/* Support's theme, ported from prototype B (wiki services/Support/Front-End.md). Bootstrap 5.3 is used as shipped
   (no Sass), and this is the one theme file. It does three things:
   1. the colour tokens of the first prototype (they follow Sum), light and dark,
   2. their mapping onto Bootstrap's CSS variables, plus the compact density of the staff side,
   3. the parts Bootstrap has no component for: the three columns, list rows, thread, player panel, player pages. */

/* ---------- 1. Tokens ---------- */
:root,[data-bs-theme=light]{
  --bg:#efedea; --surface:#fff; --surface-2:#f7f6f4; --sunken:#e8e5e1; --line:#dcd8d3; --line-2:#c2bcb5;
  --ink:#1d1a18; --ink-2:#4f4944; --ink-3:#6f6861;
  --fs-meta:11.5px; --fs-2:12.5px; --fs-base:13px; --fs-body:13.5px;
  --accent:#990000; --accent-fill:#990000; --accent-ink:#fff; --accent-hover:#7d0000; --accent-soft:#f6eae7; --accent-line:#dfbdb6;
  --note:#fff3c4; --note-line:#e0b93a; --note-ink:#5a4500;
  --ok:#0a6b2d; --ok-soft:#e0f2e4; --warn:#8f5200; --warn-soft:#fbecd2; --bad:#c62a1e; --bad-soft:#fde4df;
  /* Bootstrap wants every colour a second time as an "r,g,b" triplet (for its rgba() utilities and focus rings). */
  --accent-rgb:153,0,0; --ink-rgb:29,26,24; --surface-rgb:255,255,255; --ok-rgb:10,107,45; --warn-rgb:143,82,0; --bad-rgb:198,42,30;
  --shadow:0 1px 2px rgb(30 20 15 / .08), 0 10px 28px rgb(30 20 15 / .10);
  --g-bg-l:91%; --g-fg-l:27%; --g-s:55%;
}
[data-bs-theme=dark]{
  --bg:#100e0d; --surface:#1e1b19; --surface-2:#262220; --sunken:#181514; --line:#35302c; --line-2:#4c4540;
  --ink:#eeeae6; --ink-2:#b9b1aa; --ink-3:#a0978f;
  /* --accent is for text, links and thin marks. A filled red surface takes --accent-fill, which carries white text. */
  --accent:#e8746a; --accent-fill:#b3261e; --accent-ink:#fff; --accent-hover:#c8372e; --accent-soft:#3a1c19; --accent-line:#703630;
  --note:#352e14; --note-line:#7a6820; --note-ink:#ecdc9a;
  --ok:#6fcf8a; --ok-soft:#15331f; --warn:#e3a550; --warn-soft:#3a2a10; --bad:#ff8a5c; --bad-soft:#4a2019;
  --accent-rgb:232,116,106; --ink-rgb:238,234,230; --surface-rgb:30,27,25; --ok-rgb:111,207,138; --warn-rgb:227,165,80; --bad-rgb:255,138,92;
  --shadow:0 1px 2px rgb(0 0 0 / .4), 0 10px 28px rgb(0 0 0 / .45);
  --g-bg-l:22%; --g-fg-l:82%; --g-s:38%;
}

/* ---------- 2. Bootstrap theme: variables only ---------- */
/* Bootstrap's --bs-body-bg is both the page canvas and the surface of inputs, menus and modals.
   Here it is the surface, and <body> gets the canvas colour by hand. */
:root,[data-bs-theme=light],[data-bs-theme=dark]{
  --bs-body-bg:var(--surface); --bs-body-bg-rgb:var(--surface-rgb); --bs-body-color:var(--ink); --bs-body-color-rgb:var(--ink-rgb);
  --bs-emphasis-color:var(--ink); --bs-emphasis-color-rgb:var(--ink-rgb); --bs-heading-color:inherit;
  --bs-secondary-color:var(--ink-3); --bs-tertiary-color:var(--ink-3);
  --bs-secondary-bg:var(--sunken); --bs-tertiary-bg:var(--surface-2);
  --bs-border-color:var(--line-2); --bs-border-color-translucent:var(--line-2);
  --bs-border-radius:6px; --bs-border-radius-sm:4px; --bs-border-radius-lg:12px; --bs-box-shadow:var(--shadow);
  --bs-primary:var(--accent); --bs-primary-rgb:var(--accent-rgb);
  --bs-primary-bg-subtle:var(--accent-soft); --bs-primary-border-subtle:var(--accent-line); --bs-primary-text-emphasis:var(--accent);
  --bs-success:var(--ok); --bs-success-rgb:var(--ok-rgb); --bs-success-bg-subtle:var(--ok-soft); --bs-success-border-subtle:var(--ok); --bs-success-text-emphasis:var(--ok);
  --bs-warning:var(--warn); --bs-warning-rgb:var(--warn-rgb); --bs-warning-bg-subtle:var(--warn-soft); --bs-warning-border-subtle:var(--warn); --bs-warning-text-emphasis:var(--warn);
  --bs-danger:var(--bad); --bs-danger-rgb:var(--bad-rgb); --bs-danger-bg-subtle:var(--bad-soft); --bs-danger-border-subtle:var(--bad); --bs-danger-text-emphasis:var(--bad);
  --bs-secondary-bg-subtle:var(--sunken); --bs-secondary-text-emphasis:var(--ink-2);
  --bs-link-color:var(--accent); --bs-link-color-rgb:var(--accent-rgb); --bs-link-hover-color:var(--accent-hover); --bs-link-hover-color-rgb:var(--accent-rgb);
  --bs-focus-ring-color:rgba(var(--accent-rgb),.2);
  --bs-form-invalid-color:var(--bad); --bs-form-invalid-border-color:var(--bad);
  --bs-font-monospace:ui-monospace,'SF Mono',SFMono-Regular,Menlo,Consolas,monospace;
}
body{background:var(--bg)}

