/* The kit: the design system every tool shares (Spin n’ Speak, Teamspin, Classboard).
   Forest ink on sky and paper, fox orange for actions, six bright accents. Rounded type (Nunito), stickers for big titles,
   pills for buttons and menus, soft cards. The fonts are served from this site (fonts/, SIL Open Font License),
   so no tool makes requests elsewhere. Each tool adds its own stylesheet after this one. */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("../fonts/nunito-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 700; font-display: swap; src: url("../fonts/fraunces-latin-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/fredoka-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Lilita One"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lilita-one-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Bungee"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/bungee-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Patrick Hand"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/patrick-hand-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/caveat-latin-wght-normal.woff2") format("woff2"); }

:root {
  --forest: #143E38; --night: #1A2926; --paper: #FFFCF4; --fox: #FF7B3A; --gold: #F3B530; --teal: #1FA89B;
  --c1: #FF7B3A; --c2: #F2B233; --c3: #1FB5A8; --c4: #4F8FD0; --c5: #A96BFF; --c6: #F0508A;
  --bg: #E3F4FB; --bg-2: #FFFCF4; --surface: #FFFCF4; --surface-2: #F3EEDD; --surface-3: #FFFFFF;
  --fg: #143E38; --muted: #56736D; --border: rgba(20,62,56,.14); --border-strong: rgba(20,62,56,.3); --hover: rgba(20,62,56,.07);
  --track: rgba(20,62,56,.16); --knob: #FFFFFF; --accent-text: #C4501A; --link: #0F6E60; --focus: #143E38;
  --sticker-fill: #143E38; --sticker-edge: #FFFCF4; --wheel-edge: rgba(255,252,244,.75);
  --glow-a: rgba(255,123,58,.22); --glow-b: rgba(79,143,208,.20); --glow-c: rgba(169,107,255,.16);
  --scrim: rgba(20,41,38,.62); --press: #C4501A; --on-fox: #143E38; --close-bg: #1A2926; --close-fg: #EAF3EE; --danger: #B3261E;
  --shadow: 0 14px 34px -16px rgba(20,48,44,.5), 0 2px 8px rgba(20,48,44,.1);
  --shadow-pop: 0 24px 60px -18px rgba(20,48,44,.45), 0 4px 14px rgba(20,48,44,.12);
  --font: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --r-sm: 14px; --r-md: 24px; --r-lg: 32px; --r-pill: 999px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101D1A; --bg-2: #1A2926; --surface: #1A2926; --surface-2: #223A35; --surface-3: #263F3A;
    --fg: #EAF3EE; --muted: #A8C0B9; --border: rgba(234,243,238,.16); --border-strong: rgba(234,243,238,.32); --hover: rgba(234,243,238,.08);
    --track: rgba(234,243,238,.22); --knob: #FFFCF4; --accent-text: #FF7B3A; --link: #1FA89B; --focus: #F3B530;
    --sticker-fill: #FFFCF4; --sticker-edge: #143E38; --wheel-edge: rgba(234,243,238,.35);
    --glow-a: rgba(255,123,58,.16); --glow-b: rgba(31,181,168,.14); --glow-c: rgba(169,107,255,.18);
    --scrim: rgba(4,10,9,.76); --press: #B4521F; --danger: #F3B0A6;
    --shadow: 0 14px 34px -16px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.2);
    --shadow-pop: 0 24px 60px -18px rgba(0,0,0,.7), 0 4px 14px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101D1A; --bg-2: #1A2926; --surface: #1A2926; --surface-2: #223A35; --surface-3: #263F3A;
  --fg: #EAF3EE; --muted: #A8C0B9; --border: rgba(234,243,238,.16); --border-strong: rgba(234,243,238,.32); --hover: rgba(234,243,238,.08);
  --track: rgba(234,243,238,.22); --knob: #FFFCF4; --accent-text: #FF7B3A; --link: #1FA89B; --focus: #F3B530;
  --sticker-fill: #FFFCF4; --sticker-edge: #143E38; --wheel-edge: rgba(234,243,238,.35);
  --glow-a: rgba(255,123,58,.16); --glow-b: rgba(31,181,168,.14); --glow-c: rgba(169,107,255,.18);
  --scrim: rgba(4,10,9,.76); --press: #B4521F; --danger: #F3B0A6;
  --shadow: 0 14px 34px -16px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.2);
  --shadow-pop: 0 24px 60px -18px rgba(0,0,0,.7), 0 4px 14px rgba(0,0,0,.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%; margin: 0; background: var(--bg); color: var(--fg);
  font: 700 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The sky: soft glows drifting behind everything */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 92%); }
