/* Preparation Hub: a paper planner. Warm paper, ink, hairline rules, serif headings. */
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --paper: #f6f2e9; --paper2: #eee8d9; --card: #fbf8f1;
  --ink: #1d1b17; --ink2: #57514a; --ink3: #8b8476;
  --rule: #d7cfbd; --rule2: #e6dfce;
  --accent: #9b2c2c; --accent-ink: #fffaf0; --wash: color-mix(in srgb, var(--accent) 9%, var(--paper));
  --ok: #33603f; --ok-wash: #dfe8d5; --warn: #8a5a12; --warn-wash: #f0e2b9; --bad: #9c3328; --bad-wash: #f0d8d1; --info: #2c5a82; --info-wash: #dce6ee;
  --body: var(--sans); --fs: 15.5px; --lh: 1.55;
  --rail: 232px;
}
html[data-theme="dark"] {
  --paper: #171510; --paper2: #1f1c15; --card: #1c1913;
  --ink: #ece6d6; --ink2: #b5ad9b; --ink3: #837c6c; --rule: #3a352a; --rule2: #2c281f;
  --wash: color-mix(in srgb, var(--accent) 16%, var(--paper));
  --accent-ink: #171510;
  --ok: #7ec08f; --ok-wash: #1d2c20; --warn: #e2b25c; --warn-wash: #31281a; --bad: #ee8a7c; --bad-wash: #35201c; --info: #86b4dc; --info-wash: #1b2733;
}
html[data-theme="kindle"] {
  --paper: #f1e6cb; --paper2: #e8dcbb; --card: #f1e6cb;
  --ink: #3a2e1d; --ink2: #5e5039; --ink3: #8a7a5c; --rule: #d3c39d; --rule2: #dccfaa;
  --accent: #7a4a1e; --accent-ink: #f1e6cb; --wash: #e8dcbb;
  --ok: #4a6a34; --ok-wash: #dde2bd; --warn: #8a5a12; --warn-wash: #e9d9a6; --bad: #8f3a28; --bad-wash: #e8cdb3; --info: #3f5d73; --info-wash: #dfdcc2;
  --body: var(--serif); --fs: 18px; --lh: 1.75;
}
html[data-size="1"] { font-size: 112.5%; } html[data-size="2"] { font-size: 125%; }
* { box-sizing: border-box; min-width: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--fs)/var(--lh) var(--body); overflow-x: hidden; text-rendering: optimizeLegibility; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; line-height: 1.12; } h2 { font-size: 1.2rem; line-height: 1.25; } h3 { font-size: 1.02rem; line-height: 1.3; }
.ic { display: inline-block; flex: none; vertical-align: middle; }
.muted { color: var(--ink2); } .faint { color: var(--ink3); } .small { font-size: .86rem; } .tiny { font-size: .75rem; }
.num { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 12px; } .stack-lg > * + * { margin-top: 28px; } .stack-sm > * + * { margin-top: 6px; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; } .grow { flex: 1 1 auto; } .between { justify-content: space-between; } .top { align-items: flex-start; }
.hidden { display: none !important; }
.label { font: 700 .7rem/1.2 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--ink3); }
.sec { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.sec::after { content: ""; flex: 1 1 auto; border-top: 1px solid var(--rule); transform: translateY(-3px); }
.sec .label { white-space: nowrap; } .sec .more { order: 3; font-size: .8rem; color: var(--ink2); }
.sec .more + ::after { display: none; }

/* layout shell */
.app { min-height: 100vh; min-height: 100dvh; }
.main { max-width: 940px; margin: 0 auto; padding: 18px 18px calc(86px + env(safe-area-inset-bottom)); }
.rail { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.topbar .t { flex: 1 1 auto; font: 700 1rem var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.ib { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ink); text-decoration: none; }
.ib:hover { background: var(--paper2); } .ib[disabled] { opacity: .3; cursor: default; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--paper); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; text-decoration: none; color: var(--ink3); font: 600 .64rem var(--sans); letter-spacing: .04em; position: relative; }
.bottomnav a[aria-current="page"] { color: var(--ink); }
.bottomnav a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; background: var(--accent); border-radius: 0 0 3px 3px; }
@media (min-width: 960px) {
  .app.hasrail { display: grid; grid-template-columns: var(--rail) 1fr; }
  .rail { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--rule); background: var(--paper2); }
  .topbar, .bottomnav { display: none; }
  .main { padding: 34px 44px 60px; width: 100%; max-width: 1040px; }
  .rail .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 22px; }
  .rail .brand .mark { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
  .rail .brand b { font: 700 1.05rem var(--serif); line-height: 1.1; } .rail .brand span { display: block; font-size: .72rem; color: var(--ink3); font-family: var(--sans); font-weight: 500; }
  .rail nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
  .rail nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 6px; text-decoration: none; color: var(--ink2); font-weight: 600; font-size: .92rem; border-left: 3px solid transparent; }
  .rail nav a:hover { background: var(--rule2); }
  .rail nav a[aria-current="page"] { color: var(--ink); background: var(--card); border-left-color: var(--accent); }
  .rail .foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
  .rail .foot button { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--ink2); font-weight: 600; font-size: .9rem; text-align: left; }
  .rail .foot button:hover { background: var(--rule2); }
  .twocol { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .twocol > .side { position: sticky; top: 24px; }
}
.exam-chip { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 0 0 6px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); text-decoration: none; }
.exam-chip .tag { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.exam-chip b { display: block; font: 700 .9rem var(--serif); line-height: 1.15; } .exam-chip span { font-size: .72rem; color: var(--ink3); }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: 700 .9rem var(--sans); cursor: pointer; text-decoration: none; letter-spacing: .01em; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); } .btn.ghost:hover { border-color: var(--ink2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .8rem; } .btn.block { display: flex; width: 100%; } .btn:disabled { opacity: .45; cursor: default; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }
input[type=text], input[type=password], input[type=search], textarea, select { width: 100%; padding: 11px 12px; border-radius: 6px; border: 1px solid var(--rule); background: var(--card); outline: none; }
input:focus, textarea:focus, select:focus, .btn:focus-visible, .ib:focus-visible, .seg button:focus-visible, .opt:focus-visible, .blk .cb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { min-height: 96px; resize: vertical; }
label.f { display: block; font-size: .8rem; color: var(--ink2); margin-bottom: 5px; font-weight: 600; }
.err { color: var(--bad); font-size: .9rem; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--card); max-width: 100%; }
.seg button { padding: 8px 13px; border: 0; border-right: 1px solid var(--rule); background: transparent; font: 600 .82rem var(--sans); cursor: pointer; color: var(--ink2); white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.filters { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.filters .label { padding-top: 0; }
.filters .seg { justify-self: start; overflow-x: auto; scrollbar-width: none; } .filters .seg::-webkit-scrollbar { display: none; }
.tag { display: inline-block; padding: 1px 7px; border: 1px solid var(--rule); border-radius: 3px; font: 700 .64rem/1.6 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); background: transparent; white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: var(--ok); } .tag.warn { color: var(--warn); border-color: var(--warn); } .tag.bad { color: var(--bad); border-color: var(--bad); } .tag.info { color: var(--info); border-color: var(--info); } .tag.acc { color: var(--accent); border-color: var(--accent); }
.bar { height: 4px; background: var(--rule2); position: relative; } .bar > i { display: block; height: 100%; background: var(--ink); } .bar.ok > i { background: var(--ok); } .bar.acc > i { background: var(--accent); }
.panel { border: 1px solid var(--rule); border-radius: 8px; background: var(--card); padding: 16px; }
.panel.wash { background: var(--wash); border-color: transparent; }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.empty { padding: 26px 8px; text-align: center; color: var(--ink2); }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.login .art { display: none; background: var(--paper2) center / cover no-repeat; }
.login .formside { display: grid; place-items: center; padding: 28px 20px; }
.login .box { width: 100%; max-width: 360px; }
.login .mark { width: 46px; height: 46px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); margin-bottom: 18px; }
@media (min-width: 900px) { .login { grid-template-columns: 1.1fr 1fr; } .login .art { display: block; } }

