:root {
  --red: #FF0000;
  --red-dark: #CC0000;
  --red-dim: rgba(255,0,0,0.12);
  --black: #060709;
  --white: #ffffff;
  --gray-1: #f5f5f5;
  --gray-2: #e8e8e8;
  --gray-3: #c0c0c0;
  --gray-4: #888888;
  --gray-5: #444444;
  --panel: #13131a;
  --panel-2: #0d0d12;
  --line: #1e1e22;
  --line-soft: #1a1a22;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--black); font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Segoe UI, Roboto, sans-serif; color: var(--white); }
body { overflow: hidden; }

/* ── LOGIN ── */
.login {
  position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(120% 120% at 50% 0%, #14070a 0%, var(--black) 60%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login[hidden] { display: none; }
.login-card {
  width: 100%; max-width: 380px;
  background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 14px; padding: 28px 24px 24px;
  text-align: center;
}
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.login-card .brand { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login-card .brand span { color: var(--red); }
.login-card h1 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; margin-bottom: 4px; }
.login-card p.sub { font-size: 12px; color: var(--gray-4); margin-bottom: 20px; }
.login-card label { display: block; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--red); margin-bottom: 6px; }
.login-card input {
  width: 100%; padding: 13px 14px; font-size: 16px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; color: var(--white); outline: none;
}
.login-card input:focus { border-color: var(--red); }
.login-card button {
  width: 100%; margin-top: 14px; padding: 13px;
  font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--red); color: var(--white);
  border: none; border-radius: 8px; cursor: pointer;
}
.login-card button:active { background: var(--red-dark); }
.recent { margin-top: 18px; text-align: left; }
.recent-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--gray-4); margin-bottom: 8px; }
.recent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-chip { font-size: 12px; font-weight: 600; color: var(--gray-3); background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; cursor: pointer; }
.recent-chip:active { border-color: var(--red); color: var(--white); }

/* ── SHUTTER ICON ── */
.shutter { width: 28px; height: 28px; border: 2px solid var(--red); border-radius: 50%; position: relative; flex-shrink: 0; }
.shutter::before { content: 'L'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--red); letter-spacing: -.5px; }

/* ── LAYOUT ── */
.shell { display: flex; flex-direction: column; height: 100dvh; max-width: 480px; margin: 0 auto; background: var(--black); }

/* ── HEADER ── */
.hdr { padding: 0; background: var(--black); border-bottom: 2px solid var(--red); flex-shrink: 0; position: relative; overflow: hidden; }
.hdr-inner { padding: 14px 18px 12px; position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hdr::after { content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 52px 52px 0; border-color: transparent var(--red) transparent transparent; opacity: .9; }
.hdr-left { min-width: 0; }
.hdr-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.hdr-wordmark { line-height: 1.1; }
.hdr-wordmark .brand { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--white); text-transform: uppercase; }
.hdr-wordmark .brand span { color: var(--red); }
.hdr h1 { font-size: 16px; font-weight: 700; color: var(--white); letter-spacing: -.2px; }
.hdr p.tagline { font-size: 11px; color: var(--gray-4); margin-top: 1px; letter-spacing: .02em; }

