/* ==========================================================================
   Class ON Tools — design system
   Matches classonapp.com: Plus Jakarta Sans, brand red #DF3939, navy #16274A,
   yellow #FFB30C highlights, white cards with soft shadows.
   ========================================================================== */

:root {
  --co-red: #DF3939;
  --co-red-600: #CF3232;
  --co-red-700: #B92B29;
  --co-red-800: #942220;
  --co-red-900: #6E1615;
  --co-red-50: #FDF2F2;
  --co-red-100: #FADBDB;
  --co-navy: #16274A;
  --co-navy-900: #0F1B3D;
  --co-navy-700: #2A3C63;
  --co-yellow: #FFB30C;
  --co-yellow-50: #FFF7E3;

  --co-ink: #16274A;
  --co-text: #4A5466;
  --co-muted: #6C757D;
  --co-faint: #9AA3AE;
  --co-bg: #FFFFFF;
  --co-bg-soft: #F9F4F4;
  --co-bg-grey: #F4F6F9;
  --co-border: #E6E9EF;
  --co-border-strong: #D5DAE3;

  --co-green: #15A150;
  --co-green-50: #EAF8F0;
  --co-amber: #E59700;
  --co-amber-50: #FFF6E0;
  --co-blue: #2563EB;
  --co-blue-50: #EEF4FF;

  --sub-maths: #DF3939;
  --sub-science: #0E9F8E;
  --sub-english: #7C3AED;
  --sub-languages: #DB2777;
  --sub-sst: #E8770E;
  --sub-study: #2563EB;
  --sub-teacher: #16274A;

  --c: var(--co-red);              /* per-element accent (subject colour) */

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow: 0 4px 12px rgba(0, 0, 0, .08);
  --shadow-lg: 0 22px 44px -16px rgba(22, 39, 74, .22);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --container: 1200px;
  --header-h: 72px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--co-text);
  background: var(--co-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
img { display: block; height: auto; }
a { color: var(--co-red); text-decoration: none; }
a:hover { color: var(--co-red-700); }
h1, h2, h3, h4, h5 { color: var(--co-ink); font-weight: 800; line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 900; }
h2 { font-size: clamp(26px, 3.4vw, 40px); }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(223, 57, 57, .45); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--co-red-100); color: var(--co-navy); }
hr { border: 0; border-top: 1px solid var(--co-border); margin: 20px 0; }
kbd, .co-kbd {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  background: #fff; border: 1px solid var(--co-border-strong); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 6px; color: var(--co-navy);
}
code, .co-code {
  font-family: var(--mono); font-size: .92em; background: #F1F3F8; color: var(--co-navy);
  padding: 2px 6px; border-radius: 6px;
}

