/* Accounts: the login screen, the setup quiz, the timetable being built, and the account menu.
   Same school colours and type as the rest of the app. The one show-off moment on each screen:
   the red-pen circle drawn round a grade (login and goals) and the calendar filling itself in. */

/* ---------- until someone is signed in ---------- */
body.gated .topbar, body.gated .side-tab, body.gated .sidebar, body.gated .side-scrim, body.gated #app { display: none !important; }
#gate { flex: 1; min-height: 0; overflow: auto; background: var(--page); }
body:not(.gated) #gate { display: none; }

.auth-problem { max-width: 460px; margin: 18vh auto 0; padding: 0 16px; text-align: center; }
.auth-problem h1 { font-size: 28px; margin-bottom: 8px; }

/* ---------- red pen ---------- */
.pen-loop { position: absolute; inset: -10px -16px; width: calc(100% + 32px); height: calc(100% + 20px); overflow: visible; pointer-events: none; }
.pen-loop path { fill: none; stroke: var(--redpen); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 100 200; stroke-dashoffset: 101; }
.pen-loop.draw path { animation: pen 0.9s cubic-bezier(0.55, 0.1, 0.3, 1) 0.35s forwards; }
@keyframes pen { to { stroke-dashoffset: 0; } }

/* ---------- login and sign-up ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(380px, 46fr) 54fr; transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }
.auth.leaving { opacity: 0; transform: translateY(-12px); }

.auth-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 28px; padding: 40px clamp(28px, 4vw, 64px) 48px; color: #fff;
  background: radial-gradient(120% 90% at 0% 100%, rgba(88, 199, 212, 0.22), transparent 60%), radial-gradient(90% 70% at 100% 0%, #3552b8 0%, transparent 65%), linear-gradient(160deg, #18265c, #213372 60%, #263f8e);
}
.auth-logo { height: 52px; width: auto; align-self: flex-start; background: #fff; padding: 8px 14px; border-radius: 14px; }
.auth-pitch h2 { font: 800 clamp(30px, 3.2vw, 44px)/1.05 var(--font-head); letter-spacing: -0.04em; margin: 0 0 14px; max-width: 15ch; color: #fff; }
.auth-pitch p { margin: 0; max-width: 46ch; font-size: 16.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.78); }

/* The marked paper: a white sheet, gently tilted, with its grade circled. */
.auth-sheet {
  margin-top: auto; align-self: flex-start; width: min(100%, 380px); padding: 20px 22px 18px; border-radius: 10px; background: #fdfdfb; color: #1d2541;
  transform: rotate(-3deg); box-shadow: 0 30px 60px -24px rgba(5, 10, 30, 0.7), 0 2px 0 rgba(0, 0, 0, 0.05);
  animation: sheet-in 0.8s var(--ease) both;
}
@keyframes sheet-in { from { opacity: 0; transform: rotate(-8deg) translateY(40px); } }
.sheet-head { display: flex; justify-content: space-between; font: 700 13px/1 var(--font-body); color: #5b6585; padding-bottom: 12px; border-bottom: 1.5px solid #e6e9f0; margin-bottom: 6px; }
.sheet-line { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #e6e9f0; }
.sheet-line b { font: 700 13px/1 var(--font-body); color: #8a93ad; }
.sheet-text { height: 7px; border-radius: 4px; background: #e8ebf2; }
.sheet-text.short { width: 70%; }
.sheet-text.shorter { width: 45%; }
.sheet-mark { font: 700 22px/1 var(--font-hand); color: var(--redpen); }
.sheet-total { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; font: 700 26px/1 var(--font-hand); color: var(--redpen); }
.sheet-grade { position: relative; display: inline-grid; place-items: center; width: 50px; height: 50px; margin-right: 14px; font: 700 46px/1 var(--font-hand); color: var(--redpen); }

.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(100%, 440px); }
.auth-card-top { display: none; align-items: center; gap: 10px; margin-bottom: 22px; font: 800 18px/1 var(--font-head); letter-spacing: -0.02em; }
.auth-card-logo { height: 34px; }

.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 30px; border-radius: 999px; background: var(--wash); }
.auth-tabs button { position: relative; z-index: 1; border: 0; background: none; padding: 10px 12px; border-radius: 999px; font: 650 15px/1.2 var(--font-body); color: var(--text-2); }
.auth-tabs button:hover { color: var(--text); background: none; }
.auth-tabs button.on { color: var(--text); }
.auth-ink { position: absolute; z-index: 0; left: 4px; top: 4px; bottom: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(18, 26, 58, 0.1), 0 0 0 1px var(--border); transition: transform 0.35s var(--ease); }

.auth-form h1 { font-size: 34px; margin: 0 0 6px; }
.auth-sub { color: var(--text-2); margin: 0 0 22px; }
.auth-form.from-right { animation: from-right 0.35s var(--ease); }
.auth-form.from-left { animation: from-left 0.35s var(--ease); }
@keyframes from-right { from { opacity: 0; transform: translateX(22px); } }
@keyframes from-left { from { opacity: 0; transform: translateX(-22px); } }
.auth-form.nudge { animation: nudge 0.4s var(--ease); }

.auth-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--marker) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--marker) 40%, transparent); font-size: 14px; }
.auth-note svg { flex: none; margin-top: 2px; color: var(--accent); }

