/* CampusCode Tools — same look as campuscode.in: Space Grotesk, airy sky-blue
   background, frosted white cards, violet → blue gradient actions, colourful
   icon tiles, and a DARK switch. Fonts are self-hosted (no third-party calls). */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin-wght.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink: #0b1020;
  --ink-2: #1e293b;
  --muted: #475569;
  --faint: #64748b;
  --bg: #eef6fc;
  --bg-a: #f7fbff;
  --bg-b: #e3f1fa;
  --glow-1: rgba(14, 165, 233, 0.16);
  --glow-2: rgba(124, 58, 237, 0.10);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-2: #f8fafc;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.18);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --violet: #7c3aed;
  --blue: #2563eb;
  --sky: #0369a1;
  --accent: #0ea5e9;
  --focus: #7c3aed;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --err: #b91c1c;
  --err-bg: #fef2f2;
  --grad: linear-gradient(90deg, #7c3aed, #0369a1);
  --grad-text: linear-gradient(90deg, #7c3aed, #2563eb);
  --hairline: linear-gradient(90deg, #8b5cf6, #0ea5e9, #10b981);
  --radius: 20px;
  --radius-sm: 12px;
  --chip: rgba(255, 255, 255, 0.9);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #e5e7eb;
  --ink-2: #cbd5e1;
  --muted: #a8b1be;
  --faint: #94a3b8;
  --bg: #0b0f16;
  --bg-a: #0b0f16;
  --bg-b: #0d1522;
  --glow-1: rgba(56, 189, 248, 0.10);
  --glow-2: rgba(139, 92, 246, 0.10);
  --surface: rgba(15, 23, 42, 0.72);
  --surface-solid: #111827;
  --surface-2: #0f172a;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.32);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --violet: #a78bfa;
  --blue: #60a5fa;
  --sky: #38bdf8;
  --accent: #38bdf8;
  --focus: #a78bfa;
  --ok: #34d399;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --err: #f87171;
  --err-bg: rgba(239, 68, 68, 0.12);
  --grad-text: linear-gradient(90deg, #a78bfa, #60a5fa);
  --chip: rgba(15, 23, 42, 0.85);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 12% -10%, var(--glow-1), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, var(--glow-2), transparent 60%),
    linear-gradient(160deg, var(--bg-a) 0%, var(--bg-b) 55%, var(--bg-a) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
img, svg, canvas { max-width: 100%; vertical-align: middle; }
/* (no global display:block on img — the page capture library measures text with an inline <img>) */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.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; }
.mono { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg-a) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.head-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; min-width: 0; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: #fff; padding: 4px; box-shadow: var(--shadow); flex: none; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.brand-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; background: var(--chip); }
.head-nav { display: none; gap: 4px; margin-left: 12px; }
.head-nav a { color: var(--ink-2); font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.head-nav a:hover { background: var(--surface); text-decoration: none; }
.head-nav a[aria-current="page"] { background: color-mix(in srgb, var(--violet) 12%, transparent); color: var(--violet); }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (min-width: 1180px) { .head-nav { display: flex; } }

.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--chip);
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.pill:hover { border-color: var(--border-strong); color: var(--ink); }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none !important; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(91, 33, 182, 0.25); }
.btn-primary:hover { box-shadow: 0 14px 30px rgba(91, 33, 182, 0.32); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-danger { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-lg { min-height: 60px; padding: 0 30px; font-size: 18px; border-radius: 18px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.head-cta { display: none; }
@media (min-width: 640px) { .head-cta { display: inline-flex; } }

/* ---------- Generic surfaces ---------- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card.hairline { overflow: hidden; }
.card.hairline::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--hairline); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Icon tiles: same family as the campuscode.in home tiles */
.tile { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; flex: none; background: linear-gradient(135deg, var(--h1), var(--h2)); box-shadow: 0 8px 18px color-mix(in srgb, var(--h2) 35%, transparent); }
.tile .ic { width: 24px; height: 24px; }
.tile-lg { width: 64px; height: 64px; border-radius: 18px; }
.tile-lg .ic { width: 32px; height: 32px; }
.hue-violet { --h1: #8b5cf6; --h2: #6d28d9; }
.hue-blue { --h1: #3b82f6; --h2: #1d4ed8; }
.hue-indigo { --h1: #6366f1; --h2: #4338ca; }
.hue-sky { --h1: #0ea5e9; --h2: #0369a1; }
.hue-emerald { --h1: #10b981; --h2: #047857; }
.hue-rose { --h1: #f43f5e; --h2: #be123c; }
.hue-amber { --h1: #f59e0b; --h2: #b45309; }
.hue-orange { --h1: #f97316; --h2: #c2410c; }
.hue-slate { --h1: #475569; --h2: #1e293b; }
.hue-teal { --h1: #14b8a6; --h2: #0f766e; }
.hue-fuchsia { --h1: #d946ef; --h2: #a21caf; }
.hue-purple { --h1: #a855f7; --h2: #7e22ce; }
.hue-cyan { --h1: #06b6d4; --h2: #0e7490; }
.hue-pink { --h1: #ec4899; --h2: #be185d; }

/* ---------- Home ---------- */
.home-hero { text-align: center; padding: 48px 0 24px; }
.home-hero h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 auto 14px; max-width: 900px; }
.home-hero p.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 680px; margin: 0 auto 20px; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trust li { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); background: var(--chip); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; }
.trust .ic { color: var(--ok); width: 16px; height: 16px; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 16px 0 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--chip); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.filters button[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; }
@media (min-width: 768px) { .filters { justify-content: center; } }

.tool-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin-bottom: 48px; }
.tool-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; color: var(--ink); text-decoration: none !important; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; min-height: 168px; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.tool-card h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.tool-card[hidden] { display: none; }
@media (max-width: 600px) {
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tool-card { padding: 14px; gap: 8px; min-height: 0; border-radius: 16px; }
  .tool-card .tile { width: 40px; height: 40px; border-radius: 12px; }
  .tool-card .tile .ic { width: 20px; height: 20px; }
  .tool-card h3 { font-size: 15.5px; }
  .tool-card p { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
.cat-title { font-size: 22px; margin: 32px 0 12px; letter-spacing: -0.01em; }

/* ---------- Tool page ---------- */
.tool-hero { text-align: center; padding: 36px 0 8px; }
.tool-hero .tile { margin: 0 auto 14px; }
.tool-hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 10px; }
.tool-hero .lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); margin: 0 auto 6px; max-width: 640px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); }

.stage { margin: 20px 0 40px; }
.drop {
  border: 2px dashed color-mix(in srgb, var(--violet) 35%, var(--border));
  border-radius: 28px; padding: 44px 16px; text-align: center;
  background: var(--surface); transition: border-color .15s ease, background-color .15s ease;
}
.drop.over { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 7%, var(--surface)); }
.drop .pick-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.drop p { margin: 14px 0 0; color: var(--muted); }
.safe-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px !important; font-size: 14px; font-weight: 500; color: var(--ok) !important; background: var(--ok-bg); padding: 6px 12px; border-radius: 999px; }
.safe-note .ic { width: 16px; height: 16px; }
.cam-only { display: none; }
@media (pointer: coarse) { .cam-only { display: inline-flex; } }

.work { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .work { grid-template-columns: minmax(0, 1fr) 340px; } }
.work-main { padding: 16px; min-height: 260px; }
.work-side { padding: 20px; position: sticky; top: 80px; }
.work-side h2 { font-size: 20px; margin: 0 0 4px; }
.work-side .opt-help { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.work-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.work-bar .count { font-weight: 600; margin-right: auto; }
@media (max-width: 959px) {
  .work-side { position: static; }
  .sticky-go { position: sticky; bottom: 10px; z-index: 5; }
}

.files { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.fcard { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--border); }
.fcard.dragging { opacity: .45; }
.fcard.drop-before { box-shadow: -4px 0 0 0 var(--violet); }
.fcard .thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); }
.fcard .thumb canvas, .fcard .thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: transform .2s ease; background: #fff; }
.fcard .thumb .ic { width: 40px; height: 40px; color: var(--faint); }
.fcard .name { font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.fcard .meta { font-size: 12px; color: var(--muted); }
.fcard .tools { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); }
.icon-btn:hover { border-color: var(--border-strong); color: var(--ink); }
.icon-btn .ic { width: 16px; height: 16px; }
.icon-btn.del:hover { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.fcard .badge { position: absolute; top: 14px; left: 14px; z-index: 2; background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; }
.fcard.add { border-style: dashed; justify-content: center; align-items: center; text-align: center; color: var(--violet); font-weight: 600; min-height: 200px; background: transparent; }
.fcard.add .ic { width: 28px; height: 28px; }

/* page cards (organize / rotate / split) */
.pcard { cursor: grab; user-select: none; }
.pcard.sel { border-color: var(--violet); box-shadow: 0 0 0 2px var(--violet) inset; }
.pcard.sel::after { content: "✓"; position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 999px; background: var(--violet); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.pcard.off { opacity: .4; }
.split-mode .pcard { cursor: pointer; }

/* options */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .lbl { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); margin: 0; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--ink);
}
textarea.input { min-height: 180px; resize: vertical; line-height: 1.5; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type="range"] { width: 100%; accent-color: var(--violet); }
input[type="color"] { width: 48px; height: 40px; padding: 2px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-solid); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-solid); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet) inset; background: color-mix(in srgb, var(--violet) 6%, var(--surface-solid)); }
.choice input { margin-top: 4px; accent-color: var(--violet); }
.choice b { display: block; font-size: 15px; }
.choice span { display: block; font-size: 13px; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex: 1 1 auto; text-align: center; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-solid); cursor: pointer; font-size: 14px; font-weight: 600; }
.seg label:has(input:checked) { border-color: var(--violet); color: var(--violet); box-shadow: 0 0 0 1px var(--violet) inset; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.posgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 150px; }
.posgrid label { height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-solid); display: grid; place-items: center; cursor: pointer; }
.posgrid label::after { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--faint); }
.posgrid label:has(input:checked) { border-color: var(--violet); }
.posgrid label:has(input:checked)::after { background: var(--violet); }
.posgrid input { position: absolute; opacity: 0; pointer-events: none; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; margin: 0 0 12px; }
.notice .ic { margin-top: 2px; }
.notice.err { background: var(--err-bg); color: var(--err); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }

/* busy + result */
.busy { padding: 56px 20px; text-align: center; }
.busy h2 { margin: 0 0 8px; font-size: 24px; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; max-width: 520px; margin: 18px auto 10px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .2s ease; }
.spinner { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; border: 4px solid color-mix(in srgb, var(--violet) 18%, transparent); border-top-color: var(--violet); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result { padding: 36px 20px; text-align: center; }
.result h2 { font-size: clamp(24px, 4vw, 34px); margin: 8px 0; letter-spacing: -0.02em; }
.result .done-ic { width: 64px; height: 64px; border-radius: 999px; margin: 0 auto; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.result .done-ic .ic { width: 32px; height: 32px; }
.result .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0 8px; }
.saving { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; color: var(--ok); background: var(--ok-bg); padding: 6px 14px; border-radius: 999px; }
.out-list { list-style: none; padding: 0; margin: 16px auto 0; max-width: 560px; display: grid; gap: 8px; text-align: left; }
.out-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); }
.out-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.out-list .sz { font-size: 13px; color: var(--muted); white-space: nowrap; }
.next-tools { margin-top: 26px; }
.next-tools p { margin: 0 0 10px; font-weight: 600; }
.next-tools .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--chip); color: var(--ink) !important; font-weight: 600; font-size: 14px; text-decoration: none !important; }
.chip-link .tile { width: 28px; height: 28px; border-radius: 9px; box-shadow: none; }
.chip-link .tile .ic { width: 16px; height: 16px; }
.preview-imgs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 20px 0 0; }
.preview-imgs img { width: 100%; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.textout { width: 100%; min-height: 320px; font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; font-size: 13px; }

/* CampusCode promo card */
.promo { display: grid; gap: 16px; align-items: center; padding: 24px; margin: 24px auto 0; max-width: 860px; text-align: left; }
@media (min-width: 720px) { .promo { grid-template-columns: auto 1fr auto; } }
.promo .brand-mark { width: 56px; height: 56px; border-radius: 16px; }
.promo h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; }
.promo p { margin: 0; color: var(--muted); font-size: 15px; }
.promo .cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.play-badge img { display: block; height: 44px; width: auto; }

/* sections under the tool */
.section { margin: 56px 0; }
.section > h2 { font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.02em; margin: 0 0 18px; }
.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { padding: 20px; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 700; margin-bottom: 10px; }
.why { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.why .card { padding: 20px; }
.why h3 { margin: 12px 0 6px; font-size: 18px; }
.why p { margin: 0; color: var(--muted); font-size: 15px; }
.faq { display: grid; gap: 10px; }
.faq details { padding: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--violet); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); }