/* exam tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; text-decoration: none; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--card); }
.tile:hover { border-color: var(--ink2); }
.tile .art { height: 120px; background: var(--accent) center / cover no-repeat; display: grid; place-items: center; color: var(--accent-ink); }
.tile .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile .nm { font: 700 1.15rem var(--serif); } .tile .count { font: 700 2rem var(--serif); line-height: 1; margin-top: 8px; }

/* day page */
.dayhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.dayhead .d { font: 700 2.3rem/1 var(--serif); letter-spacing: -.02em; } .dayhead .m { font: 600 .95rem var(--sans); color: var(--ink2); margin-top: 4px; }
.stamp { flex: none; width: 74px; height: 74px; border: 2px solid var(--accent); border-radius: 50%; display: grid; place-content: center; text-align: center; color: var(--accent); transform: rotate(-6deg); font: 700 .62rem/1.25 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.stamp b { display: block; font: 700 1.5rem/1 var(--serif); letter-spacing: 0; }
.stamp.done { color: var(--ok); border-color: var(--ok); }
.daynav { display: flex; gap: 2px; }
.blk { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 14px 0; border-bottom: 1px solid var(--rule2); }
.blk.timed { grid-template-columns: 62px auto 1fr; }
.blk .tm { font: 700 .78rem/1.3 var(--mono); color: var(--ink2); padding-top: 3px; }
.blk .cb { width: 24px; height: 24px; border: 1.8px solid var(--ink); border-radius: 4px; background: transparent; cursor: pointer; display: grid; place-items: center; color: transparent; margin-top: 1px; padding: 0; }
.blk.on .cb { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.blk .tt { font: 700 1.02rem/1.35 var(--serif); }
.blk.on .tt { color: var(--ink3); text-decoration: line-through; text-decoration-thickness: 1px; }
.blk .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: .78rem; color: var(--ink2); }
.blk .meta .k { font: 700 .66rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--kc, var(--ink2)); }
.blk .dt { font-size: .86rem; color: var(--ink2); margin-top: 6px; line-height: 1.5; }
.blk .act { margin-top: 8px; }
.kind-study { --kc: var(--accent); } .kind-revise { --kc: var(--info); } .kind-optional { --kc: #6a4b8a; } .kind-ca { --kc: var(--warn); } .kind-csat { --kc: #1e7580; } .kind-mcq { --kc: var(--ok); } .kind-mock, .kind-test { --kc: var(--bad); } .kind-write { --kc: #6a4b8a; } .kind-review { --kc: var(--info); }
.subs { margin: 10px 0 0; padding: 0; list-style: none; border-left: 2px solid var(--rule); }
.subs li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0 7px 12px; cursor: pointer; font-size: .9rem; line-height: 1.4; }
.subs .sb { flex: none; width: 17px; height: 17px; margin-top: 2px; border: 1.5px solid var(--ink2); border-radius: 3px; display: grid; place-items: center; color: transparent; }
.subs li.on .sb { background: var(--ok); border-color: var(--ok); color: var(--paper); } .subs li.on span.t { color: var(--ink3); text-decoration: line-through; }
.subtoggle { margin-top: 8px; font: 700 .74rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); background: none; border: 0; padding: 4px 0; cursor: pointer; }

