@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
:root {
  --bg: #f6f8f6; --card: #ffffff; --ink: #0f1a14; --muted: #5a6a60; --line: #e3e9e4; --soft: #eef4f0;
  --brand: #0b6b3a; --brand-2: #0f8a4c; --brand-ink: #ffffff; --accent: #f5b400;
  --grad: linear-gradient(135deg, #0b6b3a 0%, #0e8a4b 55%, #19b46a 100%); --header: rgba(255, 255, 255, .82);
  --strong: #0b6b3a; --good: #2b7a4b; --border: #9a6200; --open: #2f5590; --unlikely: #6d746f; --bad: #b3261e;
  --strong-bg: #dff1e6; --good-bg: #e8f5ec; --border-bg: #fcefd6; --open-bg: #e4ecf8; --unlikely-bg: #eceeec;
  --radius: 18px; --shadow: 0 1px 2px rgba(15, 26, 20, .04), 0 8px 24px -8px rgba(15, 26, 20, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1311; --card: #181d1a; --ink: #e7ece8; --muted: #9eaaa1; --line: #2a322d; --soft: #1f2622;
    --brand: #36a86a; --brand-2: #46c07d; --brand-ink: #06120b; --accent: #f5c542;
    --strong: #6fd39a; --good: #8fd8ad; --border: #f0b85a; --open: #9db8e6; --unlikely: #9aa39d;
    --strong-bg: #15301f; --good-bg: #16291e; --border-bg: #33280f; --open-bg: #182334; --unlikely-bg: #222825;
    --shadow: none; --header: rgba(12, 18, 14, .82); --grad: linear-gradient(135deg, #1f8a4f 0%, #2aa463 55%, #45c27c 100%);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
[hidden] { display: none !important; }

/* Header */
.top { position: relative; z-index: 10; background: var(--header); color: var(--ink); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 16px; min-width: 0; letter-spacing: -.02em; }
.logo span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; color: transparent; font-size: 0;
  background: url("/brand/qusoma-mark.svg") center / 100% 100% no-repeat, var(--grad); box-shadow: 0 4px 12px -4px rgba(11, 107, 58, .5); }
.toplink { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; padding: 7px 12px; border-radius: 999px; }
.toplink:hover { color: var(--brand); background: var(--soft); }
.banner { background: var(--border-bg); color: var(--border); text-align: center; padding: 8px 16px; font-size: 14px; font-weight: 600; }
main { padding: 32px 0 56px; }

/* Hero */
.hero h1 { font-size: clamp(24px, 6vw, 32px); line-height: 1.2; margin: 4px 0 8px; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: 0 0 6px; }
.stat { font-size: 14px; color: var(--brand); font-weight: 600; margin: 0 0 16px; }
.stat:empty { display: none; }

/* Cards, forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 14px 0; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.card-h h2 { margin: 0; font-size: 18px; }
label { display: block; font-size: 14px; font-weight: 600; }
label input, label select { margin-top: 4px; font-weight: 400; }
select, input { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px; width: 100%; }
select:focus, input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 7px 14px; cursor: pointer; min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; column-gap: 16px; } }
.row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--soft); }
.row .name { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row select { width: 76px; min-height: 40px; padding: 6px 8px; text-align: center; }
.row select.set { border-color: var(--brand); background: var(--strong-bg); font-weight: 700; }
.rm { border: 0; background: none; color: var(--muted); font-size: 20px; width: 30px; height: 30px; cursor: pointer; flex: none; border-radius: 8px; }
.rm:hover { background: var(--soft); }
span.rm { cursor: default; }
.add { margin-top: 10px; }
.add select { color: var(--brand); font-weight: 600; border-style: dashed; }

details.more summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font-size: 22px; color: var(--brand); flex: none; }
details.more[open] summary::after { content: "–"; }
.more-body { margin-top: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.clusters { display: grid; grid-template-columns: 1fr; gap: 6px; max-height: 340px; overflow: auto; padding-right: 4px; }
.clusters label { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 13px; }
.clusters label span { flex: 1; min-width: 0; }
.clusters input { width: 96px; flex: none; margin: 0; min-height: 38px; padding: 6px 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; min-height: 46px;
  transition: transform .15s, box-shadow .15s, filter .15s, background .15s; }
.btn:hover:not(:disabled) { background: var(--soft); }
.btn.big { width: 100%; min-height: 54px; font-size: 17px; margin-top: 14px; }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px -8px rgba(11, 107, 58, .55); }
.btn.primary:hover:not(:disabled) { background: var(--grad); transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 10px 24px -10px rgba(11, 107, 58, .6); }
@media (prefers-reduced-motion: reduce) { .btn.primary:hover { transform: none; } }
.btn:disabled { opacity: .55; cursor: default; }
.btn.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font-weight: 400; width: 100%; }
.fine { color: var(--muted); font-size: 13px; text-align: center; margin: 8px 0 0; }
.fine:empty { display: none; }
.error { color: var(--bad); font-size: 14px; margin: 8px 0 0; }
.error:empty { display: none; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tile span { display: block; font-size: 12px; color: var(--muted); }
.tile strong { font-size: 24px; line-height: 1.2; }
.tile.accent { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tile.accent span { color: inherit; opacity: .85; }
.headline { font-size: 22px; line-height: 1.25; margin: 18px 0 2px; }

/* Course list */
.courses { list-style: none; padding: 0; margin: 14px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.courses li { padding: 12px 14px; border-top: 1px solid var(--soft); display: flex; gap: 12px; align-items: flex-start; }
.courses li:first-child { border-top: 0; }
.courses .body { flex: 1; min-width: 0; }
.courses .t { font-weight: 700; font-size: 15px; line-height: 1.3; }
.courses .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.courses .n { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.courses .n b { color: var(--ink); font-weight: 600; }
.courses .up { color: var(--strong); }
.courses .down { color: var(--border); }
.courses li.masked .t, .courses li.masked .s { filter: blur(6px); user-select: none; }
.courses li.masked { position: relative; }
.lock { flex: none; width: 22px; height: 22px; color: var(--muted); }
.num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.more-count { text-align: center; color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.more-count:empty { display: none; }

.pill { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 99px; font-weight: 700; white-space: nowrap; }
.v-strong { background: var(--strong-bg); color: var(--strong); }
.v-good { background: var(--good-bg); color: var(--good); }
.v-borderline { background: var(--border-bg); color: var(--border); }
.v-open { background: var(--open-bg); color: var(--open); }
.v-unlikely { background: var(--unlikely-bg); color: var(--unlikely); }

/* Unlock */
.unlock { border: 2px solid var(--brand); margin-top: 18px; }
.unlock h3 { margin: 0 0 8px; font-size: 20px; }
.ticks { list-style: none; padding: 0; margin: 0 0 14px; font-size: 14px; }
.ticks li { padding-left: 24px; position: relative; margin: 4px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 2px; color: var(--brand); font-weight: 800; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.tab { font: inherit; font-size: 14px; font-weight: 600; border: 0; border-radius: 9px; padding: 9px 4px; background: none; color: var(--muted); cursor: pointer; min-height: 40px; }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* Waiting */
.wait { text-align: center; padding: 28px 16px; }
.wait h2 { margin: 14px 0 6px; }
.spinner { width: 46px; height: 46px; margin: 0 auto; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Results */
.keep { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--strong-bg); border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 14px; }
.keep .btn { flex: none; }
.filters { display: flex; gap: 8px; margin: 6px 0 10px; }
.filters input { flex: 2; min-width: 0; }
.filters select { flex: 1; min-width: 0; }
.group h3 { margin: 22px 0 4px; display: flex; align-items: center; gap: 8px; font-size: 17px; }
.group > p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.showmore { width: 100%; margin-top: 8px; }

.disclaimer { margin-top: 32px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

/* Schools page */
.code-box { font: 700 28px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .06em; text-align: center; padding: 16px; border: 2px dashed var(--brand); border-radius: 12px; background: var(--strong-bg); color: var(--strong); margin: 8px 0; }
.meter { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; margin: 8px 0; }
.meter div { height: 100%; background: var(--brand); }
table.used { width: 100%; border-collapse: collapse; font-size: 14px; }
table.used th, table.used td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--soft); }
table.used th { color: var(--muted); font-weight: 600; font-size: 12px; }
.total { font-size: 15px; margin: 10px 0 0; }
