/* Spazcat 3D Print Desk — shared styles
   Colour tokens mirror the original quote page; dark mode swaps the tokens. */

:root {
  --purple: #5f249f;
  --purple-light: #7030a0;
  --purple-dark: #3d1566;
  --purple-muted: #e6e6fa;
  --accent: #c084fc;
  --accent-bright: #a855f7;
  --text: #1a1a2e;
  --text-muted: #555;
  --bg: #f8f8ff;
  --surface: #ffffff;
  --surface-2: #f3f0fb;
  --border: #d8d8f0;
  --heading: #5f249f;
  --link: #5f249f;
  --header-bg: #5f249f;
  --footer-bg: #3d1566;
  --input-bg: #f8f8ff;
  --card-shadow: 0 4px 20px rgba(95, 36, 159, 0.12);
  --card-shadow-hover: 0 10px 30px rgba(95, 36, 159, 0.2);
  --ok: #15803d; --ok-bg: #f0fdf4; --ok-border: #22c55e;
  --warn: #92400e; --warn-bg: #fffbeb; --warn-border: #f59e0b;
  --err: #b91c1c; --err-bg: #fef2f2; --err-border: #ef4444;
  --info: #1e40af; --info-bg: #eff6ff; --info-border: #60a5fa;
  --display-font: 'Ethnocentric', 'Arial Black', Arial, sans-serif;
  --radius: 12px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --purple-dark: #1c0f33;
  --purple-muted: #2a1d45;
  --accent: #c084fc;
  --accent-bright: #d8b4fe;
  --text: #ece8f5;
  --text-muted: #a8a0bf;
  --bg: #0f0b1a;
  --surface: #1a1329;
  --surface-2: #221936;
  --border: #3a2d57;
  --heading: #c4a5ff;
  --link: #c4a5ff;
  --header-bg: #2b1250;
  --footer-bg: #150a26;
  --input-bg: #140e22;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  --card-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.6);
  --ok: #86efac; --ok-bg: #0f2a1a; --ok-border: #16a34a;
  --warn: #fcd34d; --warn-bg: #2d2008; --warn-border: #d97706;
  --err: #fca5a5; --err-bg: #2d1111; --err-border: #dc2626;
  --info: #93c5fd; --info-bg: #0f1d33; --info-border: #3b82f6;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .25s, color .25s;
}
main { flex: 1; }
a { color: var(--link); }
img { max-width: 100%; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: var(--display-font); letter-spacing: .02em; }

