:root {
  /* rail / surfaces */
  --rail-bg: #ffffff;
  --content-bg: #f5f4f1;
  --card-bg: #ffffff;
  --overlay-bg: #ffffff;

  /* ink */
  --ink: #111111;
  --ink-strong: #0a0a0a;
  --ink-soft: #6b6b6b;
  --ink-faint: #9c9c9c;

  /* accent-on-dark (text sitting on the black pill / active rows) */
  --on-accent: #ffffff;
  --accent-solid: #0a0a0a;

  --line: rgba(10, 10, 10, 0.1);
  --hover-fill: #f0efec;
  --dash: #e6e6e4;
  --scrim: rgba(10, 10, 10, 0.35);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --rail-bg: #141414;
    --content-bg: #0e0e0e;
    --card-bg: #1a1a1a;
    --overlay-bg: #1a1a1a;

    --ink: #f2f2f0;
    --ink-strong: #ffffff;
    --ink-soft: #a3a3a0;
    --ink-faint: #6f6f6c;

    --on-accent: #0a0a0a;
    --accent-solid: #f2f2f0;

    --line: rgba(255, 255, 255, 0.12);
    --hover-fill: #202020;
    --dash: #2a2a2a;
    --scrim: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --rail-bg: #141414;
  --content-bg: #0e0e0e;
  --card-bg: #1a1a1a;
  --overlay-bg: #1a1a1a;

  --ink: #f2f2f0;
  --ink-strong: #ffffff;
  --ink-soft: #a3a3a0;
  --ink-faint: #6f6f6c;

  --on-accent: #0a0a0a;
  --accent-solid: #f2f2f0;

  --line: rgba(255, 255, 255, 0.12);
  --hover-fill: #202020;
  --dash: #2a2a2a;
  --scrim: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--content-bg);
  color: var(--ink);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }

.shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ---------- LEFT RAIL ---------- */
.rail {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 24px;
  background: var(--rail-bg);
  border-right: 1px solid var(--line);
}

.rail-top { display: flex; flex-direction: column; gap: 10px; }

.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--ink-strong); font-size: 10px; }
.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.4px;
}

.rail-tagline {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 500;
}

.agent-nav {
  flex: 1;
  overflow-y: auto;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-item { display: flex; flex-direction: column; }

.agent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  transition: background 0.15s ease;
}
.agent-row:hover { background: var(--hover-fill); }
.agent-row.active { background: var(--accent-solid); color: var(--on-accent); }

.agent-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
}
.agent-row.active .agent-count { color: rgba(255,255,255,0.55); }

.category-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0 4px 29px;
  padding: 10px 0 2px 14px;
  border-left: 1px solid var(--line);
}

.category-row {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.category-row:hover { background: var(--hover-fill); color: var(--ink); }
.category-row.active { background: var(--hover-fill); color: var(--ink-strong); }

.category-empty-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dash);
  flex-shrink: 0;
  margin-top: 5px;
}

.rail-bottom { display: flex; flex-direction: column; gap: 14px; }

.ask-btn {
  width: 100%;
  background: var(--accent-solid);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-pill);
  padding: 13px 18px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.ask-btn:hover { opacity: 0.85; }
.ask-dot { width: 6px; height: 6px; border-radius: 50%; background: #7dff97; }

.rail-foot {
  text-align: center;
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 600;
}

/* ---------- RIGHT CONTENT ---------- */
.content {
  flex: 1;
  background: var(--content-bg);
  padding: 48px 56px 96px;
  min-height: 100vh;
}

.content-header { margin-bottom: 28px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.eyebrow-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-faint);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink-soft);
}

.content-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.9px;
  margin: 0 0 8px;
  text-wrap: balance;
}

.content-sub {
  font-size: 14.5px;
  color: var(--ink-soft);
  font-weight: 500;
  max-width: 560px;
  line-height: 1.55;
  margin: 0;
}

