/* AURA look: soft lavender background, deep plum text, violet gradient buttons, pink→purple brand mark. */
:root {
  --bg: #f9f4fb; --bg2: #f3e9f8; --panel: #ffffff; --ink: #3a2a4c; --muted: #8a7c99; --line: #ece2f2;
  --brand1: #ec6fb6; --brand2: #9b7cf4; --violet: #8f7cf5; --violet2: #b59cf5; --violet-ink: #5b3fc4;
  --accent: #3a2a4c; --accent-ink: #ffffff; --quote: #f6f0fa; --title: #6d4fc9;
  --red: #c2416b; --red-bg: #fde8ef; --yellow: #a0620b; --yellow-bg: #fdf1dc; --green: #2f8f5b; --green-bg: #e3f5ea;
  --radius: 16px; --shadow: 0 1px 2px rgba(58,42,76,.04), 0 6px 20px rgba(120,80,170,.06);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171221; --bg2: #1f1730; --panel: #211a2e; --ink: #f1eaf8; --muted: #a596b8; --line: #33284a;
    --accent: #f1eaf8; --accent-ink: #171221; --quote: #2a2139; --title: #c3b0ff; --violet-ink: #c3b0ff;
    --red: #ff8fb0; --red-bg: #3b1d2a; --yellow: #f0c46c; --yellow-bg: #362a14; --green: #7fdba4; --green-bg: #183126;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--ink); }
body { font: 15px/1.55 var(--font); background: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, rgba(236,111,182,.10), transparent 60%),
                    radial-gradient(900px 500px at 10% 110%, rgba(155,124,244,.12), transparent 60%);
  background-attachment: fixed; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1, h2 { margin: 0; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: 30px; } h2 { font-size: 24px; }

.btn { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--violet2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--violet), var(--violet2)); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(143,124,245,.35); }
.btn.good { background: linear-gradient(135deg, var(--violet), var(--brand1)); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(200,110,200,.30); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn.wide { width: 100%; padding: 12px; }
.link { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; text-decoration: underline; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .tcard:focus-visible { outline: 2px solid var(--violet2); outline-offset: 1px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; text-align: center; display: grid; gap: 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 24px; padding: 32px 26px; box-shadow: var(--shadow); }
.login-box form { display: grid; gap: 10px; }
.login-box input { text-align: center; font-size: 22px; letter-spacing: .3em; padding: 12px; }
.msg { min-height: 1.5em; color: var(--muted); margin: 0; }
.logo { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand1), var(--brand2));
  color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: 0 3px 12px rgba(200,110,200,.35); }
.logo.big { width: 60px; height: 60px; font-size: 28px; margin: 0 auto; }

/* shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,.75) 0%, rgba(243,233,248,.9) 55%, rgba(222,204,247,.95) 100%);
  border-right: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .side { background: linear-gradient(180deg, #1c1529 0%, #261b3b 100%); } }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; padding: 0 8px 20px; letter-spacing: -.01em; }
.nav { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 600; }
.nav:hover { background: rgba(155,124,244,.10); color: var(--ink); }
.nav.active { background: var(--panel); color: var(--violet-ink); box-shadow: var(--shadow); }
.badge { font-size: 12px; background: linear-gradient(135deg, var(--brand1), var(--brand2)); color: #fff; border-radius: 99px; padding: 0 8px; }
.badge:empty { display: none; }
.side-foot { margin-top: auto; display: grid; gap: 6px; padding: 0 12px; }
main { min-width: 0; }
.view { max-width: 900px; margin: 0 auto; padding: 26px 30px 60px; }
#view-tasks { max-width: none; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.bar-right { display: flex; align-items: center; gap: 10px; }

/* tabs */
.tabs, .seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tab, .seg button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: none; color: var(--muted); padding: 6px 16px;
  border-radius: 999px; cursor: pointer; }
