:root {
  --ink: #20231d;
  --muted: #74786e;
  --paper: #f4f3ed;
  --card: #fbfaf6;
  --line: #dfded5;
  --dark: #171914;
  --coral: #e56f51;
  --coral-soft: #f5ddd4;
  --sage: #78937a;
  --sage-soft: #dce8dc;
  --sand: #c49351;
  --sand-soft: #efe2cf;
  --blue: #687f9f;
  --blue-soft: #dce3ec;
  --radius: 22px;
  --shadow: 0 18px 60px rgba(35, 37, 30, .08);
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 72% -20%, #fff 0, transparent 32%), var(--paper); }
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; background: var(--dark); color: white; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 0 10px 34px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--coral); font-family: Georgia, serif; font-size: 24px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .08em; }
.brand small { margin-top: 3px; color: #9fa397; font-size: 11px; }
.side-nav { display: grid; gap: 8px; }
.nav-item { width: 100%; border: 0; border-radius: 13px; background: transparent; color: #a9ada2; padding: 13px 14px; display: flex; align-items: center; gap: 12px; text-align: left; transition: .2s ease; }
.nav-item span { width: 22px; text-align: center; font-size: 18px; }
.nav-item:hover, .nav-item.active { background: #292c25; color: white; }
.nav-item.active::after { content: ""; width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--coral); }
.sidebar-foot { margin-top: auto; padding: 15px 12px; border-top: 1px solid #30332d; display: flex; gap: 10px; align-items: center; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 12px; }.sidebar-foot small { margin-top: 3px; color: #858a7f; font-size: 10px; }
.mode-dot { width: 8px; height: 8px; border-radius: 50%; background: #80ad7c; box-shadow: 0 0 0 4px rgba(128,173,124,.12); }
.main { width: min(1240px, 100%); margin: 0 auto; padding: 34px 42px 80px; }
.topbar { min-height: 76px; display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.server-button { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.5); color: var(--muted); font-size: 10px; }
.server-indicator { width: 7px; height: 7px; border-radius: 50%; background: #b7b9b1; }.server-button.connected .server-indicator { background: #77a173; box-shadow: 0 0 0 4px rgba(119,161,115,.12); }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
h1, h2, p { margin-top: 0; } h1 { margin-bottom: 0; font-family: Georgia, "STSong", serif; font-size: clamp(27px, 3vw, 39px); font-weight: 500; letter-spacing: -.02em; }
h2 { margin-bottom: 6px; font-family: Georgia, "STSong", serif; font-size: 23px; font-weight: 500; }
.icon-button { border: 1px solid var(--line); background: rgba(255,255,255,.5); width: 40px; height: 40px; border-radius: 50%; font-size: 20px; color: var(--muted); }
.view { display: none; animation: view-in .25s ease; }.view.active { display: block; } @keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
.composer-card { position: relative; padding: 20px 22px 18px; border: 1px solid rgba(43,46,37,.1); border-radius: 26px; background: var(--dark); color: white; box-shadow: 0 24px 70px rgba(28,30,24,.16); overflow: hidden; }
.composer-card::after { content: ""; position: absolute; width: 260px; height: 260px; right: -100px; top: -150px; border-radius: 50%; background: rgba(229,111,81,.12); pointer-events: none; }
.composer-head { position: relative; z-index: 1; display: flex; justify-content: space-between; color: #bec2b8; font-size: 12px; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(229,111,81,.13); }
.shortcut { color: #73786d; }
.intake-lanes { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.intake-lane { padding: 16px; border: 1px solid #34372f; border-radius: 19px; background: #20221d; }
.intake-lane.update-lane { background: #24251f; }
.lane-title { display: flex; align-items: center; gap: 10px; }.lane-title strong,.lane-title small { display: block; }.lane-title strong { font-size: 13px; }.lane-title small { margin-top: 3px; color: #858a7f; font-size: 9px; }
.lane-number { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid #44483e; border-radius: 10px; color: var(--coral); font-size: 9px; font-weight: 800; }
.intake-lane textarea { width: 100%; min-height: 112px; margin: 9px 0; padding: 9px 0; resize: vertical; border: 0; outline: 0; background: transparent; color: white; font-size: 14px; line-height: 1.65; }.intake-lane textarea::placeholder { color: #696e64; }
.lane-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid #33362f; }.submit-button.secondary { background: #687f9f; box-shadow: 0 8px 20px rgba(104,127,159,.18); }
.privacy-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 13px; background: rgba(255,255,255,.035); color: #858a7f; }.privacy-note > span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #3a3e35; border-radius: 9px; color: #9eb49b; font-size: 9px; }.privacy-note p { margin: 0; font-size: 9px; line-height: 1.55; }.privacy-note strong { display: block; color: #c7cabf; }
.composer-actions { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; border-top: 1px solid #30332c; }
.suggestions, .primary-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.suggestions button, .voice-button { border: 1px solid #373b33; background: transparent; color: #aeb2a8; border-radius: 999px; padding: 8px 12px; font-size: 11px; }
.suggestions button:hover { color: white; border-color: #5a5f54; }
.voice-button span { color: var(--coral); font-size: 10px; }.voice-button.listening { color: white; border-color: var(--coral); animation: breathe 1.2s infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px rgba(229,111,81,.12); } }
.submit-button { border: 0; border-radius: 999px; padding: 10px 16px; background: var(--coral); color: white; font-weight: 700; font-size: 12px; box-shadow: 0 8px 20px rgba(229,111,81,.2); }.submit-button:disabled { opacity: .55; cursor: wait; }
.submit-button span { margin-left: 8px; font-size: 16px; }
.result-box { position: relative; z-index: 1; margin-top: 14px; border-radius: 14px; padding: 12px 14px; background: #262922; color: #d7dacd; font-size: 13px; line-height: 1.6; }.result-box.warning { border-left: 3px solid var(--sand); }.result-box.success { border-left: 3px solid #7da477; }
.draft-review { margin: 20px 0; padding: 22px; border: 1px solid var(--line); border-radius: 25px; background: #ebe9e0; box-shadow: var(--shadow); }.draft-review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }.draft-review-head p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }.draft-count { padding: 7px 10px; border-radius: 999px; background: var(--dark); color: white; font-size: 10px; white-space: nowrap; }
.draft-list { display: grid; gap: 12px; margin-top: 18px; }.draft-card { padding: 17px; border: 1px solid #d9d6ca; border-radius: 18px; background: var(--card); }.draft-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }.draft-index { font-family: Georgia,serif; color: var(--coral); font-size: 19px; }.scope-pill,.confidence { padding: 5px 8px; border-radius: 999px; background: var(--blue-soft); color: #536a86; font-size: 9px; }.scope-pill.personal { background: var(--sage-soft); color: #557158; }.confidence { margin-left: auto; background: #eeece4; color: var(--muted); }.draft-delete { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #9d6a5e; font-size: 18px; }
.draft-fields { display: grid; gap: 10px; }.draft-fields.compact { grid-template-columns: 1fr 1fr 1fr 1fr; }.draft-fields.two { grid-template-columns: 1fr 1fr; margin-top: 10px; }.draft-card label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 700; }.draft-card input,.draft-card select,.draft-card textarea { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: white; color: var(--ink); font-size: 11px; }.draft-card textarea { resize: vertical; line-height: 1.55; }.draft-card input:focus,.draft-card select:focus,.draft-card textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(229,111,81,.08); }.wide-field { margin-top: 10px; }.wide-field small { color: #a06d5d; font-weight: 400; }.hidden { display: none !important; }
.draft-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #d3d0c4; }.draft-footer > div { display: flex; align-items: center; gap: 12px; }.draft-footer small { color: var(--muted); font-size: 9px; }.text-button.danger { color: #a05b49; }.personal-card { border-top: 4px solid var(--sage); }.continue-button { margin-top: 12px; padding: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
.metric-card { position: relative; min-height: 138px; padding: 18px; border: 1px solid transparent; border-radius: var(--radius); text-align: left; color: var(--ink); transition: transform .2s ease, box-shadow .2s ease; }.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-card.coral { background: var(--coral-soft); }.metric-card.sand { background: var(--sand-soft); }.metric-card.sage { background: var(--sage-soft); }.metric-card.blue { background: var(--blue-soft); }
.metric-icon { position: absolute; right: 16px; top: 16px; display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid rgba(32,35,29,.15); border-radius: 50%; font-weight: 700; }
.metric-number { display: block; margin: 8px 0 16px; font-family: Georgia, serif; font-size: 36px; line-height: 1; }.metric-card strong, .metric-card small { display: block; }.metric-card strong { font-size: 13px; }.metric-card small { margin-top: 4px; color: rgba(32,35,29,.55); font-size: 10px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(251,250,246,.9); box-shadow: 0 8px 30px rgba(35,37,30,.035); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 14px; }.panel-heading h2 { margin-bottom: 0; }.text-button { border: 0; background: transparent; color: var(--coral); font-size: 11px; font-weight: 700; }
.item-list { padding: 0 12px 13px; }.todo-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 12px 10px; border-top: 1px solid #e7e5dc; }.todo-row:first-child { border-top: 0; }
.todo-check { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #c9c9be; border-radius: 8px; color: var(--sage); }.todo-copy strong, .todo-copy small { display: block; }.todo-copy strong { font-size: 13px; font-weight: 650; }.todo-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }.status-pill { padding: 5px 8px; border-radius: 999px; background: #eeece4; color: #66695f; font-size: 9px; }
.empty { padding: 28px 18px; color: var(--muted); text-align: center; font-size: 12px; }
.timeline { padding: 2px 20px 18px; }.timeline-item { position: relative; padding: 8px 0 13px 17px; border-left: 1px solid #dbd9cf; }.timeline-item::before { content: ""; position: absolute; left: -4px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }.timeline-item strong { display: block; font-size: 11px; }.timeline-item p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.section-toolbar, .hero-line { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }.hero-line { align-items: flex-end; padding: 10px 0; }.hero-line p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.segmented { display: flex; padding: 4px; border-radius: 13px; background: #e6e4dc; }.segmented button { border: 0; border-radius: 10px; padding: 9px 14px; background: transparent; color: var(--muted); font-size: 11px; }.segmented button.active { background: var(--card); color: var(--ink); box-shadow: 0 3px 10px rgba(32,35,29,.07); }
select, .search-box { border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--ink); } select { padding: 10px 32px 10px 12px; font-size: 11px; }
.table-panel { overflow: hidden; }.record-list { min-height: 300px; }.record-row { display: grid; grid-template-columns: 120px minmax(0,1fr) 120px 110px; align-items: center; gap: 16px; padding: 17px 20px; border-top: 1px solid var(--line); }.record-row:first-child { border-top: 0; }.record-manager { font-size: 11px; color: var(--muted); }.record-main strong { display: block; font-size: 13px; }.record-main small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }.record-date { color: var(--muted); font-size: 10px; }
.search-box { display: flex; min-width: min(420px, 45vw); align-items: center; padding-left: 12px; }.search-box input { min-width: 0; flex: 1; padding: 11px 8px; border: 0; outline: 0; background: transparent; font-size: 12px; }.search-box button { margin: 3px; border: 0; border-radius: 9px; padding: 8px 13px; background: var(--dark); color: white; font-size: 10px; }
.card-grid, .project-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }.knowledge-card, .project-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }.knowledge-card .meta, .project-card .meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }.knowledge-card h3, .project-card h3 { margin: 14px 0 10px; font-family: Georgia, "STSong", serif; font-size: 17px; font-weight: 600; }.answer { padding: 12px; border-radius: 12px; background: var(--sage-soft); font-size: 11px; line-height: 1.6; }.source { margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.project-card { position: relative; overflow: hidden; }.project-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }.stage { padding: 5px 8px; border-radius: 999px; background: var(--blue-soft); color: #506782; }.project-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }.project-details div { padding: 11px; border-radius: 12px; background: #f0efe9; }.project-details small, .project-details strong { display: block; }.project-details small { color: var(--muted); font-size: 9px; }.project-details strong { margin-top: 5px; font-size: 11px; line-height: 1.45; }
.mobile-nav { display: none; }.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 340px; padding: 12px 16px; border-radius: 12px; background: var(--dark); color: white; font-size: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s; }.toast.show { opacity: 1; transform: none; }
.server-dialog { width: min(440px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 30px 90px rgba(0,0,0,.26); }.server-dialog::backdrop { background: rgba(16,18,14,.58); backdrop-filter: blur(5px); }.server-dialog form { padding: 27px; }.dialog-mark { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 22px; border-radius: 13px; background: var(--coral); color: white; font-family: Georgia, serif; font-size: 20px; }.server-dialog h2 { font-size: 25px; }.dialog-copy { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }.server-dialog label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 750; }.server-dialog .token-label { margin-top: 14px; }.server-dialog input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: white; color: var(--ink); font-size: 13px; }.server-dialog input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(229,111,81,.1); }.field-hint { margin: 7px 0 0; color: var(--muted); font-size: 9px; }.field-hint.error { color: #b54735; }.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }.dialog-actions button { border-radius: 999px; padding: 10px 15px; font-size: 11px; }.dialog-cancel { border: 1px solid var(--line); background: transparent; color: var(--muted); }.dialog-save { border: 0; background: var(--dark); color: white; font-weight: 700; }

@media (max-width: 980px) { .app-shell { grid-template-columns: 190px minmax(0,1fr); }.sidebar { padding-inline: 12px; }.main { padding-inline: 24px; }.metric-grid { grid-template-columns: repeat(2,1fr); }.content-grid { grid-template-columns: 1fr; }.activity-panel { display: none; }.record-row { grid-template-columns: 90px minmax(0,1fr) 100px; }.record-date { display: none; } }
@media (max-width: 700px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }.app-shell { display: block; }.sidebar { display: none; }.main { padding: 20px 14px 30px; }.topbar { min-height: 58px; margin-bottom: 14px; }.topbar h1 { font-size: 26px; }.icon-button { width: 36px; height: 36px; }.server-button { width: 36px; min-height: 36px; padding: 0; justify-content: center; }.server-button #serverLabel { display: none; }
  .composer-card { padding: 17px 15px 14px; border-radius: 21px; }.shortcut, .suggestions { display: none; }.intake-lanes { grid-template-columns: 1fr; }.intake-lane textarea { min-height: 105px; font-size: 16px; }.lane-actions .voice-button { flex: 0 0 auto; }.lane-actions .submit-button { flex: 1; }.privacy-note { align-items: flex-start; }
  .draft-review { padding: 16px 12px; border-radius: 20px; }.draft-review-head { flex-direction: column; gap: 8px; }.draft-fields.compact,.draft-fields.two { grid-template-columns: 1fr 1fr; }.draft-footer,.draft-footer > div { align-items: stretch; flex-direction: column; }.draft-footer .submit-button { width: 100%; }
  .metric-grid { gap: 10px; margin: 14px 0; }.metric-card { min-height: 116px; padding: 14px; border-radius: 18px; }.metric-number { margin: 5px 0 13px; font-size: 30px; }.metric-icon { right: 12px; top: 12px; }
  .content-grid { display: block; }.panel { border-radius: 18px; }.panel-heading { padding: 17px 16px 10px; }
  .mobile-nav { position: fixed; z-index: 15; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,1fr); padding: 7px; border: 1px solid #33362f; border-radius: 20px; background: rgba(23,25,20,.96); box-shadow: 0 12px 35px rgba(0,0,0,.25); backdrop-filter: blur(12px); }.mobile-nav button { border: 0; background: transparent; color: #898e82; font-size: 9px; }.mobile-nav span { display: block; margin-bottom: 3px; font-size: 17px; }.mobile-nav button.active { color: white; }
  .section-toolbar, .hero-line { align-items: stretch; flex-direction: column; }.segmented { overflow-x: auto; }.segmented button { white-space: nowrap; }.section-toolbar select { width: 100%; }.search-box { min-width: 0; width: 100%; }.card-grid, .project-grid { grid-template-columns: 1fr; }.record-row { grid-template-columns: 62px minmax(0,1fr) auto; gap: 9px; padding: 14px 12px; }.record-manager { font-size: 9px; }.status-pill { white-space: nowrap; }.project-details { grid-template-columns: 1fr; }.toast { left: 14px; right: 14px; bottom: 90px; max-width: none; }
}