.google-btn {
  position: relative; width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px;
  border: 1px solid var(--axis); border-radius: 14px; background: var(--surface); color: var(--text); font: 650 15.5px/1.2 var(--font-body);
}
.google-btn:hover:not(:disabled) { background: var(--surface); border-color: var(--muted); box-shadow: var(--shadow); transform: translateY(-1px); }
.google-btn.busy { color: transparent; }
.google-btn.busy svg { opacity: 0; }
.google-btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--grid); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }

.auth-or { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.af { display: grid; gap: 6px; margin-bottom: 14px; }
.af label { font-weight: 650; font-size: 14px; }
.af-box { position: relative; }
.af-box input { width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 14px; }
/* Email boxes are not covered by the app-wide input styles, so all of them are set here. */
.af-box input { font: inherit; font-size: 16px; border: 1px solid var(--axis); background: var(--surface); color: var(--text); transition: border-color 0.15s, box-shadow 0.15s; }
.af-box input:hover { border-color: var(--muted); }
.af-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.af-box input[type="password"], .af-box input[name="password"] { padding-right: 70px; }
.af-reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 6px 10px; font-size: 13px; font-weight: 650; color: var(--text-2); border-radius: 10px; }
.af-reveal:hover { background: var(--wash); }
.af-reveal:active:not(:disabled) { transform: translateY(-50%) scale(0.95); }
.af-hint { font-size: 13px; color: var(--muted); }
p.af-hint { margin: -2px 0 12px; }
.field-error:empty { display: none; }
.field-error, .form-error { color: var(--redpen); font-size: 13.5px; font-weight: 600; }
.form-error { margin: 0 0 12px; }
.form-error:empty { display: none; }
.af.bad input { border-color: var(--redpen); box-shadow: 0 0 0 4px color-mix(in srgb, var(--redpen) 14%, transparent); }
.af-row { display: grid; grid-template-columns: 1fr 104px; gap: 12px; align-items: start; }
.af-row .field-error { display: none; }
.row-error { margin: -6px 0 12px; }
.age-input { -moz-appearance: textfield; text-align: center; }

.auth-submit { position: relative; width: 100%; justify-content: center; padding: 14px; font-size: 16px; border-radius: 14px; margin-top: 4px; }
.auth-submit .spinner { display: none; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
.auth-submit.busy .btn-label { visibility: hidden; }
.auth-submit.busy .spinner { display: block; }
.auth-submit.done { background: var(--good); border-color: var(--good); animation: settle 0.4s var(--spring); }
.auth-submit.done .btn-label::before { content: "✓  "; }

.google-setup ol { padding-left: 20px; display: grid; gap: 10px; margin: 14px 0 18px; }
.google-setup li { padding-left: 4px; }
.gs-origin { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; }
.gs-origin code { padding: 6px 10px; border-radius: 8px; background: var(--wash); font-size: 14px; }
.google-setup input { width: 100%; }

/* Inputs keep their own rounded focus ring (the app-wide one would square their corners). */
.af-box input:focus-visible, .ob-search:focus-visible, .ob-age-input:focus-visible, .account-section input:focus-visible { outline: none; border-radius: 14px; }
.ob-age-input:focus-visible { border-radius: 22px; }

/* ---------- the setup quiz ---------- */
.ob { min-height: 100%; display: flex; flex-direction: column; }
.ob-loading { display: grid; place-items: center; }
.ob-top { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 16px; padding: 18px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(8px); }
.ob-back { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.ob-back[hidden] { display: grid !important; visibility: hidden; }
.ob-progress { display: flex; gap: 6px; }
.ob-progress span { flex: 1; height: 6px; border-radius: 999px; background: var(--grid); overflow: hidden; position: relative; }
.ob-progress span::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--marker), var(--accent)); transform-origin: left; transform: scaleX(0); transition: transform 0.5s var(--ease); }
.ob-progress span.done::after { transform: scaleX(1); }
.ob-progress span.now::after { transform: scaleX(0.45); }
.ob-count { font: 650 14px/1 var(--font-body); color: var(--muted); font-variant-numeric: tabular-nums; }