/* sets */
.setrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule2); text-decoration: none; }
.setrow .t { font: 700 1rem var(--serif); } .setrow .s { font-size: .82rem; color: var(--ink2); }
.score { font: 700 1.35rem var(--serif); text-align: right; line-height: 1; } .score small { display: block; font: 600 .68rem var(--sans); color: var(--ink3); letter-spacing: .06em; margin-top: 4px; text-transform: uppercase; }

/* statistics */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--card); }
.stats > div { padding: 14px 16px; border-right: 1px solid var(--rule2); border-bottom: 1px solid var(--rule2); } .stats > div:nth-child(2n) { border-right: 0; } .stats > div:nth-last-child(-n+2) { border-bottom: 0; }
.stats .n { font: 700 1.9rem/1 var(--serif); } .stats .l { margin-top: 6px; font-size: .78rem; color: var(--ink2); }
@media (min-width: 700px) { .stats.four { grid-template-columns: repeat(4, 1fr); } .stats.four > div { border-bottom: 0; border-right: 1px solid var(--rule2); } .stats.four > div:last-child { border-right: 0; } }
.big { font: 700 3.4rem/1 var(--serif); letter-spacing: -.02em; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); background: var(--card); }
.cal .dow { padding: 6px 0; text-align: center; font: 700 .66rem var(--sans); letter-spacing: .1em; color: var(--ink3); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper2); }
.cd { position: relative; min-height: 58px; padding: 6px 6px 4px; border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: transparent; text-align: left; cursor: pointer; font: 600 .86rem var(--sans); color: var(--ink); display: flex; flex-direction: column; justify-content: space-between; }
.cd.out { background: var(--paper2); cursor: default; color: var(--ink3); }
.cd .bd { height: 4px; width: 100%; background: var(--rule2); } .cd .pf { height: 100%; display: block; background: var(--ok); }
.cd.s-done { background: var(--ok-wash); } .cd.s-part { background: var(--warn-wash); } .cd.s-miss { background: var(--bad-wash); } .cd.s-relief { background: var(--info-wash); } .cd.s-exam { background: var(--accent); color: var(--accent-ink); }
.cd.today::after { content: ""; position: absolute; inset: 1px; border: 2px solid var(--accent); pointer-events: none; }
.cd .tn { font: 700 .62rem var(--sans); letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
@media (min-width: 700px) { .cd { min-height: 84px; padding: 8px; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--ink2); margin-top: 10px; } .legend i { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--rule); }