.tab.active, .seg button.active { background: linear-gradient(135deg, var(--violet), var(--violet2)); color: #fff; }
.tab.active .count { color: rgba(255,255,255,.85); }
.count { font-size: 12px; color: var(--muted); }

/* digest */
.digest-head { margin: 0 0 18px; color: var(--muted); }
.digest-head p { margin: 4px 0; }
.digest-head .overview { color: var(--ink); font-weight: 500; }
.cards { display: grid; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card.done { opacity: .55; }
.card-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-head .n { color: var(--muted); font-weight: 700; }
.card-head .who { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.card-head .ctx { color: var(--muted); font-size: 13px; }
.label { margin: 14px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--violet-ink); }
.pill { font-size: 12px; font-weight: 700; border-radius: 99px; padding: 2px 10px; display: inline-block; }
.pill.urgent { background: var(--red-bg); color: var(--red); }
.pill.today { background: var(--yellow-bg); color: var(--yellow); }
.pill.sent { background: var(--green-bg); color: var(--green); }
.pill.plain { background: var(--bg2); color: var(--muted); font-weight: 600; }
.points { margin: 0; padding-left: 18px; }
.points li { margin: 2px 0; }
.draft { background: var(--quote); border-left: 3px solid var(--violet2); border-radius: 10px; padding: 11px 14px; white-space: pre-wrap; }
.next { font-size: 14px; }
.task-line { font-size: 14px; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.editor { display: grid; gap: 8px; margin-top: 12px; }
.editor textarea { width: 100%; min-height: 110px; resize: vertical; }
.editor .row, .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.editor .row input { flex: 1; min-width: 220px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.section-title { margin: 30px 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.fyi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 20px; }
.fyi p { margin: 6px 0; }

/* tasks: Notion-style board */
.add-task { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; max-width: 900px; }
.add-task #new-title { flex: 1; min-width: 220px; }
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.col { flex: 0 0 290px; display: flex; flex-direction: column; gap: 10px; }
.col-head { font-weight: 700; color: var(--violet-ink); padding: 2px 4px; }
.col-head span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.col-head.overdue { color: var(--red); }
.col-body { display: flex; flex-direction: column; gap: 10px; }
.col-empty { color: var(--muted); font-size: 13px; padding: 8px 4px; }
.tcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow);
  cursor: pointer; display: grid; gap: 8px; transition: transform .1s, border-color .1s; }
.tcard:hover { border-color: var(--violet2); transform: translateY(-1px); }
.tcard.leaving { opacity: .3; }
.tcard-top { display: flex; gap: 10px; align-items: flex-start; }
.tcard-title { color: var(--title); font-weight: 600; line-height: 1.35; }
.check { width: 18px; height: 18px; margin-top: 2px; flex: none; border-radius: 50%; border: 2px solid var(--violet2); background: none; cursor: pointer; padding: 0; }
.check:hover { background: var(--green-bg); border-color: var(--green); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; background: var(--bg2); color: var(--muted); border-radius: 6px; padding: 1px 8px; font-weight: 600; }
.tag.status::before { content: "● "; color: var(--red); }
.tmeta { font-size: 13px; color: var(--muted); }

/* task drawer */
.drawer { position: fixed; inset: 0; background: rgba(40,25,60,.25); display: flex; justify-content: flex-end; z-index: 8; }
.drawer-box { width: min(460px, 100%); height: 100%; overflow-y: auto; background: var(--panel); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: -10px 0 40px rgba(60,30,90,.18); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-title { font: inherit; font-size: 20px; font-weight: 800; letter-spacing: -.01em; border: 1px solid transparent; resize: vertical; }
.drawer-title:hover { border-color: var(--line); }
.drawer label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--violet-ink); margin-top: 8px; }
.drawer .row input[type=text] { flex: 1; min-width: 180px; }
.comments { font-size: 14px; display: grid; gap: 8px; }
.note { background: var(--quote); border-radius: 10px; padding: 8px 12px; }

/* activity */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 99px; padding: 4px 12px; cursor: pointer; }
.chip.active { background: linear-gradient(135deg, var(--violet), var(--violet2)); color: #fff; border-color: transparent; }
.day { margin: 20px 0 8px; font-size: 13px; font-weight: 700; color: var(--violet-ink); }
.act { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; padding: 10px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; cursor: pointer; }
.act .t { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.act.fail .s { color: var(--red); }
.act .k { font-size: 12px; color: var(--muted); }
.act pre { grid-column: 2 / -1; margin: 6px 0 0; white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--muted); }

/* chat */
.chat-view { display: flex; flex-direction: column; height: 100vh; padding-bottom: 18px; }
.chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 12px; }
.bubble { max-width: 80%; padding: 11px 15px; border-radius: 18px; }
.bubble.user { align-self: flex-end; background: linear-gradient(135deg, var(--violet), var(--violet2)); color: #fff; white-space: pre-wrap; }
.bubble.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble blockquote, .md blockquote { margin: 6px 0; padding: 8px 12px; background: var(--quote); border-left: 3px solid var(--violet2);
  border-radius: 8px; white-space: pre-wrap; }
.bubble.user a { color: inherit; }
.thinking { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; max-height: 200px; border-radius: 16px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--quote); padding: 1px 4px; border-radius: 4px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(60,30,90,.25); z-index: 9; max-width: 90vw; }
.toast.bad { background: var(--red); color: #fff; }

.side-talk { margin: 14px 4px 0; }
.fab { display: none; }
.steps { margin: 4px 0 6px; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }
.copy { cursor: pointer; word-break: break-all; }

/* phone: tabs at the bottom, a big talk button, room for the iPhone home bar */
@media (max-width: 760px) {
  body { padding-top: env(safe-area-inset-top); }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; top: auto; z-index: 6; height: auto; flex-direction: row;
    justify-content: space-around; align-items: center; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
  .brand, .side-foot, .side-talk { display: none; }
  .nav { flex-direction: column; gap: 0; padding: 6px 10px; font-size: 13px; border-radius: 12px; }
  .nav .badge { position: absolute; transform: translate(18px, -8px); font-size: 11px; }
  .view { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); }
  .bar { gap: 8px; }
  .bar-right { flex-wrap: wrap; }
  #siri-setup { padding: 6px 10px; font-size: 13px; }
  .chat-view { height: calc(100dvh - 70px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); padding-bottom: 8px; }
  .bubble { max-width: 92%; }
  .col { flex-basis: 82vw; }
  .card { padding: 15px 16px; }
  .actions .btn { flex: 1; text-align: center; }
  .drawer-box { width: 100%; }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 7; width: 60px; height: 60px; border-radius: 50%; border: 0; font-size: 26px; cursor: pointer;
    background: linear-gradient(135deg, var(--brand1), var(--brand2)); color: #fff; box-shadow: 0 8px 24px rgba(155,124,244,.45); }
  #view-chat ~ .fab, body:has(#view-chat:not(.hidden)) .fab { display: none; }
  .orb { width: 200px; height: 200px; }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) { .side { background: rgba(23,18,33,.92); } }