.ob-stage { flex: 1; width: min(100% - 32px, 880px); margin: 0 auto; padding: 18px 0 40px; }
.ob-step.in-right { animation: from-right 0.45s var(--ease); }
.ob-step.in-left { animation: from-left 0.45s var(--ease); }
.ob-kicker { margin: 0 0 8px; font-weight: 700; color: var(--accent); }
.ob-step h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.04em; margin: 0 0 10px; outline: none; }
.ob-sub { color: var(--text-2); font-size: 17px; margin: 0 0 26px; max-width: 60ch; }

.ob-grid { display: grid; gap: 14px; }
.ob-years { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ob-boards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ob-goals { grid-template-columns: repeat(3, 1fr); }

.ob-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px; min-height: 120px; text-align: left;
  border: 1.5px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  transition: border-color 0.18s, box-shadow 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s;
}
.ob-tile:hover:not(:disabled) { background: var(--surface); border-color: var(--axis); transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.ob-tile:active:not(:disabled) { transform: scale(0.98); }
.ob-tile.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-lift); }
.ob-tile strong { font: 750 19px/1.2 var(--font-head); letter-spacing: -0.02em; }
.ob-tile small { color: var(--text-2); font-size: 14px; line-height: 1.4; }
.ob-tile kbd { position: absolute; right: 14px; top: 14px; font: 600 11px/1 var(--font-body); color: var(--muted); padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; }
.ob-tile, .ob-subject { white-space: normal; }
.ob-tile.on kbd { visibility: hidden; }
.ob-tick { position: absolute; right: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); transform: scale(0); transition: transform 0.3s var(--spring); }
.on > .ob-tick { transform: scale(1); }
.ob-big { font: 800 40px/1 var(--font-head); letter-spacing: -0.04em; color: var(--accent); margin-bottom: 6px; }

.ob-board-logo { height: 30px; width: auto; margin-bottom: 8px; }
.ob-board-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px; background: var(--bc, var(--muted)); color: #fff; font: 800 18px/1 var(--font-head); }
.board-school { grid-column: span 2; border-top: 5px solid var(--orange); }
.board-school strong { font-size: 21px; }
.board-unsure .ob-board-mark { background: var(--muted); }