/* plan list */
.week { border-bottom: 1px solid var(--rule); } .week > summary { list-style: none; cursor: pointer; padding: 14px 2px; } .week > summary::-webkit-details-marker { display: none; }
.drow { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 2px; border-top: 1px solid var(--rule2); text-decoration: none; }
.drow .dd { text-align: center; line-height: 1.1; } .drow .dd b { display: block; font: 700 1.1rem var(--serif); } .drow .dd span { font: 700 .6rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.drow .tx { font-size: .88rem; line-height: 1.4; }
.st { width: 20px; height: 20px; border: 1.6px solid var(--rule); border-radius: 4px; display: grid; place-items: center; color: transparent; }
.st.done { background: var(--ok); border-color: var(--ok); color: var(--paper); } .st.part { border-color: var(--warn); background: var(--warn-wash); } .st.miss { border-color: var(--bad); } .st.relief { border-color: var(--info); background: var(--info-wash); }

/* syllabus */
.subj { border-bottom: 1px solid var(--rule); } .subj > summary { list-style: none; cursor: pointer; padding: 16px 2px; } .subj > summary::-webkit-details-marker { display: none; }
.unit { display: block; padding: 12px 2px 12px 14px; border-top: 1px solid var(--rule2); text-decoration: none; border-left: 3px solid transparent; }
.unit.done { border-left-color: var(--ok); } .unit.part { border-left-color: var(--warn); }
.unit .ut { font: 700 .98rem/1.35 var(--serif); } .unit .tp { font-size: .82rem; color: var(--ink2); margin-top: 4px; line-height: 1.45; } .unit .um { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: .76rem; color: var(--ink3); }

/* overlay, sheet, toast */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 16, 8, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; max-height: 88vh; max-height: 88dvh; overflow-y: auto; background: var(--paper); border-radius: 14px 14px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 12px; border: 1px solid var(--rule); } }
.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 6px; font-size: .88rem; z-index: 60; max-width: 90vw; }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* questions */
.qwrap { max-width: 720px; }
.qt { font: 500 1.12rem/1.6 var(--serif); white-space: pre-line; overflow-wrap: anywhere; }
html[data-theme="kindle"] .qt { font-size: 1.15rem; }
.opts { margin-top: 14px; border-top: 1px solid var(--rule); }
.opt { display: grid; grid-template-columns: 30px 1fr; gap: 12px; width: 100%; text-align: left; padding: 14px 6px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; cursor: pointer; align-items: start; }
.opt:hover:not(.locked) { background: var(--paper2); }
.opt .lt { width: 26px; height: 26px; border: 1.5px solid var(--ink2); border-radius: 50%; display: grid; place-items: center; font: 700 .76rem var(--sans); color: var(--ink2); }
.opt .tx { line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.opt.sel { background: var(--wash); } .opt.sel .lt { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.opt.right { background: var(--ok-wash); } .opt.right .lt { background: var(--ok); border-color: var(--ok); color: var(--paper); }
.opt.wrong { background: var(--bad-wash); } .opt.wrong .lt { background: var(--bad); border-color: var(--bad); color: var(--paper); }
.opt.locked { cursor: default; }
.why { margin: 0 0 0 42px; padding: 6px 0 10px; font-size: .86rem; line-height: 1.5; color: var(--ink2); border-bottom: 1px solid var(--rule2); } .why b { color: var(--ink); }
.why.good { color: var(--ok); }
.expl { margin-top: 18px; padding: 16px; background: var(--info-wash); border-radius: 6px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; font-size: .96rem; }
.expl .label { display: block; margin-bottom: 6px; color: var(--info); }
.trap { margin-top: 12px; padding: 14px 16px; border-left: 4px solid var(--warn); background: var(--warn-wash); font-size: .92rem; line-height: 1.55; } .trap .label { color: var(--warn); display: block; margin-bottom: 4px; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; } .dots i { width: 14px; height: 6px; background: var(--rule); } .dots i.on { background: var(--ink); } .dots i.ok { background: var(--ok); } .dots i.no { background: var(--bad); }
.nat { display: flex; gap: 8px; margin-top: 14px; } .nat input { max-width: 220px; font: 600 1.2rem var(--mono); }

/* markdown and notes */
.md { line-height: 1.7; overflow-wrap: anywhere; }
.md h2, .md h3, .md h4, .md h5 { margin: 22px 0 8px; line-height: 1.3; }
.md h2 { font-size: 1.25rem; padding-bottom: 6px; border-bottom: 1px solid var(--rule); } .md h3 { font-size: 1.08rem; } .md h4, .md h5 { font-size: .98rem; }
.md p { margin: 10px 0; } .md ul, .md ol { margin: 10px 0; padding-left: 24px; } .md li { margin: 4px 0; }
.md code { font-family: var(--mono); font-size: .86em; background: var(--paper2); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--paper2); padding: 12px 14px; border-radius: 6px; overflow-x: auto; max-width: 100%; } .md pre code { background: none; padding: 0; }
.md blockquote { margin: 12px 0; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--ink2); }
.md .tbl { overflow-x: auto; max-width: 100%; margin: 14px 0; } .md table { border-collapse: collapse; font-size: .88rem; min-width: 100%; } .md th, .md td { border: 1px solid var(--rule); padding: 7px 10px; text-align: left; vertical-align: top; } .md th { background: var(--paper2); }
.md hr { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }
.reader { max-width: 36rem; margin: 0 auto; }
.reader .md { font-size: 1.04rem; } html[data-theme="kindle"] .reader .md, html[data-theme="kindle"] .md { font-family: var(--serif); }
.plain { white-space: pre-line; font-size: .95rem; line-height: 1.7; }
.ca { padding: 14px 0; border-bottom: 1px solid var(--rule2); } .ca h3 { font-size: 1.02rem; } .ca p { margin-top: 6px; font-size: .9rem; line-height: 1.6; white-space: pre-line; color: var(--ink2); }