/* user chip */
.user-chip { display: flex; align-items: center; gap: 8px; flex-shrink: 0; z-index: 2; }
.user-chip .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.user-chip .uname { font-size: 12px; font-weight: 700; color: var(--white); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .switch { font-size: 10px; color: var(--gray-4); background: none; border: 1px solid #333; border-radius: 5px; padding: 3px 7px; cursor: pointer; }

/* ── TABS ── */
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; background: var(--black); border-bottom: 1px solid #1a1a1a; flex-shrink: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; padding: 12px 15px; font-size: 12px; font-weight: 600; color: var(--gray-4); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
.tab.on { color: var(--red); border-bottom-color: var(--red); }

/* ── SCROLL AREA ── */
.body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #0d0d0f; }
.page { display: none; padding: 16px 16px 48px; }
.page.on { display: block; }
.page-inner { max-width: 1100px; margin: 0 auto; }

/* ── GOLDEN RULE ── */
.rule { background: var(--red); border-radius: 8px; padding: 14px 16px; margin-bottom: 20px; position: relative; overflow: hidden; }
.rule::after { content: ''; position: absolute; bottom: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 0 40px 40px; border-color: transparent transparent rgba(0,0,0,.2) transparent; }
.rule p { font-size: 13px; font-weight: 700; color: var(--white); line-height: 1.65; text-align: center; letter-spacing: .02em; text-transform: uppercase; }

/* ── SECTION LABEL ── */
.lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--red); margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
.lbl.first { margin-top: 0; }
.lbl::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── ARC BAR ── */
.arc { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.arc-s { flex: 1; text-align: center; padding: 9px 4px; font-size: 10px; font-weight: 700; color: var(--gray-4); border-right: 1px solid var(--line); line-height: 1.3; text-transform: uppercase; letter-spacing: .03em; }
.arc-s:last-child { border-right: none; }
.arc-s span { display: block; font-size: 9px; color: #333; margin-top: 1px; }
.arc-s.hi { background: var(--red); color: var(--white); }
.arc-s.hi span { color: rgba(255,255,255,.6); }

/* ── CARDS ── */
.card { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 8px; padding: 13px 15px; margin-bottom: 8px; }
.card h3 { font-size: 13px; font-weight: 700; color: var(--white); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .02em; }
.card p { font-size: 13px; line-height: 1.55; color: var(--gray-3); }
.card strong { color: var(--white); font-weight: 700; }
.card.warn { border-left-color: #ff4444; background: #1a0808; }
.card.warn h3 { color: #ff4444; }
.card.warn p { color: #cc8888; }
.card.info { border-left-color: var(--gray-4); background: #111118; }
.card.info h3 { color: var(--gray-3); }
.card.info p { color: var(--gray-4); }

/* ── BULLET LIST ── */
.blist { list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 15px; margin-bottom: 8px; }
.blist li { font-size: 13px; color: var(--gray-3); line-height: 1.55; padding: 9px 0 9px 16px; position: relative; border-bottom: 1px solid var(--line-soft); }
.blist li:last-child { border-bottom: none; }
.blist li::before { content: "\25B6"; position: absolute; left: 0; color: var(--red); font-size: 7px; top: 13px; }
.blist li strong { font-weight: 700; color: var(--white); }

/* ── SETTINGS TABLE ── */
.stbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.stbl th { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--red); padding: 10px 14px 6px; text-align: left; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.stbl td { font-size: 12.5px; padding: 9px 14px; border-top: 1px solid var(--line-soft); vertical-align: top; line-height: 1.45; }
.stbl td:first-child { font-weight: 700; color: var(--white); width: 38%; font-size: 11.5px; }
.stbl td:last-child { color: var(--gray-3); }

/* ── SHOT LIST ── */
.shot-block { break-inside: avoid; -webkit-column-break-inside: avoid; }
.shot-block .lbl { margin-top: 22px; }
.shot-block .lbl.first { margin-top: 0; }
.shot-group { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 15px; margin-bottom: 8px; }
.shot { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.shot:last-child { border-bottom: none; }
.shot-name { font-size: 13.5px; font-weight: 700; color: var(--white); margin-bottom: 2px; }
.shot-move { font-size: 12px; color: var(--gray-4); }

/* ── CHECKLIST ── */
.cl-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.cl-toolbar .who { font-size: 12px; color: var(--gray-4); line-height: 1.4; min-width: 0; }
.cl-toolbar .who b { color: var(--white); font-weight: 700; }
.btn-refresh { flex-shrink: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--white); background: var(--red); border: none; border-radius: 7px; padding: 10px 14px; cursor: pointer; }
.btn-refresh:active { background: var(--red-dark); }
.cl-group { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 15px; margin-bottom: 10px; }
.cl-hdr { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.cl-hdr-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--red); }
.cl-reset { font-size: 11px; background: none; border: 1px solid #333; border-radius: 5px; padding: 3px 9px; cursor: pointer; color: var(--gray-4); }
.ci { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.ci:last-child { border-bottom: none; }
.ci input { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; cursor: pointer; accent-color: var(--red); }
.ci-txt { font-size: 13.5px; color: var(--white); line-height: 1.4; }
.ci-txt small { display: block; font-size: 11.5px; color: var(--gray-4); margin-top: 2px; }
.ci.done .ci-txt { color: #444; text-decoration: line-through; }
.progress { font-size: 12px; color: var(--gray-4); text-align: center; padding: 4px 0 12px; }
.progress .bar { height: 4px; background: var(--line); border-radius: 3px; margin: 8px auto 0; max-width: 320px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--red); width: 0; transition: width .25s ease; }

/* ── SLOGAN ── */
.slogan { text-align: center; padding: 16px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-5); }

/* ── TOAST ── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red); color: var(--white); font-size: 13px; font-weight: 600; padding: 11px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ════════ RESPONSIVE — TABLET / DESKTOP ════════ */
@media (min-width: 760px) {
  .shell { max-width: 1180px; }
  .hdr::after { border-width: 0 64px 64px 0; }
  .hdr h1 { font-size: 20px; }
  .tabs { justify-content: center; }
  .tab { font-size: 13px; padding: 14px 22px; }
  .page { padding: 28px 32px 64px; }

  /* multi-column flow for content-heavy pages */
  .cols { column-count: 2; column-gap: 24px; }
  .cols > * { break-inside: avoid; -webkit-column-break-inside: avoid; }
  .arc, .rule { column-span: all; }

  /* shots & checklist in a responsive grid instead of columns */
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
  .grid > .lbl { grid-column: 1 / -1; }
  .grid > .lbl.first { margin-top: 0; }

  .checklist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; align-items: start; }
  .checklist-grid > .cl-toolbar, .checklist-grid > .progress, .checklist-grid > .slogan { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .cols { column-count: 3; }
}
