/* Sub Goal Live (hosted) — shared control room, broadcast and login theme. */

:root {
  --bg: #09090b;
  --panel: #101014;
  --panel-2: #15151a;
  --field: #1b1b20;
  --border: #2a2a31;
  --border-soft: #202027;
  --text: #f7f7fb;
  --muted: #9d9dab;
  --muted-2: #6f6f7c;
  --purple: #9147ff;
  --purple-2: #b77cff;
  --green: #35d07f;
  --red: #ff5c70;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.admin-body { min-height: 100vh; background: radial-gradient(circle at 80% -10%, #281647 0, transparent 25rem), var(--bg); font-size: 16px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 26px 18px; border-right: 1px solid var(--border-soft); background: rgba(10,10,12,.94); display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 30px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--purple), #6231d7); box-shadow: 0 8px 30px rgba(145,71,255,.25); color: #fff; }
.brand-mark svg { width: 21px; height: 21px; }
.brand strong { display: block; letter-spacing: .1em; font-size: 13px; }
nav { display: grid; gap: 3px; }
.nav-link { display: flex; gap: 12px; align-items: center; min-height: 42px; padding: 0 12px; color: var(--muted); border-radius: 10px; text-decoration: none; font-weight: 650; font-size: 14px; }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover, .nav-link.active { color: var(--text); background: #19151f; }
.nav-link.active { background: #20132f; color: #c99aff; }
.sidebar-secondary { display: grid; gap: 3px; margin: 14px 0; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.sidebar-status { margin-top: auto; padding: 16px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.status-row { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); flex: none; }
.streamer-link { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 650; }
.streamer-link:hover { color: var(--text); }
.streamer-link svg { width: 13px; height: 13px; }
.sidebar-status small { display: block; color: var(--muted-2); margin-top: 9px; line-height: 1.4; font-size: 10px; }

.admin-main { margin-left: 232px; padding: 34px clamp(24px, 4vw, 60px) 80px; max-width: 1900px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.eyebrow, .step-label { margin: 0 0 7px; color: var(--purple-2); font-size: 12px; font-weight: 850; letter-spacing: .16em; }
.step-label.danger { color: var(--red); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.03em; }
h2 { margin-bottom: 5px; font-size: 22px; letter-spacing: -.02em; }
.title-row { display: flex; align-items: center; gap: 10px; }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.top-actions, .form-actions, .live-buttons, .file-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

.icon-button { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: #111115; cursor: pointer; text-decoration: none; transition: .15s; }
.icon-button:hover { color: var(--text); border-color: #4a3a6a; }
.icon-button svg { width: 16px; height: 16px; }

.pill { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--border); background: #151519; color: var(--muted); font-size: 13px; font-weight: 700; }
.pill.live { border-color: #245e41; background: #0d2117; color: #a4f2c8; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: none; }
.pill.live .pill-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pill.next-pill { background: #16101f; border-color: #3f2862; color: var(--text); cursor: default; }
.pill.next-pill b { color: var(--purple-2); }
.pill svg { width: 14px; height: 14px; }

.menu-wrap { position: relative; }
.menu-dropdown { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; display: grid; min-width: 190px; padding: 6px; border: 1px solid var(--border); border-radius: 11px; background: #131318; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.menu-dropdown[hidden] { display: none; }
.menu-dropdown button, .menu-dropdown .menu-file { display: block; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 13px; font-weight: 650; text-align: left; cursor: pointer; line-height: 38px; position: relative; }
.menu-dropdown button:hover, .menu-dropdown .menu-file:hover { background: #1e1a27; }
.menu-dropdown .menu-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.menu-dropdown form { margin: 0; }
.button, label, .nav-link { font-size: 14px; }
.button { min-height: 40px; border: 1px solid transparent; border-radius: 9px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); background: var(--panel-2); text-decoration: none; font-weight: 760; cursor: pointer; transition: .18s ease; }
.button:hover { transform: translateY(-1px); filter: brightness(1.1); }
.button:disabled { opacity: .5; cursor: wait; transform: none; }
.button.primary { background: linear-gradient(135deg, #9b4dff, #7735ed); box-shadow: 0 8px 22px rgba(145,71,255,.2); }
.button.secondary { border-color: #55358d; background: #21172f; }
.button.ghost { border-color: var(--border); background: #111115; }
.button.danger-ghost { border-color: #4c252e; color: #ff9aa6; background: #1b1115; }
.button.danger { background: linear-gradient(135deg, #d43a52, #8f1f30); box-shadow: 0 8px 22px rgba(212,58,82,.25); }
.button.twitch { background: #9147ff; }

.section-block { scroll-margin-top: 24px; margin-bottom: 46px; }
.section-title { margin-bottom: 16px; }
.section-title.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-title p:not(.step-label) { margin: 0; color: var(--muted); font-size: 14px; }
.panel { background: linear-gradient(135deg,#111114,#0b0b0e); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; }
.badge { min-height: 25px; padding: 0 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.badge.neutral { color: var(--muted); border: 1px solid var(--border); background: #151519; }
.badge.live { color: #a4f2c8; border: 1px solid #245e41; background: #0d2117; }
.badge.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.test-banner[hidden] { display: none; }
.test-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px; border-radius: 13px; border: 1px solid #3e2b5f; background: linear-gradient(90deg, #1c112c, #121018); margin-bottom: 16px; }
.test-banner.running { border-color: #6a42a6; }
.test-banner.passed { border-color: #246545; background: linear-gradient(90deg, #0d2418, #111718); }
.test-banner.failed, .test-banner.warning { border-color: #74323c; background: #241216; }
.test-banner.warning .test-icon { background: var(--red); color: #240a0e; }
.test-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--purple); font-weight: 900; }
.test-banner.passed .test-icon { background: var(--green); color: #06120b; }
.test-banner strong { font-size: 14px; }
.test-banner p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.test-button { background: #2b1a42; border-color: #553183; }

.live-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 16px; }
.progress-panel, .preview-panel { padding: 20px; }
.hero-progress { margin: 25px 0 16px; display: flex; align-items: baseline; gap: 9px; }
.hero-progress strong { font-size: clamp(54px, 6vw, 78px); line-height: .85; letter-spacing: -.06em; color: var(--purple); }
.hero-progress span { color: var(--muted); font-size: 22px; }
.hero-progress b { color: var(--text); }
.progress-row { display: flex; align-items: center; gap: 12px; }
.admin-progress-track { flex: 1; height: 12px; overflow: hidden; border: 1px solid #303039; background: #202027; border-radius: 99px; }
.admin-progress-track div { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--purple-2)); transition: width .55s cubic-bezier(.2,.8,.2,1); }
.progress-row > span { min-width: 40px; text-align: right; color: var(--muted); font-size: 13px; font-weight: 800; }
.remaining-line { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 12px 0 22px; }
.remaining-line strong { color: var(--purple-2); font-size: 13px; }
.quick-controls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.quick-controls button { min-height: 40px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: #1a1a20; font-weight: 800; cursor: pointer; }
.quick-controls button:hover { border-color: #654491; background: #241833; }

.controls-row { display: flex; align-items: stretch; gap: 20px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.control-group { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.control-label { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.info-dot { width: 16px; height: 16px; padding: 0; border: 0; background: transparent; color: var(--muted-2); cursor: help; display: inline-flex; }
.info-dot svg { width: 100%; height: 100%; }
.control-divider { width: 1px; align-self: stretch; background: var(--border-soft); }
.control-divider.vertical { width: 1px; height: 22px; background: var(--border); }
.test-group { align-items: flex-start; gap: 8px; }
.test-run-button { display: inline-flex; align-items: center; gap: 8px; }
.test-run-button svg { width: 15px; height: 15px; }
.test-group small { color: var(--muted-2); font-size: 12px; }
.test-status { margin: 12px 0 0; color: var(--muted); font-size: 12px; min-height: 16px; }
.test-status[data-status="passed"] { color: var(--green); }
.test-status[data-status="failed"] { color: var(--red); }
.test-status[data-status="running"] { color: var(--purple-2); }
.preview-head-right { display: flex; align-items: center; gap: 10px; }
.preview-size { color: var(--muted-2); font-size: 12px; font-weight: 700; }
.preview-stage { margin: 16px 0 13px; min-height: 0; padding: 12px; border-radius: 11px; overflow: hidden; background-color: #202027; background-image: conic-gradient(#17171e 25%,#25252c 0 50%,#17171e 0 75%,#25252c 0); background-size: 20px 20px; }
.preview-stage iframe { display: block; width: 100%; height: 250px; border: 0; }
.preview-actions { display: flex; align-items: center; justify-content: center; gap: 16px; }
.preview-actions .button { display: inline-flex; align-items: center; gap: 7px; }
.preview-actions .button svg { width: 15px; height: 15px; }
.live-buttons { justify-content: flex-end; }

.form-panel, .twitch-panel { padding: 22px; }
.danger-panel { padding: 22px; margin-top: 18px; border-color: #4c252e; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.three { grid-template-columns: 1.5fr .7fr .7fr; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-grid.five { grid-template-columns: repeat(5, 1fr); }
.label-with-hint { display: inline-flex; align-items: center; gap: 5px; }
label { display: grid; gap: 8px; color: #dddde4; font-weight: 700; }
input { width: 100%; min-height: 44px; border: 1px solid #313138; border-radius: 8px; outline: none; padding: 0 13px; color: var(--text); background: var(--field); font-weight: 650; }
input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(145,71,255,.14); }
input[type="color"] { padding: 6px; cursor: pointer; }
.input-suffix { display: flex; align-items: center; border: 1px solid #313138; border-radius: 8px; overflow: hidden; background: var(--field); }
.input-suffix input { border: 0; border-radius: 0; }
.input-suffix b { padding-right: 12px; color: var(--muted); font-size: 12px; }
.goal-details { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 18px 0; }
.goal-details div { padding: 13px; border: 1px solid var(--border-soft); border-radius: 9px; background: #0e0e12; }
.goal-details small, .obs-url small, .callback-box small, .twitch-status-card small { display: block; color: var(--muted-2); font-size: 9px; font-weight: 850; letter-spacing: .12em; margin-bottom: 5px; }
.obs-url small { color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.goal-details strong { font-size: 13px; }

.suggestions { display: flex; gap: 8px; margin: -2px 0 14px; flex-wrap: wrap; }
.suggestions button { min-height: 31px; border: 1px solid var(--border); border-radius: 999px; padding: 0 12px; color: #d1d1da; background: #0c0c0f; cursor: pointer; font-size: 12px; }
.milestone-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; }
.milestone-card { position: relative; min-height: 220px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: rgba(11,11,14,.84); }
.milestone-card .card-label { color: #c7a3ff; font-size: 12px; letter-spacing: .1em; font-weight: 850; }
.delete-milestone { position: absolute; right: 10px; top: 9px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.delete-milestone:hover { color: #ff9aa6; background: #1b1115; }
.delete-milestone svg { width: 16px; height: 16px; }
#addMilestone svg { width: 15px; height: 15px; }
.milestone-fields { display: grid; grid-template-columns: 1fr; gap: 11px; margin-top: 16px; }
.milestone-card label { font-size: 14px; }
.milestone-card input { min-height: 41px; }
.milestone-value-wrap { display: flex; align-items: center; gap: 7px; }
.milestone-value-wrap input { max-width: 100px; }
.milestone-value-wrap span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.section-block > .form-actions { margin-top: 12px; justify-content: flex-end; }

.obs-url, .callback-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 13px 15px; border: 1px dashed #4a3a63; border-radius: 10px; background: #0f0c14; }
.obs-url code, .callback-box code { color: #d8c3fa; font-size: 12px; word-break: break-all; }
.obs-url + .form-actions, .callback-box + .form-actions { margin-top: 15px; }
.twitch-status-card { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 14px; margin-bottom: 18px; border: 1px solid #3f2862; border-radius: 10px; background: #16101f; }
.twitch-logo { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 9px; color: white; background: #9147ff; font-size: 22px; }
.twitch-status-card strong { display: block; }
.twitch-status-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.callback-box { display: block; }
.event-panel { overflow: hidden; }
.event-list { display: grid; }
.event-row { display: grid; grid-template-columns: 39px 1fr auto; gap: 12px; align-items: center; min-height: 61px; padding: 10px 16px; border-bottom: 1px solid var(--border-soft); }
.event-row:last-child { border-bottom: 0; }
.event-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: #c9a6ff; background: #241735; font-weight: 900; }
.event-row strong, .event-row small { display: block; }
.event-row strong { font-size: 13px; }
.event-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.event-amount { color: var(--purple-2); font-weight: 900; }
.empty-state { margin: 0; padding: 28px; color: var(--muted); text-align: center; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(4,4,6,.72); }
.modal-backdrop[hidden] { display: none; }
.modal-panel:focus { outline: none; }
.modal-panel { width: 100%; max-width: 540px; max-height: min(640px, 86vh); overflow-y: auto; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(135deg,#111114,#0b0b0e); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; }
.modal-body details { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.modal-body details:last-child { border-bottom: 0; }
.modal-body summary { cursor: pointer; font-weight: 750; color: var(--text); list-style: none; }
.modal-body summary::-webkit-details-marker { display: none; }
.modal-body summary::before { content: "+ "; color: var(--purple-2); }
.modal-body details[open] summary::before { content: "− "; }
.modal-body details p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-body > p { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hold-delete { position: relative; width: 100%; overflow: hidden; background: linear-gradient(135deg, #d43a52, #8f1f30); user-select: none; touch-action: none; }
.hold-fill { position: absolute; inset: 0; width: 0%; background: rgba(255,255,255,.3); }
.hold-delete.holding .hold-fill { width: 100%; transition: width 5s linear; }
.hold-label { position: relative; z-index: 1; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 370px; padding: 12px 15px; border: 1px solid #493265; border-radius: 10px; background: #191321; color: white; font-size: 13px; font-weight: 700; box-shadow: 0 16px 50px rgba(0,0,0,.4); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Login / marketing page */
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 50% -10%, #281647 0, transparent 30rem), var(--bg); padding: 24px; }
.login-card { width: 100%; max-width: 420px; padding: 34px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(135deg,#111114,#0b0b0e); text-align: center; }
.login-card .brand-mark { margin: 0 auto 18px; }
.login-card h1 { font-size: 26px; margin-bottom: 10px; }
.login-card p { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.login-card .button { width: 100%; min-height: 48px; font-size: 15px; }
.login-note { margin-top: 18px; color: var(--muted-2); font-size: 12px; line-height: 1.5; }
.login-links { margin-top: 22px; display: flex; justify-content: center; gap: 16px; font-size: 12px; }
.login-links a { color: var(--muted); }

.site-footer { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border-soft); text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.login-card .site-footer { margin-top: 20px; padding-top: 0; border-top: 0; }
.admin-main .site-footer { text-align: left; }

/* Transparent OBS overlay */
.overlay-body { min-width: 0; overflow: hidden; background: transparent; }
.overlay-widget { --accent: #9147ff; --border-width: 2px; position: relative; width: 760px; height: 250px; color: #fff; opacity: 1; transform: translateY(0); transition: opacity .35s, transform .35s; text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 10px rgba(0,0,0,.55); }
.overlay-widget.hidden { opacity: 0; transform: translateY(8px); }
.overlay-view { position: absolute; inset: 8px; padding: 24px; border: var(--border-width) solid var(--accent); border-radius: 24px; background: transparent; opacity: 0; transform: scale(.985) translateY(6px); transition: opacity .4s, transform .4s; pointer-events: none; }
.overlay-view.active { opacity: 1; transform: scale(1) translateY(0); }
.bar-view { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: 14px 28px; }
.overlay-main { display: grid; gap: 14px; min-width: 0; }
.overlay-title { font-size: 18px; font-weight: 850; letter-spacing: .05em; overflow-wrap: anywhere; }
.overlay-count { display: flex; gap: 7px; align-items: baseline; }
.overlay-count b { color: var(--accent); font-size: 46px; letter-spacing: -.04em; }
.overlay-count span { color: #777783; }
.overlay-count em { color: #bdbdc8; font-style: normal; font-size: 26px; font-weight: 750; }
.overlay-track-row { display: flex; align-items: center; gap: 12px; }
.overlay-track { flex: 1; position: relative; height: 22px; overflow: hidden; border: 1px solid #363640; border-radius: 999px; background: #222229; }
.overlay-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 75%, #4b1a8a), var(--accent), color-mix(in srgb, var(--accent) 65%, white)); box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 50%, transparent); transition: width .75s cubic-bezier(.2,.85,.2,1); }
.overlay-track-row > span:last-child { color: #d7d7e0; font-size: 14px; font-weight: 850; min-width: 40px; text-align: right; }
.next-col { display: grid; gap: 10px; justify-items: start; align-content: center; padding-left: 24px; border-left: 1px solid #39323f; }
.next-col small, .milestone-header small { display: block; color: color-mix(in srgb, var(--accent) 62%, white); font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.next-pill-overlay { display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%; padding: 10px 18px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 55%, #34343c); background: color-mix(in srgb, var(--accent) 14%, #15151a); }
.next-pill-overlay b { color: var(--accent); font-size: 20px; white-space: nowrap; }
.next-pill-overlay span { color: #ececf2; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.milestone-view { padding: 24px; }
.milestone-header { margin-bottom: 16px; }
.milestone-header strong { font-size: 18px; letter-spacing: .05em; }
.overlay-milestones { display: grid; grid-template-columns: repeat(var(--columns,5), minmax(0,1fr)); gap: 10px; }
.overlay-milestone { min-width: 0; height: 128px; padding: 16px 12px; display: flex; flex-direction: column; justify-content: center; gap: 8px; border: 1px solid color-mix(in srgb, var(--accent) 45%, #34343c); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 12%, #15151a); }
.overlay-milestone b { color: var(--accent); font-size: 26px; letter-spacing: -.02em; }
.overlay-milestone span { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #d7d7e0; font-size: 13px; line-height: 1.35; font-weight: 650; }
.overlay-widget.many-goals .overlay-milestones { grid-template-rows: repeat(2,1fr); gap: 6px; }
.overlay-widget.many-goals .overlay-milestone { height: 62px; padding: 6px 10px; gap: 3px; }
.overlay-widget.many-goals .overlay-milestone b { font-size: 18px; }
.overlay-widget.many-goals .overlay-milestone span { font-size: 12px; -webkit-line-clamp: 1; }
.overlay-event { position: absolute; left: 50%; top: 20px; z-index: 4; display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 15px; border: 1px solid var(--accent); border-radius: 999px; background: #111116; box-shadow: 0 8px 30px rgba(0,0,0,.4); opacity: 0; transform: translate(-50%,-18px) scale(.95); transition: .3s; }
.overlay-event.show { opacity: 1; transform: translate(-50%,0) scale(1); }
.overlay-event span { color: color-mix(in srgb, var(--accent) 58%, white); font-size: 16px; font-weight: 900; }
.overlay-event strong { font-size: 12px; }
.overlay-status { position: fixed; left: 12px; bottom: 8px; color: #555; font-size: 10px; font-family: monospace; }

button:focus-visible, a:focus-visible { outline: 3px solid #c99aff; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  /* Exempted: this fill's width tracks a real 5s hold timer, not decorative
     motion — without it, the bar would jump to full instantly while deletion
     is still 5 seconds away from actually triggering. */
  .hold-delete.holding .hold-fill { transition: width 5s linear !important; }
}

@media (max-width: 1050px) {
  .sidebar { position: static; width: 100%; min-height: auto; flex-direction: row; align-items: center; padding: 14px 18px; }
  .brand { padding: 0; }
  .sidebar nav { margin-left: auto; display: flex; }
  .sidebar-status { display: none; }
  .nav-link { min-height: 38px; }
  .nav-link span { display: none; }
  .admin-main { margin-left: 0; }
  .live-grid { grid-template-columns: 1fr; }
  .form-grid.four, .form-grid.five { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 720px) {
  .sidebar nav { display: none; }
  .admin-main { padding: 24px 16px 60px; }
  .topbar, .section-title.split { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; }
  .top-actions .button { flex: 1; }
  .test-banner { grid-template-columns: auto 1fr; }
  .test-button { grid-column: 1/-1; }
  .live-grid { grid-template-columns: minmax(0,1fr); }
  .form-grid.two, .form-grid.three, .form-grid.four, .form-grid.five, .milestone-grid, .goal-details { grid-template-columns: 1fr; }
  .preview-stage { overflow: hidden; }
}