/* error log */
.errcard { border: 1px solid var(--rule); border-radius: 8px; background: var(--card); padding: 14px 16px; }
.errcard + .errcard { margin-top: 12px; }
.snap { margin-top: 10px; padding: 12px 14px; background: var(--paper2); border-radius: 6px; font-size: .88rem; line-height: 1.55; white-space: pre-line; }
.causes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.causes button { padding: 6px 11px; border: 1px solid var(--rule); border-radius: 4px; background: transparent; cursor: pointer; font: 600 .78rem var(--sans); color: var(--ink2); }
.causes button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.guide { padding: 12px 14px; background: var(--wash); border-left: 3px solid var(--accent); font-size: .88rem; line-height: 1.55; }
.dategroup { margin: 24px 0 10px; }

/* prefs */
.prefrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule2); }

/* ---- Softness pass: rounder, calmer, smoother ---- */
:root {
  --r1: 12px; --r2: 18px; --r3: 24px;
  --sh: 0 1px 2px rgba(80, 58, 24, .05), 0 10px 28px -12px rgba(80, 58, 24, .16);
  --sh2: 0 1px 2px rgba(80, 58, 24, .06), 0 4px 12px -4px rgba(80, 58, 24, .14);
  --ease: cubic-bezier(.3, .7, .3, 1);
}
html[data-theme="dark"] { --sh: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -12px rgba(0, 0, 0, .55); --sh2: 0 2px 8px -2px rgba(0, 0, 0, .5); }
html[data-theme="kindle"] { --sh: none; --sh2: none; }
html { scroll-behavior: smooth; }
body { background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%), var(--paper); background-attachment: fixed; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
.btn, .ib, .seg button, .opt, .cd, .blk .cb, .subs li, .tile, .exam-chip, .rail nav a, .causes button, .drow, .setrow, .unit, .bottomnav a { transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .14s var(--ease); }
.main > * { animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1, h2, h3, .serif { letter-spacing: -.015em; }
.btn { border-radius: 999px; padding: 0 22px; box-shadow: var(--sh2); border-color: transparent; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.ghost { box-shadow: none; border: 1.5px solid var(--rule); background: color-mix(in srgb, var(--card) 70%, transparent); }
.btn.ghost:hover { border-color: var(--ink3); background: var(--card); }
.btn.small { padding: 0 16px; } .btn.danger { box-shadow: none; border: 1.5px solid color-mix(in srgb, var(--bad) 55%, transparent); }
.ib { border-radius: 14px; } .ib:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
input[type=text], input[type=password], input[type=search], textarea, select { border-radius: var(--r1); border-color: var(--rule); box-shadow: inset 0 1px 2px rgba(80, 58, 24, .04); padding: 12px 14px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); outline: none; }
.btn:focus-visible, .ib:focus-visible, .seg button:focus-visible, .opt:focus-visible, .blk .cb:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* segmented control: soft track, raised selected segment */
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--ink) 7%, transparent); overflow: visible; }
.seg button { border: 0; border-radius: 11px; padding: 8px 15px; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--sh2); }
.filters { gap: 10px 14px; } .filters .seg { max-width: 100%; }
html[data-theme="kindle"] .seg button[aria-pressed="true"], html[data-theme="kindle"] .seg button[aria-selected="true"] { background: var(--ink); color: var(--paper); }