/* voice mode */
.voice { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(900px 600px at 50% 30%, rgba(236,111,182,.25), transparent 60%),
              radial-gradient(900px 700px at 50% 90%, rgba(155,124,244,.35), transparent 60%), var(--bg); }
.voice-box { width: min(560px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.orb { width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8, transparent 40%),
  linear-gradient(135deg, var(--brand1), var(--brand2)); box-shadow: 0 20px 60px rgba(155,124,244,.45);
  transition: transform .3s; animation: breathe 3s ease-in-out infinite; }
.orb.speaking { animation: talk .5s ease-in-out infinite alternate; }
.orb.off { filter: grayscale(.7); opacity: .6; animation: none; }
@keyframes breathe { 50% { transform: scale(1.05); } }
@keyframes talk { from { transform: scale(1); } to { transform: scale(1.12); } }
.voice-status { font-size: 20px; font-weight: 700; color: var(--violet-ink); }
.voice-lines { width: 100%; max-height: 34vh; overflow-y: auto; display: grid; gap: 8px; text-align: left; }
.voice-lines div { padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; }
.voice-lines .me { background: transparent; color: var(--muted); }
.row.center { justify-content: center; }
.bar > div h2 + span { display: block; }

.fixer { display: grid; gap: 8px; margin-top: 8px; }
.fixer .row input { flex: 1; min-width: 220px; }
.btn.small { font-size: 13px; padding: 5px 12px; }
