/* Başaracağız — sunny study app. Light-first, warm peach → lilac sky; dark = night study desk. */
:root {
  --bg: #fff6f1;
  --bg-2: #f7efff;
  --blob-1: #ffd6c4;
  --blob-2: #e4dcff;
  --blob-3: #ccf3e5;
  --card: #ffffff;
  --card-2: #fff9f6;
  --ink: #2b2140;
  --ink-2: #5f5573;
  --ink-3: #978cab;
  --line: #f1e7ee;
  --line-2: #f8f1f5;
  --accent: #ff5c8d;
  --accent-ink: #ffffff;
  --accent-soft: #ffe4ec;
  --violet: #7b5cff;
  --violet-soft: #ece6ff;
  --sun: #ffb21f;
  --sun-soft: #fff1d1;
  --mint: #14b886;
  --mint-soft: #d9f6ec;
  --done: #2b2140;
  --done-ink: #ffffff;
  --c-oabt: #3d8bfd;
  --c-ags: #14b886;
  --c-cebir: #7b5cff;
  --c-geo: #f5a300;
  --c-tekrar: #ff7a59;
  --c-plan: #a79bb8;
  --shadow: 0 1px 2px rgba(80, 40, 90, .05), 0 8px 24px rgba(120, 60, 130, .08);
  --f-display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --f-ui: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 20px;
  --tabbar-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15111d; --bg-2: #1b1426; --blob-1: #4a2236; --blob-2: #2e2457; --blob-3: #163a35;
    --card: #211a2d; --card-2: #261e33; --ink: #f7f1ff; --ink-2: #cbbfdc; --ink-3: #9789ab;
    --line: #342a46; --line-2: #2a2239; --accent: #ff77a2; --accent-ink: #2a0d18; --accent-soft: #4a1f31;
    --violet: #a08bff; --violet-soft: #2f2652; --sun: #ffc04d; --sun-soft: #3d2e12; --mint: #34d3a2; --mint-soft: #133a30;
    --done: #f7f1ff; --done-ink: #1b1426;
    --c-oabt: #5b9dff; --c-ags: #2fcf9c; --c-cebir: #a08bff; --c-geo: #ffbf3b; --c-tekrar: #ff8f73; --c-plan: #a497b8;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15111d; --bg-2: #1b1426; --blob-1: #4a2236; --blob-2: #2e2457; --blob-3: #163a35;
  --card: #211a2d; --card-2: #261e33; --ink: #f7f1ff; --ink-2: #cbbfdc; --ink-3: #9789ab;
  --line: #342a46; --line-2: #2a2239; --accent: #ff77a2; --accent-ink: #2a0d18; --accent-soft: #4a1f31;
  --violet: #a08bff; --violet-soft: #2f2652; --sun: #ffc04d; --sun-soft: #3d2e12; --mint: #34d3a2; --mint-soft: #133a30;
  --done: #f7f1ff; --done-ink: #1b1426;
  --c-oabt: #5b9dff; --c-ags: #2fcf9c; --c-cebir: #a08bff; --c-geo: #ffbf3b; --c-tekrar: #ff8f73; --c-plan: #a497b8;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(60vmax 40vmax at 0% -10%, var(--blob-1), transparent 60%),
    radial-gradient(50vmax 40vmax at 100% 0%, var(--blob-2), transparent 60%),
    radial-gradient(50vmax 30vmax at 50% 110%, var(--blob-3), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 10px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; line-height: 1.1; text-wrap: balance; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }

.app { max-width: 1040px; margin: 0 auto; padding-inline: 16px; padding-top: calc(env(safe-area-inset-top, 0px) + 14px); padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 28px); }

/* ---------- header */
.hello { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 4px 2px 14px; }
.hello h1 { font-size: clamp(26px, 6.5vw, 36px); font-weight: 700; }
.hello .sub { color: var(--ink-2); font-weight: 600; margin-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; padding: 6px 11px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); white-space: nowrap; }
.chip.fire { color: #e2531b; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- cards */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card + .card, .stack > * + * { margin-top: 14px; }
.stats > .card, .charts > .card, .week > .card, .list > .card, .list > * { margin-top: 0; }
.card h3 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card .hint { color: var(--ink-3); font-size: 14px; margin: 4px 0 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } .grid2 > .stack > * + * { margin-top: 14px; } }

