:root {
  color-scheme: light;
  --ink: #071118;
  --ink-2: #12212a;
  --paper: #f4f6f5;
  --white: #ffffff;
  --muted: #60717a;
  --line: #d7dede;
  --green: #17b26a;
  --cyan: #2bb7c7;
  --gold: #c69a42;
  --silver: #8fa6b5;
  --red: #d84d42;
  --amber: #d98b20;
  --radius: 8px;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 0 30px;
  color: var(--white);
  background: var(--ink);
  border-bottom: 1px solid #26343b;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #67d5df;
  color: #67d5df;
  font-weight: 800;
}
.brand strong, .brand small { display: block; letter-spacing: 0; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: #9fb0b8; font-size: 9px; }
.primary-nav { display: flex; justify-content: center; gap: 24px; }
.primary-nav a { color: #b8c4ca; font-size: 12px; font-weight: 700; }
.primary-nav a:hover, .primary-nav a.active { color: var(--white); }
.privacy-lock { color: #75d9ac; font-size: 10px; font-weight: 800; white-space: nowrap; }
.privacy-lock span { margin-right: 6px; }
.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  color: var(--white);
  background: transparent;
  border: 1px solid #45535a;
  cursor: pointer;
}
.mobile-menu {
  position: fixed;
  inset: 64px 0 auto 0;
  z-index: 40;
  padding: 14px 20px 22px;
  background: var(--ink);
  border-bottom: 1px solid #3b4a51;
}
.mobile-menu a { display: block; padding: 12px 4px; color: #dce5e8; border-bottom: 1px solid #27363d; }

.hero {
  position: relative;
  min-height: 620px;
  height: calc(100vh - 64px);
  max-height: 860px;
  overflow: hidden;
  color: var(--white);
  background: #172f42;
}
.hero > img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-shade { position: absolute; inset: 0; background: rgba(4, 15, 24, 0.16); pointer-events: none; }
.hero-content {
  position: absolute;
  left: max(30px, calc((100vw - 1400px) / 2));
  top: 50%;
  width: min(500px, calc(100% - 60px));
  transform: translateY(-50%);
}
.eyebrow { margin: 0 0 10px; color: var(--cyan); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.hero h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 82px; font-weight: 500; line-height: 0.95; letter-spacing: 0; }
.hero-statement { max-width: 460px; margin: 24px 0; color: #e8eff2; font-size: 18px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
.button--primary { color: #071118; background: #70d9df; border-color: #70d9df; }
.button--primary:hover { background: #91e6ea; }
.button--glass { color: var(--white); background: rgba(7, 17, 24, 0.48); border-color: rgba(255,255,255,0.52); }
.button--secondary { color: var(--ink); background: var(--white); border-color: var(--line); }
.button--danger { color: var(--red); background: #fff5f4; border-color: #f2c9c5; }
.button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #61cbd6; outline-offset: 2px; }
.hero-contract { display: flex; gap: 10px; margin-top: 24px; color: #cbd7dc; font-size: 9px; }
.hero-contract span { color: #70d9df; }
.hero-next { position: absolute; bottom: 20px; left: 50%; display: grid; gap: 2px; text-align: center; font-size: 10px; transform: translateX(-50%); }
.hero-next b { font-size: 20px; }

main { min-height: 70vh; }
.page-shell { width: min(1400px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 80px; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1, .page-header h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 40px; font-weight: 500; letter-spacing: 0; }
.page-header p:last-child { max-width: 620px; margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar select, .toolbar input { height: 42px; padding: 0 12px; background: var(--white); border: 1px solid var(--line); border-radius: 4px; }

.metric-strip { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--ink); border: 1px solid var(--ink); }
.metric-strip > div { min-width: 0; padding: 20px; color: var(--white); border-right: 1px solid #314048; }
.metric-strip > div:last-child { border-right: 0; }
.metric-strip span, .metric-strip small { display: block; color: #90a2ab; font-size: 10px; }
.metric-strip strong { display: block; margin: 8px 0 4px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.metric-strip strong.status-green { color: #6ddaa5; font-family: inherit; font-size: 15px; }

.operations-band { padding-top: 34px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 22px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.ops-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr); gap: 22px; }
.priority-queue, .side-rail { min-width: 0; }

.queue-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) minmax(210px, 0.72fr);
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.queue-item:last-child { border-bottom: 1px solid var(--line); }
.priority-badge { width: 52px; height: 52px; display: grid; place-items: center; color: var(--white); background: var(--ink); font-weight: 900; }
.priority-badge.p0 { background: var(--red); }
.priority-badge.p1 { background: var(--amber); }
.priority-badge.p2 { background: var(--silver); }
.priority-badge.p3 { color: var(--ink); background: #dce4e5; }
.queue-main { min-width: 0; }
.queue-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 11px; }
.queue-main h3 { margin: 8px 0 5px; font-size: 17px; }
.queue-summary { margin: 0; color: #41515a; line-height: 1.55; }
.route-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.tag { padding: 4px 7px; color: #2a5960; background: #e3f2f2; border: 1px solid #c8e6e7; border-radius: 3px; font-size: 9px; font-weight: 800; }
.queue-decision { display: grid; align-content: start; gap: 10px; }
.draft-preview { margin: 0; padding-left: 12px; color: #24343d; border-left: 2px solid var(--gold); font-size: 12px; line-height: 1.55; }
.state-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; }
.state-pill { padding: 4px 7px; color: #27794f; background: #e9f7ef; border: 1px solid #ccebd9; border-radius: 3px; font-weight: 800; }
.state-pill.wait { color: #8c5d17; background: #fff4df; border-color: #efd9ad; }
.state-pill.closed { color: #64737a; background: #edf0f1; border-color: #d7dede; }
.decision-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.decision-actions button { min-height: 32px; padding: 0 9px; color: #223139; background: var(--white); border: 1px solid #cbd5d7; border-radius: 3px; font-size: 10px; font-weight: 800; cursor: pointer; }
.decision-actions button:hover { border-color: #599aa0; }
.decision-actions [data-action="approve"] { color: #17633e; border-color: #8bcfad; }
.decision-actions [data-action="reject"] { color: #a3332b; }

.side-rail { padding: 20px; color: var(--white); background: var(--ink-2); }
.side-rail h3 { margin: 0 0 16px; }
.side-rail-list { display: grid; gap: 0; }
.side-rail-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid #35454d; }
.side-rail-row img { width: 34px; height: 42px; object-fit: cover; object-position: top; border: 1px solid #4d5b62; }
.side-rail-row strong, .side-rail-row small { display: block; }
.side-rail-row strong { font-size: 12px; }
.side-rail-row small { color: #8fa1aa; font-size: 9px; margin-top: 3px; }
.agent-light { width: 7px; height: 7px; background: #6ddaa5; border-radius: 50%; }
.gate-note { margin-top: 18px; padding: 14px; color: #bfd0d6; background: #0b171e; border: 1px solid #394a52; font-size: 11px; line-height: 1.6; }

.pipeline-band { margin-top: 48px; padding: 34px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.agent-pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.agent-card { position: relative; min-height: 310px; aspect-ratio: 4 / 5; overflow: hidden; color: var(--white); background: var(--ink); border-radius: var(--radius); }
.agent-card img { width: 100%; height: 310px; object-fit: cover; object-position: top; opacity: 0.78; }
.agent-card::after { content: ""; position: absolute; inset: 55% 0 0; background: rgba(4, 13, 19, 0.88); }
.agent-card-copy { position: absolute; z-index: 2; inset: auto 16px 16px; }
.agent-card-copy span { color: #6ed8df; font-size: 9px; font-weight: 800; }
.agent-card-copy h3 { margin: 5px 0; font-size: 18px; }
.agent-card-copy p { margin: 0; color: #bdcbd0; font-size: 11px; line-height: 1.45; }

.data-table { width: 100%; overflow-x: auto; background: var(--white); border: 1px solid var(--line); }
table { width: 100%; min-width: 820px; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #e2e7e8; font-size: 12px; }
th { color: #51626a; background: #edf1f1; font-size: 10px; text-transform: uppercase; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); }

.empty-state { padding: 44px; text-align: center; background: var(--white); border: 1px solid var(--line); }
.empty-state strong { display: block; font-size: 18px; }
.empty-state p { margin: 8px 0 0; color: var(--muted); }

.agent-profile { display: grid; grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr); min-width: 0; min-height: calc(100vh - 64px); overflow: hidden; background: var(--white); }
.agent-profile-visual { position: relative; min-height: 720px; aspect-ratio: 2 / 3; overflow: hidden; background: #dfe9ec; }
.agent-profile-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.agent-profile-index { position: absolute; left: 20px; top: 20px; padding: 8px 10px; color: var(--white); background: var(--ink); font-size: 11px; font-weight: 900; }
.agent-profile-copy { display: grid; align-content: center; gap: 26px; padding: 60px max(30px, 7vw); }
.agent-profile-copy h1 { margin: 0; font-family: Georgia, serif; font-size: 54px; font-weight: 500; }
.agent-profile-copy .mission { margin: 12px 0 0; color: #42535b; font-size: 17px; line-height: 1.7; }
.agent-facts { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.agent-facts > div { padding: 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.agent-facts dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.agent-facts dd { margin: 7px 0 0; font-size: 12px; line-height: 1.5; }
.task-list { margin: 0; padding: 0; list-style: none; }
.task-list li { display: flex; gap: 9px; padding: 10px 0; border-bottom: 1px solid #e4e8e9; font-size: 12px; }
.task-list li::before { content: "✓"; color: var(--green); font-weight: 900; }

.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.settings-section { padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.settings-section h3 { margin: 0 0 10px; }
.settings-section p { color: var(--muted); line-height: 1.6; }
.setting-row { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid #e2e7e8; }
.toggle { min-width: 58px; height: 30px; color: #17633e; background: #e4f4eb; border: 1px solid #a8d9bd; border-radius: 15px; font-size: 9px; font-weight: 800; }

.edit-dialog { width: min(560px, calc(100% - 28px)); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 26px 80px rgba(0,0,0,0.28); }
.edit-dialog::backdrop { background: rgba(3, 12, 18, 0.7); }
.edit-dialog form { padding: 24px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 0 0 20px; }
.icon-button { width: 36px; height: 36px; color: var(--ink); background: var(--white); border: 1px solid var(--line); cursor: pointer; }
.edit-dialog label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.edit-dialog textarea { width: 100%; resize: vertical; padding: 12px; border: 1px solid #b8c5c8; border-radius: 4px; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; z-index: 60; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 16px; color: var(--white); background: var(--ink); border-left: 4px solid #6ddaa5; box-shadow: 0 14px 40px rgba(0,0,0,0.22); font-size: 12px; }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 24px 30px; color: #8fa1aa; background: var(--ink); border-top: 1px solid #293840; font-size: 9px; }

@media (max-width: 1080px) {
  .primary-nav { display: none; }
  .topbar { grid-template-columns: 1fr auto auto; }
  .menu-button { display: block; }
  .metric-strip { grid-template-columns: repeat(3, 1fr); }
  .metric-strip > div:nth-child(3) { border-right: 0; }
  .metric-strip > div:nth-child(-n+3) { border-bottom: 1px solid #314048; }
  .ops-grid { grid-template-columns: 1fr; }
  .queue-item { grid-template-columns: 64px minmax(0, 1fr); }
  .queue-decision { grid-column: 2; }
  .agent-pipeline { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .topbar { height: 58px; padding: 0 14px; gap: 10px; }
  .brand { min-width: 0; }
  .brand small { display: none; }
  .privacy-lock { font-size: 0; }
  .privacy-lock span { margin: 0; font-size: 13px; }
  .mobile-menu { inset: 58px 0 auto; }
  .hero { min-height: 620px; height: calc(100svh - 58px); max-height: 760px; }
  .hero > img { object-position: 58% center; }
  .hero-shade { background: rgba(4, 15, 24, 0.42); }
  .hero-content { left: 20px; top: auto; bottom: 70px; width: calc(100% - 40px); transform: none; }
  .hero h1 { font-size: 54px; }
  .hero-statement { margin: 15px 0; font-size: 15px; line-height: 1.55; }
  .hero-contract { display: none; }
  .hero-next { bottom: 12px; }
  .page-shell { width: calc(100% - 28px); padding: 38px 0 60px; }
  .page-header { display: block; }
  .page-header h1, .page-header h2 { font-size: 32px; }
  .toolbar { margin-top: 16px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip > div { padding: 15px; border-bottom: 1px solid #314048; }
  .metric-strip > div:nth-child(odd) { border-right: 1px solid #314048; }
  .metric-strip > div:nth-child(even) { border-right: 0; }
  .queue-item { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; }
  .priority-badge { width: 42px; height: 42px; }
  .queue-decision { grid-column: 1 / -1; padding-left: 58px; }
  .agent-pipeline { grid-template-columns: 1fr; }
  .agent-card, .agent-card img { min-height: 370px; height: 370px; }
  .agent-profile { grid-template-columns: 1fr; }
  .agent-profile-visual { width: 100%; min-width: 0; min-height: 590px; height: 72vh; aspect-ratio: auto; }
  .agent-profile-copy { padding: 38px 20px 60px; }
  .agent-profile-copy h1 { font-size: 40px; }
  .settings-grid { grid-template-columns: 1fr; }
  footer { display: grid; padding: 22px 16px; }
}
