:root{--bg: #f5f2eb;--surface: #fffdf8;--surface-alt: #ece7dc;--ink: #1b221e;--muted: #5d665f;--accent: #1f4d3f;--accent-soft: #dce8e2;--warm: #c97d3b;--danger: #b83c35;--border: #dfd8ca;--radius: 16px}*,*:before,*:after{box-sizing:border-box}html,body,#root{margin:0;padding:0;height:100%;width:100%;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,SF Pro Text,PingFang SC,Noto Sans SC,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;overscroll-behavior-y:contain}.app-shell{display:flex;flex-direction:column;height:100dvh;max-width:600px;margin:0 auto;background:var(--bg)}.top-bar{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;background:var(--surface);border-bottom:1px solid var(--border)}.brand{display:flex;align-items:center;gap:10px}.brand-mark{width:26px;height:26px;border-radius:50%;background:conic-gradient(var(--accent) 0 180deg,var(--warm) 180deg 360deg);box-shadow:inset 0 0 0 4px var(--surface);border:1px solid var(--border)}.brand-title{margin:0;font-size:16px;line-height:1.15;font-weight:700}.brand-sub{font-size:11px;color:var(--muted)}.icon-btn{width:38px;height:38px;border-radius:999px;border:1px solid var(--border);background:var(--bg);color:var(--ink);font-size:16px;cursor:pointer}.main-stage{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.tab-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:14px 14px 88px;display:flex;flex-direction:column;gap:12px}.hero-card,.lab-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px}.hero-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.eyebrow{margin:0 0 4px;font-size:10px;font-weight:700;letter-spacing:.08em;color:var(--muted)}.section-title{margin:0;font-size:20px;font-weight:700}.hero-sub{margin:8px 0 0;font-size:13px;line-height:1.45;color:var(--muted)}.status-stack{display:flex;flex-direction:column;align-items:flex-end;gap:4px}.pill{font-size:11px;font-weight:600;padding:3px 9px;border-radius:999px}.pill-ok{background:var(--accent-soft);color:var(--accent)}.pill-syncing{background:#ede6d5;color:#6b5732}.pill-pending{background:#f5e2cf;color:#8f4e16}.rev-label{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.lab-header{width:100%;background:none;border:none;padding:0;display:flex;align-items:center;justify-content:space-between;font-size:14px;font-weight:600;color:var(--ink);cursor:pointer}.flashback-badge{font-size:12px;font-weight:700;padding:3px 8px;border-radius:999px;font-variant-numeric:tabular-nums}.badge-pass{background:var(--accent-soft);color:var(--accent)}.badge-fail{background:#f8d8d6;color:var(--danger)}.lab-body{margin-top:12px;display:flex;flex-direction:column;gap:10px;border-top:1px solid var(--border);padding-top:12px}.lab-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.lab-label{font-size:13px;color:var(--muted)}.segmented{display:inline-flex;background:var(--surface-alt);border-radius:10px;padding:2px;gap:2px}.seg-btn{border:none;background:transparent;padding:6px 10px;border-radius:8px;font-size:12px;font-weight:600;color:var(--muted);cursor:pointer}.seg-btn.active{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px #00000014}.toggle-chip{border:1px solid var(--border);background:var(--surface-alt);color:var(--muted);border-radius:999px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer}.toggle-chip.on{background:var(--accent);border-color:var(--accent);color:#fff}.metrics-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.metric-box{background:var(--bg);border-radius:10px;padding:7px 6px;text-align:center;display:flex;flex-direction:column}.metric-num{font-size:15px;font-weight:700;font-variant-numeric:tabular-nums}.metric-lbl{font-size:10px;color:var(--muted)}.lab-actions{display:flex;flex-wrap:wrap;gap:8px}.btn-secondary,.btn-ghost{border-radius:10px;padding:8px 12px;font-size:13px;font-weight:600;cursor:pointer}.btn-secondary{border:none;background:var(--accent);color:#fff}.btn-ghost{border:1px solid var(--border);background:var(--surface);color:var(--ink)}.btn-sm{padding:5px 10px;font-size:12px}.anchor-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.anchor-row{width:100%;min-height:60px;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);text-align:left;cursor:pointer;transition:transform 80ms ease,background-color .12s ease}.anchor-row:active{transform:scale(.99)}.anchor-row.checked{background:#f0f5f2;border-color:#b7cfc3}.anchor-check{width:24px;height:24px;border-radius:8px;border:2px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;flex:0 0 auto;color:#fff}.anchor-row.checked .anchor-check{background:var(--accent);border-color:var(--accent)}.anchor-text{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}.anchor-label{font-size:15px;font-weight:600;color:var(--ink)}.anchor-row.checked .anchor-label{color:var(--accent)}.anchor-meta{font-size:12px;color:var(--muted)}.switch-track{width:44px;height:26px;border-radius:999px;background:#d3ccbe;padding:3px;flex:0 0 auto;display:flex;align-items:center;transition:background-color .12s ease}.switch-track.on{background:var(--accent)}.switch-thumb{width:20px;height:20px;border-radius:50%;background:#fff;transform:translate(0);transition:transform .12s ease}.switch-track.on .switch-thumb{transform:translate(18px)}.undo-toast{position:fixed;left:50%;transform:translate(-50%);bottom:calc(68px + env(safe-area-inset-bottom));width:calc(100% - 28px);max-width:572px;background:var(--ink);color:#fff;border-radius:12px;padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;box-shadow:0 8px 24px #0003;z-index:20}.undo-text{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.undo-actions{display:flex;align-items:center;gap:6px}.undo-btn{border:none;background:var(--warm);color:#fff;border-radius:8px;padding:6px 12px;font-size:13px;font-weight:700;cursor:pointer}.undo-dismiss{border:none;background:transparent;color:#c7cdc8;font-size:18px;padding:2px 6px;cursor:pointer}.error-banner{background:#fbeae9;color:var(--danger);border:1px solid #ecc0bc;border-radius:12px;padding:10px 12px;font-size:13px}.empty-state{text-align:center;color:var(--muted);padding:28px 12px;font-size:14px}.chat-shell{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.chat-subheader{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:8px 14px;border-bottom:1px solid var(--border);background:var(--bg)}.chat-vp{display:block;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.chat-messages{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:12px 14px;display:flex;flex-direction:column;gap:10px}.msg-row{display:flex}.msg-row.user{justify-content:flex-end}.msg-row.assistant{justify-content:flex-start}.msg-bubble{max-width:82%;border-radius:16px;padding:10px 13px;line-height:1.45;font-size:15px;word-break:break-word;white-space:pre-wrap}.bubble-user{background:var(--accent);color:#fff;border-bottom-right-radius:4px}.bubble-assistant{background:var(--surface);color:var(--ink);border:1px solid var(--border);border-bottom-left-radius:4px}.bubble-optimistic{opacity:.82}.msg-text{margin:0}.msg-meta{display:block;margin-top:4px;font-size:10px;opacity:.72}.chat-error{margin:0 14px 8px}.chat-composer{flex:0 0 auto;display:flex;align-items:flex-end;gap:8px;padding:10px 12px;background:var(--surface);border-top:1px solid var(--border)}.chat-input{flex:1 1 auto;min-height:40px;max-height:128px;resize:none;border:1px solid var(--border);border-radius:14px;padding:9px 12px;font-family:inherit;font-size:16px;line-height:1.35;background:var(--bg);color:var(--ink);outline:none}.chat-input:focus{border-color:var(--accent)}.send-btn{flex:0 0 auto;height:40px;padding:0 16px;border-radius:14px;border:none;background:var(--accent);color:#fff;font-size:14px;font-weight:700;cursor:pointer}.send-btn:disabled{opacity:.45;cursor:default}.bottom-nav{flex:0 0 auto;display:grid;grid-template-columns:1fr 1fr;background:var(--surface);border-top:1px solid var(--border);padding:6px 12px calc(6px + env(safe-area-inset-bottom));gap:8px}.nav-item{border:none;background:transparent;padding:8px 10px;border-radius:12px;font-size:13px;font-weight:600;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:7px;cursor:pointer}.nav-item.active{background:var(--accent-soft);color:var(--accent)}.nav-dot{width:7px;height:7px;border-radius:50%;background:currentColor}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1218145c;display:flex;align-items:flex-end;justify-content:center;z-index:40}.sheet-panel{width:100%;max-width:600px;background:var(--surface);border-top-left-radius:20px;border-top-right-radius:20px;padding:10px 18px calc(20px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:14px}.sheet-handle{width:38px;height:4px;border-radius:999px;background:var(--border);margin:0 auto}.sheet-header{display:flex;align-items:center;justify-content:space-between}.sheet-header h3{margin:0;font-size:17px}.sheet-section{display:flex;flex-direction:column;gap:8px}.diag-line{display:flex;justify-content:space-between;font-size:13px}.muted{color:var(--muted)}.field-label{font-size:12px;font-weight:600;color:var(--muted)}.token-row{display:flex;gap:8px}.text-input{flex:1 1 auto;border:1px solid var(--border);border-radius:10px;padding:8px 10px;font-size:14px;background:var(--bg)}