.ob-subjects-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ob-search { flex: 1; max-width: 340px; }
.ob-chosen { font-weight: 650; color: var(--muted); transition: color 0.2s; }
.ob-chosen.some { color: var(--accent); }
.ob-subjects { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ob-subject {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px 12px; text-align: center;
  border: 1.5px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.18s var(--ease);
}
.ob-subject:hover:not(:disabled) { background: var(--surface); border-color: var(--subj); transform: translateY(-2px); }
.ob-subject.on { border-color: var(--subj); background: color-mix(in srgb, var(--subj) 9%, var(--surface)); }
.ob-subject.on .ob-tick { background: var(--subj); }
.ob-subject .ob-tick { width: 20px; height: 20px; right: 8px; top: 8px; }
.ob-subject.pop .subj-badge { animation: badge-pop 0.45s var(--spring); }
@keyframes badge-pop { 40% { transform: scale(1.18) rotate(-6deg); } }
.ob-subject-name { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.ob-subject small { font-size: 12px; color: var(--muted); }
.ob-more { margin-top: 12px; }
.ob-empty { color: var(--muted); grid-column: 1 / -1; }

.ob-goals .ob-tile { align-items: center; text-align: center; padding: 26px 18px 34px; }
.ob-grade { position: relative; display: grid; place-items: center; width: 110px; height: 76px; margin-bottom: 12px; font: 700 50px/1 var(--font-hand); color: var(--gc, var(--accent)); }
.ob-grade.g-5 { --gc: var(--g-5); }
.ob-grade.g-7 { --gc: var(--g-7); }
.ob-grade.g-9 { --gc: var(--g-9); }
.ob-grade .pen-loop { inset: -6px -12px; width: calc(100% + 24px); height: calc(100% + 12px); }
.ob-grade .pen-loop path { stroke: var(--gc); stroke-width: 1.5; }
.ob-goals .ob-tile.on .ob-grade .pen-loop path { animation: pen 0.7s cubic-bezier(0.55, 0.1, 0.3, 1) 0.05s forwards; }
.ob-goals .ob-tile strong { font-size: 24px; }
.ob-pace { margin-top: 10px; font-size: 13px; font-weight: 650; color: var(--accent); background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; }

.ob-age-pick { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ob-age-input { width: 150px; text-align: center; font: 800 56px/1 var(--font-head) !important; padding: 12px !important; border-radius: 22px !important; -moz-appearance: textfield; }
.ob-age-input::-webkit-inner-spin-button, .age-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.round-step { width: 58px; height: 58px; border-radius: 50%; padding: 0; font: 600 28px/1 var(--font-body); display: grid; place-items: center; }
.ob-note { flex-basis: 100%; color: var(--redpen); font-weight: 600; margin: 4px 0 0; min-height: 1.4em; }

.ob-foot {
  position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border); box-shadow: 0 -14px 34px -24px rgba(10, 16, 40, 0.45);
}
.ob-hint { color: var(--muted); font-size: 14px; }
.ob-next { padding: 13px 22px; font-size: 16px; border-radius: 14px; gap: 10px; display: inline-flex; align-items: center; }
.ob-next:disabled { opacity: 0.45; box-shadow: none; }

/* ---------- building the timetable ---------- */
.ob-build { display: grid; place-items: center; padding: 32px 16px; }
.bt { width: min(100%, 760px); }
.bt-head { text-align: center; margin-bottom: 26px; }
.bt-head h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.04em; margin: 0 0 8px; }
.bt-head .ob-sub { margin: 0 auto; }

.bt-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 14px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lift); }
.bt-dow { text-align: center; font: 700 12px/1 var(--font-body); color: var(--muted); padding-bottom: 4px; }
.bt-day { position: relative; min-height: 74px; padding: 6px; border-radius: 12px; background: var(--wash); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; transition: background 0.3s; }
.bt-day.past { opacity: 0.4; }
.bt-day.today { box-shadow: inset 0 0 0 2px var(--marker); }
.bt-date { width: 100%; font: 700 12px/1 var(--font-body); color: var(--text-2); margin-bottom: 2px; }
.bt-block { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--subj) 16%, var(--surface)); border: 1.5px solid var(--subj); animation: drop 0.45s var(--spring) both; }
.bt-block .subj-badge { border-radius: 6px; box-shadow: none; }
@keyframes drop { from { opacity: 0; transform: translateY(-18px) scale(0.6); } }
.bt-exam { width: 100%; text-align: center; padding: 3px 0; border-radius: 6px; background: color-mix(in srgb, var(--redpen) 14%, var(--surface)); color: var(--redpen); font: 700 11px/1 var(--font-body); animation: drop 0.4s var(--spring) both; }

.bt-lines { list-style: none; margin: 24px auto 18px; padding: 0; display: grid; gap: 10px; width: min(100%, 520px); }
.bt-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 600; transition: color 0.3s; }
.bt-line.now, .bt-line.done { color: var(--text); }
.bt-state { position: relative; flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--grid); }
.bt-state .spinner { display: none; position: absolute; inset: -2px; width: auto; height: auto; border-width: 2px; }
.bt-state svg { opacity: 0; transform: scale(0.4); transition: opacity 0.2s, transform 0.35s var(--spring); }
.bt-line.now .bt-state .spinner { display: block; }
.bt-line.done .bt-state { background: var(--good); border-color: var(--good); color: #fff; }
.bt-line.done .bt-state svg { opacity: 1; transform: scale(1); }
.bt-bar { height: 6px; width: min(100%, 520px); margin: 0 auto; border-radius: 999px; background: var(--grid); overflow: hidden; }
.bt-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--marker), var(--accent)); transition: width 0.6s var(--ease); }