/* Buttons: .btn-primary and friends carry their colours as hex in --bs-btn-*, so --bs-primary alone changes nothing. */
.btn{--bs-btn-font-weight:500;--bs-btn-focus-shadow-rgb:var(--accent-rgb)}
.btn-primary{--bs-btn-color:var(--accent-ink);--bs-btn-bg:var(--accent-fill);--bs-btn-border-color:var(--accent-fill);--bs-btn-hover-color:var(--accent-ink);--bs-btn-hover-bg:var(--accent-hover);--bs-btn-hover-border-color:var(--accent-hover);--bs-btn-active-color:var(--accent-ink);--bs-btn-active-bg:var(--accent-hover);--bs-btn-active-border-color:var(--accent-hover);--bs-btn-disabled-color:var(--accent-ink);--bs-btn-disabled-bg:var(--accent-fill);--bs-btn-disabled-border-color:var(--accent-fill)}
/* Two variants Bootstrap does not ship, defined the same way: the neutral button and the note button. */
.btn-plain{--bs-btn-color:var(--ink);--bs-btn-bg:var(--surface);--bs-btn-border-color:var(--line-2);--bs-btn-hover-color:var(--ink);--bs-btn-hover-bg:var(--surface);--bs-btn-hover-border-color:var(--ink-3);--bs-btn-active-color:var(--ink);--bs-btn-active-bg:var(--accent-soft);--bs-btn-active-border-color:var(--accent-line);--bs-btn-disabled-color:var(--ink-3);--bs-btn-disabled-bg:var(--surface);--bs-btn-disabled-border-color:var(--line)}
.btn-note{--bs-btn-color:var(--note-ink);--bs-btn-bg:var(--note);--bs-btn-border-color:var(--note-line);--bs-btn-hover-color:var(--note-ink);--bs-btn-hover-bg:var(--note);--bs-btn-hover-border-color:var(--note-ink);--bs-btn-active-color:var(--note-ink);--bs-btn-active-bg:var(--note);--bs-btn-active-border-color:var(--note-ink);--bs-btn-disabled-color:var(--note-ink);--bs-btn-disabled-bg:var(--note);--bs-btn-disabled-border-color:var(--note-line)}
.btn-tab{--bs-btn-color:var(--ink-2);--bs-btn-hover-color:var(--ink);--bs-btn-active-color:var(--ink);--bs-btn-active-bg:var(--surface);--bs-btn-active-border-color:var(--line-2)}
/* Focus rings and checked states are plain hex in Bootstrap's rules. These need real overrides, not variables. */
.form-control:focus,.form-select:focus,.form-check-input:focus{border-color:var(--accent);box-shadow:0 0 0 .2rem rgba(var(--accent-rgb),.18)}
.form-check-input:checked{background-color:var(--accent-fill);border-color:var(--accent-fill)}
.dropdown-menu{--bs-dropdown-link-active-bg:var(--accent-soft);--bs-dropdown-link-active-color:var(--ink)}
.badge{--bs-badge-font-size:var(--fs-meta);--bs-badge-font-weight:600;--bs-badge-padding-y:.27em;--bs-badge-padding-x:.55em;--bs-badge-color:var(--ink-2)}
.modal{--bs-modal-width:560px;--bs-modal-padding:14px 18px;--bs-modal-header-padding:14px 18px 4px;--bs-modal-header-border-width:0;--bs-modal-footer-border-width:0;--bs-modal-box-shadow:var(--shadow)}
.modal-dialog:has(.dlg-wide){max-width:780px}
@media (min-width:992px){.modal-dialog:has(.dlg-xl){max-width:min(1140px,calc(100vw - 2rem))}}
.modal-title{font-size:17px;font-weight:600}
.modal-footer{padding-top:0}
.toast{--bs-toast-bg:var(--ink);--bs-toast-color:var(--bg);--bs-toast-border-color:transparent;--bs-toast-font-size:var(--fs-base);--bs-toast-max-width:290px;width:auto;max-width:var(--bs-toast-max-width);font-weight:500}
.toast-bad{--bs-toast-bg:var(--bad);--bs-toast-color:var(--surface)}
.toast-container{display:flex;flex-direction:column;align-items:flex-end}
.table{--bs-table-bg:transparent;--bs-table-border-color:var(--line)}
.table th{font-size:var(--fs-meta);color:var(--ink-3);font-weight:600;white-space:nowrap}
.alert-success{--bs-alert-color:var(--ink);--bs-alert-bg:var(--ok-soft);--bs-alert-border-color:transparent}
kbd{font:500 11px/1.45 var(--bs-font-sans-serif);border:1px solid var(--line-2);border-bottom-width:2px;border-radius:4px;padding:0 4px;background:var(--surface);color:var(--ink-2);white-space:nowrap}
.btn-primary kbd,.btn-note kbd{background:transparent;border-color:currentColor;color:inherit;opacity:.8}