/* ── HEADER ── */
.site-header {
  background: var(--header-bg);
  padding: .8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.site-header .logo { height: 56px; width: auto; display: block; }
.site-header .brand-title {
  font-family: var(--display-font);
  font-size: clamp(1.1rem, 2.6vw, 2rem);
  color: #fff;
  text-decoration: none;
  text-shadow:
    -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000,
    -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
  margin: 0;
  flex: 1;
  text-align: left;
  white-space: nowrap;
}
.header-nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.header-pill {
  background: #fff;
  color: #5f249f;
  padding: .4rem .8rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, transform .15s;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.header-pill:hover { background: #e6e6fa; transform: translateY(-1px); }
.header-pill.ghost { background: rgba(255,255,255,.12); color: #fff; }
.header-pill.ghost:hover { background: rgba(255,255,255,.25); }
.theme-toggle { font-size: 1rem; padding: .4rem .6rem; }
.theme-toggle .icon-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-light { display: none; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #3d1566 0%, #5f249f 50%, #7c3aed 100%);
  color: #fff;
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
:root[data-theme="dark"] .hero { background: linear-gradient(135deg, #12081f 0%, #2b1250 50%, #4c1d95 100%); }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(168,85,247,.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(192,132,252,.2) 0%, transparent 40%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero-content { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }
.hero h2 {
  font-family: var(--display-font);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  margin: 0 0 1rem;
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0,0,0,.4);
}
.hero p { font-size: clamp(1rem, 2vw, 1.25rem); opacity: .92; max-width: 620px; margin: 0 auto 2rem; line-height: 1.6; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-cta {
  display: inline-block; background: #fff; color: #5f249f;
  padding: .9rem 2.2rem; border-radius: 8px; font-size: 1.05rem; font-weight: 700;
  text-decoration: none; transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.hero-cta:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.hero-cta.secondary { background: rgba(255,255,255,.12); color: #fff; border: 2px solid rgba(255,255,255,.6); box-shadow: none; }

/* ── SECTIONS ── */
section { padding: 3.5rem 1.5rem; }
.section-alt { background: var(--surface); }
.section-title {
  font-family: var(--display-font);
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--heading);
  text-align: center;
  margin: 0 0 2.5rem;
}
.section-title::after {
  content: ''; display: block; width: 60px; height: 4px;
  background: var(--purple); border-radius: 2px; margin: .6rem auto 0;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.container-wide { max-width: 1500px; margin: 0 auto; padding: 0 1.25rem; }
.page { padding-top: 2rem; padding-bottom: 3rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; font-size: 1.6rem; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card > h2:first-child, .card > h3:first-child, .card-head h2, .card-head h3 { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.15rem; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; max-width: 1100px; margin: 0 auto; }
.why-card {
  background: var(--surface); border-radius: 12px; padding: 1.8rem 1.5rem;
  box-shadow: var(--card-shadow); border-top: 4px solid var(--purple);
  transition: transform .25s, box-shadow .25s; text-align: center;
}
.why-card:hover { transform: translateY(-6px); box-shadow: var(--card-shadow-hover); }
.why-card .icon { font-size: 2.5rem; margin-bottom: .8rem; display: block; }
.why-card h3 { margin: .4rem 0; font-size: 1.15rem; }
.why-card p { color: var(--text-muted); font-size: .95rem; margin: 0; }

.process-steps { display: flex; flex-wrap: wrap; gap: 1rem; max-width: 1000px; margin: 0 auto; justify-content: center; }
.step { flex: 1 1 180px; max-width: 220px; text-align: center; }
.step-num {
  width: 52px; height: 52px; background: var(--purple); color: #fff; border-radius: 50%;
  font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  margin: 0 auto .8rem; box-shadow: 0 4px 12px rgba(95,36,159,.3);
}
.step h4 { margin: .3rem 0; font-size: 1rem; }
.step p { font-size: .88rem; color: var(--text-muted); margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.layout-main-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .grid-2, .grid-3, .layout-main-side { grid-template-columns: 1fr; } }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; box-shadow: var(--card-shadow); text-decoration: none; color: inherit; display: block;
}
.stat .label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 1.7rem; font-weight: 700; color: var(--heading); }

/* ── FORMS ── */
.form-wrapper {
  max-width: 820px; margin: 0 auto; background: var(--surface); border-radius: 16px;
  padding: 2.5rem 2rem; box-shadow: var(--card-shadow); border: 2px solid var(--purple-muted);
}
.form-section-heading {
  color: var(--heading); font-size: 1.05rem; font-weight: 700;
  letter-spacing: .01em; margin: 2rem 0 .9rem;
  padding-bottom: .4rem; border-bottom: 2px solid var(--purple-muted);
}
.form-section-heading:first-child { margin-top: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) { .form-row, .form-row.three { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.form-group > label, .label { font-size: .88rem; font-weight: 600; color: var(--text); }
.req { color: var(--accent-bright); margin-left: 2px; }
.hint { font-size: .78rem; color: var(--text-muted); }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password],
input[type=date], input[type=url], input[type=search], select, textarea {
  padding: .6rem .85rem; border: 2px solid var(--border); border-radius: 8px;
  font-size: .95rem; font-family: inherit; color: var(--text); background: var(--input-bg);
  transition: border-color .2s, box-shadow .2s; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,.18); }
textarea { resize: vertical; min-height: 90px; }
input[type=checkbox], input[type=radio] { accent-color: var(--purple); }
.inline-check { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; cursor: pointer; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; }
.check-item {
  display: flex; align-items: flex-start; gap: .5rem; padding: .55rem .75rem; border-radius: 8px;
  border: 2px solid var(--border); cursor: pointer; transition: border-color .2s, background .2s;
  font-size: .88rem; line-height: 1.4; background: var(--surface);
}
.check-item:hover { border-color: var(--purple); background: var(--purple-muted); }
.check-item input { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.check-item:has(input:checked) { border-color: var(--purple); background: var(--purple-muted); }
.check-item:has(input:checked) .check-text { color: var(--heading); font-weight: 600; }
.check-desc { display: block; font-size: .75rem; color: var(--text-muted); font-weight: 400; }

/* Selectable option tiles (radio cards) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tile > span {
  display: block; height: 100%; border: 2px solid var(--border); border-radius: 10px; padding: .7rem .8rem;
  background: var(--surface); transition: border-color .2s, background .2s, transform .15s; font-size: .9rem;
}
.tile > span strong { display: block; color: var(--text); }
.tile > span small { color: var(--text-muted); font-size: .76rem; }
.tile input:hover + span { border-color: var(--purple); }
.tile input:checked + span { border-color: var(--purple); background: var(--purple-muted); transform: translateY(-1px); }
.tile input:checked + span strong { color: var(--heading); }
.tile input:focus-visible + span { box-shadow: 0 0 0 3px rgba(139,92,246,.35); }
.tiles.project .tile span { text-align: center; }
.tiles.project .tile .ti { font-size: 1.6rem; display: block; }

/* File drop */
.file-drop {
  border: 2px dashed #b0a0d0; border-radius: 10px; padding: 1.5rem 1rem; text-align: center;
  cursor: pointer; transition: border-color .2s, background .2s; background: var(--input-bg); position: relative;
}
.file-drop:hover, .file-drop.drag-over { border-color: var(--purple); background: var(--purple-muted); }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop .drop-icon { font-size: 2rem; display: block; margin-bottom: .4rem; }
.file-drop .drop-label { font-weight: 600; color: var(--heading); }
.file-drop .drop-hint { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
.file-list { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.file-list li {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .86rem;
  padding: .4rem .7rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
}
.file-list li.too-big { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn); }
.file-list button { background: none; border: 0; cursor: pointer; color: var(--text-muted); font-size: 1rem; }

/* Color picker */
.color-picker-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.color-wheel-container { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
#colorWheelCanvas { border-radius: 50%; cursor: crosshair; display: block; box-shadow: 0 2px 10px rgba(0,0,0,.2); touch-action: none; }
.wheel-crosshair {
  position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px #333, 0 1px 4px rgba(0,0,0,.4); pointer-events: none; transform: translate(-50%,-50%); display: none;
}
.color-preset-and-result { flex: 1; min-width: 180px; }
.color-presets { display: flex; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.color-preset-btn {
  display: flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 20px;
  border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-size: .82rem;
  font-family: inherit; color: var(--text); transition: border-color .2s, background .2s;
}
.color-preset-btn:hover { border-color: var(--purple); }
.color-preset-btn.active { border-color: var(--purple); background: var(--purple-muted); font-weight: 700; }
.preset-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); display: inline-block; flex-shrink: 0; }
.rainbow { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.color-result { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--text-muted); }
.color-result-swatch { width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--border); flex-shrink: 0; }
.color-result-label { font-weight: 600; color: var(--text); }
.swatch-inline { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border); vertical-align: -2px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.1rem; border-radius: 8px; border: 2px solid transparent; font-size: .92rem;
  font-weight: 600; font-family: inherit; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background .2s, border-color .2s, transform .15s, box-shadow .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 4px 12px rgba(95,36,159,.25); }
.btn-primary:hover { background: var(--purple-light); }
.btn-outline { background: transparent; color: var(--heading); border-color: var(--purple); }
.btn-outline:hover { background: var(--purple-muted); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--purple); }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err-border); }
.btn-danger:hover { background: var(--err-bg); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.submit-btn {
  width: 100%; background: var(--purple); color: #fff; border: none; padding: 1rem; font-size: 1.05rem;
  font-weight: 700; border-radius: 10px; cursor: pointer; margin-top: 1rem; font-family: inherit;
  letter-spacing: .01em; transition: background .2s, transform .2s, box-shadow .2s; box-shadow: 0 4px 15px rgba(95,36,159,.3);
}
.submit-btn:hover { background: var(--purple-light); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(95,36,159,.4); }
.submit-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.inline-form { display: inline; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ── ALERTS ── */
.flash-stack { max-width: 1100px; margin: 1rem auto 0; padding: 0 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.alert {
  border-radius: 10px; padding: .85rem 1.1rem; border: 2px solid; font-weight: 500; font-size: .95rem;
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
}
.alert-success { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.alert-error { background: var(--err-bg); border-color: var(--err-border); color: var(--err); }
.alert-warning { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }
.alert a { color: inherit; font-weight: 700; }
.alert .close { background: none; border: 0; color: inherit; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.upload-progress { height: 10px; border-radius: 6px; background: var(--purple-muted); overflow: hidden; margin-top: .8rem; }
.upload-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), var(--accent-bright)); transition: width .2s; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; background: var(--purple-muted); color: var(--heading); white-space: nowrap;
}
.badge-open { background: var(--info-bg); color: var(--info); }
.badge-hold { background: var(--warn-bg); color: var(--warn); }
.badge-done, .badge-paid { background: var(--ok-bg); color: var(--ok); }
.badge-cancelled, .badge-void { background: var(--err-bg); color: var(--err); }
.badge-draft { background: var(--surface-2); color: var(--text-muted); }
.badge-sent { background: var(--warn-bg); color: var(--warn); }
.badge-failed { background: var(--err-bg); color: var(--err); }
.badge-queued { background: var(--surface-2); color: var(--text-muted); }
.badge-rush { background: #dc2626; color: #fff; }
.badge-approval { background: #f59e0b; color: #1a1a2e; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .65rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; }
.table tr:hover td { background: var(--surface-2); }
.table a.rowlink { font-weight: 600; text-decoration: none; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; font-size: .93rem; }
dl.kv dt { color: var(--text-muted); font-weight: 600; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ── TRACKER (pizza-tracker style) ── */
.tracker-card { text-align: center; }
.tracker-headline { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-bottom: 1.8rem; }
.tracker-headline .big-icon {
  font-size: 2.6rem; width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; background: var(--purple-muted); box-shadow: 0 0 0 6px rgba(139,92,246,.15);
  animation: pulse-ring 2.2s infinite;
}
.tracker-headline h2 { margin: .5rem 0 0; font-weight: 800; font-size: clamp(1.1rem, 3vw, 1.6rem); }
.tracker-headline p { margin: 0; color: var(--text-muted); max-width: 520px; }
.tracker { position: relative; display: flex; justify-content: space-between; list-style: none; margin: 0; padding: 0; }
.tracker::before, .tracker .tracker-fill {
  content: ''; position: absolute; top: 25px; height: 8px; border-radius: 4px;
  left: calc(100% / var(--n) / 2);
}
.tracker::before { right: calc(100% / var(--n) / 2); background: var(--purple-muted); }
.tracker .tracker-fill {
  width: calc((100% - 100% / var(--n)) * var(--pct) / 100);
  background: linear-gradient(90deg, var(--purple), var(--accent-bright));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  transition: width .8s ease;
}
.tracker-step { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.tracker-dot {
  width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; background: var(--surface); border: 4px solid var(--purple-muted);
  transition: transform .3s, background .3s; position: relative;
}
.tracker-step.done .tracker-dot { background: var(--purple); border-color: var(--purple); }
.tracker-step.done .tracker-dot::after {
  content: '✓'; position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: #16a34a; color: #fff; font-size: .75rem; font-weight: 700; display: flex; align-items: center;
  justify-content: center; border: 2px solid var(--surface);
}
.tracker-step.current .tracker-dot {
  background: var(--surface); border-color: var(--accent-bright); transform: scale(1.18);
  animation: pulse-ring 1.8s infinite;
}
.tracker-step.upcoming .tracker-dot { filter: grayscale(1); opacity: .55; }
.tracker-label { margin-top: .6rem; font-size: .8rem; font-weight: 700; color: var(--text-muted); text-align: center; padding: 0 .2rem; }
.tracker-step.current .tracker-label { color: var(--heading); font-size: .88rem; }
.tracker-step.done .tracker-label { color: var(--text); }
.tracker-time { font-size: .7rem; color: var(--text-muted); font-weight: 400; display: block; }
.tracker-banner { margin-top: 1.5rem; }
.tracker.is-cancelled .tracker-fill { background: var(--err-border); animation: none; }
.tracker.is-hold .tracker-fill { background: var(--warn-border); animation: none; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(168,85,247,.55); }
  70% { box-shadow: 0 0 0 14px rgba(168,85,247,0); }
  100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); }
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .tracker-step.current .tracker-dot, .tracker-headline .big-icon, .tracker .tracker-fill { animation: none; }
}
@media (max-width: 720px) {
  .tracker { flex-direction: column; gap: 1rem; padding-left: 0; }
  .tracker::before { left: 25px; right: auto; top: 29px; bottom: 29px; width: 8px; height: auto; }
  .tracker .tracker-fill { left: 25px; top: 29px; width: 8px; height: calc((100% - 58px) * var(--pct) / 100); }
  .tracker-step { flex-direction: row; gap: 1rem; }
  .tracker-step.current .tracker-dot { transform: scale(1.08); }
  .tracker-label { margin: 0; text-align: left; font-size: .92rem; }
}

/* Mini segmented tracker for lists */
.mini-tracker { display: flex; gap: 3px; margin: .5rem 0 .3rem; }
.mini-tracker span { flex: 1; height: 8px; border-radius: 4px; background: var(--purple-muted); }
.mini-tracker span.done { background: var(--purple); }
.mini-tracker span.current {
  background: linear-gradient(90deg, var(--purple), var(--accent-bright), var(--purple));
  background-size: 200% 100%; animation: shimmer 2s linear infinite;
}

/* ── TIMELINE ── */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 1.1rem 48px; }
.timeline .t-icon {
  position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.timeline .t-meta { font-size: .78rem; color: var(--text-muted); }
.timeline .t-body {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: .6rem .8rem; margin-top: .3rem; font-size: .92rem; overflow-wrap: anywhere;
}
.timeline li.from-customer .t-body { border-color: var(--accent); }
.timeline li.internal .t-body { background: var(--warn-bg); border-color: var(--warn-border); color: var(--text); }
.timeline li.internal .t-icon { border-color: var(--warn-border); }

/* ── ADMIN BOARD ── */
.admin-nav {
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; gap: .25rem; padding: 0 1.25rem; overflow-x: auto;
}
.admin-nav a {
  padding: .8rem 1rem; text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: .92rem;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.admin-nav a:hover { color: var(--heading); }
.admin-nav a.active { color: var(--heading); border-bottom-color: var(--purple); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; min-height: 180px; }
.board-col h3 { margin: 0 0 .75rem; font-size: .9rem; display: flex; justify-content: space-between; align-items: center; }
.board-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--purple);
  border-radius: 10px; padding: .65rem .75rem; margin-bottom: .6rem; text-decoration: none; color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: transform .15s, box-shadow .15s;
}
.board-card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow); }
.board-card.hold { border-left-color: var(--warn-border); opacity: .85; }
.board-card.rush { border-left-color: #dc2626; }
.board-card .bc-num { font-size: .75rem; font-weight: 700; color: var(--heading); }
.board-card .bc-title { font-weight: 600; font-size: .9rem; margin: .1rem 0; }
.board-card .bc-meta { font-size: .76rem; color: var(--text-muted); display: flex; gap: .4rem; flex-wrap: wrap; }

.stage-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.stage-actions label.stage-choice { position: relative; }
.stage-actions label.stage-choice input { position: absolute; opacity: 0; }
.stage-actions label.stage-choice span {
  display: inline-flex; gap: .3rem; align-items: center; padding: .4rem .7rem; border-radius: 999px;
  border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-size: .84rem;
}
.stage-actions label.stage-choice input:checked + span { border-color: var(--purple); background: var(--purple-muted); font-weight: 700; }
.stage-actions label.stage-choice.is-current span { border-style: dashed; }

.update-banner { display: none; }
.update-banner.show { display: flex; }

/* ── FOOTER ── */
.site-footer {
  margin-top: 3rem; background: var(--footer-bg); color: rgba(255,255,255,.82);
  padding: 2rem 1.25rem; text-align: center; font-size: .92rem;
}
.site-footer a { color: #c084fc; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.version-link {
  display: inline-block; margin-top: .6rem; font-size: .78rem; padding: .15rem .6rem; border-radius: 999px;
  border: 1px solid rgba(192,132,252,.5); color: #c084fc !important;
}

/* Changelog */
.prose { font-size: .98rem; }
.prose h1 { font-family: var(--display-font); font-size: 1.6rem; }
.prose h2 { border-bottom: 2px solid var(--purple-muted); padding-bottom: .3rem; margin-top: 2rem; }
.prose h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.prose code { background: var(--surface-2); padding: .1rem .35rem; border-radius: 4px; font-size: .88em; }
.prose li { margin: .25rem 0; }

/* Invoice */
.invoice-doc { max-width: 850px; margin: 0 auto; }
.invoice-head { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
.invoice-head h1 { font-family: var(--display-font); margin: 0; font-size: 1.8rem; }
.invoice-totals { margin-left: auto; width: min(100%, 320px); }
.invoice-totals td { padding: .35rem .5rem; }
.invoice-totals tr.grand td { font-size: 1.15rem; font-weight: 800; border-top: 2px solid var(--purple); color: var(--heading); }
.paid-stamp {
  display: inline-block; border: 4px solid #16a34a; color: #16a34a; font-weight: 900; font-size: 1.6rem;
  padding: .2rem 1rem; border-radius: 8px; transform: rotate(-8deg); letter-spacing: .1em;
}
.line-row input { min-width: 0; }

/* Auth pages */
.auth-wrap { max-width: 440px; margin: 3rem auto; padding: 0 1rem; }
.auth-wrap .card { padding: 2rem; }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--text-muted); font-size: .8rem; margin: 1.2rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; gap: .5rem; padding: .7rem 1rem; }
  .site-header .brand-title { order: -1; flex-basis: 100%; font-size: 1.15rem; }
  .site-header .logo { height: 44px; }
  .header-nav { flex: 1; }
  .form-wrapper { padding: 1.5rem 1rem; }
  section { padding: 2.5rem 1rem; }
  .hero { padding: 3.5rem 1.25rem 3rem; }
}

/* GitHub issues */
.gh-label {
  display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  margin-left: .25rem; vertical-align: 1px; white-space: nowrap; border: 1px solid rgba(0,0,0,.12);
}
.md-body { overflow-wrap: anywhere; }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .7rem; overflow-x: auto; }
.md-body code { background: var(--surface-2); padding: .1rem .3rem; border-radius: 4px; font-size: .88em; }
.md-body pre code { background: none; padding: 0; }
.md-body table { border-collapse: collapse; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: .3rem .6rem; }
.md-body blockquote { margin: .5rem 0; padding-left: .8rem; border-left: 3px solid var(--border); color: var(--text-muted); }

@media print {
  .site-header, .site-footer, .admin-nav, .no-print, .flash-stack { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: none; }
}
