@font-face {
  font-family: Manrope;
  src: url("/manrope-latin-ext-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02FF,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: Manrope;
  src: url("/manrope-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+FEFF,U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f4f7f7;
  --panel: #fff;
  --ink: #12252c;
  --muted: #51646a;
  --line: #dfe7e7;
  --soft: #eff5f4;
  --accent: #136553;
  --accent-strong: #0c5243;
  --accent-bg: #e2f4ec;
  --mint: #dff4ed;
  --mint-ink: #14725d;
  --blue: #e8effc;
  --blue-ink: #315e9a;
  --amber: #fbf0d9;
  --amber-ink: #875b11;
  --danger: #a22b38;
  --danger-bg: #fbe8eb;
  --side: #10232a;
  --side-edge: #203941;
  --side-text: #b5c5c8;
  --hero-green: #b5f47e;
  --font: Manrope, "Segoe UI", sans-serif;
  --radius: 16px;
  font-size: 15px;
}
:root[data-text="small"] { font-size: 13px; }
:root[data-text="large"] { font-size: 18px; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111e22; --panel: #18292e; --ink: #f0f6f5; --muted: #b3c4c4; --line: #354950;
  --soft: #22383e; --accent: #8ee4b6; --accent-strong: #b3f8ce; --accent-bg: #203d34;
  --mint: #24423b; --mint-ink: #a0f0c7; --blue: #243952; --blue-ink: #bed7ff;
  --amber: #403525; --amber-ink: #ffd88c; --danger: #ffadba; --danger-bg: #481f2c;
}
:root[data-theme="contrast"] {
  color-scheme: dark;
  --bg: #000; --panel: #0b0b0b; --ink: #fff; --muted: #f4f4f4; --line: #eee;
  --soft: #202020; --accent: #f8ff50; --accent-strong: #fff; --accent-bg: #252609;
  --mint: #222; --mint-ink: #caff90; --blue: #262626; --blue-ink: #d8f2ff;
  --amber: #282828; --amber-ink: #fff097; --danger: #ffbdc7; --danger-bg: #3c1016;
  --side: #080808; --side-edge: #c4c4c4; --side-text: #fff; --hero-green: #f8ff50;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 1rem/1.6 var(--font); min-height: 100vh; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .62; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #55b597; outline-offset: 3px;
}
:root[data-theme="contrast"] :focus-visible { outline-color: #fffa55; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.045em; }
h1 { font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.13rem; font-weight: 800; }
a { color: var(--accent); }
.icon { width: 1.23rem; height: 1.23rem; flex: 0 0 auto; vertical-align: middle; }
.skip-link { position: fixed; top: 10px; left: 12px; z-index: 100; transform: translateY(-200%); background: var(--panel); padding: .65rem 1rem; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.boot { display: grid; place-items: center; min-height: 65vh; color: var(--muted); }
.muted, .small { color: var(--muted); }
.small { font-size: .83rem; }
.prewrap { white-space: pre-wrap; }
.button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 42px;
  padding: .6rem .96rem; border-radius: 10px; border: 1px solid transparent; font-size: .89rem;
  font-weight: 800; line-height: 1.28; text-decoration: none; transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.button .icon { width: 1.12rem; height: 1.12rem; }
.button.primary { background: var(--accent); color: white; }
:root[data-theme="dark"] .button.primary, :root[data-theme="contrast"] .button.primary { color: #102329; }
.button.primary:hover { background: var(--accent-strong); }
.button.secondary, .icon-button { border-color: var(--line); background: var(--panel); color: var(--ink); }
.button.secondary:hover, .icon-button:hover { background: var(--soft); border-color: var(--accent); }
.button.ghost, .button.link { background: transparent; color: var(--accent); }
.button.link { gap: .35rem; min-height: 30px; padding: .15rem .2rem; }
.button.link:hover, .text-button:hover { text-decoration: underline; }
.button.ghost:hover { background: var(--accent-bg); }
.button.danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.button.danger:hover { outline: 1px solid var(--danger); }
.danger-text { color: var(--danger) !important; }
.icon-button { min-width: 42px; padding: .5rem; position: relative; }
.wide { width: 100%; }
.compact-button { min-height: 36px; font-size: .82rem; padding: .4rem .64rem; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--accent); font-weight: 800; }
.actions, .row-actions { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; }
.row-actions { justify-content: flex-end; }
.square {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  background: var(--soft); color: var(--accent);
}
.mint { background: var(--mint); color: var(--mint-ink); }
.blue { background: var(--blue); color: var(--blue-ink); }
.amber { background: var(--amber); color: var(--amber-ink); }
.tag { display: inline-flex; align-items: center; padding: .26rem .65rem; border-radius: 99px; background: var(--accent-bg); color: var(--accent); font-size: .77rem; font-weight: 800; width: max-content; max-width: 100%; }
.online-dot { display: inline-block; height: 8px; width: 8px; flex: 0 0 auto; border-radius: 99px; background: #9cef88; box-shadow: 0 0 0 4px #9cef8821; }
.brand { display: flex; align-items: center; gap: .69rem; color: #fff; font-size: 1.65rem; font-weight: 800; letter-spacing: -.062em; line-height: 1; }
.brand > span:last-child span { color: #a7ef83; }
.brand-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; background: #adf186; color: #172f26; }
.brand-icon .icon { width: 21px; height: 21px; fill: currentColor; stroke-width: 1.2; }

/* App navigation */
.app-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; overflow-y: auto; min-width: 0; padding: 28px 17px 18px; background: var(--side); color: var(--side-text); }
.sidebar-brand { margin: 0 0 34px 9px; }
.sidebar-brand > div:last-child { color: #a5b8be; margin: 12px 0 0 2px; font-size: .77rem; font-weight: 700; }
.nav-group { display: grid; gap: 4px; }
.nav-group p { color: #94aab1; margin: 0 0 7px 12px; font-size: .67rem; font-weight: 800; letter-spacing: .12em; }
.nav-group.misc { margin-top: 33px; }
.nav-item { display: flex; align-items: center; gap: .75rem; min-height: 44px; padding: .48rem .73rem; text-align: left; color: var(--side-text); background: none; border: 1px solid transparent; border-radius: 9px; font-size: .87rem; font-weight: 750; }
.nav-item:hover { background: var(--side-edge); color: #fff; }
.nav-item.active { background: #22443e; color: #c6f7b8; border-color: #32594c; }
.nav-item .icon { width: 1.14rem; height: 1.14rem; }
.sidebar-bottom { display: flex; align-items: center; gap: 12px; border: 1px solid var(--side-edge); border-radius: 11px; margin-top: auto; padding: 11px 11px 11px 13px; }
.sidebar-bottom strong, .sidebar-bottom small { display: block; line-height: 1.45; }
.sidebar-bottom strong { color: #e4efeb; font-size: .78rem; }
.sidebar-bottom small { font-size: .69rem; }
.sidebar-bottom .icon { margin-left: auto; color: #81ab9a; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; min-height: 73px; gap: 1rem; padding: 10px clamp(1.15rem, 3vw, 2.65rem); background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: .72rem; min-width: 0; }
.breadcrumb { font-weight: 800; font-size: .92rem; }
.button.top-exam { background: var(--accent-bg); color: var(--accent); min-height: 39px; white-space: nowrap; border-radius: 9px; }
.button.top-exam:hover { border-color: var(--accent); }
.topbar-actions > .icon-button { min-height: 39px; min-width: 39px; }
[data-unread]::after { content: ''; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #df565e; }
.profile { position: relative; margin-left: .19rem; }
.profile-button { display: flex; align-items: center; gap: .62rem; border: 0; padding: 2px; background: none; text-align: left; }
.avatar { display: grid; place-items: center; border-radius: 50%; width: 37px; height: 37px; background: #e6efed; color: #29554e; font-weight: 800; flex: 0 0 auto; }
.profile-name { max-width: 145px; min-width: 0; }
.profile-name strong, .profile-name small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.profile-name strong { font-size: .82rem; }
.profile-name small { color: var(--muted); font-size: .68rem; }
.profile-button > .icon { width: .86rem; color: var(--muted); }
.popover { position: absolute; top: calc(100% + .65rem); right: 0; background: var(--panel); border: 1px solid var(--line); padding: .42rem; border-radius: 12px; min-width: 168px; box-shadow: 0 12px 24px #0c2e211c; }
.popover .button { display: flex; width: 100%; justify-content: flex-start; }
#mobile-menu, .mobile-backdrop { display: none; }
.content { max-width: 1500px; margin: 0 auto; padding: 30px clamp(1rem, 3vw, 2.65rem) 3rem; }
.content:focus { outline: none; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 0 0 24px; }
.page-title p { color: var(--muted); margin-top: .48rem; font-size: .94rem; }
.section-gap { margin-top: 27px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: .7rem; margin-bottom: 13px; }
.section-heading p { margin-top: .33rem; color: var(--muted); font-size: .83rem; }
.panel { min-width: 0; padding: 19px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); }
.panel h2 + p { margin-top: .55rem; }

/* Dashboard and circuit artwork */
.hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 298px; border-radius: 20px; background: radial-gradient(ellipse at 79% 59%, #23574a 0%, #133c34 36%, #0e2d2b 68%, #10272b 100%); color: #f5fffa; }
.hero-text { z-index: 1; padding: 28px clamp(23px, 4vw, 47px) 31px; width: 58%; }
.hero-tag { display: inline-flex; align-items: center; gap: .5rem; padding: .27rem .68rem; border-radius: 6px; border: 1px solid #5ea97772; background: #224a3b; color: #c3f8a7; font-size: .72rem; letter-spacing: .1em; font-weight: 800; }
.hero-tag .icon { width: .88rem; height: .88rem; }
.hero h2 { margin: .7rem 0; font-size: clamp(2rem, 4.22vw, 3.8rem); line-height: 1.03; color: #f8fff8; letter-spacing: -.057em; }
.hero p { width: min(100%, 390px); margin-top: .7rem; color: #c2dcd2; font-size: .92rem; }
.hero-actions { margin-top: 1.12rem; }
.hero-primary { color: #173726; background: var(--hero-green); }
.hero-primary:hover { background: #d2ffae; }
.hero-secondary { color: #f2fff8; background: #ffffff0d; border-color: #b7e3cd57; }
.hero-secondary:hover { background: #ffffff23; border-color: #d4fae8; }
.circuit { position: absolute; pointer-events: none; width: 53%; height: 100%; right: 0; bottom: 0; overflow: hidden; }
.circuit-halo { position: absolute; inset: 0; background: radial-gradient(ellipse at 53% 57%, #90de6c32 0%, transparent 65%); }
.circuit-grid {
  position: absolute; inset: 10% -10% -8% -5%; opacity: .43;
  background: linear-gradient(#baf69b23 1px, transparent 1px), linear-gradient(90deg, #baf69b23 1px, transparent 1px);
  background-size: 29px 29px; mask-image: radial-gradient(ellipse, #000 10%, transparent 76%); transform: skewY(-11deg);
}
.board-shadow, .board { position: absolute; width: 61%; aspect-ratio: 1.22; left: 20%; top: 12%; border-radius: 14px; transform: rotateX(53deg) rotateZ(-34deg); transform-origin: center; }
.board-shadow { background: #020a07; filter: blur(21px); transform: translate(24px, 26px) rotateX(53deg) rotateZ(-34deg); opacity: .8; }
.board {
  border: 2px solid #b3ed92a8; background: linear-gradient(145deg, #36765a, #224c42 64%, #163f34);
  box-shadow: 0 1px 0 #bded96, 0 5px 0 #4f8d69, 0 8px 0 #2b6550, 0 12px 0 #143d35, 0 14px 0 #6fa975, 0 15px 20px #041711a8, 0 0 26px #9be58140;
}
.board-inner { position: absolute; inset: 6%; border: 1px solid #9be5815e; border-radius: 10px; background-image: radial-gradient(#b6f09536 1px, transparent 1.5px); background-size: 12px 12px; }
.trace { position: absolute; width: 30%; height: 16%; border-top: 2px solid #a4eb84b8; border-right: 2px solid #a4eb84b8; border-radius: 0 7px 0 0; box-shadow: 2px -2px 6px #9ee07915; }
.trace::before { content: ''; position: absolute; left: -2px; top: -4px; width: 7px; height: 7px; border: 1px solid #b3f492; border-radius: 50%; background: #306a52; }
.t1 { left: 12%; top: 29%; }.t2 { left: 12%; top: 39%; width: 26%; }.t3 { left: 12%; top: 54%; width: 27%; transform: scaleY(-1); }
.t4 { right: 12%; top: 27%; transform: scaleX(-1); }.t5 { right: 12%; top: 40%; width: 26%; transform: scaleX(-1); }
.t6 { right: 12%; top: 56%; width: 28%; transform: scale(-1); }.t7 { left: 35%; top: 73%; height: 10%; width: 19%; transform: scaleY(-1); }
.t8 { right: 28%; top: 13%; height: 9%; width: 21%; transform: scaleX(-1); }
.chip { position: absolute; border: 1px solid #a4df97; border-radius: 6px; background: linear-gradient(145deg, #56896c, #1b3834 62%); box-shadow: 0 4px 0 #102c27, 0 8px 14px #0620177f; }
.chip-main { width: 31%; left: 34.5%; top: 30%; aspect-ratio: 1; display: grid; place-items: center; }
.chip-main::before, .chip-main::after {
  content: ''; position: absolute; z-index: -1; inset: -13% 9%; background: repeating-linear-gradient(90deg, #abeb8e 0 6%, transparent 6% 13%);
}
.chip-main::after { transform: rotate(90deg) scale(1, 1.08); }
.chip-main span { display: grid; place-items: center; position: absolute; inset: 0; border: 1px solid #a4df97; border-radius: 6px; background: linear-gradient(145deg, #4f886d, #203d37 72%); color: #cdffad; }
.chip-main .icon { width: 52%; height: 52%; filter: drop-shadow(0 0 7px #b1f09491); stroke-width: 1.22; }
.chip-mini { width: 14%; height: 12%; left: 13%; top: 73%; }.chip-tiny { width: 12%; height: 18%; right: 12%; top: 15%; }
.board-via { width: 4%; aspect-ratio: 1; position: absolute; border: 1px solid #c4ffa0; border-radius: 50%; background: #163f32; box-shadow: 0 0 6px #b3f4926e; }
.v1 { left: 7%; top: 8%; }.v2 { right: 7%; top: 8%; }.v3 { left: 7%; bottom: 8%; }.v4 { right: 7%; bottom: 8%; }
.circuit-point { width: 4px; height: 4px; position: absolute; background: #bdf6a2; border-radius: 50%; box-shadow: 0 0 10px 2px #b1f09462; opacity: .85; }
.p1 { left: 11%; top: 44%; }.p2 { left: 31%; top: 16%; }.p3 { right: 14%; top: 25%; }.p4 { right: 13%; top: 66%; }.p5 { right: 28%; bottom: 17%; }.p6 { left: 21%; bottom: 22%; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.quick-card { display: flex; align-items: flex-start; gap: .88rem; padding: 17px; border: 1px solid var(--line); background: var(--panel); border-radius: 13px; }
.quick-card p { color: var(--muted); font-size: .83rem; line-height: 1.24; font-weight: 800; }
.quick-card strong { display: block; font-size: 1.88rem; line-height: 1.17; letter-spacing: -.045em; margin: .25rem 0 .16rem; }
.quick-card strong span { font-size: .98rem; color: var(--muted); letter-spacing: 0; }
.quick-card small { display: block; color: var(--muted); font-size: .71rem; line-height: 1.32; }
.dashboard-bottom { display: grid; grid-template-columns: 1.14fr 1fr; gap: 14px; }
.chart-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; padding-top: 8px; }
.chart-day { display: grid; justify-items: center; gap: 7px; color: var(--muted); font-size: .69rem; font-weight: 750; text-transform: capitalize; }
.chart-track { display: flex; align-items: end; width: min(100%, 37px); height: 81px; background: var(--soft); border-radius: 7px; overflow: hidden; }
.chart-track i { display: block; width: 100%; height: var(--bar); min-height: 4px; background: #6bbb9d; border-radius: 7px 7px 0 0; }
.chart-track .today { background: #1a826b; }
.recent-list { display: grid; gap: 6px; }
.recent-item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: 7px 0; background: transparent; border: 0; text-align: left; }
.recent-item:hover { color: var(--accent); }
.recent-item .square { width: 34px; height: 34px; }
.recent-item small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.recent-item b { margin-left: auto; }
.empty { padding: 22px 10px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.empty p { max-width: 43ch; color: var(--muted); font-size: .85rem; }
.empty .button { margin-top: 5px; }
.recent-panel .empty { padding: 5px 0 7px; gap: 5px; }
.recent-panel .empty .square { width: 39px; height: 39px; }

/* Sign-in and reusable forms */
.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1fr); background: var(--panel); }
.auth-art { position: sticky; top: 0; isolation: isolate; min-height: 620px; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; padding: clamp(30px, 5vw, 76px); color: #f4fff8; background: radial-gradient(ellipse at 75% 73%, #275e49 0%, #153c36 38%, #11292e 73%, #10232a); }
.auth-copy { z-index: 1; max-width: 590px; margin-top: clamp(62px, 11vh, 150px); }
.auth-copy h2 { font-size: clamp(2.35rem, 5.2vw, 5rem); line-height: 1.01; margin: 1.12rem 0; }
.auth-copy p { max-width: 29rem; color: #c5ddd3; }
.auth-qualifications { display: flex; gap: .45rem; }
.auth-qualifications span { padding: .24rem .64rem; border: 1px solid #95e3845e; background: #214a40; color: #c9f5ab; border-radius: 6px; font-size: .74rem; letter-spacing: .075em; font-weight: 800; }
.auth-art .circuit { width: 90%; height: 56%; right: -15%; bottom: -8%; }
.auth-art .board, .auth-art .board-shadow { width: 68%; left: 18%; top: 5%; }
.auth-status { position: relative; display: flex; align-items: center; gap: .8rem; color: #c1dbd2; margin-top: auto; padding-top: 2rem; font-size: .83rem; font-weight: 700; }
.auth-main { display: grid; align-items: center; justify-items: center; padding: 42px clamp(24px, 5vw, 70px); }
.auth-box { width: min(100%, 415px); }
.auth-box h1 { font-size: clamp(2rem, 3.7vw, 3.02rem); }
.auth-intro { color: var(--muted); margin: .55rem 0 1.65rem; }
.auth-mobile-brand { display: none; }
.auth-switch { text-align: center; color: var(--muted); margin: .75rem 0; font-size: .9rem; }
.auth-demo { border-top: 1px solid var(--line); margin-top: 1.13rem; padding-top: 1.13rem; }
.auth-box .forgot { display: flex; justify-content: flex-end; margin-top: -.46rem; }
.auth-box .button.primary { min-height: 47px; }
.form-stack { display: grid; gap: 13px; }
.form-stack > .button { justify-self: start; }
.form-stack > .button.wide { justify-self: stretch; }
.field { display: grid; align-content: start; gap: .35rem; font-size: .87rem; font-weight: 800; min-width: 0; }
.field small { font-size: .76rem; color: var(--muted); font-weight: 600; line-height: 1.5; }
input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), select, textarea {
  width: 100%; min-width: 0; padding: .61rem .71rem; min-height: 42px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg); color: var(--ink); font-weight: 600; font-size: .9rem;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .87; }
textarea { resize: vertical; }
input[type="file"] { max-width: 100%; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; margin: 0; flex: 0 0 auto; }
input[type="color"] { padding: 2px; border: 1px solid var(--line); border-radius: 5px; width: 45px; height: 36px; background: var(--panel); }
input[type="range"] { width: 100%; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .86rem; cursor: pointer; line-height: 1.5; }
.check input { margin-top: .13rem; }
fieldset { padding: .55rem .7rem .65rem; border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
legend { font-weight: 800; font-size: .85rem; padding: 0 .25rem; }
.checks-inline, .color-inputs { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.form-error { border: 1px solid var(--danger); color: var(--danger); background: var(--danger-bg); padding: .55rem .7rem; border-radius: 8px; font-size: .85rem; }
.notice { display: flex; align-items: flex-start; gap: .6rem; margin: .55rem 0 1rem; padding: .7rem .8rem; background: var(--accent-bg); color: var(--ink); border-radius: 8px; font-size: .87rem; overflow-wrap: anywhere; }
.notice .icon { color: var(--accent); }
.secret { display: block; padding: .65rem .72rem; border-radius: 7px; margin: .65rem 0; background: var(--soft); color: var(--accent); font-weight: 800; font-size: 1.05rem; letter-spacing: .06em; user-select: all; overflow-wrap: anywhere; }
.divided { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 15px; }
.settings-grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-grid .panel > p { margin: 0 0 .75rem; }
.keyboard-note { font-size: .85rem; color: var(--muted); }
kbd { padding: .07rem .25rem; border: 1px solid var(--line); border-radius: 4px; background: var(--soft); color: var(--ink); font-size: .78em; }

dialog { width: min(530px, calc(100% - 24px)); max-height: calc(100dvh - 28px); margin: auto; overflow: auto; padding: 22px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 22px 60px #081d2c44; }
dialog::backdrop { background: #091a20af; }
dialog.wide-modal { width: min(870px, calc(100% - 24px)); }
dialog > p { margin: .3rem 0 .9rem; color: var(--muted); }
dialog h3 { margin: .65rem 0; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: .75rem; }
.modal-heading .icon-button { min-width: 36px; min-height: 36px; }
#confirm p { color: var(--muted); margin: .5rem 0 1rem; }
#confirm .actions { justify-content: flex-end; }
.exam-choices { display: grid; gap: .6rem; }
.exam-choices label { display: flex; align-items: center; gap: .71rem; padding: .74rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.exam-choices label:has(:checked) { border-color: var(--accent); background: var(--accent-bg); }
.exam-choices small, .exam-choices strong { display: block; }
.exam-choices small { font-size: .78rem; color: var(--muted); }
.toast { position: fixed; z-index: 40; right: 18px; bottom: 18px; max-width: min(440px, calc(100% - 36px)); border: 1px solid var(--accent); border-radius: 10px; padding: .7rem .9rem; color: var(--ink); background: var(--panel); font-weight: 800; box-shadow: 0 8px 25px #10232925; }
.toast.error { border-color: var(--danger); color: var(--danger); }
.blocked-screen { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.tour-layer { position: fixed; inset: 0; z-index: 30; overflow: hidden; }
.tour-spot { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border: 2px solid #a6f581; outline: 1px solid #15382f; border-radius: 10px; box-shadow: 0 0 0 150vmax #08191bba; }
.tour-shade { position: absolute; inset: 0; background: #08191bba; }
.tour-card { position: absolute; z-index: 1; bottom: 30px; right: 30px; width: min(410px, calc(100% - 36px)); padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 16px 38px #0004; }
.tour-card h2 { margin: .6rem 0; }
.tour-card p { margin-bottom: .9rem; color: var(--muted); }
.news-list article { border-bottom: 1px solid var(--line); padding: .8rem 0; }

/* Questions, results and lists */
.quiz-wrap { max-width: 1100px; margin: 0 auto; }
.quiz-top { display: flex; align-items: flex-end; justify-content: space-between; gap: .7rem; }
.quiz-top h1 { margin-top: .18rem; font-size: clamp(1.75rem, 3.2vw, 2.55rem); }
.quiz-top h1 span { color: var(--muted); font-size: .66em; }
.overline { color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; }
.quiz-tools { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.save-badge { display: flex; align-items: center; gap: .35rem; padding: .35rem .48rem; border-radius: 7px; background: var(--accent-bg); color: var(--accent); font-size: .74rem; white-space: nowrap; font-weight: 800; }
.save-badge .icon { width: .95rem; height: .95rem; }
.button.timer { border-color: var(--line); background: var(--panel); font-variant-numeric: tabular-nums; }
.button.timer.overdue { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.quiz-progress { height: 7px; margin: .75rem 0 1rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.quiz-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .24s ease; }
.question-layout { position: relative; }
.with-drawer .question-layout { display: grid; grid-template-columns: minmax(190px, .36fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.question-panel { padding: clamp(13px, 2.45vw, 25px); }
.question-panel h2 { font-size: clamp(1.16rem, 2.45vw, 1.8rem); margin: .6rem 0 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.question-panel h2:focus { outline: none; }
.question-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .75rem; color: var(--muted); }
.marked .star-button { border-color: var(--amber-ink); color: var(--amber-ink); background: var(--amber); }
.marked .star-button .icon { fill: currentColor; }
.question-image { position: relative; display: block; width: 100%; max-height: 72dvh; background: var(--soft); border-radius: 13px; border: 1px solid var(--line); padding: .55rem; margin-bottom: 1rem; }
.question-image img { display: block; width: 100%; height: min(70dvh, 790px); object-fit: contain; border-radius: 9px; }
.question-image > .icon { position: absolute; right: 12px; bottom: 12px; width: 32px; height: 32px; padding: 6px; border-radius: 7px; background: var(--panel); }
.zoom-image { display: block; max-width: 100%; width: 100%; object-fit: contain; max-height: 82dvh; }
.answers { display: grid; gap: 9px; }
.answer { display: flex; width: 100%; min-height: 54px; gap: .75rem; align-items: center; padding: .65rem .8rem; text-align: left; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; overflow-wrap: anywhere; }
.answer:hover { border-color: var(--accent); background: var(--soft); }
.answer-letter { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border-radius: 7px; background: var(--soft); color: var(--ink); font-weight: 800; }
.study-mode .answer-letter { background: var(--answer-color); color: var(--answer-ink); }
.study-mode .answer { background: color-mix(in srgb, var(--answer-color) 40%, var(--panel)); }
:root[data-theme="dark"] .study-mode .answer { background: color-mix(in srgb, var(--answer-color) 13%, var(--panel)); }
:root[data-theme="contrast"] .study-mode .answer { background: var(--panel); }
.answers .answer.selected { border-color: var(--accent); background: var(--accent-bg); }
.answers .answer.correct { border-color: var(--accent); background: var(--accent-bg); }
.answers .answer.incorrect { border-color: var(--danger); background: var(--danger-bg); }
.answer:disabled { opacity: 1; }
.answer .icon:last-child { margin-left: auto; color: var(--accent); }
.answer.incorrect .icon:last-child { color: var(--danger); }
.question-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: 15px; }
.question-count { color: var(--muted); font-size: .8rem; font-weight: 750; }
.feedback { display: flex; align-items: flex-start; gap: .65rem; padding: .75rem; margin-top: 12px; border-radius: 9px; color: var(--accent); background: var(--accent-bg); }
.feedback.incorrect { color: var(--danger); background: var(--danger-bg); }
.feedback p { margin-top: .2rem; color: var(--ink); }
.feedback small { color: var(--muted); }
.year-drawer { position: sticky; top: 87px; padding: 11px; }
.year-drawer .section-heading { margin-bottom: 6px; }
.year-drawer h2 { font-size: 1rem; margin-left: 6px; }
.year-link { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .65rem .48rem; border-radius: 8px; border: 0; background: transparent; }
.year-link:hover, .year-link.current { background: var(--accent-bg); color: var(--accent); }
.year-link span { margin-left: auto; color: var(--muted); font-size: .78rem; }
.question-index { margin-top: 13px; }
.index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); gap: 6px; }
.index-grid button { min-width: 38px; min-height: 38px; padding: 4px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); font-weight: 800; }
.index-grid button.answered { background: var(--accent-bg); color: var(--accent); }
.index-grid button.current { border: 2px solid var(--accent); }
.result-hero { display: flex; align-items: center; gap: 1.08rem; }
.score-ring { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 103px; height: 103px; border-radius: 50%; background: conic-gradient(var(--accent) var(--score), var(--line) 0); }
.score-ring strong { display: grid; place-items: center; width: 82px; height: 82px; border-radius: 50%; background: var(--panel); font-size: 1.55rem; }
.result-group { display: grid; gap: .4rem; margin-top: .8rem; }
.result-group > div { display: flex; gap: .5rem; justify-content: space-between; }
progress { width: 100%; height: 9px; accent-color: var(--accent); }
.review { margin-top: .6rem; border: 1px solid var(--line); padding: .6rem .75rem; border-radius: 9px; }
.review summary { cursor: pointer; font-weight: 800; }
.review form, .review p { margin-top: .5rem; }
.review-image, .editor-image { display: block; max-width: 100%; max-height: 42dvh; object-fit: contain; margin: .65rem 0; border-radius: 8px; background: var(--soft); }
.filters { display: flex; gap: .65rem; align-items: end; flex-wrap: wrap; }
.filters .field { flex: 1 1 165px; }
.filters.compact .field { flex: 0 1 280px; }
.list-panel { margin-top: 14px; }
.list-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .square { width: 36px; height: 36px; border-radius: 9px; }
.list-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list-copy small { display: block; color: var(--muted); font-size: .77rem; }
.tabs { display: flex; gap: .38rem; flex-wrap: wrap; margin-bottom: 15px; }
.tabs button { padding: .52rem .65rem; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; font-weight: 800; }
.tabs button[aria-current] { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.admin-questions { margin-top: .75rem; }
.report-card { padding: .75rem 0; border-top: 1px solid var(--line); }
.report-card dt { font-weight: 750; }
.report-card dd { margin: 0 0 .45rem; white-space: pre-wrap; }
.import-matches { display: grid; gap: .5rem; max-height: 410px; overflow: auto; }
.import-matches .check { padding: .65rem; background: var(--soft); border-radius: 8px; }
.preview-choices { padding-left: 1.45rem; }
.preview-choices strong { color: var(--accent); }

@media (max-width: 1040px) {
  .app-layout { grid-template-columns: 205px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .hero-text { width: 67%; }
  .circuit { width: 52%; }
  .board, .board-shadow { width: 69%; left: 20%; top: 22%; }
  .quick-card { padding: 12px; gap: .55rem; }
}
@media (max-width: 780px) {
  .app-layout { display: block; }
  .sidebar { position: fixed; z-index: 15; inset: 0 auto 0 0; width: min(255px, 79vw); transform: translateX(-105%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .nav-open .sidebar { transform: none; visibility: visible; }
  .nav-open .mobile-backdrop { display: block; position: fixed; z-index: 14; inset: 0; background: #071a2599; border: 0; }
  #mobile-menu { display: inline-flex; }
  .topbar { min-height: 62px; }
  .topbar-left, .topbar-actions { gap: .45rem; }
  .profile-name { display: none; }
  .content { padding-top: 22px; }
  .hero h2 { font-size: clamp(2.15rem, 6.6vw, 3.4rem); }
  .auth-layout { grid-template-columns: .8fr 1fr; }
  .auth-art { padding: 25px; }
  .auth-copy h2 { font-size: clamp(2rem, 5.9vw, 3rem); }
}
@media (max-width: 560px) {
  .topbar { gap: .35rem; padding-inline: .65rem; }
  .breadcrumb { display: none; }
  .topbar-actions .button.top-exam { font-size: .76rem; min-height: 37px; padding-inline: .55rem; }
  .topbar-actions .icon-button { min-width: 36px; min-height: 36px; }
  .auth-layout { display: block; }
  .auth-art { display: none; }
  .auth-main { min-height: 100dvh; padding: 30px 20px; }
  .auth-mobile-brand { display: block; margin-bottom: 1.6rem; }
  .auth-mobile-brand .brand { color: var(--ink); }
  .auth-mobile-brand .brand > span:last-child span { color: var(--accent); }
  .page-title { align-items: flex-start; flex-direction: column; margin-bottom: 16px; }
  .hero { min-height: 267px; }
  .hero-text { width: 100%; padding: 19px 16px; }
  .hero h2 { font-size: clamp(2rem, 8.2vw, 2.85rem); }
  .hero p { max-width: 24ch; }
  .hero .circuit { width: 65%; opacity: .48; right: -13%; }
  .hero .board, .hero .board-shadow { top: 30%; width: 82%; left: 11%; }
  .hero-actions { gap: .45rem; }
  .hero-actions .button { min-height: 40px; padding-inline: .64rem; font-size: .81rem; }
  .dashboard-bottom, .settings-grid, .form-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; gap: 7px; }
  .quick-card { align-items: center; }
  .quick-card > div { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 2px .45rem; align-items: center; }
  .quick-card strong { grid-column: 2; grid-row: span 2; margin: 0; }
  .quick-card small { grid-column: 1; grid-row: 2; }
  .section-gap { margin-top: 20px; }
  .panel { padding: 13px; }
  .question-panel .section-heading { align-items: flex-start; }
  .question-panel .icon-button { min-width: 38px; min-height: 38px; }
  .question-image img { height: min(67dvh, 560px); }
  .with-drawer .question-layout { display: block; }
  .year-drawer { position: relative; top: auto; margin-bottom: 10px; }
  .question-count { order: 3; width: 100%; text-align: center; }
  .list-row { flex-wrap: wrap; }
  .list-row .row-actions { margin-left: auto; }
  .tour-card { right: 12px; bottom: 12px; width: calc(100% - 24px); }
}
@media (orientation: landscape) and (min-width: 600px) {
  .study-mode .answers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .study-mode .answer { min-height: 95px; align-items: flex-start; flex-direction: column; }
  .study-mode .answer .icon:last-child { margin-top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