/* ---------- hero */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; background: linear-gradient(135deg, var(--card) 0%, var(--card-2) 100%); }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bgc { stroke: var(--line); }
.ring .fgc { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lbl b { font-family: var(--f-display); font-size: 28px; line-height: 1; display: block; }
.ring .lbl span { display: block; margin-top: 2px; }
.ring .lbl span { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.hero .big { font-family: var(--f-display); font-size: 22px; font-weight: 700; line-height: 1.15; }
.hero .meta { color: var(--ink-2); font-size: 14.5px; margin-top: 4px; }
.lvl { margin-top: 10px; }
.lvl .row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.bar { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--sun), var(--accent), var(--violet)); transition: width .6s; }

.note-card { background: linear-gradient(135deg, var(--accent-soft), var(--violet-soft)); }
.note-card .from { font-weight: 800; font-size: 13.5px; color: var(--accent); }
.note-card p { margin: 6px 0 10px; font-size: 17px; font-weight: 600; }
.quote { font-style: italic; color: var(--ink-2); text-align: center; padding: 6px 12px 2px; font-weight: 600; }

/* ---------- day nav */
.daynav { display: flex; align-items: center; gap: 8px; margin: 18px 2px 8px; }
.daynav .when { flex: 1; min-width: 0; }
.daynav .when b { font-family: var(--f-display); font-size: 21px; font-weight: 700; display: block; }
.daynav .when span { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.iconbtn { width: 40px; height: 40px; border-radius: 14px; border: 0; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn:disabled { opacity: .35; cursor: default; }
.pillbtn { border: 0; border-radius: 999px; padding: 9px 14px; font-weight: 800; background: var(--card); box-shadow: var(--shadow); }
.datein { position: relative; }
.datein input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 2px 10px; }
.tag { font-size: 12.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); }

