/* The Workshop admin. Tokens first; dark by default, light when the system is. No images, no fonts to fetch. */
:root {
  color-scheme: dark;
  --bg: #0d0f14;
  --bg-2: #12151c;
  --surface: #171b24;
  --surface-2: #1e2330;
  --surface-3: #262c3b;
  --line: #2a3142;
  --text: #eef1f7;
  --text-2: #a4adc2;
  --text-3: #6f7a93;
  --accent: #7cf0b2;
  --accent-ink: #06210f;
  --accent-soft: rgba(124, 240, 178, 0.14);
  --warn: #ffc857;
  --warn-soft: rgba(255, 200, 87, 0.14);
  --bad: #ff6b7a;
  --bad-soft: rgba(255, 107, 122, 0.14);
  --info: #7aa7ff;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-up: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 14px 34px rgba(0, 0, 0, 0.5);
  --radius: 16px;
  --radius-s: 10px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --rail: 76px;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f3f5f9; --bg-2: #e9edf4; --surface: #ffffff; --surface-2: #f4f6fb; --surface-3: #e8ecf5; --line: #d9deea;
    --text: #141824; --text-2: #4a5470; --text-3: #7d869d; --accent: #0f9d58; --accent-ink: #ffffff;
    --accent-soft: rgba(15, 157, 88, 0.12); --warn: #b7791f; --warn-soft: rgba(183, 121, 31, 0.13); --bad: #d6334a; --bad-soft: rgba(214, 51, 74, 0.1);
    --info: #2f6fed; --shadow: 0 1px 2px rgba(20, 24, 36, 0.06), 0 8px 24px rgba(20, 24, 36, 0.07); --shadow-up: 0 2px 4px rgba(20, 24, 36, 0.08), 0 16px 36px rgba(20, 24, 36, 0.14);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { height: 100%; }
h1, h2, h3, p { margin: 0; }
.noscript { padding: 24px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- layout */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100%; overflow: hidden; }
.rail { background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); }
.rail .logo { width: 40px; height: 40px; margin-bottom: 14px; }
.rail .spacer { flex: 1; }
.nav { width: 56px; height: 56px; border: 0; background: transparent; border-radius: 16px; color: var(--text-3); display: grid; place-items: center; gap: 2px; position: relative; transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.25s var(--spring); }
.nav svg { width: 22px; height: 22px; }
.nav span { font-size: 10px; letter-spacing: 0.02em; }
.nav:hover { background: var(--surface); color: var(--text-2); }
.nav:active { transform: scale(0.92); }
.nav[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--warn); color: #241a00; font-size: 10px; font-weight: 700; display: grid; place-items: center; animation: pop 0.4s var(--spring); }
main { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 28px clamp(16px, 4vw, 44px) 80px; scroll-behavior: smooth; }
.page { max-width: 1080px; margin: 0 auto; animation: rise 0.35s var(--ease); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; letter-spacing: -0.02em; }
.page-head p { color: var(--text-2); margin-top: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .rail .logo, .rail .spacer { display: none; }
  .nav { width: 64px; height: 52px; }
  main { padding-top: 18px; }
}

