:root {
  color-scheme: light dark;
  --paper: oklch(0.97 0.004 260);
  --card: oklch(0.943 0.007 260);
  --card-used: oklch(0.91 0.006 260);
  --ink: oklch(0.25 0.007 260);
  --muted: oklch(0.515 0.009 260);
  --line: oklch(0.84 0.007 260);
  --yellow: oklch(0.72 0.011 260);
  --yellow-ink: oklch(0.37 0.009 260);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(0.19 0.005 260);
    --card: oklch(0.265 0.006 260);
    --card-used: oklch(0.225 0.004 260);
    --ink: oklch(0.925 0.006 260);
    --muted: oklch(0.68 0.008 260);
    --line: oklch(0.35 0.008 260);
    --yellow: oklch(0.79 0.01 260);
    --yellow-ink: oklch(0.86 0.008 260);
  }
  .capture, .sync-dialog, .sync-dialog input, .sync-dialog textarea, .capture textarea, .capture-footer { background: oklch(0.23 0.006 260); }
  .capture textarea, .sync-dialog input, .sync-dialog textarea { color: var(--ink); caret-color: var(--ink); }
  .capture textarea::placeholder { color: oklch(0.63 0.008 260); }
  .save-button { background: oklch(0.9 0.005 260); color: oklch(0.23 0.006 260); }
  .idea-card { box-shadow: 1px 2px 0 color-mix(in oklch, var(--yellow) 23%, transparent); }
  .brand-mark { box-shadow: 0 2px 10px color-mix(in oklch, var(--yellow) 18%, transparent); }
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--font); }
button, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 680px); min-height: 100vh; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); }
.topbar { padding: 0 2px 28px; }
.eyebrow { margin: 0 0 var(--space-xs); color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .12em; line-height: 1; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); }
.brand-title { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; box-shadow: 0 2px 9px color-mix(in oklch, var(--yellow) 27%, transparent); }
h1 { margin: 0; font-size: 32px; letter-spacing: -.055em; line-height: 1; }
.icon-button { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; letter-spacing: 1px; line-height: 12px; }
.capture { border: 1px solid var(--line); border-radius: 18px; background: oklch(0.982 0.006 94); overflow: hidden; }
textarea { display: block; width: 100%; resize: none; border: 0; outline: 0; padding: 17px 17px 12px; color: var(--ink); background: transparent; font-size: 17px; line-height: 1.46; }
textarea::placeholder { color: oklch(0.66 0.016 80); font-style: italic; }
.capture-footer { display: flex; align-items: center; justify-content: space-between; min-height: 53px; padding: 8px 10px 8px 17px; border-top: 1px solid var(--line); }
.capture-footer span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.save-button { border: 0; border-radius: 11px; padding: 9px 13px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 600; }
.save-button:disabled { opacity: .34; cursor: not-allowed; }
.filters { display: flex; gap: 20px; padding: 30px 2px 14px; border-bottom: 1px solid var(--line); }
.filter { position: relative; padding: 0 0 10px; border: 0; background: none; color: var(--muted); font-size: 13px; }
.filter span { margin-left: 3px; font-size: 10px; font-variant-numeric: tabular-nums; }
.filter.is-active { color: var(--ink); font-weight: 700; }
.filter.is-active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--ink); }
.ideas { display: grid; gap: var(--space-md); padding-top: var(--space-lg); }
.idea-card { display: grid; gap: var(--space-lg); padding: 17px 17px 11px; border-radius: 4px 14px 4px 4px; background: var(--card); box-shadow: 1px 2px 0 color-mix(in oklch, var(--yellow) 42%, transparent); animation: arrive .32s cubic-bezier(.22, 1, .36, 1) both; }
.idea-card.is-used { background: var(--card-used); box-shadow: none; }
.card-topline { display: flex; justify-content: space-between; color: var(--yellow-ink); font-size: 10px; font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: .04em; }
.is-used .card-topline { color: var(--muted); }
.idea-text { margin: 0; white-space: pre-wrap; font-size: 17px; letter-spacing: -.02em; line-height: 1.4; }
.card-actions { display: flex; align-items: center; gap: var(--space-sm); }
.card-actions button { border: 0; background: transparent; color: var(--yellow-ink); padding: 3px 0; font-size: 12px; }
.card-actions .use-button { margin-left: 7px; }
.card-actions .delete-button { margin-left: auto; width: 24px; color: var(--muted); font-size: 20px; line-height: 1; }
.is-used .card-actions button { color: var(--muted); }
.empty-state { padding: 46px 4px; color: var(--muted); text-align: center; }
.empty-state p { margin: 0 0 6px; color: var(--ink); font-size: 17px; font-weight: 600; letter-spacing: -.03em; }
.empty-state span { font-size: 13px; }
.sync-dialog { position: fixed; z-index: 10; top: 50%; left: 50%; width: min(calc(100% - 32px), 420px); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 100vmax oklch(0.22 0.012 75 / .22), 0 20px 65px color-mix(in oklch, var(--ink) 22%, transparent); transform: translate(-50%, -50%); }
.sync-dialog h2 { margin: 0 0 10px; font-size: 25px; letter-spacing: -.05em; }
.dialog-close { position: absolute; top: 15px; right: 16px; border: 0; background: transparent; color: var(--muted); font-size: 24px; }
.sync-status { min-height: 36px; margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.sync-dialog label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.sync-dialog input { width: 100%; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: oklch(0.982 0.006 94); color: var(--ink); font-size: 13px; }
.sync-dialog textarea { min-height: 68px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: oklch(0.982 0.006 94); font-size: 11px; line-height: 1.35; }
.dialog-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.copy-pairing, .plain-button, .disconnect { border: 0; background: transparent; padding: 0; color: var(--yellow-ink); font-size: 12px; font-weight: 600; }
.connect-button { display: block; margin-top: 16px; }
.disconnect { margin-top: 25px; color: var(--muted); font-weight: 400; }
.sync-simple { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.privacy-note { margin: 26px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.45; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px) rotate(.15deg); } to { opacity: 1; transform: translateY(0) rotate(0); } }
@media (min-width: 700px) { .app-shell { padding-top: 54px; } .ideas { grid-template-columns: repeat(2, 1fr); align-items: start; } }
