:root {
  --ink: #172131;
  --muted: #718096;
  --line: #dce4ef;
  --canvas: #f4f6fa;
  --surface: #ffffff;
  --navy: #16283f;
  --blue: #1668dc;
  --blue-soft: #edf3ff;
  --orange: #f29b55;
  --orange-soft: #fff1e4;
  --green: #268b68;
  --red: #c94c57;
  font-family: Inter, "Noto Sans SC", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 7vw; align-items: center; padding: 7vw 10vw; background: linear-gradient(125deg, #e7f2ff 0%, #f5f8fc 55%, #fff 100%); }
.auth-copy { max-width: 660px; }
.kicker { margin: 0 0 10px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.auth-copy h1 { max-width: 640px; margin: 0; color: var(--navy); font-size: clamp(38px, 5.5vw, 76px); line-height: 1.04; letter-spacing: -.06em; }
.auth-copy > p:not(.kicker) { max-width: 520px; margin: 28px 0 0; color: #55657b; font-size: 17px; line-height: 1.8; }
.auth-proof { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.auth-proof span { padding: 8px 12px; border: 1px solid #cad8f2; border-radius: 999px; color: #41608c; background: #ffffffaa; font-size: 12px; }
.auth-card { padding: 30px; border: 1px solid #fff; border-radius: 14px; background: #fff; box-shadow: 0 12px 36px #1c3d6710; }
.auth-tabs { display: flex; gap: 5px; padding: 4px; margin-bottom: 26px; border-radius: 10px; background: #f0f3f8; }
.auth-tabs button { flex: 1; padding: 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.auth-tabs button.active { color: var(--navy); background: #fff; box-shadow: 0 2px 10px #273a5815; font-weight: 700; }
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #617087; font-size: 13px; }
input, select { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus { border-color: #7fa2f7; box-shadow: 0 0 0 3px #2864f018; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 10px 16px; min-height:36px; border: 0; border-radius: 6px; font-weight: 600; }
.button.primary { color: #fff; background: var(--blue); }
.button.secondary { color: #2457c5; background: var(--blue-soft); }
.button:disabled { opacity: .55; cursor: default; }
.form-message { min-height: 20px; margin: 16px 0 0; color: var(--red); font-size: 13px; }

.site-header { display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 0 34px; color: #fff; background: var(--navy); }
.brand, .header-actions, .user-chip { display: flex; align-items: center; }
.brand { gap: 11px; }
.brand-mark { display: grid; flex: none; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--navy); background: var(--orange); font-weight: 900; }
.brand strong { display: block; font-size: 16px; letter-spacing: -.03em; }
.brand small { display: block; margin-top: 2px; color: #acbbcd; font-size: 11px; }
.header-actions { gap: 18px; }
.user-chip { padding: 7px 11px; border: 1px solid #ffffff2a; border-radius: 999px; color: #dfe8f6; font-size: 12px; }
.ghost-button { border: 0; color: #dfe8f6; background: transparent; font-size: 13px; }
.app-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar { display: flex; flex-direction: column; padding: 30px 18px; border-right: 1px solid #e3e8f1; background: #fff; }
.sidebar-label { margin: 0 14px 14px; color: #a4afbf; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.nav-item { padding: 12px 14px; margin: 2px 0; border: 0; border-radius: 9px; color: #718096; background: transparent; text-align: left; font-size: 14px; }
.nav-item:hover { color: var(--navy); background: #f4f7fb; }
.nav-item.active { color: var(--blue); background: var(--blue-soft); font-weight: 750; }
.sidebar-foot { display: grid; gap: 8px; margin-top: auto; padding: 14px; color: #a3adba; font-size: 11px; line-height: 1.6; }
.sidebar-foot a { color: var(--blue); text-decoration: none; }
.main-content { max-width: 1500px; width: 100%; padding: 44px clamp(22px, 5vw, 76px) 80px; }
.page-view { animation: rise .22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.hero-row, .page-title, .section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.hero-row { margin-bottom: 34px; }
.hero-row h2, .page-title h2 { margin: 0; color: var(--navy); font-size: clamp(28px, 3.7vw, 48px); letter-spacing: -.05em; }
.lede, .page-title p:not(.kicker) { margin: 12px 0 0; color: var(--muted); line-height: 1.7; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.summary-card { min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.summary-card.warm { background: var(--orange-soft); border-color: #f8d7b8; }
.summary-card span, .summary-card small { display: block; color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin: 11px 0 4px; color: var(--navy); font-size: 34px; letter-spacing: -.05em; }
.summary-card small { color: #9ba7b7; }
.content-grid { display: grid; gap: 18px; }
.content-grid.two { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.surface { padding: 23px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 10px 30px #213b6910; }
.accent-surface { background: linear-gradient(135deg, #f0f5ff, #fff8f0); }
.section-head { align-items: flex-start; margin-bottom: 18px; }
.section-head h3, .surface > h3 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.03em; }
.text-button { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 700; }
.project-list, .report-list, .credential-list { display: grid; gap: 9px; }
.list-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 0; border: 0; border-bottom: 1px solid #eff2f6; color: var(--ink); background: transparent; text-align: left; }
.list-row:last-child { border-bottom: 0; }
.list-row span:first-child { min-width: 0; }
.list-row strong, .list-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row strong { font-size: 13px; }
.list-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.list-row-right { min-width: 95px; text-align: right; }
.list-row-right b { color: var(--green); font-size: 12px; }
.page-title { align-items: flex-start; margin-bottom: 28px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.project-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; min-height: 82px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.project-card-body { min-width: 0; overflow-wrap: anywhere; }
.project-card h3 { margin: 0; color: var(--navy); font-size: 17px; line-height: 1.4; }
.project-card p { margin: 4px 0 0; color: #52647a; font-size: 12px; line-height: 1.45; }
.project-action { min-height: 40px; padding: 8px 14px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.project-action:hover { background: #125bbf; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; color: var(--muted); font-size: 11px; }
.status-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--green); background: #e8f6ef; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.status-pill.pending, .status-pill.running { color: #9b7000; background: #fff1cc; }
.status-pill.failed { color: var(--red); background: #fdebed; }
.upload-meta, .hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.progress-card { display: grid; gap: 6px; margin-top: 22px; padding: 15px; border-radius: 10px; color: #455a73; background: #f5f8fc; font-size: 13px; }
.progress-card strong { color: var(--navy); }
.progress-card span { color: var(--muted); font-size: 12px; }
.progress-card button { justify-self: start; margin-top: 6px; }
.comparison-bar { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; align-items: center; gap: 12px; margin-bottom: 16px; }
.comparison-bar strong, .comparison-bar span { display: block; }
.comparison-bar span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.table-surface { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 15px 18px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: 11px; font-weight: 700; }
.data-table td small, .data-table td strong { display: block; }
.data-table td small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.score-cell { color: var(--navy); font-size: 16px; font-weight: 800; }
#comparison-result { margin-top: 16px; }
.credential-row { display: grid; gap: 5px; padding: 12px 0; border-bottom: 1px solid #edf0f4; }
.credential-row span { color: var(--muted); font-size: 11px; }
.empty-state { padding: 30px 10px; color: var(--muted); text-align: center; font-size: 13px; }
.empty-state.compact { padding: 12px 0; text-align: left; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 10; background: #10243c85; }
.report-drawer { position: absolute; top: 0; right: 0; width: min(680px, 100%); height: 100%; padding: 34px; overflow: auto; background: #fff; box-shadow: -20px 0 60px #10243c25; }
.close-button { position: absolute; top: 18px; right: 22px; border: 0; color: var(--muted); background: transparent; font-size: 28px; }
.drawer-kicker { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.report-drawer h2 { margin: 8px 0; color: var(--navy); font-size: 28px; letter-spacing: -.04em; }
.drawer-meta { color: var(--muted); font-size: 12px; }
.drawer-score { display: flex; align-items: baseline; gap: 7px; padding: 24px 0; }
.drawer-score strong { color: var(--navy); font-size: 52px; letter-spacing: -.07em; }
.drawer-score span { color: var(--muted); font-size: 18px; }
.drawer-score small { margin-left: auto; color: var(--green); font-weight: 700; }
.media-button { margin-bottom: 14px; }
.report-video { width: 100%; max-height: 300px; margin-bottom: 14px; border-radius: 10px; background: #0e1928; }
.evidence-timeline { display: grid; gap: 6px; margin: 10px 0 22px; }
.evidence-timeline button { display: flex; gap: 12px; padding: 9px 10px; border: 0; border-left: 2px solid #bed0f8; color: #53667f; background: #f5f8ff; text-align: left; font-size: 11px; }
.evidence-timeline button span { color: var(--blue); font-family: monospace; }
.report-items { display: grid; gap: 9px; }
.report-item { position: relative; padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: 11px; }
.report-item h3 { margin: 4px 0; font-size: 14px; }
.report-item > strong { position: absolute; top: 17px; right: 16px; color: var(--navy); font-size: 18px; }
.report-item > strong small { color: var(--muted); font-size: 11px; }
.report-item p { margin: 12px 0 8px; color: #617087; font-size: 12px; line-height: 1.7; }
.item-id { color: var(--muted); font: 10px monospace; }
.evidence-state { display: inline-flex; padding: 4px 7px; border-radius: 999px; color: #7b6a31; background: #fff5d9; font-size: 10px; }
.evidence-state.verified { color: var(--green); background: #e8f6ef; }
.evidence-state.unclear, .evidence-state.insufficient_evidence { color: #a26511; background: #fff0dd; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 12px 16px; border-radius: 9px; color: #fff; background: var(--navy); box-shadow: 0 12px 30px #10243c35; font-size: 13px; }
.toast.error, .error-text { color: var(--red); }

@media (max-width: 1050px) {
  .auth-view { grid-template-columns: 1fr 380px; padding: 6vw; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-bar .button { justify-self: start; }
}
@media (max-width: 780px) {
  .auth-view { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 16px; }
  .auth-copy h1 { font-size: 42px; }
  .auth-card { max-width: 520px; padding: 20px; }
  .site-header { height: 60px; gap: 12px; padding: 0 14px; }
  .brand, .header-actions, .user-chip { min-width: 0; }
  .brand { flex: none; gap: 8px; }
  .brand strong { font-size: 15px; }
  .header-actions { justify-content: flex-end; gap: 6px; }
  .user-chip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ghost-button { flex: none; min-width: 44px; min-height: 44px; }
  .app-layout { display: block; }
  .sidebar { flex-flow: row wrap; gap: 3px; padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-label, .sidebar-foot { display: none; }
  .nav-item { flex: 1 1 auto; min-height: 44px; margin: 0; padding: 8px 6px; text-align: center; white-space: nowrap; }
  .main-content { padding: 22px 14px 48px; }
  .content-grid.two, .project-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-row, .page-title { flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
  .page-title h2 { font-size: 26px; }
  .page-title p:not(.kicker) { margin-top: 6px; }
  .summary-grid { gap: 9px; }
  .summary-card { min-height: 94px; padding: 13px; }
  .summary-card strong { font-size: 27px; }
  .project-grid { gap: 8px; }
  .project-card { min-height: 68px; gap: 10px; padding: 11px 12px; }
  .project-card h3 { font-size: 16px; }
  .project-action { min-height: 44px; padding-inline: 11px; }
  .surface:not(.table-surface) { min-width: 0; padding: 16px; overflow-wrap: anywhere; }
  .comparison-bar { grid-template-columns: minmax(0, 1fr); }
  .form-stack :is(input, select), .comparison-bar select { min-width: 0; font-size: 16px; }
  .form-stack .button { min-height: 44px; }
  .table-surface .data-table { min-width: 620px; }
  .toast { right: 14px; bottom: 14px; max-width: calc(100% - 28px); overflow-wrap: anywhere; }
  .report-drawer { padding: 28px 18px; }
}

.data-table th { color:#465a71; background:#f7f9fc; }
.data-table tbody tr:hover { background:#f8fbff; }
button:focus-visible,summary:focus-visible { outline:2px solid #438cf2; outline-offset:2px; }

#analysis-progress progress { display: block; width: 100%; height: 6px; margin-top: 8px; accent-color: var(--primary, #1677ff); }
