/* Look taken from visual-reference-clan-tower.html */
:root {
  --bg: #e8eee9; --surface: #ffffff; --sunk: #f2f5f2; --ink: #16231c; --muted: #56665d; --line: #c8d3cb;
  --red: #c94a33; --blue: #3567b8; --mark: #b9800f;
  --f-display: 'Grandstander', 'Trebuchet MS', system-ui, sans-serif;
  --f-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111814; --surface: #19221d; --sunk: #141c17; --ink: #e3ebe5; --muted: #93a399; --line: #2b3831;
    --red: #ee7a62; --blue: #7aa3ea; --mark: #e2b04a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111814; --surface: #19221d; --sunk: #141c17; --ink: #e3ebe5; --muted: #93a399; --line: #2b3831;
  --red: #ee7a62; --blue: #7aa3ea; --mark: #e2b04a; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
.wrap { margin: 0 auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; }
.title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(24px, 3vw, 32px); margin: 0; line-height: 1.1; }
h1 .r { color: var(--red); } h1 .b { color: var(--blue); }
.tag { color: var(--muted); margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 13px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: 12px; color: var(--muted); border-style: dashed; }
.main { --sidebar: 380px; --top: 74px; display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar); gap: 12px; align-items: stretch; }
.main.noinfo { grid-template-columns: minmax(0, 1fr); }
.main.noinfo .sidebar { display: none; }
.stagecol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#stage { width: 100%; height: calc(100vh - var(--top) - 64px); min-height: 300px; display: block; border-radius: 14px; border: 1px solid var(--line); background: #a9d8ea; cursor: grab; touch-action: none; }
.belowstage { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
#infoToggle { flex: none; }
/* The sidebar is as tall as the island column; its content scrolls inside it. */
.sidebar { position: relative; min-width: 0; }
.sidebar-inner { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; }
.sidebar .panel { flex: none; }
.sidebar .who { grid-template-columns: 1fr; }
.sidebar ul.list { max-height: none; overflow: visible; }
.hint { font-size: 12px; color: var(--muted); margin: 0 4px; }
@media (max-width: 1000px) {
  .main, .main.noinfo { grid-template-columns: 1fr; }
  #stage, .main.noinfo #stage { height: auto; aspect-ratio: 16 / 9; min-height: 0; }
  .sidebar-inner { position: static; }
  .sidebar ul.list { max-height: 360px; overflow: auto; }
  #infoToggle { display: none; }
}
#stage:active { cursor: grabbing; }
.roster { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.roster .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; }
button { font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
button:hover { border-color: var(--muted); }
button:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.now { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.who { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px 18px; font-size: 14px; }
.who li { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.who li .dot { transform: translateY(1px); }
.who li.card { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--sunk); border-left: 4px solid var(--line); }
.who li.card.red { border-left-color: var(--red); } .who li.card.blue { border-left-color: var(--blue); }
.who .cardhead { display: flex; align-items: center; gap: 6px; }
.who .doing { font-weight: 700; }
.who .why { color: var(--muted); font-style: italic; font-size: 13px; }
.who .said { font-size: 13px; }
.tag.ai, .tag.dummy { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 1px 7px; }
.tag.ai { background: var(--mark); color: #1b1300; } .tag.dummy { border: 1px dashed var(--line); color: var(--muted); }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.panel h2 { font-family: var(--f-display); font-weight: 700; font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; font-variant-numeric: tabular-nums; margin: 0; }
.stats dt { color: var(--muted); } .stats dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.meter { width: 80px; height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; border: 1px solid var(--line); display: inline-block; }
.meter i { display: block; height: 100%; }
small { color: var(--muted); }
ul.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; max-height: 360px; overflow: auto; }
ul.list li { padding-left: 10px; border-left: 3px solid var(--line); }
ul.list li.red { border-left-color: var(--red); } ul.list li.blue { border-left-color: var(--blue); }
ul.list li time { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }

details.panel summary { font-family: var(--f-display); font-weight: 700; font-size: 16px; cursor: pointer; }
#controls { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
#controls .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#controls .sep { width: 12px; }
#controls .lbl, #controls label { font-size: 13px; color: var(--muted); }
#controls input { font: inherit; font-size: 14px; color: var(--ink); background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
#controls input.short { width: 110px; }
#controls .state { margin: 0; }
#controls .danger { border-color: var(--red); color: var(--red); }
#controls .msg { font-size: 13px; color: var(--muted); }
#controls .msg.bad { color: var(--red); }
.note { margin: 0; color: var(--muted); font-size: 13px; }
#controls select { font: inherit; font-size: 14px; color: var(--ink); background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
#controls .money { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
#controls .money .bar { height: 8px; border-radius: 4px; background: var(--sunk); border: 1px solid var(--line); overflow: hidden; }
#controls .money .bar i { display: block; height: 100%; background: var(--mark); }
#controls .moneyline { margin: 0; font-variant-numeric: tabular-nums; }

.loghead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seg { display: inline-flex; gap: 0; }
.seg button { border-radius: 0; font-size: 12px; padding: 3px 9px; }
.seg button:first-child { border-radius: 8px 0 0 8px; } .seg button:last-child { border-radius: 0 8px 8px 0; border-left: none; }
ul.list.history { max-height: 50vh; overflow-y: auto; }
.sidebar ul.list.history { max-height: 50vh; overflow-y: auto; }
ul.list.history li { padding: 4px 0 6px 10px; }
ul.list.history .what { font-weight: 700; }
ul.list.history .nm { margin-right: 2px; }
ul.list.history .why { color: var(--muted); font-style: italic; }
ul.list.history .result { color: var(--muted); font-size: 12px; }
ul.list.history li.event { border-left-style: dotted; color: var(--muted); }