/* tags: soft rounded, clear space around them */
.tag { border: 0; border-radius: 8px; padding: 3px 9px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink2); letter-spacing: .06em; }
.tag.ok { background: var(--ok-wash); color: var(--ok); } .tag.warn { background: var(--warn-wash); color: var(--warn); } .tag.bad { background: var(--bad-wash); color: var(--bad); } .tag.info { background: var(--info-wash); color: var(--info); } .tag.acc { background: var(--wash); color: var(--accent); }
.blk .meta, .unit .um, .legend { gap: 8px 10px; }
.bar { height: 6px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--ink) 8%, transparent); } .bar > i { border-radius: 99px; transition: width .5s var(--ease); background: var(--accent); }
.bar.ok > i { background: var(--ok); }

/* surfaces */
.panel, .stats, .errcard { border: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); border-radius: var(--r2); box-shadow: var(--sh); background: var(--card); }
.panel.wash { background: var(--wash); border-color: transparent; box-shadow: none; }
.stats { overflow: hidden; } .stats > div { border-color: color-mix(in srgb, var(--rule) 55%, transparent); }
.sheet { border-radius: var(--r3) var(--r3) 0 0; border: 0; box-shadow: 0 -12px 40px -12px rgba(0, 0, 0, .35); animation: slideup .26s var(--ease); }
@media (min-width: 700px) { .sheet { border-radius: var(--r3); } }
@keyframes slideup { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); background: rgba(30, 22, 10, .42); }
.toast { border-radius: 999px; padding: 11px 20px; box-shadow: var(--sh); }

