/* Arya — Apple UI design system tokens.
   Semantic colors, system type, grouped lists, 44 pt targets, dark mode.
   See DESIGN.md. */
:root {
  --bg: #f2f2f7;
  --group: #ffffff;
  --label: #1c1c1e;
  --secondary: #636366;
  --tertiary: #aeaeb2;
  --sep: rgba(60, 60, 67, 0.14);
  --fill: rgba(120, 120, 128, 0.14);
  --accent: #1c6b3c;
  --accent-press: #155c32;
  --accent-text: #176b36;
  --danger: #c81e1e;
  --tabbar: rgba(242, 242, 247, 0.82);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --group: #1c1c1e;
    --label: #f2f2f7;
    --secondary: #aeaeb2;
    --tertiary: #636366;
    --sep: rgba(255, 255, 255, 0.16);
    --fill: rgba(120, 120, 128, 0.28);
    --accent: #1e7a3e;
    --accent-press: #176b36;
    --accent-text: #52c878;
    --danger: #ff6961;
    --tabbar: rgba(20, 20, 22, 0.82);
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --group: #1c1c1e;
  --label: #f2f2f7;
  --secondary: #aeaeb2;
  --tertiary: #636366;
  --sep: rgba(255, 255, 255, 0.16);
  --fill: rgba(120, 120, 128, 0.28);
  --accent: #1e7a3e;
  --accent-press: #176b36;
  --accent-text: #52c878;
  --danger: #ff6961;
  --tabbar: rgba(20, 20, 22, 0.82);
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto; max-width: 680px;
  background: var(--bg); color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 17px; line-height: 1.45;
  padding: 14px 16px calc(96px + env(safe-area-inset-bottom));
}
::selection { background: rgba(28, 107, 60, 0.28); }
a { color: var(--accent-text); text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: 0.45; cursor: default; }
[hidden] { display: none !important; }
.btn.primary:disabled { background: var(--fill); color: var(--secondary); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }

header { display: flex; justify-content: space-between; align-items: baseline; }
.wordmark { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.largetitle { font-size: 34px; font-weight: 700; letter-spacing: -0.022em; margin: 10px 0 2px; }
.subtitle { color: var(--secondary); margin: 0 0 4px; font-size: 15px; }
.muted { color: var(--secondary); font-size: 15px; }
.note {
  background: var(--fill); border-radius: 10px; padding: 10px 14px;
  font-size: 15px; color: var(--label);
}
.sect {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--secondary); margin: 26px 0 8px 16px;
}
.group {
  background: var(--group); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2px 16px; margin-bottom: 12px;
}
.group.pad { padding: 14px 16px; }
.nomargin { margin: 0; }

.row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--sep); min-height: 44px;
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.name { font-weight: 600; overflow-wrap: anywhere; }
a.name { color: var(--label); }
.sub { color: var(--secondary); font-size: 14px; display: block; font-weight: 400; overflow-wrap: anywhere; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.empty { color: var(--secondary); padding: 12px 0; margin: 0; }
.return { color: var(--danger); }

.btn {
  background: var(--fill); color: var(--label);
  border: none; border-radius: 980px; padding: 10px 20px; min-height: 44px;
  font-weight: 600; font-size: 16px; transition: background 0.15s ease, transform 0.1s ease;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-press); }
.btn.secondary { background: var(--fill); color: var(--label); }
.btn.danger { background: var(--fill); color: var(--danger); }
#token-value { flex: 1; font: inherit; font-size: 13px; padding: 8px; border: 1px solid var(--sep); border-radius: 8px; background: var(--bg); color: var(--label); }
.btn.wide { width: 100%; }
.chip {
  border: none; background: var(--fill); color: var(--label); border-radius: 980px;
  padding: 8px 14px; min-height: 36px; font-size: 15px; font-weight: 550;
}
.chip:active { background: var(--accent); color: #fff; }

.field { display: block; margin: 12px 0; font-weight: 550; font-size: 15px; }
.field input, .field select { margin-top: 6px; }
input[type="text"], input[type="password"], select {
  width: 100%; font: inherit; font-size: 17px; color: var(--label);
  background: var(--fill); border: none; border-radius: 10px; padding: 11px 12px;
}
input[type="file"] { width: 100%; font: inherit; font-size: 15px; margin-top: 6px; }

.listrow .check {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--tertiary); background: transparent; padding: 0;
  display: grid; place-items: center; color: #fff;
}
.listrow .check svg { width: 16px; height: 16px; opacity: 0; }
.listrow.checked .check { background: var(--accent); border-color: var(--accent); }
.listrow.checked .check svg { opacity: 1; }
.listrow.checked .name, .listrow.checked .sub { color: var(--tertiary); text-decoration: line-through; }
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper button {
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: var(--fill); font-size: 19px; line-height: 1; color: var(--label);
}
.stepper .qty { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; }
.remove {
  flex: none; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: transparent; color: var(--tertiary); font-size: 20px; line-height: 1;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 12px; }
.editor { padding: 0 0 12px; display: flex; gap: 8px; }
.editor input { flex: 1; }
.candrow {
  display: flex; width: 100%; text-align: left; background: transparent; border: none;
  padding: 12px 0; border-bottom: 1px solid var(--sep); min-height: 44px; font-size: 16px;
}
.candrow:last-child { border-bottom: none; }

#toast {
  position: sticky; top: 8px; z-index: 20; margin: 8px 0;
  background: var(--label); color: var(--bg); border-radius: 10px;
  padding: 10px 14px; font-size: 15px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: var(--tabbar); border-top: 1px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
#tabs button {
  background: transparent; border: none; color: var(--secondary);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 550; padding: 4px 14px; min-height: 48px; min-width: 64px;
}
#tabs button svg { width: 25px; height: 25px; }
#tabs button.active { color: var(--accent-text); }

.bar { height: 6px; background: var(--accent); border-radius: 3px; min-width: 2px; }
.month-row { display: grid; grid-template-columns: 78px 1fr 70px; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--sep); }
.month-row:last-child { border-bottom: none; }
.month-row > span:first-child { white-space: nowrap; }
.month-row .track { background: var(--fill); border-radius: 3px; }

#chat-log { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 14px; }
.bubble { max-width: 84%; padding: 10px 14px; border-radius: 18px; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.arya { align-self: flex-start; background: var(--fill); border-bottom-left-radius: 4px; }
.bubble.sys { align-self: center; background: transparent; color: var(--secondary); font-size: 14px; padding: 2px 8px; }
#chat-form { display: flex; gap: 8px; align-items: center; }
#chat-form input { flex: 1; border-radius: 980px; padding: 11px 16px; }
.iconbtn {
  flex: none; width: 44px; height: 44px; border: none; border-radius: 50%;
  background: var(--fill); color: var(--secondary); display: grid; place-items: center;
}
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.on { background: var(--accent); color: #fff; }
.iconbtn.listening { background: var(--danger); color: #fff; }

.eyes-record img { max-width: 100%; border-radius: 12px; }
.view.enter { animation: rise 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .view.enter { animation: none; }
  .btn { transition: none; }
}

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg .chip[aria-pressed="true"] { background: var(--accent); color: #fff; }

ol.steps { margin: 10px 0 4px 20px; padding: 0; }
ol.steps li { margin: 6px 0; line-height: 1.45; }
