/* ClipperShed — app styles. No external fonts or frameworks: everything is served from this server. */
@font-face { font-family: 'Inter Black'; src: url('../assets/fonts/Inter-Black.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Inter ExtraBold'; src: url('../assets/fonts/Inter-ExtraBold.otf') format('opentype'); font-display: swap; }

:root {
  --bg: #0e0f12;
  --bg2: #15171c;
  --panel: #1a1d23;
  --panel2: #21252d;
  --line: #2c313b;
  --line2: #3a404c;
  --text: #e9ebef;
  --muted: #9aa1ad;
  --faint: #6b7280;
  --accent: #ffd400;
  --accent-ink: #141414;
  --accent-soft: rgba(255, 212, 0, .12);
  --good: #36c37a;
  --good-soft: rgba(54, 195, 122, .14);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, .14);
  --bad: #f05252;
  --bad-soft: rgba(240, 82, 82, .14);
  --info: #4ea1ff;
  --info-soft: rgba(78, 161, 255, .14);
  --radius: 10px;
  --radius-s: 7px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7; --bg2: #eceef2; --panel: #ffffff; --panel2: #f6f7f9; --line: #e1e4ea; --line2: #cfd4dc;
  --text: #15181e; --muted: #5d6573; --faint: #8b93a1; --accent: #f5c400; --accent-ink: #141414;
  --accent-soft: rgba(245, 196, 0, .16); --shadow: 0 10px 30px rgba(15, 20, 30, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
.ico { width: 18px; height: 18px; flex: none; }
.drop > .ico { width: 40px; height: 40px; color: var(--accent); }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 .8em; }
code, kbd { font-family: var(--mono); font-size: 12.5px; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); } .num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font: 15px 'Inter Black', var(--font); }
.nav { padding: 4px 8px 16px; display: flex; flex-direction: column; gap: 1px; }
.nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--text); }
.nav a.on .ico { color: var(--accent); }
.nav .ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .badge { margin-left: auto; }
.side .foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 22px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); min-height: 56px; }
.top h1 { font-size: 18px; margin: 0; }
.content { padding: 22px; max-width: 1500px; width: 100%; }
.content.full { max-width: none; padding: 0; }
.burger { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .burger { display: inline-flex; }
  .content { padding: 14px; }
  .top { padding: 10px 14px; }
}