.sky i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; background: radial-gradient(closest-side, var(--glow-a), transparent); animation: drift 40s ease-in-out infinite alternate; }
.sky i:nth-child(1) { left: -22vmax; top: -24vmax; }
.sky i:nth-child(2) { right: -26vmax; top: 4vh; background: radial-gradient(closest-side, var(--glow-b), transparent); animation-duration: 48s; animation-delay: -12s; }
.sky i:nth-child(3) { left: 18vw; bottom: -38vmax; background: radial-gradient(closest-side, var(--glow-c), transparent); animation-duration: 56s; animation-delay: -30s; }
@keyframes drift { to { transform: translate(7vmax, 5vmax) scale(1.1); } }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; max-width: 1320px; margin: 0 auto; padding-block: 14px 6px; position: relative; z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 900; font-size: 23px; letter-spacing: -.01em; }
.brand svg { width: 40px; height: 40px; flex: none; color: var(--fg); }
.spinner { transform-origin: 20px 21px; animation: spin 18s linear infinite; }
.brand b { color: var(--accent-text); font-weight: 900; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text small { margin-top: 3px; font-size: 12.5px; font-weight: 800; letter-spacing: .01em; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.top-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-pill); color: var(--fg); text-decoration: none; font-weight: 800; font-size: 15px; border: 2px solid transparent; }
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--fg); color: var(--bg-2); }
.nav .nav-new { border-color: var(--border-strong); border-style: dashed; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--gold); color: var(--forest); font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
.count-mine { background: var(--c3); color: var(--night); }

main { max-width: 1320px; margin: 0 auto; padding-block: 6px 28px; }