/* date filter */
.date-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
}
.date-nav-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
  transition: background 0.15s ease;
}
.date-nav-btn:hover:not(:disabled) { background: var(--hover-fill); }
.date-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.date-pill {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 700;
  min-width: 150px;
  text-align: center;
}

/* day block */
.day-block {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 8px;
  margin-bottom: 20px;
}

.row-item {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px 24px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
}
.row-item + .row-item { border-top: 1px solid var(--line); }

.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.field-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: break-word;
  line-height: 1.4;
}
.field-value.name { font-weight: 700; font-size: 15px; }

.field-full { grid-column: 1 / -1; }
.field-full + .field-full {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
}

.field-paragraph {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-line;
}

.field-bullets {
  margin: 2px 0 0;
  padding-left: 18px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
}
.field-bullets li { margin-bottom: 4px; }
.field-bullets li:last-child { margin-bottom: 0; }

.field-value.link,
a.field-value {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 9px;
  margin-left: -9px;
  border-radius: var(--radius-pill);
  background: var(--hover-fill);
  transition: background 0.15s ease;
}
a.field-value:hover { background: var(--dash); }

/* job cards (LinkedIn-style postings) */
.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.job-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.job-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--hover-fill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.job-titleblock { flex: 1; min-width: 0; }
.job-role {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-strong);
  line-height: 1.35;
}
.job-company {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 2px;
}

.job-posted-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-faint);
  background: var(--hover-fill);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

.job-location {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding-top: 2px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.job-apply-btn {
  align-self: flex-start;
  background: var(--accent-solid);
  color: var(--on-accent);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.job-apply-btn:hover { opacity: 0.85; }

/* empty state */
.empty-state {
  background: var(--card-bg);
  border: 1px dashed var(--dash);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
  color: var(--ink-faint);
}
.empty-state-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.empty-state-sub { font-size: 13px; font-weight: 500; }

/* ---------- LOGIN GATE ---------- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--content-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-overlay.unlocked { display: none; }

.login-card {
  width: min(360px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}

.login-brand { display: flex; align-items: center; gap: 8px; }
.login-brand .brand-mark { color: var(--ink-strong); font-size: 10px; }
.login-brand .brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.4px; color: var(--ink-strong); }

.login-sub {
  margin: 6px 0 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.login-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin: 14px 0 6px;
}
.login-label:first-of-type { margin-top: 0; }

.login-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--content-bg);
  outline: none;
}
.login-input:focus { border-color: var(--ink-strong); }

.login-btn {
  margin-top: 22px;
  background: var(--accent-solid);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.login-btn:hover { opacity: 0.85; }

.login-error {
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #e0554a;
  text-align: center;
}

/* ---------- ASSISTANT OVERLAY ---------- */
.assistant-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 50;
}
.assistant-overlay.open { display: flex; }

.assistant-panel {
  width: min(560px, 90vw);
  background: var(--overlay-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
}
.assistant-close {
  border: none;
  background: var(--hover-fill);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.assistant-body { padding: 18px 22px 22px; overflow-y: auto; }

.assistant-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  margin-bottom: 16px;
}
.assistant-input:focus { border-color: var(--ink-strong); }

.assistant-hint { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; line-height: 1.5; }

.assistant-result-item {
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.assistant-result-item:first-child { border-top: none; }
.assistant-result-title { font-weight: 700; }
.assistant-result-meta { color: var(--ink-soft); font-weight: 500; margin-top: 2px; }

:focus-visible {
  outline: 2px solid var(--ink-strong);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* scrollbars */
.agent-nav::-webkit-scrollbar, .content::-webkit-scrollbar { width: 8px; }
.agent-nav::-webkit-scrollbar-thumb, .content::-webkit-scrollbar-thumb { background: var(--dash); border-radius: 8px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; height: auto; position: relative; }
  .content { padding: 32px 20px 64px; }
}