/* ---------- components ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
.card.pad0 { padding: 0; }
.card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card .head h3 { margin: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 12px; color: var(--faint); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--radius-s); border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; user-select: none; }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel2); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.xs { height: 24px; padding: 0 7px; font-size: 12px; border-radius: 6px; }
.btn .ico { width: 16px; height: 16px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); }

input, select, textarea { font: 14px var(--font); color: var(--text); background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--radius-s); padding: 7px 10px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=range] { padding: 0; accent-color: var(--accent); background: transparent; border: 0; }
input[type=color] { padding: 2px; height: 34px; width: 46px; }
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 550; min-width: 0; }
label.f > span .hint { font-weight: 400; color: var(--faint); }
label.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 14px; }
.form > * { grid-column: span 12; }
.form .s2 { grid-column: span 2; } .form .s3 { grid-column: span 3; } .form .s4 { grid-column: span 4; } .form .s6 { grid-column: span 6; } .form .s8 { grid-column: span 8; } .form .s9 { grid-column: span 9; }
@media (max-width: 700px) { .form .s2, .form .s3, .form .s4, .form .s6, .form .s8, .form .s9 { grid-column: span 12; } }
.form .sec { grid-column: span 12; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.form .sec:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.form .help { grid-column: span 12; font-size: 12.5px; color: var(--muted); margin-top: -4px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th, table.t td { text-align: left; padding: 8px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 650; background: var(--panel2); position: sticky; top: 0; z-index: 1; white-space: nowrap; cursor: default; }
table.t th.sort { cursor: pointer; } table.t th.sort:hover { color: var(--text); }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--panel2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t td .cell-sub { font-size: 12px; color: var(--faint); }
table.t.compact th, table.t.compact td { padding: 5px 9px; }
table.t tfoot td { font-weight: 700; background: var(--panel2); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 260px; }
.toolbar select { width: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--muted); font: 600 13.5px var(--font); padding: 9px 13px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--info); background: var(--panel); border-radius: var(--radius-s); padding: 11px 14px; font-size: 13.5px; }
.callout.warn { border-left-color: var(--warn); } .callout.good { border-left-color: var(--good); } .callout.bad { border-left-color: var(--bad); } .callout.acc { border-left-color: var(--accent); }
.callout b:first-child { display: block; margin-bottom: 3px; }
.progress { height: 8px; border-radius: 99px; background: var(--panel2); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s; }
.list { display: flex; flex-direction: column; }
.list .it { display: flex; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.list .it:last-child { border-bottom: 0; }
.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.score-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 19px; background: conic-gradient(var(--c, var(--accent)) calc(var(--p) * 1%), var(--panel2) 0); position: relative; }
.score-ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--panel); }
.score-ring span { position: relative; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban .colk { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.kanban .colk h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kanban .kc { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-top: 8px; cursor: pointer; }
.kanban .kc:hover { border-color: var(--line2); }
.kanban .kc.drag { opacity: .5; }
.kanban .colk.over { outline: 2px dashed var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line2); background: var(--panel2); color: var(--muted); font-size: 12.5px; cursor: pointer; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 8px; }
.bar-chart .b { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; opacity: .9; }
.bar-chart .b:hover { opacity: 1; }
.bar-labels { display: flex; gap: 4px; font-size: 10.5px; color: var(--faint); }
.bar-labels span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 140px 1fr 70px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.hbar .track { height: 10px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .12s; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: min(1040px, 100%); }
.modal.narrow { width: min(460px, 100%); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; font-size: 17px; }
.modal .body { padding: 18px; overflow-y: auto; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--good); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); max-width: 380px; font-size: 13.5px; animation: fade .15s; }
.toast.err { border-left-color: var(--bad); }
.toast.info { border-left-color: var(--info); }

/* auth & landing */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at 10% 10%, rgba(255, 212, 0, .14), transparent 60%), var(--bg2); padding: 48px 56px; display: flex; flex-direction: column; gap: 26px; border-right: 1px solid var(--line); }
.auth-hero h1 { font: 44px/1.08 'Inter Black', var(--font); letter-spacing: -.02em; margin: 0; }
.auth-hero h1 em { font-style: normal; color: var(--accent); }
.auth-hero .lead { font-size: 17px; color: var(--muted); max-width: 560px; }
.feat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 680px; }
.feat div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; color: var(--muted); }
.feat b { display: block; color: var(--text); margin-bottom: 2px; }
.auth-box { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(400px, 100%); }
@media (max-width: 960px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { padding: 28px 22px; } .auth-hero h1 { font-size: 32px; } .feat { grid-template-columns: 1fr; } }

/* guide */
.prose { max-width: 820px; font-size: 14.5px; line-height: 1.65; }
.prose h2 { margin-top: 1.6em; padding-top: .4em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose table { border-collapse: collapse; width: 100%; margin: .6em 0 1.2em; font-size: 13.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.prose th { background: var(--panel2); }
.guide { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; }
.guide nav { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - 100px); overflow: auto; }
.guide nav a { color: var(--muted); padding: 5px 10px; border-radius: 6px; font-size: 13.5px; }
.guide nav a.on, .guide nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
@media (max-width: 900px) { .guide { grid-template-columns: 1fr; } .guide nav { position: static; flex-direction: row; flex-wrap: wrap; } }

/* timer pill in the top bar */
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line2); font-size: 12.5px; font-weight: 650; cursor: pointer; color: var(--text); }
.pill.hot { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.pill.late { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.pill.rec .dot { background: var(--bad); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.spin { width: 16px; height: 16px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: rot .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading { padding: 50px; text-align: center; color: var(--muted); }
.check-list { display: flex; flex-direction: column; gap: 2px; }
.check-list label { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.check-list label:hover { background: var(--panel2); }
.check-list input { margin-top: 3px; }
.check-list label.done span { color: var(--muted); text-decoration: line-through; }
.tpl-preview { white-space: pre-wrap; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 13.5px; line-height: 1.6; }
.tpl-preview mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 2px; }
.hook-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.hook-item:last-child { border-bottom: 0; }
.hook-item .txt { flex: 1; min-width: 0; }
.hook-item:hover { background: var(--panel2); }
.pill .ico { width: 15px; height: 15px; }
label.f { justify-content: flex-end; }