/* ---------- shared type and controls ---------- */
.eyebrow { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--link); }
.sticker {
  margin: 0; font-weight: 900; line-height: 1.02; letter-spacing: -.01em; color: var(--sticker-fill); text-wrap: balance;
  text-shadow: 3px 0 0 var(--sticker-edge), -3px 0 0 var(--sticker-edge), 0 3px 0 var(--sticker-edge), 0 -3px 0 var(--sticker-edge),
    2px 2px 0 var(--sticker-edge), -2px 2px 0 var(--sticker-edge), 2px -2px 0 var(--sticker-edge), -2px -2px 0 var(--sticker-edge),
    0 6px 0 var(--sticker-edge), 0 16px 28px rgba(20,48,44,.26);
}
.tagline { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: clamp(18px, 2vw, 24px); color: var(--muted); max-width: 46ch; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid transparent; border-radius: var(--r-pill); padding: 10px 18px; font-weight: 800; font-size: 16px; line-height: 1.2; cursor: pointer; text-decoration: none; color: var(--fg); background: transparent; transition: transform .08s; }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--fox); color: var(--on-fox); box-shadow: 0 4px 0 var(--press); }
.btn-primary:active { box-shadow: 0 1px 0 var(--press); transform: translateY(3px); }
.btn-soft { background: var(--surface-2); }
.btn-soft:hover { background: var(--hover); }
.btn-ghost { border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--hover); }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-lg { padding: 14px 24px; font-size: 18px; }
.btn-danger { color: var(--danger); }
.btn svg { width: 20px; height: 20px; flex: none; }
.linkbtn { border: 0; background: none; padding: 2px 4px; font-weight: 800; font-size: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pill { padding: 2px 10px; border-radius: var(--r-pill); background: var(--gold); color: var(--forest); font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.mini-lbl { font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chip-lgr { display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); background: #0F5FA8; color: #FFFFFF; font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.fine { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.field { width: 100%; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--border-strong); background: var(--surface-3); font-weight: 700; font-size: 16px; }
textarea.field { min-height: 240px; resize: vertical; line-height: 1.6; font-weight: 600; }
.field:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.field-label { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-weight: 900; font-size: 15px; }
.field-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.tip { border-radius: 16px; background: var(--surface-2); padding: 12px 16px; font-size: 15px; font-weight: 600; }
.tip summary { cursor: pointer; font-weight: 800; }
.tip p { margin: 8px 0 0; }
.tip code { font: 800 14px var(--font); padding: 1px 6px; border-radius: 6px; background: var(--surface); }
.ed-err { min-height: 0; margin: 0; color: var(--accent-text); font-weight: 800; }
.ed-err:empty { display: none; }

/* switches */
.sw { position: relative; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; line-height: 1.2; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-ui { position: relative; flex: none; width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--track); transition: background .2s; }
.sw-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .28s cubic-bezier(.3,1.5,.5,1); }
.sw input:checked + .sw-ui { background: var(--teal); }
.sw input:checked + .sw-ui::after { transform: translateX(18px); }
.sw input:focus-visible + .sw-ui { outline: 3px solid var(--focus); outline-offset: 2px; }

/* dropdown in the site's style */
.dd { position: relative; display: inline-block; }
.dd-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 14px; border: 2px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface-3); color: var(--fg); font-weight: 800; font-size: 14px; cursor: pointer; max-width: 100%; }
.dd-btn:hover { background: var(--hover); }
.dd-btn[aria-expanded="true"] { border-color: var(--fg); }
.dd-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-icon { width: 18px; height: 18px; flex: none; }
.dd-chev { width: 12px; height: 12px; flex: none; transition: transform .2s; }
.dd-btn[aria-expanded="true"] .dd-chev { transform: rotate(180deg); }
.dd-list { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; min-width: max(100%, 200px); max-width: min(360px, calc(100vw - 32px)); max-height: min(60vh, 380px); overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; border-radius: 18px; background: var(--surface); color: var(--fg); border: 1px solid var(--border); box-shadow: var(--shadow-pop); outline: none;
  animation: ddIn .16s ease-out; }
.dd-right .dd-list { left: auto; right: 0; }
.dd-up .dd-list { top: auto; bottom: calc(100% + 6px); }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dd-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 12px; font-weight: 800; font-size: 15px; cursor: pointer; }
.dd-list li svg { width: 16px; height: 16px; flex: none; opacity: 0; }
.dd-list li.is-active { background: var(--hover); }
.dd-list li[aria-selected="true"] { color: var(--link); }
.dd-list li[aria-selected="true"] svg { opacity: 1; }

/* segmented control */
.segc { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); }
.segc button { border: 0; padding: 7px 14px; border-radius: var(--r-pill); background: transparent; font-weight: 800; font-size: 14px; cursor: pointer; }
.segc button:hover { background: var(--hover); }
.segc button[aria-checked="true"] { background: var(--fg); color: var(--bg-2); }