/* Density. Bootstrap sizes everything in rem, so a 13px root makes the whole staff side compact in one line.
   The -sm controls get a little tighter on top. The player side keeps 16px. */
html{font-size:16px}
html.side-staff{font-size:13px}
.side-staff body{line-height:1.45}
.side-staff p,.side-staff dl,.side-staff h2,.side-staff h3{margin:0}
.btn-sm{--bs-btn-padding-y:3px;--bs-btn-padding-x:9px;--bs-btn-font-size:var(--fs-2);--bs-btn-border-radius:6px}
.form-control-sm,.form-select-sm{padding:3px 8px;font-size:13px;min-height:0;border-radius:4px}
.form-select-sm{padding-right:24px;background-position:right 7px center;background-size:11px 9px}
.side-staff .form-control:not(.form-control-sm),.side-staff .form-select:not(.form-select-sm){font-size:var(--fs-body)}
.side-staff .form-label{margin:6px 0 2px;font-size:var(--fs-2);color:var(--ink)}

/* htmx: our own indicator rules (the built-in ones fade opacity and keep the space). */
.htmx-indicator{display:none}
.htmx-indicator.htmx-request{display:flex}
.saving{display:none;text-transform:none;letter-spacing:0;color:var(--accent);font-style:italic}
.htmx-request>span>.saving{display:inline}
.abtn .spinner-border{display:none;--bs-spinner-width:10px;--bs-spinner-height:10px;--bs-spinner-border-width:2px;margin-right:5px}
.abtn.htmx-request .spinner-border{display:inline-block}

/* ---------- 3. App ---------- */
/* Rules of the staff side, so it stays calm:
   - four text sizes (--fs-*), nothing in between and nothing smaller,
   - monospace only for identifiers someone copies (.mono, .tid) and for game action notes,
   - red (--accent) for the primary action, the unread dot and the selection bar. --bad is for failures and "stuck",
   - a badge marks an exception. Ordinary attributes are plain text. */
.grow{flex:1 1 auto}
.mono{font-family:var(--bs-font-monospace);font-size:.92em}
.dim{color:var(--ink-3)}
.empty{padding:28px 16px;text-align:center;color:var(--ink-3)}
.gi{flex:none;border-radius:22%;display:block}
.chip-game{display:inline-flex;align-items:center;gap:4px;vertical-align:middle;font:600 var(--fs-meta)/1.6 var(--bs-font-sans-serif);letter-spacing:.02em;padding:0 5px;border-radius:3px;background:hsl(var(--h) var(--g-s) var(--g-bg-l));color:hsl(var(--h) 60% var(--g-fg-l));white-space:nowrap}
.gm{font-weight:600;color:var(--ink-2);white-space:nowrap}
/* the icon's centre on the code's capitals (half their height, .35em above the baseline) at any font size */
.gm .gi{display:inline-block;vertical-align:calc(.35em - 7px);margin-right:4px}
.kind{font-size:var(--fs-meta);color:var(--ink-2);white-space:nowrap}
.lab{background:var(--sunken);box-shadow:inset 0 0 0 1px var(--line);font-weight:400}
.lab button{border:0;background:none;padding:0 0 0 4px;color:var(--ink-3);line-height:1}
.st-open{background:var(--surface);color:var(--ink);box-shadow:inset 0 0 0 1px var(--line-2)}
.st-waiting{background:var(--warn-soft);color:var(--warn)}
.st-closed{background:var(--sunken);color:var(--ink-3)}
.idl-game,.idl-mail{background:var(--ok-soft);color:var(--ok)}
.idl-addr{background:var(--warn-soft);color:var(--warn)}
.idl-none{box-shadow:inset 0 0 0 1px var(--line-2);color:var(--ink-2)}
.pst{font-size:var(--fs-meta);color:var(--ok)}
.pst-warn{color:var(--warn);font-weight:600}
.pst-bad{color:var(--bad);font-weight:600}
.lnk{border:0;background:none;padding:0;font:inherit;color:var(--accent);text-decoration:underline}
.lnk:disabled{opacity:.5}

/* top bar: 3px red line on top, product name in red */
.topbar{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;padding:7px 16px;background:var(--surface);border-top:3px solid var(--accent);border-bottom:1px solid var(--line);font-size:13px}
.brand{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;margin-right:auto}
.brand b{font-size:16px;font-weight:700;letter-spacing:-.01em;color:var(--accent)}
.brand span{color:var(--ink-3);font-size:12px}