.cta-band { padding: 32px 24px; text-align: center; margin: 56px 0; }
.cta-band h2 { font-size: clamp(24px, 3.6vw, 34px); margin: 0 0 8px; letter-spacing: -0.02em; }
.cta-band p { color: var(--muted); margin: 0 auto 18px; max-width: 620px; }
.cta-band .cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--border); padding: 32px 0 40px; margin-top: 40px; font-size: 14px; color: var(--muted); }
.foot-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-foot h4 { color: var(--ink); margin: 0 0 10px; font-size: 14px; letter-spacing: .02em; }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--ink); }
.foot-bottom { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---------- Calculators ---------- */
.calc { padding: 20px; }
.calc h2 { margin: 0 0 12px; font-size: 20px; }
.calc-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 880px) { .calc-grid { grid-template-columns: 1fr 1fr; } }
.big-num { font-size: clamp(36px, 7vw, 52px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.stat-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: 14px; }
.stat { padding: 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); }
.stat b { display: block; font-size: 26px; letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.sem-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.sem-table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 0 6px; }
.sem-table td { padding: 0 6px; }
.formula { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; color: var(--muted); }

/* ---------- Sign / crop canvas ---------- */
.page-stage { position: relative; margin: 0 auto; max-width: 720px; user-select: none; touch-action: none; }
.page-stage canvas { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: var(--shadow); background: #fff; }
.sig-box { position: absolute; border: 2px dashed var(--violet); border-radius: 6px; cursor: move; touch-action: none; background: rgba(124, 58, 237, 0.04); }
.sig-box img { display: block; width: 100%; height: 100%; pointer-events: none; object-fit: contain; }
.sig-box .handle { position: absolute; right: -10px; bottom: -10px; width: 22px; height: 22px; border-radius: 999px; background: var(--violet); border: 3px solid #fff; cursor: nwse-resize; touch-action: none; }
.crop-shade { position: absolute; background: rgba(15, 23, 42, 0.45); pointer-events: none; }
.crop-line { position: absolute; border: 2px solid var(--violet); pointer-events: none; }
.sig-pad { width: 100%; height: 180px; border-radius: 14px; border: 1px solid var(--border-strong); background: #fff; touch-action: none; cursor: crosshair; }
.page-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0; }

/* Word to PDF page rendering (off screen while converting, shown for printing) */
.docx-hold { position: absolute; left: -100000px; top: 0; }
.docx-page { position: relative; background: #fff; color: #000; overflow: hidden; font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 11pt; line-height: 1.17; text-align: left; }
.docx-page * { box-sizing: border-box; }
.docx-body { position: absolute; overflow: hidden; }
.docx-hf { position: absolute; overflow: hidden; }
.docx-p { margin: 0; white-space: pre-wrap; tab-size: 48px; -moz-tab-size: 48px; overflow-wrap: break-word; }
.docx-p:empty::after { content: "\200b"; }
.docx-tbl { border-collapse: collapse; table-layout: fixed; }
.docx-tbl td { vertical-align: top; padding: 0 7px; }
.docx-img { display: inline-block; vertical-align: bottom; max-width: 100%; }
.docx-box { border: 1px solid #94a3b8; padding: 6px; margin: 4px 0; }
.print-root { display: none; }
@media print {
  body.printing > *:not(.print-root) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing .print-root { display: block; }
  body.printing .print-root .docx-page { break-after: page; page-break-after: always; box-shadow: none; }
  body.printing .print-root .docx-page:last-child { break-after: auto; page-break-after: auto; }
}