/* ---------- tasks */
.group { margin-top: 6px; }
.group + .group { margin-top: 14px; }
.ghead { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); padding: 0 4px 6px; }
.ghead .dot { width: 10px; height: 10px; border-radius: 4px; }
.ghead .sub { margin-left: auto; text-transform: none; letter-spacing: 0; color: var(--ink-3); font-weight: 700; }
.task { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 12px 10px 12px 12px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.task + .task { margin-top: 8px; }
.task .t { font-weight: 700; overflow-wrap: anywhere; }
.task .d { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.task .mins { font-size: 13px; color: var(--ink-3); font-weight: 800; white-space: nowrap; padding-top: 3px; text-align: right; }
.task .moved { font-size: 12px; color: var(--violet); font-weight: 800; margin-top: 3px; }
.task.done { background: var(--card-2); }
.task.done .t { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.time { display: inline-block; font-size: 12px; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: var(--ink); color: var(--card); margin-right: 6px; vertical-align: 1px; }
.bub { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--tc, var(--accent)); background: transparent; display: grid; place-items: center; padding: 0; transition: transform .12s, background .2s, border-color .2s; }
.bub svg { width: 18px; height: 18px; opacity: 0; transform: scale(.4); transition: transform .25s cubic-bezier(.3,1.6,.5,1), opacity .15s; }
.bub svg path { stroke: var(--done-ink); }
.bub:active { transform: scale(.88); }
.bub[aria-checked="true"] { background: var(--tc, var(--done)); border-color: var(--tc, var(--done)); }
.bub[aria-checked="true"] svg { opacity: 1; transform: scale(1); }
.bub[aria-checked="true"] svg path { stroke: #fff; }
.bub.ro { cursor: default; opacity: .9; }
.more { border: 0; background: transparent; color: var(--ink-3); width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; margin-left: auto; }
.more:hover { background: var(--line-2); }
.right { display: grid; justify-items: end; gap: 2px; }
.addbtn { width: 100%; margin-top: 12px; border: 2px dashed var(--line); background: transparent; border-radius: 16px; padding: 12px; font-weight: 800; color: var(--ink-2); }
.addbtn:hover { border-color: var(--accent); color: var(--accent); }
.empty { text-align: center; color: var(--ink-3); padding: 24px 8px; font-weight: 600; }
.empty .big { font-size: 40px; display: block; margin-bottom: 6px; }

/* overdue */
.od { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.od:first-of-type { border-top: 0; }
.od .bub { width: 26px; height: 26px; border-width: 2px; }
.od .bub svg { width: 14px; height: 14px; }
.od .k { font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.mini { border: 0; border-radius: 999px; padding: 6px 11px; font-weight: 800; font-size: 13px; background: var(--violet-soft); color: var(--violet); white-space: nowrap; }

/* check-in */
.moods { display: flex; gap: 8px; justify-content: space-between; margin: 10px 0; }
.mood { flex: 1; font-size: 28px; padding: 8px 0; border-radius: 14px; border: 2px solid transparent; background: var(--line-2); }
.mood[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.field { display: grid; gap: 5px; font-size: 13.5px; font-weight: 800; color: var(--ink-2); min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--card); font-weight: 600; font-size: 16px; }
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--violet); outline: none; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.btn { border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.ghost { background: var(--line-2); color: var(--ink); box-shadow: none; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; }
.err { color: var(--accent); font-weight: 700; font-size: 14px; min-height: 1.2em; }

/* ---------- week */
.week { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 700px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .week { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wd { padding: 14px; }
.wd.today { outline: 3px solid var(--accent); outline-offset: -3px; }
.wd .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; cursor: pointer; }
.wd .top b { font-family: var(--f-display); font-size: 19px; }
.wd .top span { font-size: 13px; color: var(--ink-3); font-weight: 800; }
.wt { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 6px 0; font-size: 14px; border-top: 1px solid var(--line-2); align-items: start; }
.wt .bub { width: 22px; height: 22px; border-width: 2px; }
.wt .bub svg { width: 12px; height: 12px; }
.wt.done .x { color: var(--ink-3); text-decoration: line-through; }
.kdot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; vertical-align: 1px; }
.weekmeta { display: grid; gap: 4px; margin: 0 2px 12px; font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* ---------- progress */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 14px; }
.stat b { font-family: var(--f-display); font-size: 28px; display: block; line-height: 1.05; }
.stat span { font-size: 13px; color: var(--ink-3); font-weight: 800; }
.heat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 10px; max-width: 440px; }
.heat .wdh { font-size: 11px; color: var(--ink-3); text-align: center; font-weight: 800; }
.heat .c { aspect-ratio: 1; border-radius: 9px; background: var(--line-2); position: relative; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink-3); max-width: 100%; }
.heat .c.l1 { background: color-mix(in srgb, var(--mint) 25%, var(--card)); }
.heat .c.l2 { background: color-mix(in srgb, var(--mint) 50%, var(--card)); color: var(--ink); }
.heat .c.l3 { background: color-mix(in srgb, var(--mint) 78%, var(--card)); color: #fff; }
.heat .c.l4 { background: var(--mint); color: #fff; }
.heat .c.t { outline: 2.5px solid var(--accent); outline-offset: 1px; }
.heat .c.fut { background: transparent; border: 1.5px dashed var(--line); }
.heat .c.pre { opacity: .35; }
.legend-h { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); font-weight: 700; margin-top: 8px; max-width: 440px; justify-content: flex-end; }
.legend-h i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.badge { text-align: center; padding: 12px 8px; border-radius: 16px; background: var(--line-2); }
.badge .i { font-size: 32px; display: block; filter: grayscale(1); opacity: .35; }
.badge b { display: block; font-size: 13.5px; margin-top: 4px; }
.badge span { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.badge.got { background: linear-gradient(160deg, var(--sun-soft), var(--accent-soft)); }
.badge.got .i { filter: none; opacity: 1; }
.tracks { display: grid; gap: 10px; margin-top: 10px; }
.trk { display: grid; grid-template-columns: 96px minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 14px; font-weight: 700; }
.trk .bar i { background: var(--tc); }
.trk .pct { text-align: right; color: var(--ink-2); font-size: 13px; }

/* ---------- exams */
.charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 760px) { .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; margin-top: 8px; }
.chart .ax { fill: var(--ink-3); font-size: 11px; font-weight: 700; font-family: var(--f-ui); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .tl { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; }
.chart .tlab { fill: var(--accent); font-size: 12px; font-weight: 800; font-family: var(--f-ui); }
.chart .ln { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .pt { stroke: var(--card); stroke-width: 2.5; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .emptytxt { fill: var(--ink-3); font-size: 13px; font-weight: 700; font-family: var(--f-ui); }
.chart .cv { position: relative; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--card); font-size: 12.5px; font-weight: 700; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -120%); z-index: 2; }
.exam { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line-2); align-items: center; }
.exam:first-child { border-top: 0; }
.exam .net { font-family: var(--f-display); font-size: 22px; font-weight: 700; text-align: right; }
.exam .s { font-size: 13px; color: var(--ink-3); font-weight: 700; }

/* ---------- notes */
.thread { display: grid; gap: 10px; margin-top: 12px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 18px; background: var(--line-2); font-weight: 600; }
.msg.me { justify-self: end; background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff; border-bottom-right-radius: 6px; }
.msg.them { border-bottom-left-radius: 6px; }
.msg .w { display: block; font-size: 11.5px; font-weight: 700; opacity: .75; margin-top: 4px; }
.qchips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.qchip { border: 0; border-radius: 999px; padding: 6px 11px; font-weight: 700; font-size: 13px; background: var(--violet-soft); color: var(--violet); }

/* ---------- roadmap */
.phase { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.phase .when { font-weight: 800; color: var(--ink-3); font-size: 13.5px; }
.phase.now { outline: 3px solid var(--accent); outline-offset: -3px; }
.phase.past { opacity: .65; }
.phase ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14.5px; }
.st { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-3); margin-left: 6px; }
.phase.now .st { background: var(--accent); color: #fff; }
.list { display: grid; gap: 8px; }
.linkrow { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); border: 0; width: 100%; text-align: left; font-weight: 800; }
.linkrow .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--line-2); flex: none; }
.linkrow .ar { margin-left: auto; color: var(--ink-3); }
.linkrow small { display: block; font-weight: 600; color: var(--ink-3); font-size: 13px; }
ol.rules { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.blocks { display: grid; margin-top: 8px; }
.blk { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.blk:first-child { border-top: 0; }
.blk .h { font-weight: 800; color: var(--ink-2); font-size: 13.5px; }

/* ---------- tab bar */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); width: min(560px, calc(100% - 20px)); height: var(--tabbar-h); background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 24px; box-shadow: 0 10px 30px rgba(60, 20, 80, .18); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px; z-index: 20; }
.tabbar a { display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 18px; text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 800; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ---------- sheet / toast */
.scrim { position: fixed; inset: 0; background: rgba(30, 10, 40, .35); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: min(560px, 100%); border-radius: 26px 26px 0 0; padding: 20px 18px calc(env(safe-area-inset-bottom, 0px) + 20px); max-height: 88dvh; overflow: auto; animation: up .22s ease-out; }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 26px; } }
.sheet h3 { font-size: 21px; margin-bottom: 12px; }
.sheet .acts { display: grid; gap: 8px; margin-top: 14px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 14px; font-weight: 700; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; animation: up .2s ease-out; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; width: 100%; height: 100%; }
.offline { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; transform: translateX(-50%); background: var(--sun); color: #3a2600; font-weight: 800; font-size: 13px; padding: 5px 12px; border-radius: 99px; z-index: 50; }

/* ---------- login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: min(420px, 100%); padding: 26px 22px; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 24px; box-shadow: var(--shadow); }
.login h1 { font-size: 34px; margin-top: 12px; }
.login p { color: var(--ink-2); font-weight: 600; margin: 6px 0 18px; }
.who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.who button { border: 2.5px solid var(--line); background: var(--card); border-radius: 18px; padding: 14px 8px; font-weight: 800; font-size: 16px; }
.who button span { display: block; font-size: 30px; }
.who button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.login form { display: grid; gap: 12px; text-align: left; }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ===================== v1.1 components ===================== */
a.btn, a.card, a.chip, a.tile, a.mini { text-decoration: none; color: inherit; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; color: #fff; }
a.btn.ghost { color: var(--ink); }
.card a { color: var(--violet); font-weight: 800; }
.btn.sm { padding: 8px 12px; border-radius: 12px; font-size: 14px; }
.btn.good { background: linear-gradient(135deg, var(--mint), #0fa3c7); box-shadow: 0 6px 18px color-mix(in srgb, var(--mint) 35%, transparent); }
.btn.danger, .danger { color: var(--accent) !important; }
.row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-top: 6px; }
.bar.big { height: 14px; }
.card.sunny { background: linear-gradient(135deg, var(--sun-soft), var(--accent-soft)); }
.card.calm { background: linear-gradient(135deg, var(--sun-soft), var(--mint-soft)); }
.card.reward { display: block; background: linear-gradient(135deg, var(--sun-soft), var(--violet-soft)); }
.card.reward .from, .card.review .from { font-weight: 800; font-size: 12.5px; color: var(--violet); letter-spacing: .03em; }
.card.reward p { margin: 6px 0 10px; font-size: 18px; font-weight: 800; }
.card.reward.big p { font-size: 22px; }
.linkcard { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 800; }
.linkcard b { color: var(--violet); }
.chip { text-decoration: none; color: var(--ink); }
.chip.fire { color: #e2531b; }
.tag.hot { background: var(--accent); color: #fff; }
.qchip.sel { background: var(--accent); color: #fff; }
.qchip.tiny { padding: 1px 8px; font-size: 12px; }

/* live task + focus bar */
.task.live { box-shadow: 0 0 0 2.5px var(--tc), var(--shadow); }
.focusbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 18px); width: min(540px, calc(100% - 28px)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 18px; background: var(--ink); color: var(--card); z-index: 25; box-shadow: 0 10px 30px rgba(40, 10, 60, .3); }
.focusbar .fb-t { flex: 1; min-width: 0; display: grid; }
.focusbar .fb-t b { font-family: var(--f-display); font-size: 22px; line-height: 1.1; }
.focusbar .fb-t span { font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focusbar.done { background: linear-gradient(135deg, var(--mint), #0fa3c7); color: #fff; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--tc, var(--mint)); box-shadow: 0 0 0 0 color-mix(in srgb, var(--tc, var(--mint)) 60%, transparent); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tc, var(--mint)) 60%, transparent); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.card.live { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, var(--mint-soft), var(--card)); --tc: var(--mint); }
.app:has(~ #focusbar .focusbar) { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 100px); }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--line-2); font-weight: 700; cursor: pointer; }
.pick input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* learn hub */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { display: grid; gap: 4px; padding: 16px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); min-height: 120px; align-content: start; }
.tile .ic { font-size: 30px; }
.tile b { font-family: var(--f-display); font-size: 18px; }
.tile span { font-size: 13.5px; color: var(--ink-3); font-weight: 700; }
.tile em { color: var(--accent); font-style: normal; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 8px 4px; font-weight: 800; color: var(--ink-3); font-size: 14px; }
.seg button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.mlist { display: grid; gap: 8px; margin-top: 12px; }
.mcard { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 0; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); text-align: left; width: 100%; }
.mcard img, .mcard .noimg { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--line-2); display: grid; place-items: center; font-size: 26px; }
.mcard .mbody { display: grid; gap: 2px; min-width: 0; }
.mcard .mbody b { overflow-wrap: anywhere; }
.mcard .mbody span { font-size: 13px; color: var(--ink-3); font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--mint); }
.photo-in { display: block; position: relative; border: 2px dashed var(--line); border-radius: 16px; padding: 18px; text-align: center; font-weight: 800; color: var(--ink-2); cursor: pointer; }
.photo-in input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-in img { max-height: 220px; border-radius: 12px; margin: 0 auto; display: block; }
.chipsel { display: flex; flex-wrap: wrap; gap: 6px; }
.chipsel .qchip[aria-pressed="true"] { background: var(--accent); color: #fff; }
.bigimg { width: 100%; border-radius: 14px; margin: 8px 0; display: block; max-height: 60dvh; object-fit: contain; background: var(--line-2); }
.card.review details { margin-top: 6px; font-weight: 600; }
.card.review summary { cursor: pointer; color: var(--violet); font-weight: 800; }
.flash { width: 100%; min-height: 260px; border: 0; border-radius: 24px; background: linear-gradient(160deg, var(--card), var(--violet-soft)); box-shadow: var(--shadow); padding: 22px; display: grid; align-content: center; gap: 14px; text-align: center; }
.flash .deckname { font-size: 12.5px; font-weight: 800; color: var(--violet); letter-spacing: .04em; text-transform: uppercase; }
.flash .front { font-family: var(--f-display); font-size: 26px; font-weight: 700; line-height: 1.2; }
.flash .back { font-size: 18px; font-weight: 700; color: var(--ink-2); border-top: 2px dashed var(--line); padding-top: 14px; }
.flash.flipped { background: linear-gradient(160deg, var(--card), var(--mint-soft)); }
.deck { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.deck > a:not(.btn) { flex: 1; min-width: 0; display: grid; text-decoration: none; color: var(--ink); }
.deck > a:not(.btn) span { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.cardrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.cardrow p { margin: 4px 0; color: var(--ink-2); }
.topic { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.topic .tn { min-width: 0; display: grid; }
.topic .tn span { font-size: 12.5px; font-weight: 700; }
.topic .stars { grid-column: 1 / -1; display: flex; gap: 2px; }
.stars button { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--line); padding: 2px; }
.stars button.on { color: var(--sun); }
.stars button:disabled { cursor: default; }
.risk { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.risk.bad { background: color-mix(in srgb, #ff4d4d 18%, var(--card)); color: #d93636; }
.risk.mid { background: var(--sun-soft); color: #b87300; }
.risk.good { background: var(--mint-soft); color: var(--mint); }
.risk.none { background: var(--line-2); color: var(--ink-3); }

/* together */
.goals { display: grid; gap: 6px; margin-top: 8px; }
.goal { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.goal:first-child { border-top: 0; }
.goal .gt { font-weight: 700; overflow-wrap: anywhere; }
.goal.done .gt { color: var(--ink-3); text-decoration: line-through; }
.gdot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; color: #fff; }
.gdot.on { background: var(--violet); border-color: var(--violet); }
.cheers { font-size: 13px; font-weight: 800; color: var(--accent); }
.addgoal { display: flex; gap: 8px; margin-top: 10px; }
.addgoal input { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 12px; padding: 9px 11px; background: var(--card); font-weight: 600; }

/* exams */
.secs { display: grid; gap: 6px; }
.secrow { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 58px); gap: 6px; align-items: center; font-weight: 700; font-size: 14px; }
.secrow input { width: 100%; min-width: 0; border: 2px solid var(--line); border-radius: 10px; padding: 7px 6px; background: var(--card); font-weight: 700; text-align: center; }
.secrow:has(input:nth-of-type(3)) { grid-template-columns: minmax(0, 1fr) repeat(3, 58px); }
.secrow:not(:has(input:nth-of-type(3))) { grid-template-columns: minmax(0, 1fr) repeat(2, 58px); }
.table-wrap { overflow-x: auto; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 8px; }
.tbl th, .tbl td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); text-align: left; }
.tbl th { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.tbl .r { text-align: right; }
.tbl .bad { color: #d93636; font-weight: 800; }

/* karne */
.karne .k-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 12px; }
.karne .big { font-family: var(--f-display); font-size: 22px; font-weight: 700; }
.karne .meta { color: var(--ink-2); font-size: 14px; }
.kstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; text-align: center; }
.kstats b { font-family: var(--f-display); font-size: 22px; display: block; }
.kstats span { font-size: 12px; color: var(--ink-3); font-weight: 800; }
.kmoods { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 14px; text-align: center; }
.kmoods span { font-size: 11px; color: var(--ink-3); font-weight: 800; display: block; }
.kmoods b { font-size: 24px; }
.kmoods small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 800; min-height: 14px; }
.kline { margin: 10px 0 0; font-weight: 700; }

/* celebration sheet */
.celebrate { text-align: center; }
.celebrate .emo { font-size: 64px; line-height: 1; margin-bottom: 8px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.celebrate .big { font-family: var(--f-display); font-size: 28px; font-weight: 700; margin: 4px 0; background: linear-gradient(90deg, var(--sun), var(--accent), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

/* heat cells are links now */
.heat a.c { text-decoration: none; }

a.iconbtn { color: var(--ink); }
body:has(.focusbar) .toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 100px); }

/* link-buttons keep button colors inside cards; stacked actions get a gap everywhere */
a.btn:not(.ghost), .card a.btn:not(.ghost) { color: #fff; }
a.btn.ghost, .card a.btn.ghost { color: var(--ink); }
.acts { display: grid; gap: 8px; }
.deck .btn { flex: none; }

/* ---------- phones (iPhone/Android) */
/* date & time inputs: iOS gives them a wide intrinsic size and centred text */
.field input[type=date], .field input[type=time] { -webkit-appearance: none; appearance: none; min-height: 48px; display: block; text-align: left; }
.field input::-webkit-date-and-time-value { text-align: left; }
@media (max-width: 600px) { .row3.dates { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 380px) { .row3:not(.keep) { gap: 6px; } }
/* content never scrolls visibly under the status bar (installed app) or below the floating tab bar */
body::before { content: ''; position: fixed; inset: 0 0 auto 0; height: env(safe-area-inset-top, 0px); background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); z-index: 30; pointer-events: none; }
body::after { content: ''; position: fixed; inset: auto 0 0 0; height: calc(env(safe-area-inset-bottom, 0px) + 30px); background: linear-gradient(transparent, var(--bg-2) 70%); z-index: 19; pointer-events: none; }
@media (pointer: coarse) {
  body.typing .tabbar, body.typing #focusbar, body.typing::after { visibility: hidden; }
}
.tabbar, .focusbar { will-change: transform; }