/* ---- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.stack { display: grid; gap: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sep { height: 1px; background: var(--line); margin: 16px 0; }

/* ---- buttons: pressed things move */
.btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 9px 16px; font-weight: 600; transition: transform 0.2s var(--spring), background 0.15s, box-shadow 0.2s; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.96); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.a-btn, a.btn { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.icon-btn { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; }
.icon-btn svg { width: 18px; height: 18px; }

/* hold to confirm: the ring fills while you hold; letting go early lets it drain */
.hold { position: relative; border: 0; border-radius: 20px; padding: 0; background: var(--surface-2); color: var(--text); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; transition: transform 0.25s var(--spring), box-shadow 0.25s; box-shadow: var(--shadow); min-width: 220px; }
.hold .fill { position: absolute; inset: 0; background: var(--accent); transform-origin: left center; transform: scaleX(0); }
.hold .face { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 26px; font-weight: 700; font-size: 16px; mix-blend-mode: normal; }
.hold.holding { transform: scale(0.97); box-shadow: var(--shadow-up); }
.hold.holding .face, .hold.done .face { color: var(--accent-ink); }
.hold.done { animation: bump 0.5s var(--spring); }
.hold[disabled] { opacity: 0.45; pointer-events: none; }
.hold .face svg { width: 20px; height: 20px; flex: none; }
.hold .hint { font-weight: 500; font-size: 12px; opacity: 0.7; }
@keyframes bump { 0% { transform: scale(0.97); } 45% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ---- forms */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
input[type="text"], input[type="password"], input[type="url"], input[type="number"], select, textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 120px; line-height: 1.45; }
textarea.code { font-family: var(--mono); font-size: 13px; tab-size: 2; white-space: pre; min-height: 280px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.stepper { display: inline-flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.stepper button { width: 38px; height: 38px; border: 0; background: transparent; font-size: 18px; transition: background 0.15s, transform 0.2s var(--spring); }
.stepper button:hover { background: var(--surface-3); }
.stepper button:active { transform: scale(0.85); }
.stepper output { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; position: relative; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 600; color: var(--text-2); transition: background 0.2s var(--ease), color 0.2s, transform 0.2s var(--spring); }
.seg button:active { transform: scale(0.94); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }

/* ---- chips and badges */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.chip.ok { background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: rgba(122, 167, 255, 0.14); color: var(--info); }

/* ---- overview */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 26px; overflow: hidden; position: relative; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 65%); pointer-events: none; }
.hero h2 { font-size: 22px; letter-spacing: -0.01em; }
.hero.pending { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
@media (max-width: 700px) { .hero { grid-template-columns: 1fr; } }
.tile { padding: 18px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform 0.25s var(--spring), box-shadow 0.25s, border-color 0.2s; display: grid; gap: 2px; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tile:active { transform: scale(0.97); }
.tile b { font-size: 30px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.problems { display: grid; gap: 8px; }
.problem { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--bad-soft); color: var(--text); font-size: 14px; }
.problem::before { content: "!"; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--bad); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 12px; margin-top: 1px; }

/* ---- store */
.itemcard { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; box-shadow: var(--shadow); transition: transform 0.28s var(--spring), box-shadow 0.25s, border-color 0.2s; animation: pop 0.35s var(--spring) backwards; }
.itemcard:hover { transform: translateY(-3px) rotate(-0.2deg); box-shadow: var(--shadow-up); }
.itemcard:active { transform: scale(0.97); }
.itemcard.bad { border-color: color-mix(in srgb, var(--bad) 60%, var(--line)); }
.itemcard h3 { font-size: 16px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.itemcard .preview { height: 64px; border-radius: 10px; background: var(--bg-2); border: 1px dashed var(--line); display: grid; place-items: center; color: var(--text-3); font-family: var(--mono); font-size: 12px; overflow: hidden; }
.addcard { border: 2px dashed var(--line); background: transparent; border-radius: var(--radius); min-height: 150px; display: grid; place-items: center; gap: 6px; color: var(--text-2); text-align: center; padding: 16px; transition: border-color 0.2s, background 0.2s, transform 0.25s var(--spring); }
.addcard:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.addcard:active { transform: scale(0.97); }
.addcard svg { width: 26px; height: 26px; }
.empty { padding: 36px; text-align: center; color: var(--text-2); display: grid; gap: 8px; justify-items: center; }

/* the whole window takes a drop */
.dropveil { position: fixed; inset: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: none; place-items: center; pointer-events: none; }
/* Not in the page at all until a file is over it: a transparent element with a backdrop filter still tints what is under it in some engines. */
.dropveil.on { display: grid; animation: fade 0.18s; }
.dropveil .target { border: 3px dashed var(--accent); border-radius: 28px; padding: 54px 64px; text-align: center; background: var(--accent-soft); animation: breathe 1.4s ease-in-out infinite; max-width: 86vw; }
.dropveil h2 { font-size: 24px; color: var(--accent); }
@keyframes breathe { 50% { transform: scale(1.025); } }

/* ---- the drawer (a bottom sheet on a phone) */
.scrim { position: fixed; inset: 0; background: rgba(5, 7, 10, 0.55); z-index: 30; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg-2); border-left: 1px solid var(--line); z-index: 31; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0, 0, 0, 0.4); animation: slide 0.38s var(--spring); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.drawer header h2 { font-size: 18px; flex: 1; overflow-wrap: anywhere; }
.drawer .body { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 18px; align-content: start; }
.drawer footer { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; background: var(--bg-2); }
@media (max-width: 760px) {
  .drawer { top: auto; width: 100vw; max-height: 92vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; animation: sheet 0.38s var(--spring); }
  @keyframes sheet { from { transform: translateY(60px); opacity: 0; } }
}
.checks { display: grid; gap: 6px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.check::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.check.bad { color: var(--bad); }
.check.bad::before { background: var(--bad); }
canvas.response { width: 100%; height: 160px; border-radius: var(--radius-s); background: var(--bg); border: 1px solid var(--line); }

/* ---- updates */
.zone { border: 2px dashed var(--line); border-radius: 22px; padding: 38px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; color: var(--text-2); transition: border-color 0.2s, background 0.2s, transform 0.3s var(--spring); background: var(--surface); }
.zone.over, .zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.zone.over { transform: scale(1.01); }
.zone svg { width: 34px; height: 34px; color: var(--accent); }
.progress { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; width: min(420px, 100%); }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width 0.15s linear; }
.timeline { display: grid; gap: 12px; position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.release { position: relative; padding: 16px; }
.release::before { content: ""; position: absolute; left: -22px; top: 22px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--bg); box-shadow: 0 0 0 2px var(--line); }
.release.newest::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.release > .row:last-child { margin-top: 14px; }
.release h3 { font-size: 17px; letter-spacing: -0.01em; }
.notes { font-size: 14px; color: var(--text-2); display: grid; gap: 4px; margin-top: 8px; }
.notes h4 { margin: 6px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.notes li { margin-left: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 3px 11px; font-size: 13px; transition: transform 0.2s var(--spring); }
.chips button:active { transform: scale(0.92); }

/* ---- activity */
.feed { display: grid; }
.feed .entry { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: center; }
.feed .entry:last-child { border-bottom: 0; }
.feed .glyph { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); }
.feed .glyph svg { width: 18px; height: 18px; }
.feed .glyph.ok { background: var(--accent-soft); color: var(--accent); }
.feed .glyph.bad { background: var(--bad-soft); color: var(--bad); }

/* ---- login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.login form { width: min(380px, 100%); padding: 28px; display: grid; gap: 16px; animation: rise 0.45s var(--ease); }
.login .logo { width: 52px; height: 52px; }
.login h1 { font-size: 24px; letter-spacing: -0.02em; }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.err { color: var(--bad); font-size: 14px; min-height: 20px; }

/* ---- toasts */
.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); }
@media (max-width: 760px) { .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.toast { background: var(--surface-3); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow-up); animation: pop 0.35s var(--spring); }
.toast.bad { border-color: var(--bad); }
.toast.ok { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.toast .btn { flex: none; }
.toast.leaving { animation: leave 0.25s forwards; }
@keyframes leave { to { opacity: 0; transform: translateY(8px) scale(0.96); } }
.dialog { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(5, 7, 10, 0.6); animation: fade 0.15s; padding: 16px; }
.dialog .card { width: min(420px, 100%); padding: 22px; display: grid; gap: 14px; animation: pop 0.3s var(--spring); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
