@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #132325;
  --muted: #758387;
  --paper: #f3f5f1;
  --panel: #fbfcf9;
  --line: #dfe5df;
  --deep: #102023;
  --deep-soft: #182e30;
  --accent: #ef875d;
  --accent-soft: #ffdbc8;
  --mint: #b7e1cd;
  --yellow: #f8ca72;
  --shadow: 0 18px 50px rgba(31, 55, 50, .08);
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Manrope, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-width: 320px;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { overflow: hidden; min-height: 100vh; }

.topbar {
  align-items: center;
  background: var(--deep);
  color: #f5f8f2;
  display: flex;
  justify-content: space-between;
  min-height: 82px;
  padding: 18px clamp(22px, 5vw, 76px);
}

.brand-lockup, .topbar-meta, .search-label-row, .search-box, .keyword-tray, .quick-queries, .rail-heading, .filter-option, .results-header, .results-controls, .result-meta, .result-title-row, .footer { display: flex; align-items: center; }

.brand-lockup { gap: 14px; }
.brand-mark { display: flex; gap: 3px; height: 30px; align-items: end; }
.brand-mark span { background: var(--accent); display: block; width: 5px; border-radius: 3px 3px 0 0; }
.brand-mark span:nth-child(1) { height: 16px; opacity: .7; }
.brand-mark span:nth-child(2) { height: 25px; }
.brand-mark span:nth-child(3) { height: 20px; opacity: .85; }
.eyebrow, .section-kicker { color: #91a5a2; font: 500 10px/1.2 "DM Mono", monospace; letter-spacing: .13em; margin: 0 0 5px; text-transform: uppercase; }
.topbar h1 { font-size: 17px; letter-spacing: -.02em; margin: 0; }
.topbar h1 span { color: var(--accent); }
.topbar-meta { color: #a9bab5; font: 11px "DM Mono", monospace; gap: 10px; }
.live-dot, .status-pulse { background: #76d2a3; border-radius: 50%; box-shadow: 0 0 0 4px rgba(118,210,163,.12); height: 6px; width: 6px; }
.meta-divider { background: #3d5758; height: 14px; width: 1px; }

main { margin: 0 auto; max-width: 1500px; padding: 0 clamp(22px, 5vw, 76px) 56px; }
.hero-section { align-items: center; display: flex; justify-content: space-between; min-height: 265px; padding: 48px 0 34px; position: relative; }
.hero-copy { position: relative; z-index: 1; }
.hero-copy .section-kicker { color: var(--accent); }
.hero-copy h2 { font-size: clamp(42px, 5.2vw, 76px); letter-spacing: -.08em; line-height: .99; margin: 14px 0 18px; }
.hero-copy h2 em { color: var(--accent); font-style: normal; }
.hero-note { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 0; max-width: 390px; }
.hero-orbit { height: 210px; margin-right: 5%; position: relative; width: 300px; }
.orbit { border: 1px solid rgba(54, 88, 80, .18); border-radius: 50%; left: 50%; position: absolute; top: 50%; transform: translate(-50%, -50%) rotate(-22deg); }
.orbit-one { height: 176px; width: 286px; }
.orbit-two { border-color: rgba(239, 135, 93, .35); height: 132px; transform: translate(-50%, -50%) rotate(52deg); width: 232px; }
.orbit-core { align-items: center; background: var(--deep); border-radius: 50%; color: white; display: flex; flex-direction: column; height: 106px; justify-content: center; left: 50%; position: absolute; top: 50%; transform: translate(-50%, -50%); width: 106px; }
.orbit-core::after { background: var(--accent); border: 5px solid var(--paper); border-radius: 50%; content: ""; height: 9px; position: absolute; right: 4px; top: 2px; width: 9px; }
.orbit-core strong { font-size: 27px; letter-spacing: -.06em; }
.orbit-core span { color: #a6b9b3; font: 9px "DM Mono", monospace; margin-top: 4px; }

.search-panel { background: var(--deep); border-radius: 4px; box-shadow: var(--shadow); color: white; padding: 25px clamp(20px, 3vw, 42px) 20px; position: relative; }
.search-panel::before { background: var(--accent); content: ""; height: 3px; left: 0; position: absolute; right: 0; top: 0; }
.search-label-row { justify-content: space-between; margin-bottom: 14px; }
.search-label-row label { font-size: 14px; font-weight: 700; }
.label-index { color: var(--accent); font: 11px "DM Mono", monospace; margin-right: 12px; }
.live-search-status { align-items: center; color: #8ca5a1; display: flex; font: 10px "DM Mono", monospace; gap: 8px; }
.search-box { background: #f9fbf6; border-radius: 3px; gap: 13px; padding: 0 17px; }
.search-box svg { fill: none; height: 19px; stroke: #76908a; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 19px; }
.search-box input { background: transparent; border: 0; color: var(--ink); flex: 1; font-size: 15px; min-width: 0; outline: none; padding: 17px 0; }
.search-box input::placeholder { color: #94a3a0; }
.enter-hint { color: #9aaba6; font: 10px "DM Mono", monospace; white-space: nowrap; }
.keyword-tray { flex-wrap: wrap; gap: 8px; min-height: 27px; padding: 13px 0 4px; }
.keyword-label { color: #718c87; font: 10px "DM Mono", monospace; margin-right: 4px; }
.empty-keywords { color: #6e8581; font-size: 11px; }
.keyword-chip { align-items: center; background: #254443; border: 1px solid #35625d; border-radius: 2px; color: #d4e5da; display: inline-flex; font-size: 11px; gap: 7px; padding: 5px 8px; }
.keyword-chip button { background: transparent; border: 0; color: #91b1a6; line-height: 1; padding: 0; }
.quick-queries { border-top: 1px solid #2b4243; gap: 9px; margin-top: 12px; padding-top: 14px; }
.quick-queries span { color: #718984; font: 10px "DM Mono", monospace; margin-right: 2px; }
.quick-queries button { background: transparent; border: 0; color: #b6c7c1; font-size: 11px; padding: 0; text-decoration: underline; text-decoration-color: #3a5955; text-underline-offset: 3px; }
.quick-queries button:hover { color: var(--accent); }

.answer-dock { background: #fffaf1; border: 1px solid #eadac7; box-shadow: 0 14px 32px rgba(101, 73, 45, .09); margin-top: 15px; padding: 15px 20px 17px; position: sticky; top: 14px; z-index: 5; }
.answer-dock::before { background: var(--accent); content: ""; height: 100%; left: -1px; position: absolute; top: -1px; width: 4px; }
.answer-dock-topline { align-items: center; border-bottom: 1px solid #efe3d6; display: flex; justify-content: space-between; padding-bottom: 11px; }
.answer-heading { align-items: center; display: flex; gap: 14px; }
.answer-heading .section-kicker { color: #b76949; margin: 0; }
.answer-live { align-items: center; color: #8b9c91; display: flex; font: 9px "DM Mono", monospace; gap: 7px; }
.answer-live .status-pulse { background: var(--accent); box-shadow: 0 0 0 4px rgba(239, 135, 93, .12); }
.answer-source-count { color: #9d8a77; font: 10px "DM Mono", monospace; }
.answer-dock-main { align-items: center; display: grid; gap: 20px; grid-template-columns: 92px minmax(0, 1fr); padding: 15px 0 4px; }
.answer-token { align-items: center; background: var(--accent); color: white; display: flex; flex-direction: column; height: 72px; justify-content: center; width: 72px; }
.answer-token strong { font-size: 25px; letter-spacing: -.06em; line-height: 1; }
.answer-token span { font: 9px "DM Mono", monospace; margin-top: 6px; opacity: .82; }
.answer-copy { min-width: 0; }
.answer-question { color: #88786b; font-size: 11px; line-height: 1.65; margin: 0 0 6px; max-width: 900px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answer-value { color: var(--ink); font-size: clamp(16px, 2vw, 22px); font-weight: 800; letter-spacing: -.04em; line-height: 1.35; margin: 0; }
.answer-value mark { background: var(--accent-soft); color: var(--ink); padding: 2px 3px; }
.answer-standard { color: #9a8878; font-size: 10px; line-height: 1.6; margin: 6px 0 0; max-width: 920px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answer-followups { border-top: 1px solid #efe3d6; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.followup-answer { background: #fff4e8; border: 1px solid #f0d7c2; color: #7f6554; font-size: 10px; padding: 6px 8px; }
.followup-answer strong { color: #b76546; margin-right: 4px; }

.workspace-grid { display: grid; gap: clamp(30px, 5vw, 82px); grid-template-columns: 230px minmax(0, 1fr); padding-top: 44px; }
.filter-rail { border-right: 1px solid var(--line); padding-right: 30px; }
.rail-heading { justify-content: space-between; margin-bottom: 34px; }
.rail-heading .section-kicker { color: var(--ink); margin: 0; }
.reset-button { background: transparent; border: 0; color: var(--accent); font: 10px "DM Mono", monospace; padding: 3px 0; }
.filter-group { border-top: 1px solid var(--line); padding: 19px 0 22px; }
.filter-title { color: #687976; font: 10px "DM Mono", monospace; letter-spacing: .1em; margin-bottom: 14px; text-transform: uppercase; }
.filter-option { color: #4f605f; cursor: pointer; font-size: 12px; gap: 9px; justify-content: space-between; margin: 13px 0; }
.filter-option input { accent-color: var(--accent); margin: 0; }
.filter-option span { flex: 1; }
.filter-option b { color: #9aa8a5; font: 10px "DM Mono", monospace; }
.rail-tip { background: #e6ede7; color: #67807a; display: flex; font-size: 11px; gap: 9px; line-height: 1.7; margin-top: 12px; padding: 13px; }
.rail-tip span { color: var(--accent); font-size: 22px; line-height: 1; }
.rail-tip p { margin: 0; }

.results-header { justify-content: space-between; margin-bottom: 18px; }
.results-header .section-kicker { color: var(--accent); margin-bottom: 6px; }
.results-header h3 { font-size: 27px; letter-spacing: -.06em; margin: 0; }
.results-header h3 span { color: var(--accent); font: 14px "DM Mono", monospace; margin-left: 5px; vertical-align: middle; }
.results-controls { color: var(--muted); font: 10px "DM Mono", monospace; gap: 15px; }
.results-controls select { background: transparent; border: 0; border-bottom: 1px solid #bdc9c4; color: #536764; font: 10px "DM Mono", monospace; outline: none; padding: 5px 1px; }
.results-list { display: grid; gap: 12px; }
.result-card { animation: reveal .35s ease both; background: var(--panel); border-left: 3px solid transparent; box-shadow: 0 5px 18px rgba(37, 57, 51, .035); padding: 19px 21px 18px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.result-card:hover { border-left-color: var(--accent); box-shadow: 0 10px 26px rgba(37, 57, 51, .09); transform: translateY(-2px); }
.result-title-row { align-items: flex-start; gap: 14px; justify-content: space-between; }
.result-title { font-size: 14px; font-weight: 700; line-height: 1.55; margin: 0; }
.result-badge { background: #e7f1ec; color: #4d7765; flex-shrink: 0; font: 10px "DM Mono", monospace; padding: 5px 7px; }
.result-badge.pdf { background: #ffeadf; color: #a95d3e; }
.result-badge.docx { background: #e5edf5; color: #577492; }
.result-text { color: #60716e; font-size: 12px; line-height: 1.85; margin: 11px 0 14px; }
.result-text mark { background: var(--accent-soft); color: var(--ink); padding: 1px 2px; }
.result-meta { border-top: 1px solid #ebefeb; color: #91a09d; font: 10px "DM Mono", monospace; gap: 9px; padding-top: 11px; }
.result-meta .source-name { color: #637773; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-dot { background: #c5d0cb; border-radius: 50%; height: 3px; width: 3px; }
.metadata-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.metadata-tag { background: #f0f3ed; color: #6e8179; font: 10px "DM Mono", monospace; padding: 4px 6px; }
.result-answer { align-items: flex-start; background: #fff3e5; border-left: 2px solid var(--accent); display: flex; gap: 10px; margin: 12px 0 13px; padding: 9px 11px; }
.result-answer span { color: #b66b4b; flex-shrink: 0; font: 10px "DM Mono", monospace; padding-top: 2px; }
.result-answer strong { color: #4b4038; font-size: 12px; line-height: 1.6; }
.result-answer mark { background: var(--accent-soft); color: var(--ink); padding: 1px 2px; }
.load-more { background: transparent; border: 1px solid #cdd8d2; color: #60736e; font-size: 12px; margin: 19px auto 0; padding: 11px 20px; display: block; }
.load-more:hover { border-color: var(--accent); color: var(--accent); }
.empty-state { border: 1px dashed #cbd6d0; padding: 58px 20px; text-align: center; }
.empty-icon { color: var(--accent); font-size: 32px; }
.empty-state h4 { font-size: 15px; margin: 12px 0 7px; }
.empty-state p { color: var(--muted); font-size: 12px; margin: 0; }
.footer { color: #8b9a96; font: 9px "DM Mono", monospace; justify-content: space-between; letter-spacing: .05em; margin-top: 54px; padding-top: 15px; border-top: 1px solid var(--line); }
.footer span:first-child { color: #617570; }

@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .topbar-meta { font-size: 9px; }
  .hero-section { min-height: 245px; }
  .hero-orbit { margin-right: -55px; opacity: .45; position: absolute; right: 0; }
  .enter-hint { display: none; }
  .answer-dock { padding: 13px 16px; top: 8px; }
  .answer-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .answer-source-count { font-size: 9px; }
  .answer-dock-main { gap: 13px; grid-template-columns: 66px minmax(0, 1fr); }
  .answer-token { height: 58px; width: 58px; }
  .answer-token strong { font-size: 20px; }
  .answer-question, .answer-standard { white-space: normal; }
  .workspace-grid { grid-template-columns: 1fr; }
  .filter-rail { border-bottom: 1px solid var(--line); border-right: 0; padding: 0 0 16px; }
  .filter-group { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 0; }
  .filter-title { flex-basis: 100%; margin-bottom: 0; }
  .filter-option { margin: 0; }
  .rail-tip { display: none; }
  .results-header { align-items: flex-start; flex-direction: column; gap: 11px; }
  .footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