/* rail and bottom nav */
.rail { background: color-mix(in srgb, var(--paper2) 80%, var(--paper)); border-right: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); }
.rail nav a { border-radius: 14px; border-left: 0; padding: 10px 12px; }
.rail nav a[aria-current="page"] { background: var(--card); box-shadow: var(--sh2); color: var(--ink); }
.rail nav a[aria-current="page"] .ic { color: var(--accent); }
.rail .brand .mark, .login .mark { border-radius: 14px; box-shadow: var(--sh2); }
.rail .foot button { border-radius: 12px; }
.exam-chip { border-radius: var(--r1); border-color: color-mix(in srgb, var(--rule) 60%, transparent); box-shadow: var(--sh2); } .exam-chip .tag { border-radius: 10px; padding: 0; }
.topbar { border-bottom-color: color-mix(in srgb, var(--rule) 55%, transparent); }
.bottomnav { border-top: 0; box-shadow: 0 -6px 24px -10px rgba(80, 58, 24, .22); border-radius: 22px 22px 0 0; background: color-mix(in srgb, var(--card) 96%, transparent); }
.bottomnav a { border-radius: 16px; margin: 4px 2px; min-height: 52px; }
.bottomnav a[aria-current="page"] { background: var(--wash); color: var(--accent); } .bottomnav a[aria-current="page"]::before { display: none; }