.wheel-wrap { position: relative; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.wheel-wrap:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
.wheel-wrap.intro { animation: wheelIn .9s cubic-bezier(.2,1.25,.35,1) both; }
@keyframes wheelIn { from { opacity: 0; transform: scale(.78); } to { opacity: 1; transform: none; } }
.wheel-wrap canvas { display: block; touch-action: none; cursor: grab; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.spin-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.spin-btn { display: inline-flex; align-items: center; gap: 12px; border: 0; border-radius: var(--r-pill); padding: 16px 30px 16px 22px; background: var(--fox); color: var(--on-fox); font-weight: 900; font-size: clamp(22px, 2.1vw, 27px); letter-spacing: .01em; cursor: pointer; box-shadow: 0 6px 0 var(--press), var(--shadow); transition: transform .08s; }
.spin-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--press), var(--shadow); }
.spin-btn:disabled { cursor: default; opacity: .6; transform: none; }
.spin-btn svg { width: 30px; height: 30px; flex: none; }
.spin-btn:not(:disabled):hover svg { animation: spin 1.2s cubic-bezier(.3,.7,.3,1); }
.spin-sm { padding: 12px 24px 12px 18px; font-size: 20px; }
.spin-sm svg { width: 24px; height: 24px; }
.hint { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); line-height: 1.35; }
kbd { font: 800 12px var(--font); padding: 1px 7px; border-radius: 6px; border: 2px solid var(--border-strong); border-bottom-width: 3px; }
.panel { display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); }
.hist-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-size: 15px; font-weight: 900; }
.hist-head span + span { color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; padding: 8px; background: var(--surface-2); }
.tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border: 0; border-radius: 16px; background: transparent; font-weight: 900; font-size: 15px; cursor: pointer; color: var(--muted); }
.tabs button svg { width: 18px; height: 18px; flex: none; }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 2px 8px rgba(20,48,44,.12); }
.pane { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 22px; }
.pane-h { margin: 12px 0 2px; font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pane-h:first-child { margin-top: 0; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.theme-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; border: 2px solid transparent; border-radius: 16px; background: var(--surface-2); cursor: pointer; font-weight: 800; font-size: 12px; transition: transform .2s; }
.theme-tile:hover { transform: translateY(-2px); }
.theme-tile canvas { width: 64px; height: 64px; }
.theme-tile[aria-pressed="true"] { border-color: var(--fg); background: var(--surface-3); }
.pop { position: absolute; z-index: 20; width: min(300px, 100%); padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: ddIn .16s ease-out; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatch-row.is-off { opacity: .35; pointer-events: none; }
.sw-dot { position: relative; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 3px solid var(--surface-3); background: var(--c); box-shadow: 0 0 0 1.5px var(--border-strong); cursor: pointer; transition: transform .15s; }
.sw-dot:hover { transform: scale(1.12); }
.sw-dot[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--fg); }
.sw-custom { background: conic-gradient(#FF5E5B, #FFC15E, #B7E35A, #1FB5A8, #4F8FD0, #A96BFF, #F0508A, #FF5E5B); overflow: hidden; }
.sw-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: var(--r-pill); background: var(--forest); color: var(--paper); font-weight: 800; box-shadow: var(--shadow); transform: translate(-50%, 140%); opacity: 0; transition: transform .35s cubic-bezier(.2,1.3,.4,1), opacity .2s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; max-width: 1320px; margin: 0 auto; padding-block: 8px 24px; color: var(--muted); font-size: 13px; font-weight: 700; }
.foot p { margin: 0; max-width: 72ch; }

/* 404 page */
.lost { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 90vh; text-align: center; }
.lost h1 { font-size: clamp(32px, 5vw, 56px); }
.lost p { margin: 0; color: var(--muted); font-size: 18px; }

/* ---------- the tools menu and the tool cards ---------- */
.bob { animation: bob 3.2s ease-in-out infinite; }
.bob-2 { animation-delay: -1.6s; }
@keyframes bob { 50% { transform: translateY(-1.6px); } }
.tick { animation: tick 9s linear infinite; }
.twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 4.8s ease-in-out infinite; }
@keyframes twinkle { 0%, 80%, 100% { transform: none; } 88% { transform: rotate(-14deg) scale(1.15); } 94% { transform: rotate(8deg) scale(.96); } }
@keyframes tick { to { stroke-dashoffset: -37.7; } }
.tools { position: relative; }
.tools-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 14px; border: 2px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface-3); color: var(--fg); font-weight: 800; font-size: 14px; cursor: pointer; }
.tools-btn:hover { background: var(--hover); }
.tools-btn[aria-expanded="true"] { border-color: var(--fg); }
.tools-btn svg { width: 16px; height: 16px; flex: none; fill: currentColor; }
.tools-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(380px, calc(100vw - 32px)); padding: 14px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: ddIn .16s ease-out; }
.tools-pop ul { display: grid; gap: 4px; margin: 8px 0 10px; padding: 0; list-style: none; }
.tools-home { display: flex; align-items: center; gap: 10px; margin: -2px 0 10px; padding: 6px 10px 12px; border-bottom: 1px solid var(--border); color: var(--fg); font-size: 18px; text-decoration: none; }
.tools-home:hover { background: none; text-decoration: underline; text-underline-offset: 4px; }
.tools-home-logo { display: grid; width: 30px; height: 31px; flex: none; }
.tools-home-logo svg { width: 100%; height: 100%; }
.tool-link { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 16px; color: var(--fg); text-decoration: none; }
.tool-link:hover { background: var(--hover); }
.tool-link.is-here { background: var(--surface-2); }
.tool-link em { margin-left: auto; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface); font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tool-ico { flex: none; display: grid; place-items: center; color: var(--fg); }
.tool-ico svg { width: 36px; height: 38px; }
.tool-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tool-txt > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.tool-name { font-size: 17px; font-weight: 900; letter-spacing: -.01em; }
.tool-name b { color: var(--accent-text); font-weight: 900; }
.tool-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 18px; }
@media (max-width: 1180px) and (min-width: 601px) { .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool-card { --tint: rgba(255,123,58,.2); display: flex; align-items: center; gap: 16px; padding: 20px 20px 20px 22px; border-radius: var(--r-md); background: radial-gradient(circle at 0% 0%, var(--tint), transparent 62%), var(--surface); box-shadow: var(--shadow); color: var(--fg); text-decoration: none; transition: transform .3s cubic-bezier(.2,.9,.3,1.3); animation: rise .5s cubic-bezier(.2,.9,.3,1) both; }
.tool-card:hover { transform: translateY(-4px); }
.tool-card .tool-ico svg { width: 58px; height: 61px; }
.tool-card .tool-name { font-size: 22px; }
.tool-card .tool-txt > span { font-size: 15px; }
.tool-teamspin { --tint: rgba(31,181,168,.22); }
.tool-classboard { --tint: rgba(79,143,208,.24); }
.tool-starjar { --tint: rgba(243,181,48,.26); }
.tool-go { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; border-radius: 50%; background: var(--fox); color: var(--on-fox); transition: transform .3s cubic-bezier(.2,.9,.3,1.3); }
.tool-go svg { width: 22px; height: 22px; }
.tool-card:hover .tool-go { transform: translateX(4px); }

/* ---------- the class editor (classedit.js): a dialog any tool opens ---------- */
.cls-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--fg); box-shadow: var(--shadow-pop); overflow: auto; overscroll-behavior: contain; }
.cls-dialog::backdrop { background: var(--scrim); }
.cls-dialog[open] { animation: clsIn .32s cubic-bezier(.2,1.2,.4,1); }
@keyframes clsIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.cls-form { display: flex; flex-direction: column; gap: 8px; padding: clamp(18px, 4vw, 28px); }
.cls-title { margin: 0 0 4px; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 28px; line-height: 1.1; }
.cls-names { min-height: 220px; max-height: 46vh; font-weight: 700; line-height: 1.5; }
.cls-dupes { margin: 0; color: var(--accent-text); font-size: 14px; font-weight: 800; }
.cls-dupes:empty { display: none; }
.cls-private, .cls-backup { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px 8px; margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.4; }
.cls-private { flex-wrap: nowrap; }
.cls-private svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--link); }
.cls-backup { align-items: baseline; }
.cls-backup .linkbtn { font-size: 14px; }
.cls-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.cls-foot .btn-danger { margin-right: auto; }
.cls-foot .btn-danger.is-sure { background: var(--danger); border-color: var(--danger); color: var(--surface); }

/* ---------- narrower screens ---------- */
@media (max-width: 1050px) {
  .brand-text small { display: none; }
}
@media (max-width: 600px) {
  .brand { font-size: 20px; }
  .brand svg { width: 34px; height: 34px; }
  .nav a { padding: 6px 11px; font-size: 14px; }
  .tools-btn span { display: none; }
  .tools-btn { padding: 7px 12px; }
  .tabs button span { font-size: 13px; }
  .pane { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
