/* resmentor.sg — one stylesheet, system fonts, no external requests. */
:root {
  --bg: #f5f8f7; --surface: #fff; --ink: #0f1b1a; --muted: #586966; --line: #dce5e2;
  --brand: #0b7a63; --brand-ink: #fff; --brand-soft: #e2f3ee; --accent: #f2a900;
  --good: #14804f; --good-soft: #e3f5ec; --bad: #b93a2c; --bad-soft: #fbe9e6;
  --radius: 14px; --shadow: 0 1px 2px rgba(15, 27, 26, .05), 0 8px 24px -12px rgba(15, 27, 26, .12);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1312; --surface: #131d1b; --ink: #e7efed; --muted: #9ab0ab; --line: #24332f;
    --brand: #34c6a2; --brand-ink: #05211a; --brand-soft: #11302a; --accent: #f7b928;
    --good: #46cf8e; --good-soft: #10291d; --bad: #ff8a7a; --bad-soft: #33161280;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--brand); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
img, video, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
kbd { font: 600 .8em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }

/* header */
.site-head { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; flex: none; }
.brand b { color: var(--brand); font-weight: 800; }
.site-head nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-head nav::-webkit-scrollbar { display: none; }
.site-head nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .94rem; white-space: nowrap; }
.site-head nav a:hover { color: var(--ink); background: var(--brand-soft); }
.site-head nav a[aria-current] { color: var(--brand); background: var(--brand-soft); }
@media (max-width: 720px) {
  .site-head .wrap { flex-wrap: wrap; gap: 0; padding-top: 10px; }
  .site-head nav { width: 100%; margin: 4px -4px 0; padding-bottom: 8px; }
}

main { padding-block: 28px 64px; }
main > section { margin-top: 44px; }
h1 { font-size: clamp(1.8rem, 4.6vw, 2.9rem); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
h2 { font-size: 1.25rem; letter-spacing: -.015em; margin-bottom: 14px; }
.lede { color: var(--muted); font-size: 1.08rem; margin-top: 12px; max-width: 60ch; text-wrap: pretty; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.note { color: var(--muted); font-size: .9rem; margin-top: 12px; }
.note.warn { color: var(--bad); }
.pill { display: inline-block; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .78rem; padding: 3px 10px; border-radius: 999px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .08s, border-color .15s, background .15s; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.small { min-height: 38px; padding: 7px 13px; font-size: .9rem; border-radius: 9px; }
.btn.ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn.ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn:disabled { opacity: .45; cursor: default; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; padding-block: 18px 6px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 26px; color: var(--muted); font-size: .9rem; }
.stats b { display: block; color: var(--ink); font-size: 1.5rem; line-height: 1.1; letter-spacing: -.02em; }
.hero-tool h2 { font-size: 1.02rem; margin-bottom: 14px; }
.hero-tool .field + .field { margin-top: 12px; }
.quick-out { margin: 16px 0 10px; border-top: 1px solid var(--line); }
.quick-out div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.quick-out b { color: var(--ink); font-variant-numeric: tabular-nums; }
.quick-out .sum { border: 0; font-size: 1.15rem; }
.quick-out .sum span { color: var(--ink); font-weight: 700; }
.quick-out .sum b { color: var(--brand); font-size: 1.4rem; }
.hero-media { margin-top: 28px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.hero-media img, .hero-media video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 24px; } }

/* progress strip */
.strip { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--muted); font-size: .9rem; padding: 16px 18px; }
a.tile:hover { border-color: var(--brand); }
.tile b { color: var(--ink); font-size: 1.9rem; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile small { color: var(--brand); font-weight: 600; font-size: .84rem; }
.exam-tile { gap: 8px; }
.exam-tile label { font-weight: 700; color: var(--ink); }
.exam-tile input { border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 8px 10px; min-height: 42px; width: 100%; }
.exam-tile a { font-weight: 600; font-size: .86rem; }
.cd { display: flex; align-items: baseline; gap: 8px; }
.cd b { color: var(--brand); }
@media (max-width: 860px) { .strip { grid-template-columns: 1fr 1fr 1fr; } .exam-tile { grid-column: 1 / -1; } .tile b { font-size: 1.5rem; } }
@media (max-width: 460px) { .tile { padding: 12px; font-size: .8rem; } }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--muted); font-size: .92rem; transition: transform .12s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--brand); }
.card strong { color: var(--ink); font-size: 1.03rem; letter-spacing: -.01em; }
.ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }

/* page head */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .86rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs a::after { content: "/"; margin-left: 6px; opacity: .5; }
.page-head { margin-bottom: 24px; }

/* forms */
.tool { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .tool { grid-template-columns: 1fr; } }
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.form > *, .tool > *, .field, #bank-fields, #profile-field, .hero > * { min-width: 0; }
.form.inline { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: end; }
.field { display: grid; gap: 6px; }
.field > span:first-child, .field legend { font-weight: 700; font-size: .92rem; }
.field legend { margin-bottom: 6px; }
.field small { color: var(--muted); font-size: .82rem; }
.input { display: flex; align-items: center; border: 1px solid var(--line); background: var(--bg); border-radius: 11px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input i { font-style: normal; color: var(--muted); padding: 0 12px; font-weight: 600; white-space: nowrap; }
.input input, .input select { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; padding: 11px 12px; min-height: 46px; font-size: 1.05rem; font-variant-numeric: tabular-nums; outline: 0; }
.input i + input { padding-left: 0; }
.input select { font-size: 1rem; cursor: pointer; }
.seg > div { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.seg label { flex: 1 1 auto; cursor: pointer; }
.seg input, .chip input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: .92rem; color: var(--muted); white-space: nowrap; }
.seg input:checked + span { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.seg input:focus-visible + span, .chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--brand); flex: none; }
#bank-fields, #profile-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* results */
.result { position: sticky; top: 76px; }
@media (max-width: 860px) { .result { position: static; } }
.headline { display: grid; gap: 2px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.headline-label { color: var(--muted); font-weight: 600; font-size: .9rem; }
.headline-value { font-size: clamp(2rem, 6vw, 2.7rem); line-height: 1.1; letter-spacing: -.035em; color: var(--brand); font-variant-numeric: tabular-nums; }
.headline-sub { color: var(--muted); font-size: .9rem; }
.rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rows dt { color: var(--muted); }
.rows dd { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rows .total dt { color: var(--ink); font-weight: 700; }
.rows .total dd { color: var(--brand); }
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
th, td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; white-space: normal; }
th:last-child, td:last-child { padding-right: 0; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 16px; }
.steps li { display: grid; gap: 2px; text-align: center; padding: 9px 4px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.steps b { font-size: 1.02rem; color: var(--ink); }
.steps .on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps .on b { color: var(--brand-ink); }
.bar { height: 12px; border-radius: 999px; background: var(--accent); overflow: hidden; margin-top: 16px; }
.bar i { display: block; height: 100%; background: var(--brand); }
.bar-key { display: flex; gap: 18px; font-size: .84rem; color: var(--muted); margin-top: 8px; }
.bar-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.k1 { background: var(--brand); } .k2 { background: var(--accent); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
details { margin-top: 16px; }
summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.rates { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 20px 16px; margin-top: 26px; }
.rates-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 4px 34px; }
.rates-grid > .note { grid-column: 1 / -1; }
main > section > .rates-grid { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 20px 18px; }

/* drills */
.drill { max-width: 760px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { cursor: pointer; }
.chip span { display: block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: .9rem; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.q-card { display: grid; gap: 16px; justify-items: start; padding: 24px; }
.q { font-size: 1.18rem; line-height: 1.45; text-wrap: pretty; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
@media (max-width: 520px) { .opts { grid-template-columns: 1fr; } }
.opt { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-weight: 700; font-size: 1.06rem; font-variant-numeric: tabular-nums; cursor: pointer; text-align: left; }
.opt:hover:not(:disabled) { border-color: var(--brand); }
.opt:disabled { cursor: default; opacity: .6; }
.opt.right { border-color: var(--good); background: var(--good-soft); color: var(--good); opacity: 1; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); opacity: 1; }
.feedback { width: 100%; padding: 14px 16px; border-radius: 12px; font-size: .95rem; }
.feedback.good { background: var(--good-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback strong { display: block; margin-bottom: 6px; }
.feedback.good strong { color: var(--good); } .feedback.bad strong { color: var(--bad); }
.feedback li { font-variant-numeric: tabular-nums; padding: 2px 0; }
.score-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.score { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: .92rem; }
.score b { color: var(--ink); }

/* tracker */
.overall { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.ring { --p: 0; flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(closest-side, var(--surface) 76%, transparent 78%), conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); }
.ring b { font-size: 1.05rem; }
.unit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 8px; margin-top: 14px; }
.unit header { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; margin-bottom: 6px; }
.unit h2 { margin: 0; font-size: 1.08rem; }
.cu { color: var(--brand); margin-right: 4px; }
.unit-pct { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .25s; }
.topics li { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ref { color: var(--muted); font-weight: 700; font-size: .86rem; font-variant-numeric: tabular-nums; }
.topics li[data-s="2"] .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.states { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.states button { border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.states button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.states button[data-set="1"][aria-pressed="true"] { background: var(--accent); color: #2b1d00; }
.states button[data-set="2"][aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
@media (max-width: 620px) { .topics li { grid-template-columns: 40px 1fr; } .states { grid-column: 1 / -1; } .states button { flex: 1; } }

/* planner */
.countdown { margin: 18px 0 4px; color: var(--muted); }
.countdown b { color: var(--ink); font-size: 1.15rem; }
.weeks { display: grid; gap: 10px; margin-top: 14px; }
.weeks li { display: grid; grid-template-columns: 190px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 14px 16px; break-inside: avoid; }
.weeks .revise { border-left-color: var(--accent); }
.weeks .exam { border-left-color: var(--ink); }
.wk b { display: block; } .wk span { color: var(--muted); font-size: .86rem; }
.wk-body { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .92rem; }
.topic { display: inline-flex; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; }
.topic i { font-style: normal; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .weeks li { grid-template-columns: 1fr; gap: 8px; } }

/* flashcards */
.deck { max-width: 620px; }
.progress { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.progress b { color: var(--ink); }
.flash { display: grid; place-items: center; width: 100%; min-height: 250px; padding: 26px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: center; }
.flash.flipped { background: var(--brand-soft); border-color: var(--brand); }
.face { display: grid; gap: 10px; justify-items: center; }
.face strong { font-size: 1.45rem; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.face .term { font-size: clamp(2.6rem, 11vw, 4rem); letter-spacing: -.04em; color: var(--brand); }
.face span { color: var(--muted); max-width: 44ch; }
.grp { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.hint { font-size: .86rem; }
.deck-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* misc pages */
.contact { display: grid; gap: 4px; justify-items: start; }
.big-mail, .mail { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.big-mail { font-size: clamp(1.2rem, 5vw, 1.8rem); letter-spacing: -.02em; word-break: break-all; }
.prose ul { display: grid; gap: 14px; }
.prose li { padding-left: 18px; position: relative; max-width: 72ch; }
.prose li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

/* footer */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding-block: 36px 28px; font-size: .92rem; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1.3fr 1fr .7fr; gap: 28px; }
.site-foot h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink); margin-bottom: 10px; }
.site-foot li { padding: 3px 0; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--brand); }
.site-foot p { margin-top: 10px; }
.site-foot .mail { color: var(--brand); }
.mail svg { width: 18px; height: 18px; }
.fine { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .82rem; }
.fine p { max-width: 90ch; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-head, .site-foot, .tool-actions, .related, .crumbs, .skip, .chips, form.inline { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .unit, .weeks li, .rates { box-shadow: none; }
  .result { position: static; }
  main { padding: 0; }
}

/* compact tool cards on phones */
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .card { display: grid; grid-template-columns: 42px 1fr; column-gap: 14px; row-gap: 2px; padding: 14px; align-items: start; }
  .card .ico { grid-row: 1 / span 2; margin: 0; }
  .card > span:last-child { grid-column: 2; }
}