/* day page */
.dayhead { border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
.stamp { border-width: 2px; opacity: .92; }
.blk { padding: 16px 0; border-bottom-color: color-mix(in srgb, var(--rule) 55%, transparent); }
.blk .cb { border: 2px solid color-mix(in srgb, var(--ink) 45%, transparent); border-radius: 9px; width: 26px; height: 26px; }
.blk .cb:hover { border-color: var(--accent); }
.blk.on .cb { background: var(--accent); border-color: var(--accent); }
.blk.on .cb svg { animation: pop .22s var(--ease); } @keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.subs { border-left: 0; margin-left: 2px; }
.subs li { border-radius: 10px; padding: 8px 10px; } .subs li:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.subs .sb { border-radius: 6px; width: 18px; height: 18px; border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.setrow { padding: 14px 16px; margin-bottom: 10px; border: 1px solid color-mix(in srgb, var(--rule) 65%, transparent); border-radius: var(--r2); background: var(--card); box-shadow: var(--sh2); }
.setrow:hover { transform: translateY(-1px); box-shadow: var(--sh); }
.ca { border-bottom-color: color-mix(in srgb, var(--rule) 55%, transparent); }

/* tiles */
.tile { border: 0; border-radius: var(--r2); box-shadow: var(--sh); } .tile:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(80, 58, 24, .06), 0 18px 36px -14px rgba(80, 58, 24, .28); }
.tile .art { height: 132px; }

/* calendar: floating rounded days instead of a hard grid */
.cal { gap: 6px; border: 0; background: transparent; }
.cal .dow { border: 0; background: transparent; padding: 4px 0 2px; }
.cd { border: 0; border-radius: 14px; background: var(--card); box-shadow: var(--sh2); padding: 8px 9px; }
.cd:hover:not(.out) { transform: translateY(-1px); box-shadow: var(--sh); }
.cd.out { background: transparent; box-shadow: none; color: var(--ink3); opacity: .55; }
.cd .bd { border-radius: 99px; overflow: hidden; height: 5px; }
.cd.s-done { background: var(--ok-wash); } .cd.s-part { background: var(--warn-wash); } .cd.s-miss { background: var(--bad-wash); } .cd.s-relief { background: var(--info-wash); }
.cd.s-exam { background: var(--accent); }
.cd.today::after { inset: 0; border-radius: 14px; border: 2px solid var(--accent); }
.legend i { border-radius: 4px; border: 0; width: 12px; height: 12px; }

/* lists */
.week, .subj { border-bottom: 0; margin-bottom: 10px; border: 1px solid color-mix(in srgb, var(--rule) 65%, transparent); border-radius: var(--r2); background: var(--card); box-shadow: var(--sh2); overflow: hidden; }
.week > summary, .subj > summary { padding: 16px 18px; }
.drow, .unit { padding-left: 18px; padding-right: 18px; border-top-color: color-mix(in srgb, var(--rule) 50%, transparent); }
.unit { border-left: 0; position: relative; } .unit::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: transparent; } .unit.done::before { background: var(--ok); } .unit.part::before { background: var(--warn); }
.st { border-radius: 7px; }

/* questions */
.opts { border-top: 0; display: grid; gap: 8px; }
.opt { border: 1.5px solid color-mix(in srgb, var(--rule) 80%, transparent); border-radius: var(--r1); padding: 14px 14px; background: var(--card); box-shadow: var(--sh2); grid-template-columns: 32px 1fr; align-items: center; }
.opt:hover:not(.locked) { background: var(--card); border-color: var(--ink3); transform: translateY(-1px); }
.opt .lt { width: 30px; height: 30px; border-width: 1.5px; }
.opt.sel { border-color: var(--ink); background: var(--wash); box-shadow: none; }
.opt.right { border-color: var(--ok); box-shadow: none; } .opt.wrong { border-color: var(--bad); box-shadow: none; }
.why { margin: -2px 6px 6px 46px; border-bottom: 0; padding: 4px 0 6px; }
.expl { border-radius: var(--r2); background: var(--info-wash); padding: 18px; }
.trap { border-left: 0; border-radius: var(--r2); padding: 16px 18px; }
.dots i { height: 6px; border-radius: 99px; width: 18px; }
.errcard { padding: 18px; } .snap { border-radius: var(--r1); }
.causes button { border: 0; border-radius: 10px; background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 8px 13px; }
.causes button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.guide { border-left: 0; border-radius: var(--r1); }
.md pre, .md code, .md .tbl, .md blockquote { border-radius: 10px; } .md blockquote { border-left-width: 3px; border-radius: 4px 10px 10px 4px; }
.md h2 { border-bottom-color: color-mix(in srgb, var(--rule) 70%, transparent); }
.md th, .md td { border-color: color-mix(in srgb, var(--rule) 60%, transparent); }
.dots { display: flex; gap: 2px; flex-wrap: nowrap; } .dots i { flex: 1 1 0; width: auto; min-width: 3px; max-width: 18px; height: 6px; border-radius: 99px; }

.tile .art { position: relative; display: block; background-color: var(--accent); }
.tile .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .28)); }
.tile .art .ic { position: absolute; left: 14px; bottom: 12px; z-index: 1; padding: 8px; width: 42px; height: 42px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 82%, black); color: #fffaf0; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .5); }
.login .art { background-color: var(--paper2); }
