:root {
  --bg: #070707; --panel: #121212; --panel2: #1a1a1a; --line: #262626; --line2: #333;
  --ink: #f4f4f4; --ink2: #b9b9b9; --ink3: #7c7c7c;
  --blue: #2560cb; --pink: #e8458b; --ok: #2f9e44; --warn: #e2bd1b; --bad: #d12b2b;
  --focus: #4f86ff; --radius: 10px; --cell-h: 30px;
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100%; }
body { font-size: 14px; line-height: 1.35; -webkit-font-smoothing: antialiased; }
a { color: #7fa6ff; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--ink3); }

/* ---- shell ---- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(7,7,7,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-size: 13px; white-space: nowrap; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 14px var(--blue); }
.brand a { color: inherit; text-decoration: none; }
.event-name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.event-name small { color: var(--ink3); font-weight: 500; margin-left: 8px; }
.status { display: flex; align-items: center; gap: 8px; color: var(--ink2); font-size: 12px; white-space: nowrap; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); }
.led.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.led.sheet { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.led.off { background: var(--bad); }
.avatars { display: flex; gap: 4px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; border: 2px solid var(--bg); }
.tabs { display: flex; gap: 2px; padding: 0 10px 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; color: var(--ink2); padding: 8px 12px 10px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; font-size: 13px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--pink); }
.banner { background: #2a2411; color: #ffe39a; border-bottom: 1px solid #4a3f14; padding: 8px 16px; font-size: 13px; }
.banner.red { background: #2b1212; color: #ffb3b3; border-color: #4a1a1a; }
.banner.blue { background: #0f1a33; color: #bcd1ff; border-color: #1d3573; }
main { padding: 16px; max-width: 100%; }
.footer { color: var(--ink3); font-size: 11px; padding: 24px 16px; text-align: center; }

/* ---- buttons & fields ---- */
.btn { background: var(--panel2); border: 1px solid var(--line2); color: var(--ink); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: #555; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.pink { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.danger { border-color: #5a1f1f; color: #ff9a9a; }
.btn.small { padding: 4px 8px; font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); font-weight: 700; }
.field input, .field select, .field textarea, .text { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; color: var(--ink); min-width: 0; width: 100%; }
.field input:focus, .field textarea:focus, .text:focus, .cell:focus, .field select:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.field input:disabled, .field textarea:disabled, .cell:disabled { color: var(--ink2); -webkit-text-fill-color: var(--ink2); opacity: 1; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.panel h2, .panel h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink2); font-weight: 800; }
.panel h2 .sub, .muted { color: var(--ink3); font-weight: 500; text-transform: none; letter-spacing: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: #262626; color: var(--ink2); }
.pill.ok { background: #143d1e; color: #9ff0b0; } .pill.warn { background: #3d3414; color: #ffe39a; } .pill.bad { background: #3d1414; color: #ffb3b3; } .pill.blue { background: #142447; color: #bcd1ff; } .pill.pink { background: #41142a; color: #ffb6d4; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 4px 8px; font-size: 12px; color: var(--ink2); }
.chip b { color: var(--ink); }
.swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,.2); display: inline-block; }
code, .code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
textarea.code { width: 100%; min-height: 220px; background: #0b0b0b; border: 1px solid var(--line2); border-radius: 8px; padding: 10px; color: #d8d8d8; white-space: pre; }
.notice { color: var(--ink2); font-size: 13px; }
.steps { margin: 0; padding-left: 20px; color: var(--ink2); }
.steps li { margin: 6px 0; }
.steps b { color: var(--ink); }
kbd { background: #222; border: 1px solid #444; border-radius: 4px; padding: 0 5px; font-size: 11px; }

/* ---- grids / tables ---- */
.scroller { overflow: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
table.grid th { position: sticky; top: 0; z-index: 2; background: #161616; color: var(--ink2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
table.grid th.group { text-align: center; background: #1d1d1d; color: var(--ink); border-left: 1px solid var(--line2); top: 0; }
table.grid thead tr:nth-child(2) th { top: 31px; }
table.grid td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); height: var(--cell-h); vertical-align: middle; }
table.grid td.ro { padding: 0 8px; color: var(--ink2); white-space: nowrap; }
table.grid td.num { padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.n { padding: 0 8px; color: var(--ink3); text-align: right; font-variant-numeric: tabular-nums; width: 38px; background: #0f0f0f; }
table.grid td.sticky, table.grid th.sticky { position: sticky; left: 0; z-index: 3; background: #101010; }
table.grid th.sticky { z-index: 4; }
table.grid td.sticky2, table.grid th.sticky2 { position: sticky; left: 38px; z-index: 3; background: #101010; }
table.grid th.sticky2 { z-index: 4; }
table.grid tr.live td { box-shadow: inset 3px 0 0 var(--pink); }
table.grid tr.zebra td { background: #0e0e0e; }
table.grid tr.total td { font-weight: 700; background: #161616; }
table.grid td.status { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--pink); padding: 0 8px; }
.cell { width: 100%; height: var(--cell-h); border: 0; background: transparent; padding: 0 8px; color: var(--ink); min-width: 60px; }
.cell.w-s { min-width: 54px; width: 64px; } .cell.w-m { min-width: 110px; width: 130px; } .cell.w-l { min-width: 160px; width: 200px; } .cell.w-xl { min-width: 220px; width: 300px; }
.cell.ta { height: auto; min-height: 60px; padding: 6px 8px; resize: vertical; width: 100%; }
.cell.center { text-align: center; }
.cell::placeholder { color: #3f3f3f; }
input.cb { width: 16px; height: 16px; accent-color: var(--blue); margin: 0 8px; vertical-align: middle; cursor: pointer; }
.remote-focus { outline: 2px solid var(--who, var(--pink)) !important; outline-offset: -2px; position: relative; }
td.has-remote { position: relative; }
td.has-remote::after { content: attr(data-who); position: absolute; right: 2px; top: -1px; font-size: 9px; background: var(--who, var(--pink)); color: #fff; padding: 0 4px; border-radius: 3px; pointer-events: none; z-index: 1; }
.sub-bar { display: inline-block; width: 4px; height: 18px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.cellwrap { display: flex; align-items: center; height: var(--cell-h); padding-left: 6px; }
.cellwrap .cell { padding-left: 2px; }

/* ---- acts layout ---- */
.split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.split > * { min-width: 0; }
main { overflow-x: clip; }
.actlist { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 110px); overflow: auto; }
.actbtn { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink); }
.actbtn:hover { border-color: var(--line2); }
.actbtn.active { border-color: var(--blue); background: #0f162a; }
.actbtn .no { color: var(--ink3); font-weight: 800; font-size: 12px; }
.actbtn .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actbtn .tm { color: var(--ink3); font-size: 11px; grid-column: 2; }
.actbtn .live { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.actbtn.empty .nm { color: var(--ink3); font-weight: 500; }
.acthead { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.acthead h1 { margin: 0; font-size: 22px; font-weight: 800; }
.flags { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; color: var(--ink2); }
.flags label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.plot img { max-width: 100%; max-height: 520px; border-radius: 8px; border: 1px solid var(--line2); display: block; }
.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.box-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; border-bottom: 1px solid var(--line); }
.box-head select { background: transparent; border: 0; color: inherit; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; cursor: pointer; flex: 1; }
.box-head select option { color: #000; }
.box-line { display: grid; grid-template-columns: 40px 1fr; gap: 6px; padding: 3px 10px; border-bottom: 1px solid #1c1c1c; font-size: 13px; min-height: 24px; align-items: center; }
.box-line .k { color: var(--ink3); font-weight: 700; font-size: 11px; }
.box-line .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-line .v small { color: var(--ink3); margin-left: 6px; }
.box-line:nth-child(even) { background: #0e0e0e; }
.home { max-width: 720px; margin: 40px auto; padding: 0 16px; }
.home h1 { font-size: 34px; margin: 0 0 6px; font-weight: 800; }
.home .lead { color: var(--ink2); margin-bottom: 24px; font-size: 15px; }
.events { display: flex; flex-direction: column; gap: 8px; }
.event-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.event-row .nm { font-weight: 700; }
.event-row .nm small { display: block; color: var(--ink3); font-weight: 500; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1e1e1e; border: 1px solid var(--line2); color: var(--ink); padding: 10px 14px; border-radius: 10px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 13px; max-width: 90vw; }
.toast.bad { border-color: var(--bad); }
.toast.ok { border-color: var(--ok); }
.glow { position: fixed; inset: auto -200px -300px auto; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(closest-side, rgba(37,96,203,.22), rgba(232,69,139,.10) 55%, transparent 75%); pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; }

@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .actlist { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; } .actbtn { flex: 1 1 160px; } .top-row { padding: 8px 12px; } main { padding: 10px; } .event-name { font-size: 14px; } }

/* ---- print ---- */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html, body { background: #fff; color: #000; font-size: 11px; }
  .top, .footer, .toast, .glow, .no-print, .actlist, .banner { display: none !important; }
  main { padding: 0; }
  .split { display: block; }
  .panel, .scroller, .box { background: #fff; border-color: #999; color: #000; break-inside: avoid; box-shadow: none; }
  .panel h2, .panel h3 { color: #000; }
  table.grid { font-size: 10px; width: 100%; }
  table.grid th { position: static; background: #eee; color: #000; border: 1px solid #999; padding: 3px 4px; }
  table.grid td { border: 1px solid #bbb; height: 18px; color: #000; background: #fff !important; }
  table.grid td.n, table.grid td.ro { color: #000; background: #fff; }
  .cell { color: #000; height: 18px; font-size: 10px; padding: 0 4px; -webkit-text-fill-color: #000; }
  .cell::placeholder { color: transparent; }
  .cell.ta { min-height: 30px; }
  input.cb { accent-color: #000; }
  .pill, .chip { border: 1px solid #999; background: #fff; color: #000; }
  .acthead h1 { color: #000; }
  .box-head { color: #000; border-color: #999; }
  .box-line .k, .box-line .v { color: #000; }
  .box-line:nth-child(even) { background: #f3f3f3; }
  .boxes { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .print-title { display: block !important; font-size: 16px; font-weight: 800; margin-bottom: 6px; }
}
.print-title { display: none; }

/* ---- accounts, sharing, comments (1.1.0) ---- */
.userchip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); font-size: 12px; white-space: nowrap; }
.userchip a { color: var(--ink3); text-decoration: none; }
.userchip a:hover { color: var(--ink); }
.rolepill { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: #222; color: var(--ink2); }
.rolepill.owner { background: #41142a; color: #ffb6d4; } .rolepill.editor { background: #142447; color: #bcd1ff; } .rolepill.commenter { background: #3d3414; color: #ffe39a; } .rolepill.viewer { background: #1f1f1f; color: var(--ink2); }
.btn.ghost { background: transparent; }
.btn .count { background: var(--pink); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 6px; min-width: 16px; text-align: center; }
.signin-hero { text-align: center; padding: 30px 10px; }
.signin-hero .btn { font-size: 15px; padding: 12px 20px; }
.members { width: 100%; border-collapse: collapse; }
.members td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.members select { background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 6px; color: var(--ink); }
.roles-help { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 13px; color: var(--ink2); margin: 10px 0; }
.roles-help b { color: var(--ink); }
td.has-comment, .field.has-comment { position: relative; }
td.has-comment::before, .field.has-comment::before { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 10px 10px 0; border-color: transparent var(--pink) transparent transparent; pointer-events: none; z-index: 1; }
.sel-cell { outline: 2px dashed var(--ink3); outline-offset: -2px; }
@keyframes flash { 0% { box-shadow: inset 0 0 0 3px var(--pink); } 100% { box-shadow: none; } }
.flash { animation: flash 1.6s ease-out; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: #0d0d0d; border-left: 1px solid var(--line2); z-index: 40; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0,0,0,.6); transform: translateX(100%); transition: transform .18s ease; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.drawer-body { overflow: auto; flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.newc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.newc .target { font-size: 12px; color: var(--ink2); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.newc .target b { color: var(--ink); }
.newc textarea { width: 100%; min-height: 64px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 8px; color: var(--ink); resize: vertical; }
.cmt { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.cmt.resolved { opacity: .55; }
.cmt .where { font-size: 12px; color: #7fa6ff; cursor: pointer; font-weight: 700; }
.cmt .where:hover { text-decoration: underline; }
.cmt .text { margin: 6px 0; white-space: pre-wrap; }
.cmt .by { font-size: 11px; color: var(--ink3); }
.cmt .reply { margin: 8px 0 0 12px; padding-left: 10px; border-left: 2px solid var(--line2); font-size: 13px; }
.cmt .tools { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.cmt .tools input { flex: 1; min-width: 120px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 8px; color: var(--ink); font-size: 12px; }
.drawer .section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); font-weight: 800; margin-top: 6px; }