.bt-summary { margin-top: 24px; display: grid; gap: 16px; animation: rise 0.5s var(--ease) both; }
.bt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bt-stats div { padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); text-align: center; }
.bt-stats strong { display: block; font: 800 34px/1 var(--font-head); letter-spacing: -0.03em; color: var(--accent); }
.bt-stats span { font-size: 14px; color: var(--text-2); }
.bt-first { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: color-mix(in srgb, var(--subj) 8%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--subj) 45%, transparent); }
.bt-first small { display: block; font-weight: 700; color: var(--muted); }
.bt-first strong { display: block; font: 700 17px/1.3 var(--font-head); }
.bt-first span { color: var(--text-2); font-size: 14px; }
.bt-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.bt-actions button { padding: 13px 22px; font-size: 16px; border-radius: 14px; display: inline-flex; align-items: center; gap: 8px; }

/* ---------- account button and menu ---------- */
.account-wrap { position: relative; }
.account-btn { padding: 2px; border-radius: 50%; border: 2px solid transparent; background: none; display: grid; }
.account-btn:hover { border-color: var(--marker); background: none; }
.account-btn[aria-expanded="true"] { border-color: var(--accent); }
.avatar { position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--av, var(--accent)); color: #fff; font-family: var(--font-head); font-weight: 800; letter-spacing: -0.02em; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-menu { min-width: 270px; right: 0; left: auto; top: calc(100% + 10px); z-index: 50; }
.account-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.account-head strong { display: block; font-family: var(--font-head); }
.account-head small { color: var(--text-2); font-size: 13px; }
.account-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.account-menu .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; text-decoration: none; }

/* Settings → account */
#account { scroll-margin-top: 16px; }
.account-section .set-row input[type="text"] { max-width: 320px; }
.account-section .set-row .num-input { width: 96px; flex: none; }
.account-top { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.account-top > div { flex: 1; min-width: 0; }
.account-top h2 { margin: 0; }
.account-section[data-open] { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.set-row.stack-row { flex-wrap: wrap; }
.pw-form { flex-basis: 100%; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pw-form input { flex: 1; min-width: 200px; }
.pw-form[hidden] { display: none !important; }

/* My subjects → exam boards */
.board-section { margin-bottom: 22px; }
.board-rows { display: grid; gap: 8px; }
.board-row { display: grid; grid-template-columns: auto 1fr minmax(0, 300px); align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.board-row-name strong { display: block; }
.board-row-name small { color: var(--muted); }
.board-row select { width: 100%; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 26px 20px 28px; gap: 18px; }
  .auth-sheet, .auth-pitch p { display: none; }
  .auth-logo { height: 40px; }
  .auth-pitch h2 { font-size: 26px; max-width: none; margin: 0; }
  .auth-panel { padding: 28px 16px 40px; place-items: start center; }
  .ob-goals { grid-template-columns: 1fr; }
  .ob-goals .ob-tile { flex-direction: row; flex-wrap: wrap; text-align: left; align-items: center; padding: 18px 18px 18px 14px; column-gap: 14px; }
  .ob-goals .ob-grade { width: 84px; height: 60px; font-size: 38px; margin: 0; }
  .ob-goals .ob-tile > strong { flex: 1; }
  .ob-goals .ob-tile > small, .ob-goals .ob-pace { flex-basis: 100%; }
  .ob-goals kbd { display: none; }
  .board-school { grid-column: auto; }
  .board-row { grid-template-columns: auto 1fr; }
  .board-row select { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .af-row { grid-template-columns: 1fr 88px; }
  .auth-form h1 { font-size: 28px; }
  .ob-top { gap: 10px; padding: 12px 16px; }
  .ob-tile { min-height: 0; padding: 16px; }
  .ob-tile kbd, .ob-hint { display: none; }
  .ob-big { font-size: 30px; }
  .ob-subjects { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .ob-subjects-bar { flex-direction: column; align-items: stretch; }
  .ob-search { max-width: none; }
  .ob-foot { padding: 12px 16px; }
  .ob-next { flex: 1; justify-content: center; }
  .bt-cal { padding: 8px; gap: 4px; border-radius: 16px; }
  .bt-day { min-height: 58px; padding: 4px; gap: 3px; }
  .bt-block { width: 22px; height: 22px; border-radius: 7px; }
  .bt-block .subj-badge { width: 14px !important; height: 14px !important; }
  .bt-exam { font-size: 9px; }
  .bt-stats strong { font-size: 26px; }
}
/* Without motion the circle is simply there, round the chosen grade only. */
@media (prefers-reduced-motion: reduce) {
  .pen-loop.draw path, .ob-tile.on .pen-loop path { stroke-dashoffset: 0; animation: none !important; }
}
body.no-motion .pen-loop.draw path, body.no-motion .ob-tile.on .pen-loop path { stroke-dashoffset: 0; animation: none !important; }
