:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: #101116;
  color: #f4f4f5;
  --bg: #101116;
  --panel: #17191f;
  --panel-2: #1e2129;
  --border: #30343f;
  --text: #f5f5f7;
  --muted: #a6abb7;
  --accent: #d8d9ff;
  --accent-ink: #171827;
  --danger: #ffb9b9;
  --warning: #ffd6a8;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.boot-message { padding: 2rem; color: var(--muted); }
.ram-shell { width: min(100%, 1040px); margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 18px calc(92px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.brand { font-weight: 850; letter-spacing: -0.03em; font-size: 1.35rem; }
.brand span { font-weight: 550; color: var(--muted); font-size: .88rem; margin-left: 6px; letter-spacing: 0; }
.tagline { margin: 5px 0 0; color: var(--muted); font-size: .92rem; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--border); background: var(--panel); border-radius: 14px; cursor: pointer; font-size: 1.15rem; }

.capture-card, .smart-area, .immediate-review { border: 1px solid var(--border); background: var(--panel); border-radius: 22px; }
.capture-card { padding: 18px; }
.capture-heading, .smart-heading, .review-now-heading, .dialog-heading, .view-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 800; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(1.35rem, 4vw, 1.8rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
h4 { font-size: 1rem; }
.local-pill, .count-pill { border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 5px 9px; font-size: .75rem; white-space: nowrap; }

#brain-dump { width: 100%; margin-top: 16px; resize: vertical; min-height: 118px; border: 1px solid var(--border); background: #111319; color: var(--text); border-radius: 16px; padding: 15px 16px; font-size: 1rem; line-height: 1.45; }
#brain-dump::placeholder { color: #777d8b; }
.capture-actions { display: flex; gap: 14px; justify-content: space-between; align-items: center; margin-top: 12px; }
.capture-actions p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.primary-button, .secondary-button, .small-button, .text-button, .file-button { min-height: 44px; border-radius: 13px; cursor: pointer; border: 1px solid var(--border); }
.primary-button { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 800; padding: 0 18px; }
.primary-button:disabled { opacity: .55; cursor: default; }
.secondary-button, .file-button { background: var(--panel-2); padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; }
.text-button { min-height: 36px; background: transparent; border-color: transparent; color: var(--accent); padding: 0 6px; }
.capture-status { min-height: 1.3em; margin-top: 10px; color: var(--muted); font-size: .84rem; }

.immediate-review { margin-top: 16px; padding: 17px; border-color: #5b4b40; background: #1d1a18; }
.review-now-heading { margin-bottom: 10px; }
.quick-review-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid #3c3530; }
.quick-review-row:first-child { border-top: 0; }
.quick-review-row div { min-width: 0; }
.quick-review-row strong, .quick-review-row small { display: block; }
.quick-review-row small { color: var(--muted); margin-top: 4px; }

.smart-area { margin-top: 16px; padding: 17px; }
.smart-heading { margin-bottom: 12px; }
.smart-nav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.smart-nav::-webkit-scrollbar { display: none; }
.view-chip { min-height: 38px; border: 1px solid var(--border); background: transparent; border-radius: 999px; padding: 0 12px; white-space: nowrap; cursor: pointer; color: var(--muted); }
.view-chip.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 800; }
.view-summary { align-items: center; padding: 10px 2px 13px; }
.view-summary p { margin: 4px 0 0; color: var(--muted); font-size: .84rem; }
.entry-list { display: grid; gap: 10px; }
.entry-card { display: flex; gap: 14px; justify-content: space-between; border: 1px solid var(--border); background: #14161c; border-radius: 16px; padding: 14px; }
.entry-main { min-width: 0; flex: 1; }
.entry-title-row { display: flex; gap: 8px; align-items: center; }
.entry-title-row h4 { overflow-wrap: anywhere; }
.review-badge { border-radius: 999px; padding: 3px 7px; font-size: .68rem; background: #3d2d20; color: var(--warning); white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.badge { border: 1px solid var(--border); border-radius: 999px; padding: 3px 7px; color: var(--muted); font-size: .7rem; }
.kind-task, .kind-shopping { color: #cfd9ff; }
.kind-idea { color: #e0cfff; }
.priority-must { color: #ffd1d1; border-color: #694349; }
.priority-high { color: #ffd7bd; border-color: #614b3d; }
.date-badge { color: #cce6da; }
.inline-suggestion { display: block; margin-top: 10px; border: 0; padding: 0; background: transparent; color: var(--warning); font-size: .78rem; text-align: left; cursor: pointer; }
.entry-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; gap: 6px; max-width: 190px; }
.small-button { min-height: 36px; padding: 0 10px; background: var(--panel-2); color: var(--text); }
.small-button.subtle { color: var(--muted); background: transparent; }
.empty-state { padding: 28px 14px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 14px; line-height: 1.5; }

.sheet-dialog { width: min(calc(100% - 24px), 660px); max-height: calc(100% - 28px); overflow: auto; border: 1px solid var(--border); border-radius: 22px; padding: 18px; background: #17191f; color: var(--text); }
.sheet-dialog::backdrop { background: rgba(0,0,0,.66); }
.sheet-dialog label { display: grid; gap: 7px; margin-top: 14px; color: var(--muted); font-size: .82rem; }
.sheet-dialog input:not([type="checkbox"]), .sheet-dialog textarea, .sheet-dialog select { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: #101218; color: var(--text); padding: 11px 12px; min-height: 44px; font-size: 1rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.check-row { grid-template-columns: 22px 1fr !important; align-items: center; }
.check-row input { width: 20px; height: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.suggestion-box { margin-top: 12px; border: 1px solid #5b4b40; background: #1d1a18; border-radius: 12px; padding: 11px; color: var(--warning); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.settings-group { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.settings-group:first-of-type { border-top: 0; margin-top: 8px; }
.switch-row { grid-template-columns: minmax(0,1fr) auto !important; align-items: center; gap: 14px !important; padding: 10px 0; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { color: var(--text); font-size: .94rem; }
.switch-row small { margin-top: 3px; line-height: 1.4; }
.switch-row input { width: 22px; height: 22px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-button input { display: none; }
.muted { color: var(--muted); font-size: .85rem; }
.build-note { color: var(--muted); font-size: .76rem; text-align: center; margin-top: 20px; }
.hidden { display: none !important; }

@media (max-width: 640px) {
  .ram-shell { padding-left: 12px; padding-right: 12px; }
  .brand span { display: block; margin: 2px 0 0; }
  .tagline { max-width: 270px; }
  .capture-card, .smart-area, .immediate-review { border-radius: 18px; }
  .capture-actions { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .entry-card { flex-direction: column; }
  .entry-actions { max-width: none; justify-content: flex-start; }
  .field-grid { grid-template-columns: 1fr; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .primary-button, .dialog-actions .secondary-button { width: 100%; }
}