.hl { color: var(--co-red); }
.hl-y { color: var(--co-yellow); }
.muted { color: var(--co-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.w-100 { width: 100%; }
.print-only { display: none; }

/* ---------- Layout ---------- */
.co-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.co-container-sm { max-width: 860px; }
.co-section { padding: 72px 0; }
.co-section-sm { padding: 44px 0; }
.co-bg-soft { background: var(--co-bg-soft); }
.co-bg-grey { background: var(--co-bg-grey); }

.co-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.co-row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.co-stack { display: flex; flex-direction: column; gap: 16px; }
.co-stack-sm { display: flex; flex-direction: column; gap: 10px; }
.co-grid { display: grid; gap: 20px; }
.co-grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.co-grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.co-grid-4 { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.co-grid-auto { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* Controls on the left, output on the right */
.co-tool-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.co-tool-layout.wide-left { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
.co-sticky { position: sticky; top: calc(var(--header-h) + 16px); }

@media (max-width: 980px) {
  .co-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-tool-layout, .co-tool-layout.wide-left { grid-template-columns: minmax(0, 1fr); }
  .co-sticky { position: static; }
}
@media (max-width: 620px) {
  .co-grid-2, .co-grid-3, .co-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .co-section { padding: 52px 0; }
}

/* ---------- Header ---------- */
.co-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent; transition: box-shadow .25s, border-color .25s;
}
.co-header.scrolled { box-shadow: 0 8px 24px -14px rgba(22, 39, 74, .28); border-color: var(--co-border); }
.co-header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.co-logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.co-logo img { height: 38px; width: auto; }
.co-nav { display: flex; align-items: center; gap: 6px; }
.co-nav > a, .co-nav-dd > button {
  display: inline-flex; align-items: center; gap: 4px; padding: 9px 13px; border-radius: 9px;
  font-weight: 600; font-size: 15px; color: var(--co-navy); background: none; border: 0;
}
.co-nav > a:hover, .co-nav-dd > button:hover, .co-nav > a.active { color: var(--co-red); background: var(--co-red-50); }
.co-nav .co-btn { margin-left: 8px; }
.co-nav > a.co-btn-primary { background: var(--co-red); border-color: var(--co-red); color: #fff; padding: 11px 18px; font-size: 14.5px; }
.co-nav > a.co-btn-primary:hover { background: var(--co-red-700); border-color: var(--co-red-700); color: #fff; }
.co-nav-dd { position: relative; }
.co-nav-dd-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(6px);
  min-width: 260px; background: #fff; border: 1px solid var(--co-border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; opacity: 0; visibility: hidden; transition: .18s;
}
.co-nav-dd:hover .co-nav-dd-menu, .co-nav-dd:focus-within .co-nav-dd-menu, .co-nav-dd.open .co-nav-dd-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.co-nav-dd-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--co-navy); font-weight: 600; font-size: 14.5px; }
.co-nav-dd-menu a:hover { background: var(--co-bg-grey); }
.co-nav-dd-menu a i { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); font-size: 16px; }
.co-nav-dd-menu a small { margin-left: auto; color: var(--co-faint); font-weight: 700; }
.co-header-search {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-left: 6px;
  border: 1px solid var(--co-border); border-radius: 10px; background: var(--co-bg-grey);
  color: var(--co-muted); font-size: 14px; font-weight: 500; min-width: 190px;
}
.co-header-search:hover { border-color: var(--co-border-strong); color: var(--co-navy); }
.co-header-search kbd { margin-left: auto; }
.co-menu-btn { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--co-border); background: #fff; color: var(--co-navy); font-size: 22px; place-items: center; }

@media (max-width: 1080px) { .co-header-search { min-width: 0; } .co-header-search span, .co-header-search kbd { display: none; } }
@media (max-width: 900px) {
  .co-menu-btn { display: inline-grid; }
  /* Closed menu is display:none (an off-screen transform would widen the page on phones).
     The header's backdrop-filter makes it the containing block, so height is set explicitly. */
  .co-nav {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
    height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
    flex-direction: column; align-items: stretch;
    background: #fff; padding: 16px 20px 32px; gap: 4px; overflow-y: auto; border-top: 1px solid var(--co-border);
  }
  .co-nav.open { display: flex; animation: co-nav-in .22s ease; }
  .co-nav > a, .co-nav-dd > button { padding: 13px 12px; font-size: 16px; width: 100%; justify-content: flex-start; }
  .co-nav-dd-menu { position: static; transform: none !important; opacity: 1; visibility: visible; box-shadow: none; border: 0; padding: 0 0 0 8px; display: none; }
  .co-nav-dd.open .co-nav-dd-menu { display: block; }
  .co-nav .co-btn { margin: 12px 0 0; }
  .co-header-search { margin: 0 0 8px; height: 46px; }
  .co-header-search span { display: inline; }
}
@media (max-width: 420px) { .co-logo img { height: 32px; } }
@keyframes co-nav-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.co-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1.1 var(--font); padding: 13px 22px; border-radius: 8px;
  border: 1.6px solid transparent; background: none; color: var(--co-navy);
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s, transform .18s;
}
.co-btn i { font-size: 1.15em; line-height: 1; }
.co-btn:hover { transform: translateY(-1px); }
.co-btn:active { transform: translateY(0); }
.co-btn-primary { background: var(--co-red); border-color: var(--co-red); color: #fff; }
.co-btn-primary:hover { background: var(--co-red-700); border-color: var(--co-red-700); color: #fff; box-shadow: 0 10px 20px -8px rgba(223, 57, 57, .6); }
.co-btn-navy { background: var(--co-navy); border-color: var(--co-navy); color: #fff; }
.co-btn-navy:hover { background: var(--co-navy-900); color: #fff; box-shadow: 0 10px 20px -8px rgba(22, 39, 74, .55); }
.co-btn-outline { background: #fff; border-color: var(--co-border-strong); color: var(--co-navy); }
.co-btn-outline:hover { border-color: var(--co-red); color: var(--co-red); }
.co-btn-ghost { background: transparent; color: var(--co-navy); }
.co-btn-ghost:hover { background: var(--co-bg-grey); color: var(--co-red); }
.co-btn-soft { background: var(--co-red-50); color: var(--co-red); border-color: var(--co-red-50); }
.co-btn-soft:hover { background: var(--co-red-100); color: var(--co-red-700); }
.co-btn-white { background: #fff; color: var(--co-red-800); border-color: #fff; }
.co-btn-white:hover { background: var(--co-yellow); border-color: var(--co-yellow); color: var(--co-navy); }
.co-btn-glass { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .45); }
.co-btn-glass:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.co-btn-success { background: var(--co-green); border-color: var(--co-green); color: #fff; }
.co-btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 8px; }
.co-btn-lg { padding: 16px 30px; font-size: 16.5px; }
.co-btn-block { width: 100%; }
.co-btn:disabled, .co-btn.disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.co-icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 10px; display: inline-grid; place-items: center;
  border: 1px solid var(--co-border); background: #fff; color: var(--co-navy); font-size: 18px; transition: .18s;
}
.co-icon-btn:hover { border-color: var(--co-red); color: var(--co-red); }
.co-icon-btn.active { background: var(--co-red-50); border-color: var(--co-red-100); color: var(--co-red); }
.co-icon-btn-sm { width: 32px; height: 32px; font-size: 15px; border-radius: 8px; }

/* ---------- Forms ---------- */
.co-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.co-label { font-size: 13.5px; font-weight: 700; color: var(--co-navy); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.co-hint { font-size: 12.5px; color: var(--co-muted); }
.co-input, .co-select, .co-textarea {
  width: 100%; font: 500 15px/1.4 var(--font); color: var(--co-navy); background: #fff;
  border: 1.5px solid #DADFE7; border-radius: 10px; padding: 11px 14px; outline: none;
  transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.co-input::placeholder, .co-textarea::placeholder { color: #A9B0BB; font-weight: 400; }
.co-input:focus, .co-select:focus, .co-textarea:focus { border-color: var(--co-red); box-shadow: 0 0 0 4px rgba(223, 57, 57, .12); }
.co-input.invalid, .co-select.invalid, .co-textarea.invalid { border-color: #E5484D; background: #FFF8F8; }
.co-input-lg { font-size: 20px; font-weight: 700; padding: 14px 16px; }
.co-input-xl { font-size: 30px; font-weight: 800; padding: 14px 18px; text-align: center; letter-spacing: .02em; }
.co-textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.co-select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2316274A'%3E%3Cpath d='M12 15.6 6.4 10h11.2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 20px;
}
.co-input-group { display: flex; align-items: stretch; }
.co-input-group > .co-input { border-radius: 10px 0 0 10px; }
.co-input-group > .co-addon {
  display: grid; place-items: center; padding: 0 14px; background: var(--co-bg-grey); border: 1.5px solid #DADFE7;
  border-left: 0; border-radius: 0 10px 10px 0; font-weight: 700; color: var(--co-muted); font-size: 14px; white-space: nowrap;
}
.co-input-group > .co-addon:first-child { border-left: 1.5px solid #DADFE7; border-right: 0; border-radius: 10px 0 0 10px; }
.co-input-group > .co-addon:first-child + .co-input { border-radius: 0 10px 10px 0; }
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: var(--co-red); }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; }
.co-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--co-navy); cursor: pointer; }
.co-range { width: 100%; height: 6px; cursor: pointer; }
input[type="color"] { width: 44px; height: 40px; border: 1.5px solid #DADFE7; border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }

/* Segmented control: <div class="co-seg"><button class="active" data-value="a">A</button>…</div> */
.co-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--co-bg-grey); border: 1px solid var(--co-border); border-radius: 12px; max-width: 100%; }
.co-seg > button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent;
  padding: 9px 15px; border-radius: 9px; font: 600 14px/1.2 var(--font); color: var(--co-muted); transition: .15s; flex: 1 1 auto;
}
.co-seg > button:hover { color: var(--co-navy); }
.co-seg > button.active { background: #fff; color: var(--co-red); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.co-seg.co-seg-block { display: flex; width: 100%; }

/* Choice pills: <div class="co-pills"><button class="co-pill active">…</button></div> */
.co-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.co-pill {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid #DADFE7; background: #fff;
  border-radius: 999px; padding: 7px 14px; font: 600 13.5px/1.2 var(--font); color: var(--co-navy); transition: .15s;
}
.co-pill:hover { border-color: var(--co-red); color: var(--co-red); }
.co-pill.active { background: var(--co-red); border-color: var(--co-red); color: #fff; }
.co-pill.active.navy { background: var(--co-navy); border-color: var(--co-navy); }

/* ---------- Chips, tags, badges ---------- */
.co-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; line-height: 1.3;
  padding: 5px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--co-border); color: var(--co-navy);
}
.co-chip i { color: var(--co-red); font-size: 14px; }
.co-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 11%, #fff); line-height: 1.3;
}
.co-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; line-height: 1.4; }
.co-badge-new { background: var(--co-yellow); color: #4A3300; }
.co-badge-hot { background: var(--co-red); color: #fff; }
.co-badge-green { background: var(--co-green-50); color: var(--co-green); }
.co-badge-navy { background: var(--co-navy); color: #fff; }

/* ---------- Cards & panels ---------- */
.co-card { background: #fff; border: 1px solid var(--co-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 24px; min-width: 0; }
.co-card-lg { padding: 32px; }
.co-card-flat { box-shadow: none; }
.co-card-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: var(--co-navy); margin: 0 0 4px; }
.co-card-title i { color: var(--co-red); font-size: 20px; }
.co-card-sub { color: var(--co-muted); font-size: 14px; margin: 0 0 18px; }
.co-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.co-card-head .co-card-sub { margin: 0; }
.co-panel { background: var(--co-bg-grey); border: 1px solid var(--co-border); border-radius: 14px; padding: 18px; }
.co-divider { height: 1px; background: var(--co-border); margin: 18px 0; border: 0; }
.co-empty { text-align: center; padding: 40px 20px; color: var(--co-muted); }
.co-empty i { font-size: 44px; color: var(--co-border-strong); display: block; margin-bottom: 8px; }
.co-empty h3 { margin-bottom: 6px; }
@media (max-width: 620px) { .co-card { padding: 18px; } .co-card-lg { padding: 22px; } }

/* ---------- Results ---------- */
.co-result {
  background: linear-gradient(135deg, #FFF4F4 0%, #FFFFFF 70%); border: 1.5px solid var(--co-red-100);
  border-radius: var(--radius-lg); padding: 20px 22px; position: relative; overflow: hidden;
}
.co-result-label { font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--co-muted); margin-bottom: 4px; }
.co-result-big { font-size: clamp(28px, 4.6vw, 44px); font-weight: 800; color: var(--co-red); line-height: 1.1; word-break: break-word; }
.co-result-sub { color: var(--co-text); margin-top: 6px; font-size: 15px; }
.co-result.success { background: linear-gradient(135deg, #ECFAF2, #fff 70%); border-color: #BDE8CF; }
.co-result.success .co-result-big { color: var(--co-green); }
.co-result.navy { background: linear-gradient(135deg, #EEF2FA, #fff 70%); border-color: #D3DCEE; }
.co-result.navy .co-result-big { color: var(--co-navy); }
.co-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.co-stat { background: #fff; border: 1px solid var(--co-border); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.co-stat b { display: block; font-size: 24px; font-weight: 800; color: var(--co-navy); line-height: 1.2; word-break: break-word; }
.co-stat span { display: block; font-size: 12.5px; color: var(--co-muted); font-weight: 600; margin-top: 2px; }
/* A stacked fraction inside a stat must stay inline-flex — the rule above would otherwise flatten it */
.co-stat .frac { display: inline-flex; font-size: inherit; color: inherit; font-weight: inherit; margin-top: 0; }
.co-stat.accent b { color: var(--co-red); }
.co-stat.green b { color: var(--co-green); }

/* Step-by-step working */
.co-steps { list-style: none; counter-reset: co-step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.co-steps > li {
  counter-increment: co-step; position: relative; padding: 12px 16px 12px 54px; background: #fff;
  border: 1px solid var(--co-border); border-radius: 12px; color: var(--co-navy); font-weight: 500; line-height: 1.55;
}
.co-steps > li::before {
  content: counter(co-step); position: absolute; left: 14px; top: 11px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--co-red); color: #fff; font-weight: 800; font-size: 12.5px; display: grid; place-items: center;
}
.co-steps > li small, .co-steps > li .note { display: block; color: var(--co-muted); font-weight: 500; font-size: 13.5px; margin-top: 2px; }
.co-steps > li.final { background: var(--co-red-50); border-color: var(--co-red-100); font-weight: 700; }
.co-steps > li.final::before { content: '✓'; background: var(--co-green); }
.co-formula {
  display: inline-block; background: var(--co-navy); color: #fff; padding: 6px 12px; border-radius: 8px;
  font-family: var(--mono); font-weight: 600; font-size: 14px; letter-spacing: .01em; line-height: 1.5;
}
.co-formula.light { background: var(--co-bg-grey); color: var(--co-navy); border: 1px solid var(--co-border); }
.co-math { font-family: var(--mono); font-weight: 600; color: var(--co-navy); }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.15; margin: 0 2px; font-weight: 700; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px; }
.frac > span:last-child { padding: 0 3px; }

/* ---------- Tables ---------- */
.co-table-wrap { overflow: auto; border: 1px solid var(--co-border); border-radius: 12px; background: #fff; }
.co-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.co-table th { background: var(--co-navy); color: #fff; text-align: left; padding: 11px 14px; font-weight: 700; white-space: nowrap; font-size: 13px; letter-spacing: .02em; }
.co-table td { padding: 10px 14px; border-top: 1px solid var(--co-border); color: var(--co-navy); vertical-align: top; }
.co-table tbody tr:nth-child(even) td { background: #FAFBFD; }
.co-table tbody tr:hover td { background: var(--co-red-50); }
.co-table.compact th, .co-table.compact td { padding: 7px 10px; }
.co-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Alerts ---------- */
.co-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; border: 1px solid; line-height: 1.5; }
.co-alert i { font-size: 18px; line-height: 1.2; }
.co-alert-info { background: var(--co-blue-50); border-color: #D3E1FD; color: #1E3A8A; }
.co-alert-success { background: var(--co-green-50); border-color: #BDE8CF; color: #0E6B37; }
.co-alert-warn { background: var(--co-amber-50); border-color: #F7DFA5; color: #7A5000; }
.co-alert-error { background: #FFF1F1; border-color: var(--co-red-100); color: #9B1C1C; }

/* ---------- Progress ---------- */
.co-progress { height: 8px; background: var(--co-bg-grey); border-radius: 999px; overflow: hidden; }
.co-progress > span { display: block; height: 100%; width: 0; background: var(--co-red); border-radius: inherit; transition: width .3s ease; }
.co-progress.green > span { background: var(--co-green); }
.co-progress.lg { height: 12px; }

/* ---------- Quiz components ---------- */
.co-quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; font-weight: 700; color: var(--co-navy); font-size: 14px; }
.co-quiz-q { font-size: clamp(22px, 3.4vw, 32px); font-weight: 800; color: var(--co-navy); text-align: center; margin: 18px 0 22px; line-height: 1.3; }
.co-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.co-option {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border-radius: 12px;
  border: 1.5px solid #DADFE7; background: #fff; font: 600 15.5px/1.35 var(--font); color: var(--co-navy); transition: .15s;
}
.co-option .key { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--co-bg-grey); font-size: 13px; font-weight: 800; color: var(--co-muted); }
.co-option:hover:not(:disabled) { border-color: var(--co-red); background: var(--co-red-50); }
.co-option.correct { border-color: var(--co-green); background: var(--co-green-50); color: #0E6B37; }
.co-option.correct .key { background: var(--co-green); color: #fff; }
.co-option.wrong { border-color: #E5484D; background: #FFF1F1; color: #9B1C1C; }
.co-option.wrong .key { background: #E5484D; color: #fff; }
.co-option:disabled { cursor: default; }
@media (max-width: 620px) { .co-options { grid-template-columns: minmax(0, 1fr); } }
.co-feedback { margin-top: 14px; }
.co-score-ring { --p: 0; width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--co-red) calc(var(--p) * 1%), var(--co-bg-grey) 0); }
.co-score-ring > div { width: 112px; height: 112px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.co-score-ring b { font-size: 30px; font-weight: 800; color: var(--co-navy); line-height: 1; display: block; }
.co-score-ring span { font-size: 12px; color: var(--co-muted); font-weight: 700; }

/* ---------- Tool page hero ---------- */
.co-tool-hero {
  position: relative; padding: 26px 0 30px;
  background:
    radial-gradient(900px 260px at 95% -20%, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%),
    linear-gradient(180deg, #FBF3F3 0%, #FFFFFF 100%);
  border-bottom: 1px solid #F1E6E6;
}
.co-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; font-weight: 600; color: var(--co-muted); margin-bottom: 18px; }
.co-crumbs a { color: var(--co-muted); }
.co-crumbs a:hover { color: var(--co-red); }
.co-crumbs i { font-size: 16px; color: var(--co-faint); }
.co-crumbs span { color: var(--co-navy); }
.co-tool-head { display: flex; align-items: flex-start; gap: 20px; }
.co-tool-icon {
  width: 66px; height: 66px; flex: none; border-radius: 18px; display: grid; place-items: center; color: #fff; font-size: 30px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 72%, #000));
  box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--c) 70%, transparent);
}
.co-tool-icon .glyph, .tool-ico .glyph { font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: -.02em; font-family: var(--font); }
.co-tool-head-text { flex: 1; min-width: 0; }
.co-tool-head h1 { font-size: clamp(26px, 3.6vw, 40px); margin: 0 0 8px; }
.co-tool-head p { margin: 0 0 14px; font-size: 16.5px; max-width: 760px; color: var(--co-text); }
.co-tool-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.co-tool-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 760px) {
  .co-tool-head { flex-wrap: wrap; gap: 14px; }
  .co-tool-icon { width: 54px; height: 54px; font-size: 25px; border-radius: 15px; }
  .co-tool-actions { width: 100%; }
}

.co-tool-body { padding: 30px 0 20px; }
.co-tool-info { padding: 56px 0 24px; }

/* Presentation (classroom / smartboard) mode */
.co-presenting { background: #fff; overflow: auto; padding: 24px; }
.co-presenting .co-container { max-width: 1400px; }
body.co-present-mode .co-tool-body { padding-top: 16px; }

/* ---------- Section headings ---------- */
.co-section-head { text-align: center; max-width: 780px; margin: 0 auto 34px; }
.co-section-head.left { text-align: left; margin-left: 0; }
.co-section-head p { color: var(--co-muted); font-size: 16.5px; margin: 0; }
.co-eyebrow { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--co-muted); margin-bottom: 10px; }
.co-h-sm { font-size: clamp(22px, 2.6vw, 30px); }

/* How-to & concept blocks */
.co-howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; counter-reset: co-how; }
.co-howto-item { counter-increment: co-how; background: #fff; border: 1px solid var(--co-border); border-radius: 16px; padding: 20px; position: relative; }
.co-howto-item::before {
  content: counter(co-how, decimal-leading-zero); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--co-red-50); color: var(--co-red); font-weight: 800; font-size: 14px; margin-bottom: 12px;
}
.co-howto-item h4 { margin: 0 0 4px; font-size: 16px; }
.co-howto-item p { margin: 0; font-size: 14px; color: var(--co-muted); }
.co-learn { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.co-learn-item { background: #fff; border: 1px solid var(--co-border); border-radius: 16px; padding: 22px; }
.co-learn-item h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 16.5px; }
.co-learn-item h4 i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--co-red-50); color: var(--co-red); font-size: 18px; flex: none; }
.co-learn-item p, .co-learn-item li { font-size: 14.5px; color: var(--co-text); }
.co-learn-item p:last-child, .co-learn-item ul:last-child { margin-bottom: 0; }
.co-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.co-checks li { position: relative; padding-left: 28px; color: var(--co-navy); font-weight: 500; }
.co-checks li::before { content: '\eb7b'; font-family: 'remixicon'; position: absolute; left: 0; top: 0; color: var(--co-red); font-size: 18px; line-height: 1.4; }
.co-tip { display: flex; gap: 12px; align-items: flex-start; background: var(--co-yellow-50); border: 1px solid #F8E2AE; border-radius: 14px; padding: 14px 16px; color: #5C4300; font-size: 14.5px; }
.co-tip i { color: var(--co-amber); font-size: 20px; line-height: 1.3; }

/* ---------- Tool cards (hub + related) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--co-border);
  border-radius: 18px; padding: 22px; color: inherit; overflow: hidden; min-width: 0;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.tool-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 32%, var(--co-border)); color: inherit; }
.tool-card:hover::before { transform: scaleX(1); }
.tool-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tool-ico {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 25px; flex: none;
  color: var(--c); background: color-mix(in srgb, var(--c) 11%, #fff); transition: .22s;
}
.tool-card:hover .tool-ico { background: var(--c); color: #fff; transform: rotate(-6deg) scale(1.04); }
.tool-ico .glyph { font-size: 21px; }
.tool-ico .glyph.g1 { font-size: 27px; }
.tool-card-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tool-card h3 { font-size: 17.5px; margin: 0 0 8px; color: var(--co-navy); line-height: 1.3; }
.tool-card p { font-size: 14px; color: var(--co-muted); margin: 0 0 14px; line-height: 1.55; flex: 1; }
.tool-feats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tool-feat { font-size: 11.5px; font-weight: 600; color: var(--co-text); background: var(--co-bg-grey); padding: 3px 8px; border-radius: 6px; }
.tool-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--co-border); font-size: 13px; font-weight: 700; color: var(--co-muted); }
.tool-card-foot .cls { display: inline-flex; align-items: center; gap: 5px; }
.tool-open { color: var(--co-red); display: inline-flex; align-items: center; gap: 4px; }
.tool-open i { transition: transform .2s; }
.tool-card:hover .tool-open i { transform: translateX(4px); }
.tool-fav {
  position: absolute; right: 14px; bottom: 54px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--co-border);
  background: #fff; color: var(--co-faint); display: grid; place-items: center; font-size: 16px; opacity: 0; transition: .18s; z-index: 2;
}
.tool-card:hover .tool-fav, .tool-fav.on { opacity: 1; }
.tool-fav.on { color: var(--co-yellow); border-color: #F8E2AE; background: var(--co-yellow-50); }
.tool-fav:hover { color: var(--co-yellow); border-color: var(--co-yellow); }
@media (hover: none) { .tool-fav { opacity: 1; } }

/* ---------- Class ON promo (CTA) ---------- */
.co-cta-wrap { padding: 40px 0 64px; }
.co-cta {
  position: relative; overflow: hidden; border-radius: 24px; color: #fff; padding: 48px;
  background: linear-gradient(115deg, #7E1917 0%, #A82422 48%, #D63636 100%);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center;
}
.co-cta::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent 30%, #000 100%); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}
.co-cta > * { position: relative; }
.co-cta .co-eyebrow { color: var(--co-yellow); margin-bottom: 8px; letter-spacing: .06em; text-transform: none; font-size: 14px; }
.co-cta h2 { color: #fff; font-size: clamp(24px, 3vw, 34px); margin-bottom: 10px; }
.co-cta p { color: rgba(255, 255, 255, .85); margin-bottom: 22px; }
.co-cta-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.co-cta-feat { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; padding: 13px 14px; font-weight: 700; font-size: 14px; backdrop-filter: blur(4px); }
.co-cta-feat i { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--co-red); display: grid; place-items: center; font-size: 18px; flex: none; }
@media (max-width: 860px) { .co-cta { grid-template-columns: minmax(0, 1fr); padding: 34px 24px; } }
@media (max-width: 420px) { .co-cta-feats { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.co-footer { background: var(--co-navy-900); color: rgba(255, 255, 255, .72); padding: 56px 0 0; font-size: 14.5px; }
.co-footer a { color: rgba(255, 255, 255, .72); }
.co-footer a:hover { color: #fff; }
.co-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.co-footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.co-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.co-footer-brand img { height: 38px; margin-bottom: 14px; }
.co-footer-brand p { max-width: 340px; }
.co-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 18px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13.5px; }
@media (max-width: 860px) { .co-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .co-footer-grid { grid-template-columns: 1fr; } }

/* ---------- Toast ---------- */
.co-toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.co-toast {
  display: flex; align-items: center; gap: 10px; background: var(--co-navy); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 600; font-size: 14.5px; box-shadow: 0 16px 36px -12px rgba(15, 27, 61, .5); animation: co-toast-in .25s ease;
}
.co-toast i { font-size: 18px; }
.co-toast.success i { color: #5EE69A; }
.co-toast.error { background: #9B1C1C; }
.co-toast.out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes co-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.co-modal-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(15, 27, 61, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: co-fade .2s ease; }
.co-modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); animation: co-pop .22s ease; }
.co-modal.lg { max-width: 860px; }
.co-modal.xl { max-width: 1100px; }
.co-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--co-border); position: sticky; top: 0; background: #fff; z-index: 1; }
.co-modal-head h3 { margin: 0; font-size: 18px; }
.co-modal-body { padding: 22px; }
.co-modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--co-border); background: #FAFBFC; }
@keyframes co-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes co-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* Command palette (quick tool search) */
.co-palette { max-width: 620px; align-self: start; margin-top: 10vh; }
.co-palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--co-border); }
.co-palette-input i { font-size: 20px; color: var(--co-muted); }
.co-palette-input input { flex: 1; border: 0; outline: none; font-size: 17px; font-weight: 600; color: var(--co-navy); background: none; min-width: 0; }
.co-palette-list { max-height: 56vh; overflow: auto; padding: 8px; }
.co-palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--co-navy); font-weight: 600; }
.co-palette-item .tool-ico { width: 38px; height: 38px; font-size: 18px; border-radius: 10px; }
.co-palette-item .tool-ico .glyph { font-size: 15px; }
.co-palette-item small { display: block; color: var(--co-muted); font-weight: 500; font-size: 12.5px; }
.co-palette-item.active, .co-palette-item:hover { background: var(--co-red-50); color: var(--co-navy); }
.co-palette-item .go { margin-left: auto; color: var(--co-red); opacity: 0; }
.co-palette-item.active .go { opacity: 1; }

/* ---------- Misc ---------- */
.co-reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.co-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .co-reveal { opacity: 1; transform: none; }
}
.co-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 1100; }
.co-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.co-canvas-wrap { position: relative; width: 100%; background: #fff; border: 1px solid var(--co-border); border-radius: 14px; overflow: hidden; }
.co-canvas-wrap canvas { display: block; width: 100%; }
.co-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; font-weight: 600; color: var(--co-navy); }
.co-legend span { display: inline-flex; align-items: center; gap: 6px; }
.co-legend span::before { content: ''; width: 12px; height: 12px; border-radius: 4px; background: var(--dot, var(--co-red)); }
.co-spinner { width: 22px; height: 22px; border: 3px solid var(--co-red-100); border-top-color: var(--co-red); border-radius: 50%; animation: co-spin .8s linear infinite; display: inline-block; }
@keyframes co-spin { to { transform: rotate(360deg); } }

/* ---------- Print ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #000; font-size: 12pt; }
  .co-header, .co-footer, .co-cta-wrap, .co-related, .co-tool-info, .co-filter-bar, .co-tool-actions, .co-crumbs,
  .co-toast-wrap, .no-print, .co-modal-backdrop { display: none !important; }
  .print-only { display: block !important; }
  .co-tool-hero { background: none !important; border: 0; padding: 0 0 10px; }
  .co-tool-icon { box-shadow: none; }
  .co-tool-body { padding: 0; }
  .co-card, .co-panel, .co-result, .co-table-wrap { box-shadow: none !important; break-inside: avoid; }
  .co-tool-layout { grid-template-columns: 1fr !important; }
  a { color: inherit; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
