:root {
  color-scheme: light dark;
  --bg: Canvas;
  --fg: CanvasText;
  --muted: color-mix(in srgb, CanvasText 55%, transparent);
  --line: color-mix(in srgb, CanvasText 15%, transparent);
  --accent: #4f7cff;
  --accent-fg: white;
  --card: color-mix(in srgb, CanvasText 6%, Canvas);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 17px/1.5 system-ui, -apple-system, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}
.page { max-width: 32rem; margin: 0 auto; padding: 1rem 1rem 6rem; }
h1 { font-size: 1.4rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
.muted { color: var(--muted); font-size: .9em; }
a { color: var(--accent); }

/* inputs & buttons: big, thumb-friendly, 16px+ to avoid mobile zoom */
input[type=text], textarea, .input {
  width: 100%; font: inherit; font-size: 17px; padding: .85rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
}
textarea { resize: none; }
button, .btn {
  font: inherit; font-size: 17px; min-height: 48px; padding: .7rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--fg); cursor: pointer;
}
button.primary, .btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
button.tiny, .btn.tiny { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; }
button.block { width: 100%; }
.row { display: flex; gap: .5rem; align-items: center; }
.row > * { flex: 0 0 auto; }
.row .grow { flex: 1 1 auto; }

/* top bar + rating footer (injected by study.js) */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; padding: .3rem 0 .8rem; margin-bottom: .8rem;
  border-bottom: 1px solid var(--line); font-size: .95rem;
}
.topbar .title { font-weight: 600; }
.ratebar {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg);
  border-top: 1px solid var(--line); padding: .6rem 1rem; max-width: 32rem; margin: 0 auto;
}
.ratebar .stars { display: flex; gap: .4rem; margin: .3rem 0; }
.ratebar .stars button { flex: 1; min-height: 44px; padding: .4rem; }
.ratebar .stars button.on { background: var(--accent); color: var(--accent-fg); border-color: transparent; }

/* menu cards */
.cards { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .6rem; }
.card { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--fg); }
.card span { color: var(--muted); font-size: .9em; }

/* generic lists */
.list { list-style: none; padding: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.tag { font-size: .72em; padding: .1rem .4rem; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--fg); }
.flash { color: var(--accent); font-weight: 600; }

/* results table */
.results { width: 100%; border-collapse: collapse; }
.results th, .results td { text-align: left; padding: .45rem .4rem; border-bottom: 1px solid var(--line); }
.results th { font-size: .8em; color: var(--muted); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.chip { padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); font-size: .95rem; }
.chip.on { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.chip-label { font-size: .75em; color: var(--muted); width: 100%; margin-top: .3rem; }

/* chat */
.thread { display: flex; flex-direction: column; gap: .4rem; min-height: 40vh; margin-bottom: .6rem; }
.bubble { max-width: 80%; padding: .55rem .8rem; border-radius: 16px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-fg); border-bottom-right-radius: 4px; }
.bubble.orbit { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--muted); }

/* swipeable capture rows */
.swipe { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.swipe .content { padding: .7rem .2rem; background: var(--bg); transition: transform .05s linear; will-change: transform; touch-action: pan-y; }
.swipe.done .content { text-decoration: line-through; color: var(--muted); }

/* simulated Android notification */
.notif {
  border: 1px solid var(--line); border-radius: 18px; background: var(--card);
  padding: .9rem 1rem .4rem; margin: .8rem 0; box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.notif .head { display: flex; align-items: center; gap: .45rem; font-size: .78em; color: var(--muted); }
.notif .dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); }
.notif .title { font-weight: 600; margin: .35rem 0 .1rem; }
.notif .body { margin: .1rem 0 .3rem; }
.notif .actions { display: flex; gap: .3rem; border-top: 1px solid var(--line); margin-top: .5rem; }
.notif .actions button { flex: 1; background: transparent; border: none; border-radius: 0;
  color: var(--accent); font-weight: 600; min-height: 46px; }
.center { text-align: center; }