/* staff shell: spare width goes to the ticket, whose content stays in a centred column of 780px */
.side-staff,.side-staff body{height:100%}
.side-staff body{display:flex;flex-direction:column;overflow:hidden}
.cols{flex:1;min-height:0;display:grid;grid-template-columns:clamp(300px,23%,400px) minmax(440px,1fr) clamp(308px,26%,560px)}
.pane{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.pane-list{background:var(--surface);border-right:1px solid var(--line)}
.pane-panel{background:var(--surface);border-left:1px solid var(--line);overflow:auto;display:block}
.me{display:inline-flex;align-items:center;gap:6px;font-weight:500}
.keys{padding:10px 14px;min-width:230px;font-size:var(--fs-base)}
.keys h2{font-size:var(--fs-meta);font-weight:400;color:var(--ink-3);margin:0 0 4px}
.keys dl{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;margin:0}
.keys dl+h2{margin-top:10px}
.keys dd{margin:0}
.keys .form-label{margin-top:0}
.topbar .me{--bs-btn-padding-x:6px}

/* ticket list */
/* two groups: the views (quick filters) on the list's surface, the search with its filters set apart below them */
.views{display:flex;flex-wrap:wrap;gap:4px;padding:8px 10px}
.views .btn{--bs-btn-padding-y:1px;--bs-btn-color:var(--ink-2);--bs-btn-active-bg:var(--sunken);--bs-btn-active-border-color:var(--ink-3);--bs-btn-active-color:var(--ink)}
.views .btn.active{font-weight:600}
.views .n{font-variant-numeric:tabular-nums;color:var(--ink-3);margin-left:2px;font-weight:400}
.search{padding:8px 10px;border-top:1px solid var(--line);background:var(--surface-2)}
.filters{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.filters .form-select,.filters .form-control{flex:1 1 30%;width:auto;min-width:0;font-size:inherit}
/* the staff setting "simpler filters" (support.js): only the views and the search marked data-simple stay */
html.simple-filters #searchbox .filters,html.simple-filters #views>:not([data-simple]){display:none}
/* the staff settings under the name in the top bar (admin/layout.tpl) */
.settings{padding:8px 12px;min-width:180px}
.settings[hidden].show{display:block !important}
.settings .form-check{margin:0}
.set-lang{display:flex;align-items:center;gap:8px;margin-top:6px}
.set-lang select{width:auto}
.listinfo{padding:4px 10px;font-size:var(--fs-meta);color:var(--ink-3);border-block:1px solid var(--line);background:var(--surface-2)}
.rows{flex:1;min-height:0;overflow:auto}
.trow{display:flex;flex-direction:column;gap:3px;border-bottom:1px solid var(--line);border-left:3px solid transparent;padding:8px 10px 8px 7px;color:inherit;text-decoration:none}
.trow:hover{background:var(--surface-2)}
.trow.sel{background:var(--sunken);border-left-color:var(--accent)}
.r1{display:flex;align-items:baseline;gap:6px;min-width:0}
.udot{flex:none;align-self:center;width:7px;height:7px;border-radius:50%;background:var(--accent)}
.who{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}
.trow.unread .who{font-weight:600;color:var(--ink)}
.wait{flex:none;font-size:var(--fs-2);font-variant-numeric:tabular-nums;color:var(--ink-3)}
.r2{color:var(--ink-2);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.trow.unread .r2{color:var(--ink)}
.r3{display:flex;align-items:center;gap:6px;min-width:0;font-size:var(--fs-meta);color:var(--ink-3)}
.rmeta{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.r3 .badge{flex:none}
/* an identity state (admin/parts/identity.tpl): one icon and colour per state in every place, the label beside it or
   (list rows) as tooltip */
.idm{flex:none;white-space:nowrap;font-weight:600}
.idm::before{display:inline-block;width:1.2em;text-align:center;font-weight:700}
.idm-game,.idm-mail{color:var(--ok)}
.idm-addr{color:var(--warn)}
.idm-none{color:var(--bad)}
.idm-game::before{content:"\2714"}
.idm-mail::before{content:"\2709"}
.idm-addr::before{content:"@"}
.idm-none::before{content:"?"}
.ini{flex:none;display:inline-grid;place-items:center;width:21px;height:21px;border-radius:50%;background:var(--sunken);font-size:10.5px;font-weight:600;color:var(--ink-2)}
.trow.sel .ini{background:var(--surface)}
.ini-none{background:none;border:1px dashed var(--line-2)}

/* ticket: header, thread, composer. All three share the centred column. */
.pane-ticket{background:var(--bg);--gut:max(14px,calc((100% - 780px) / 2))}
.thead{flex:none;background:var(--surface);border-bottom:1px solid var(--line);padding:8px var(--gut);display:flex;flex-direction:column;gap:6px}
.th1{display:flex;align-items:flex-start;gap:8px}
/* one line, whatever follows it (issue link, actions), so the header never grows a second line: on a narrow pane the
   state (also in the State select) gives way first, then the identity mark, then the player's name, each with an
   ellipsis and its full text in the title */
.th1-main{flex:1;min-width:0;display:flex;align-items:center;gap:6px;min-height:25px;overflow:hidden}
.th1-main>*{flex:none;white-space:nowrap}
.th1-main>.tshrink{flex:0 1 auto;min-width:4ch;overflow:hidden;text-overflow:ellipsis}
.th1-main>.tshrink-first{flex-shrink:10000;min-width:0}
.th1>.btn{flex:none}
/* the issue link is exactly as high as the line it ends (25px), so the header keeps its height without it. Its text
   and badge are centred as flex items, not set on the baseline. The two 1px nudges (measured, seal-support#97) put
   the text on the parts' capitals and the badge on the pill's middle. */
.th1>#tissue{height:25px;--bs-btn-padding-y:0;display:inline-flex;align-items:center;gap:5px;line-height:1;padding-top:1px}
.th1>#tissue .badge{margin-top:1px}
/* the actions end the identity line: as high as it (25px), so any set of them keeps the header's height */
.th1>.tacts{flex:none;display:flex;gap:4px}
.th1>.tacts>.btn{height:25px;--bs-btn-padding-y:0;display:inline-flex;align-items:center;gap:4px;line-height:1}
.tid{font:600 var(--fs-body) var(--bs-font-monospace)}
.th1 b{font-size:var(--fs-body)}
/* the label of a recovery ticket above the thread (admin/parts/recovery.tpl) */
.rec{border:1px solid var(--line);border-radius:8px;background:var(--surface-2);padding:6px 10px;font-size:var(--fs-meta)}
.entry{font-size:var(--fs-meta);color:var(--ink-3)}
/* each field is as wide as its longest option or its label (Assignee: "assign to me"): a select never cuts its text, the
   fields wrap on a narrow pane */
.fields{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:flex-start}
.fld{display:flex;flex-direction:column;gap:1px;flex:none}
.fld-labels{flex:1 1 110px;min-width:0}
.fld>span{display:flex;align-items:baseline;gap:8px;font-size:var(--fs-meta);color:var(--ink-3);white-space:nowrap}
/* Quiet until touched: the five fields are there, but the thread is the content. */
.fld .form-select,.labs{border-color:transparent;background-color:var(--surface-2)}
.fld .form-select:hover,.labs:hover{border-color:var(--line-2)}
.labs{display:flex;flex-wrap:wrap;gap:4px;align-items:center;border:1px solid transparent;border-radius:4px;padding:2px 4px;min-height:27px}
.labs input{flex:1;min-width:52px;border:0;outline:0;background:transparent;padding:1px 2px;font-size:var(--fs-2);color:inherit}
.labs:focus-within{border-color:var(--accent);background-color:var(--surface)}
/* the fields row below the identity line */
.tfields{flex:none;background:var(--surface);border-bottom:1px solid var(--line);padding:0 var(--gut) 8px}
.tfields:not(:has(.fields)){display:none}
.msg-withdrawn{opacity:.6}
.msg-withdrawn .mtext{text-decoration:line-through}
.holdbar-note{border-top-color:var(--note-line)}
.thread{flex:1;min-height:110px;overflow:auto;padding:12px var(--gut);display:flex;flex-direction:column;gap:10px}
.msg{border:1px solid var(--line);border-radius:8px;background:var(--surface);padding:8px 12px 10px}
/* The thread reads like a chat, subtly: the player's entries keep 10% free on the right, ours (replies, notes, game
   actions) on the left. System lines and tickettool2's thread stay full width. */
.msg.from-player{margin-right:10%}
.msg.from-staff{margin-left:10%}
.msg header{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin-bottom:4px}
.msg header time{margin-left:auto;font-size:var(--fs-meta);color:var(--ink-3)}
.av{display:inline-grid;place-items:center;width:21px;height:21px;border-radius:50%;background:var(--sunken);font-size:10.5px;font-weight:600;color:var(--ink-2)}
.role{font-size:var(--fs-meta);color:var(--ink-3)}
.mtext{white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--fs-body);line-height:1.5;max-width:68ch}
/* Our reply: a white card with a red edge. Only a reply that has not gone out yet is tinted. */
.msg-staff{border-left:3px solid var(--accent-line)}
.msg-staff .av{background:var(--accent-fill);color:var(--accent-ink)}
.msg-held{background:var(--accent-soft);border-color:var(--accent-line)}
.msg-paused{background:var(--warn-soft);border-color:var(--warn)}
.msg-paused .holdbar{border-top-color:var(--warn)}
.sys-new{align-self:stretch;color:var(--accent);font-weight:600}
.sys-new::before,.sys-new::after{content:"";flex:1;height:1px;background:var(--accent-line)}
.msg-note{background:var(--note);border:1px dashed var(--note-line);color:var(--note-ink)}
.msg-note .role{color:inherit;font-weight:600}
.msg-note header time{color:inherit;opacity:.8}
.msg-rating{border-left:3px solid var(--ok)}
.msg-rating-down{border-left-color:var(--bad)}
.msg-rating .rate{font-size:var(--fs-2);font-weight:600}
.msg-rating-up .rate{color:var(--ok)}
.msg-rating-down .rate{color:var(--bad)}
.msg-action .mtext{font-family:var(--bs-font-monospace);font-size:var(--fs-2)}
.holdbar{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;justify-content:space-between;margin-top:8px;padding-top:8px;border-top:1px dashed var(--accent-line);font-size:var(--fs-2)}
.holdbar>span:first-child{flex:1 1 240px}
.hold-cd{font-variant-numeric:tabular-nums}
.sys{align-self:center;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px 8px;font-size:var(--fs-meta);color:var(--ink-3);text-align:center}
.sys:not(.htmx-indicator){display:flex}
.sys-pending{color:var(--accent);font-weight:500}
.sys-pending .spinner-border{--bs-spinner-width:11px;--bs-spinner-height:11px;--bs-spinner-border-width:2px}
.thumbs{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.thumb{width:96px;height:72px;padding:0;border-radius:5px;overflow:hidden;border:1px solid var(--line-2);background:var(--sunken);cursor:zoom-in}
.thumb:hover,.thumb:focus-visible{border-color:var(--accent);outline:0}
.thumb img,.att img{display:block;width:100%;height:100%;object-fit:cover}
/* the image viewer (admin/parts/imageViewer.tpl): the image at full size, at most the window */
#imgv .modal-dialog{max-width:min(1200px,calc(100vw - 2rem))}
.imgv-body{display:grid;place-items:center;min-height:200px;background:var(--sunken);padding:12px}
.imgv-body img{max-width:100%;max-height:calc(100vh - 11rem);width:auto;height:auto;border-radius:4px}
.dlg-img{display:grid;place-items:center;background:var(--sunken);padding:12px}
.dlg-img img{max-width:100%;max-height:70vh;width:auto;height:auto;border-radius:4px}
/* attach block of a form: waiting images, each with a remove button */
.attach-list{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.attach:not(.is-busy):not(:has(.att,.att-err)){display:none !important}
.att{position:relative;width:56px;height:56px;border-radius:5px;overflow:hidden;border:1px solid var(--line-2);background:var(--sunken)}
.att button{position:absolute;top:2px;right:2px;width:18px;height:18px;border:0;border-radius:50%;padding:0;background:var(--ink);color:var(--surface);font-size:13px;line-height:18px}
.att-n{font-size:var(--fs-meta);color:var(--ink-3)}
.att-err{flex-basis:100%;font-size:var(--fs-2);color:var(--bad)}
.att-busy{display:none;align-items:center;gap:6px;font-size:var(--fs-2);color:var(--accent)}
.att-busy .spinner-border{--bs-spinner-width:11px;--bs-spinner-height:11px;--bs-spinner-border-width:2px}
.attach.is-busy .att-busy{display:inline-flex}
form.is-drop{outline:2px dashed var(--accent);outline-offset:-4px}
.composer{flex:none;background:var(--surface);border-top:1px solid var(--line-2);padding:6px var(--gut) 10px}
.composer form{display:flex;flex-direction:column;gap:6px}
.ctabs,.cbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px}
.sendset{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;margin-left:auto}
/* Two lines while idle, so the thread gets the room. It opens when it is used or holds a draft. */
.composer textarea{min-height:46px;line-height:1.5}
.composer:focus-within textarea,.composer textarea:not(:placeholder-shown){min-height:92px}
/* Reply or note is the checked radio button. :has() restyles the composer without JS. */
.for-note,.composer:has(#mode-note:checked) .for-reply{display:none}
.composer:has(#mode-note:checked) .for-note{display:inline}
.composer:has(#mode-note:checked) textarea.for-note,.composer:has(#mode-note:checked) .attach.for-note{display:block}
.composer:has(#mode-note:checked){background:var(--note)}
.composer:has(#mode-note:checked) textarea{border-color:var(--note-line);border-style:dashed}

/* player panel */
.ph{position:sticky;top:0;z-index:2;background:var(--surface-2);border-bottom:1px solid var(--line);padding:8px 12px}
.pgrid{columns:260px;column-gap:0;column-rule:1px solid var(--line)}
.ps{padding:10px 12px;border-bottom:1px solid var(--line);display:flex;flex-direction:column;gap:6px;break-inside:avoid}
.ps h3{font-size:var(--fs-2);font-weight:600;color:var(--ink)}
.kv{display:grid;grid-template-columns:minmax(0,auto) minmax(0,1fr);gap:2px 12px}
.kv dt{color:var(--ink-3);font-weight:400}
.kv dd{margin:0;overflow-wrap:anywhere}
.kv-confirm{gap:6px 16px;font-size:var(--fs-body);margin-block:10px !important;padding:10px 12px;background:var(--surface-2);border:1px solid var(--line);border-radius:8px}
.mini{width:100%;font-size:var(--fs-2)}
.mini td{padding:4px 6px 4px 0;border-top:1px solid var(--line);vertical-align:top}
.mini td.nw{white-space:nowrap}
.info-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:6px 24px;margin:0}
.info-grid>div{display:flex;gap:10px;border-top:1px solid var(--line);padding-top:4px;min-width:0}
.info-grid dt{color:var(--ink-3);font-weight:400;flex:0 0 auto}
.info-grid dd{margin:0;overflow-wrap:anywhere;min-width:0}
.rev{font-weight:600}
.buys>summary{color:var(--ink-2);cursor:pointer;width:max-content}
.buys[open]>summary{margin-bottom:4px}
.pstate{margin:12px;padding:12px;border:1px dashed var(--line-2);border-radius:8px;display:flex;flex-direction:column;gap:8px;align-items:flex-start;background:var(--surface-2)}
.acct-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;align-self:stretch}
.acts{display:flex;flex-wrap:wrap;gap:5px}
.acts-l{font-size:var(--fs-meta);color:var(--ink-3)}
/* a change writes to the game: its button says so in a tag and in the warning colour */
.abtn-change{--bs-btn-border-color:var(--warn);--bs-btn-color:var(--warn);--bs-btn-hover-border-color:var(--warn);--bs-btn-hover-color:var(--warn)}
.abtn-tag{font-size:var(--fs-meta);font-weight:600;text-transform:uppercase;letter-spacing:.03em}
.ahelp{font-size:var(--fs-2);color:var(--ink-2);margin-bottom:8px}
.abtn.is-done{--bs-btn-bg:var(--ok-soft);--bs-btn-border-color:var(--ok);--bs-btn-color:var(--ok)}
.abtn.is-failed{--bs-btn-bg:var(--bad-soft);--bs-btn-border-color:var(--bad);--bs-btn-color:var(--bad)}
.act-err,.derr{font-size:var(--fs-2);color:var(--bad);background:var(--bad-soft);border-radius:6px;padding:6px 8px}
.et{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:2px 0;color:inherit;text-decoration:none}
.et:hover .mono{text-decoration:underline}
.job,.chg{font-size:var(--fs-2);border-left:2px solid var(--line-2);padding-left:8px}
/* dialogs */
.dlg-warn{font-weight:600;background:var(--warn-soft);border-radius:6px;padding:6px 10px}
.proto{font-size:var(--fs-meta);color:var(--ink-3);padding-left:2.2em}
.pk-list{display:flex;flex-direction:column;gap:4px}
.pk-item{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;text-align:left;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:inherit;padding:6px 9px}
.pk-item:hover,.pk-item:focus-visible{border-color:var(--line-2);background:var(--surface-2)}
.pk-item.is-active{border-color:var(--accent);background:var(--accent-soft)}
.pk-keys{font-size:var(--fs-meta);color:var(--ink-3);margin-bottom:6px !important}
.pk-item b{margin-right:auto}
.pk-item p{flex-basis:100%;font-size:var(--fs-2);color:var(--ink-2)}
@media (max-width:1099px){
  .cols{grid-template-columns:300px minmax(0,1fr)}
  .pane-panel{grid-column:1 / -1;max-height:40vh;border-left:0;border-top:1px solid var(--line)}
}

/* ---------- player pages: phone-first, one column of at most 420px, 760px from a tablet's width on ---------- */
/* the scrollbar's room is kept on every page, so the centred column does not move when a page grows taller than the
   window (seal-support#120) */
html.side-player{scrollbar-gutter:stable}
.p-wrap{max-width:420px;min-height:100vh;margin:0 auto;background:var(--surface-2);border-inline:1px solid var(--line)}
.p-head{position:sticky;top:0;z-index:3;padding:12px 18px;background:var(--surface);border-bottom:1px solid var(--line)}
.p-brand{display:inline-flex;align-items:center;gap:8px;font-weight:700;color:var(--ink);text-decoration:none}
.p-logo{width:20px;height:20px;border-radius:7px 7px 7px 2px;background:var(--accent-fill)}
.p-page{padding:18px 18px 28px;display:flex;flex-direction:column;align-items:stretch;gap:12px;line-height:1.5}
.p-page h1{font-size:23px;font-weight:700;letter-spacing:-.01em;margin:0}
.p-page h2{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--ink-3);margin:8px 0 0}
.p-page p{margin:0}
.p-lead{color:var(--ink-2)}
.p-fine{font-size:13px;color:var(--ink-3)}
.p-foot{margin-top:10px;padding-top:14px;border-top:1px solid var(--line)}
.p-back{align-self:flex-start;color:var(--ink-2);font-size:14px;font-weight:500;text-decoration:none}
.side-player .btn-lg{--bs-btn-font-size:1rem;--bs-btn-padding-y:.65rem;--bs-btn-border-radius:12px;--bs-btn-font-weight:600}
.side-player .p-page .form-control,.side-player .p-page .form-select{padding:.65rem .75rem;border-radius:10px}
.p-form{display:flex;flex-direction:column}
.p-form .form-label{font-weight:600;font-size:14.5px;margin:18px 0 6px}
.p-pair,.p-field{display:flex;flex-direction:column}
.p-form .p-addto{margin-top:10px}
.p-list{display:flex;flex-direction:column;gap:10px}
.p-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:6px;color:inherit;text-decoration:none}
.p-card:hover{border-color:var(--line-2)}
.p-card-top,.p-thead{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.p-new{background:var(--accent-fill);--bs-badge-color:var(--accent-ink)}
.p-id{font:500 13px var(--bs-font-monospace);color:var(--ink-3)}
.p-card-meta{display:flex;justify-content:space-between;gap:8px;font-size:13px;color:var(--ink-3)}
.p-state{font-weight:600}
/* The accent goes to the state in which the player has to act. */
.p-thead .p-state{margin-left:auto}
.p-state-open{color:var(--ink-2);font-weight:500}
.p-state-waiting{color:var(--accent)}
.p-state-closed{color:var(--ink-3)}
.p-idline{font-size:13px;color:var(--ink-3)}
.p-thread{display:flex;flex-direction:column;gap:12px;margin-block:4px}
.p-msg{display:flex;flex-direction:column;gap:3px;max-width:88%}
.p-msg.mine{align-self:flex-end;align-items:flex-end}
.p-msg-h{font-size:12px;color:var(--ink-3)}
.p-bubble{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--surface);border:1px solid var(--line);border-radius:16px 16px 16px 4px;padding:10px 13px}
.p-msg.mine .p-bubble{background:var(--accent-soft);border-color:var(--accent-line);border-radius:16px 16px 4px 16px}
.p-thumbs{display:flex;flex-wrap:wrap;gap:6px}
.p-msg.mine .p-thumbs{justify-content:flex-end}
.p-thumbs a{width:104px;height:104px;border-radius:12px;overflow:hidden;border:1px solid var(--line);background:var(--sunken)}
.p-thumbs img{display:block;width:100%;height:100%;object-fit:cover}
.side-player .att{width:72px;height:72px;border-radius:10px}
.side-player .att button{width:24px;height:24px;font-size:16px;line-height:24px}
.side-player .att-n,.side-player .att-err{font-size:13px}
.side-player [data-attach-pick]{align-self:flex-start}
.side-player .attach-list{gap:10px 12px}
.side-player .attach{margin-bottom:12px}
.p-opt{font-weight:400;color:var(--ink-3)}
.p-replybox{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:12px}
.p-replybox .form-label{font-weight:600;font-size:14.5px;margin:0}
/* game dropdown with icons: a Bootstrap dropdown whose toggle is styled as a .form-select */
[data-game-pick] .gp-cur,[data-game-pick] .dropdown-item{display:flex;align-items:center;gap:10px}
[data-game-pick] .gp-cur{min-height:24px;overflow:hidden;white-space:nowrap}
[data-game-pick] .dropdown-item{padding:8px 12px;border-radius:7px}
[data-game-pick] .dropdown-item.active{font-weight:600}
[data-game-pick] .dropdown-menu{padding:4px;border-radius:10px}
/* a family of several worlds (Games::byFamily): its heading lines up with the worlds under it */
[data-game-pick] .dropdown-header{padding:10px 12px 4px;font-size:12px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--ink-3)}
.gp-ph{color:var(--ink-3)}
.p-footer{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 16px;padding:14px 18px 22px;font-size:13px;color:var(--ink-3);border-top:1px solid var(--line)}
.p-footer a{color:var(--ink-2)}
.p-langs{display:flex;gap:14px}
.p-langs a[aria-current]{color:var(--ink);font-weight:600;text-decoration:none}
.p-lang{padding:0;border:0;background:none;color:var(--ink-2);text-decoration:underline;font:inherit}
.p-langs .p-lang[aria-current]{color:var(--ink);font-weight:600;text-decoration:none}
/* the honeypot field: out of sight for people, filled by bots that fill every field */
.p-hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.p-gicon{width:24px;height:24px;border-radius:6px;flex:none}
.p-email{overflow-wrap:anywhere;font-weight:600}
.p-fix{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:12px}
/* "My tickets on this browser" (start page), "Add to this ticket" (form) and the confirm button (ticket page) */
.p-card-link{color:inherit;text-decoration:none}
.p-card-link .p-state{margin-left:auto}
.p-card-excerpt{font-size:14px;color:var(--ink-2);overflow-wrap:anywhere}
.p-card-meta form{margin:0}
.p-card-meta .btn-link{font-size:13px;color:var(--ink-3)}
.p-forget,.p-confirm{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.p-forget{border-top:1px solid var(--line);padding-top:12px}
.p-confirm{background:var(--surface);border:1px solid var(--accent-line);border-radius:12px;padding:12px 14px}
.p-confirmed{color:var(--ok)}
.p-addto{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin:0}
.p-addto p{margin:0}
/* the rating on the ticket page: two toggle buttons and an optional comment */
.p-rating{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:12px}
.p-rating-q{font-weight:600}
.p-rating .form-label{font-weight:600;font-size:14.5px;margin:0}
.p-thumbs-pick{display:flex;gap:8px}
.p-thumbs-pick .btn{flex:1}
.p-thumbs-pick .btn-check:checked+.btn{background:var(--accent-soft);border-color:var(--accent);color:var(--ink);font-weight:600}
/* desktop: the same column, wider and with more air; the main buttons keep their own width, field pairs sit side by side */
@media (min-width:768px){
  .p-wrap{max-width:760px}
  .p-head{padding-inline:40px}
  .p-page{padding:36px 40px 48px;gap:14px}
  .p-page h1{font-size:28px}
  .p-footer{padding-inline:40px}
  .p-page>.btn-lg,.p-form>.btn-lg,.p-replybox>.btn-lg{align-self:flex-start;width:auto !important;min-width:240px;padding-inline:2rem}
  .p-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:16px}
  .p-msg{max-width:75%}
  .p-replybox{padding-top:16px}
}
