:root {
  --bg: #313338; --side: #2b2d31; --deep: #1e1f22; --card: #2b2d31; --hover: #35373c; --raised: #383a40;
  --line: #3f4147; --text: #dbdee1; --muted: #949ba4; --head: #f2f3f5;
  --accent: #5865f2; --accent-2: #7984f5; --green: #23a55a; --red: #f23f43; --yellow: #f0b232;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --fast: .15s; --mid: .25s;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23949ba4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 15px/1.5 "gg sans", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: #00a8fc; }
code { background: var(--deep); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
::selection { background: rgba(88, 101, 242, .45); }

/* ── motion ─────────────────────────────────────────────────────────────── */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
main.enter > * { animation: page-in .35s var(--ease) both; }
/* once a page has arrived (app.js, enter), redrawing it after a click shows the change at once:
   nothing that was already there fades in again */
main.settled .chip, main.settled .role, main.settled .notice, main.settled .sub, main.settled .entry,
main.settled .todo, main.settled .ev, main.settled .news li { animation: none; }
main.enter > *:nth-child(2) { animation-delay: .03s; }
main.enter > *:nth-child(3) { animation-delay: .06s; }
main.enter > *:nth-child(4) { animation-delay: .09s; }
main.enter > *:nth-child(n+5) { animation-delay: .12s; }

/* loading placeholders */
.sk { border-radius: 6px; background: linear-gradient(90deg, var(--side) 0, var(--raised) 50%, var(--side) 100%);
      background-size: 800px 100%; animation: shimmer 1.3s linear infinite; }
.sk-h { width: 220px; height: 26px; margin-bottom: 10px; }
.sk-l { width: 360px; max-width: 90%; height: 14px; margin-bottom: 26px; }
.sk-card { height: 120px; margin-bottom: 14px; }
.loading { color: var(--muted); padding: 40px; text-align: center; }

/* ── login ──────────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--card); border-radius: 12px; padding: 32px; width: min(380px, 100%); text-align: center;
              box-shadow: var(--shadow); animation: page-in .4s var(--ease) both; }
.login-card .logo { width: 92px; height: 92px; display: block; margin: 0 auto 12px;
                    filter: drop-shadow(0 0 14px rgba(88, 101, 242, .45)); }
.login-card h1 { color: var(--head); font-size: 22px; margin: 0 0 6px; }
.login-card p { color: var(--muted); margin: 0 0 20px; }
.login-card .msg { color: var(--red); margin: 16px 0 0; font-size: 14px; }
.btn-discord { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; border-radius: 6px;
               padding: 10px 20px; font-weight: 500; transition: background var(--fast), transform var(--fast) var(--ease); }
.btn-discord:hover { background: #4752c4; }
.btn-discord:active { transform: scale(.97); }

.ava { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); flex: none; object-fit: cover; }
.ava.sm { width: 28px; height: 28px; }
.ava.xs { width: 20px; height: 20px; }
main { padding: 28px 40px 120px; max-width: 1800px; width: 100%; }
h1 { color: var(--head); font-size: 22px; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 22px; }
.note { color: var(--muted); font-size: 13px; }
.note p { margin: 2px 0; }
.small { font-size: 12px; opacity: .85; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ── cards and rows ─────────────────────────────────────────────────────── */
.card { background: var(--card); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.card.tight { padding: 6px 10px; }
.card h3 { margin: 0 0 10px; color: var(--head); font-size: 15px; }
.row { display: flex; align-items: center; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .lbl { flex: 1; min-width: 0; }
.row .lbl b { color: var(--head); display: block; font-weight: 500; }
.row .lbl span { color: var(--muted); font-size: 13px; }
.ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 64%; }
.sub { background: var(--deep); border-radius: 8px; padding: 4px 12px; margin: 8px 0; animation: fade-in var(--mid) both; }
.sub .row { border-color: var(--card); }
.sub input[type=text], .sub input[type=number], .sub select, .sub .pick-btn { background: var(--card); border-color: var(--card); }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; padding-top: 10px; }
.btn-row.left { justify-content: flex-start; }
.sentence { background: var(--deep); border-radius: 6px; padding: 10px 12px; color: var(--muted); font-size: 14px; margin-top: 8px; }
.notice { background: #4a3b12; color: #f0d78c; border-radius: 8px; padding: 8px 14px; margin-bottom: 14px; font-size: 14px;
          animation: fade-in var(--mid) both; }
.notice p { margin: 4px 0; }
.notice b { color: #fff3c4; }

/* ── controls ───────────────────────────────────────────────────────────── */
input[type=text], input[type=search], input[type=number], select, textarea {
  background: var(--deep); color: var(--text); border: 1px solid var(--deep); border-radius: 6px; padding: 7px 10px;
  font: inherit; transition: border-color var(--fast), box-shadow var(--fast), background var(--fast); }
input:hover, select:hover, textarea:hover { border-color: #2c2e33; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 101, 242, .25); }
select { appearance: none; padding-right: 30px; max-width: 260px; cursor: pointer;
         background-image: var(--chev); background-repeat: no-repeat; background-position: right 10px center; }
textarea { resize: vertical; font-size: 14px; line-height: 1.45; }
input.num { width: 80px; }
input.dur { width: 90px; }
input.emo { width: 64px; text-align: center; }
input.grow { flex: 1; min-width: 160px; }
input.wide, .field textarea { width: 100%; }
button { background: #4e5058; color: #fff; border: 0; border-radius: 6px; padding: 7px 14px; font: inherit; font-size: 14px;
         cursor: pointer; transition: background var(--fast), color var(--fast), transform var(--fast) var(--ease), opacity var(--fast); }
button:hover { background: #5d6069; }
button:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: default; transform: none; }
button.ok { background: var(--green); }
button.ok:hover { background: #1f9150; }
button.pri { background: var(--accent); }
button.pri:hover { background: #4752c4; }
button.ghost { background: none; color: var(--muted); padding: 7px 10px; }
button.ghost:hover { background: var(--hover); color: var(--text); }
button.mini { padding: 0 6px; font-size: 12px; line-height: 18px; background: var(--deep); }
button.mini:hover { background: var(--hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--deep); border-radius: 6px; padding: 3px 8px;
        font-size: 14px; animation: fade-in var(--fast) both; }
.chip.check { cursor: pointer; padding: 5px 10px; transition: background var(--fast); }
.chip.check:hover { background: var(--hover); }
.chip .x, .role .x { cursor: pointer; color: var(--muted); padding: 0 3px; background: none; border: 0; border-radius: 4px; font-size: 15px;
                     line-height: 1; }
.chip .x:hover, .role .x:hover { color: var(--red); background: rgba(242, 63, 67, .12); }
.role { display: inline-flex; align-items: center; gap: 6px; background: var(--deep); border-radius: 6px; padding: 3px 8px;
        font-size: 14px; animation: fade-in var(--fast) both; }
.role::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #99aab5); flex: none; }
.role .bad { color: var(--yellow); font-size: 12px; }

.sw { position: relative; width: 40px; height: 24px; flex: none; display: inline-block; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw i { position: absolute; inset: 0; background: #80848e; border-radius: 12px; cursor: pointer; transition: background var(--mid); }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
               transition: transform var(--mid) var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.sw input:checked + i { background: var(--green); }
.sw input:checked + i::after { transform: translateX(16px); }
.sw input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--deep); border-radius: 6px; padding: 2px; flex-wrap: wrap; }
.seg button { background: none; color: var(--muted); padding: 5px 12px; border-radius: 5px; }
.seg button:hover { color: var(--text); background: var(--hover); }
.seg button.on { background: #404249; color: var(--head); }

/* ── picker (replaces the browser's dropdown for roles and channels) ────── */
.pick-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--deep); color: var(--text); max-width: 260px;
            border: 1px solid var(--deep); padding: 6px 10px; min-height: 36px; }
.pick-btn:hover { background: var(--hover); border-color: var(--hover); }
.pick-btn[aria-expanded=true] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 101, 242, .25); }
.pick-btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn .chev { width: 12px; height: 12px; flex: none; margin-left: auto; background: var(--chev) no-repeat center;
                  transition: transform var(--mid) var(--ease); }
.pick-btn[aria-expanded=true] .chev { transform: rotate(180deg); }
.pick-btn.add { background: none; border: 1px dashed #4e5058; color: var(--muted); }
.pick-btn.add:hover { border-color: var(--muted); color: var(--text); background: var(--hover); }
.pick-btn .plus { font-size: 16px; line-height: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #99aab5); flex: none; }
.pre-x { color: var(--muted); }
.pop { position: absolute; z-index: 50; background: #111214; border: 1px solid #26272b; border-radius: 8px; padding: 6px;
       box-shadow: var(--shadow); animation: pop-in .14s var(--ease) both; width: 260px; }
.pop.closing { animation: pop-out .12s ease both; pointer-events: none; }
.pop input { width: 100%; margin-bottom: 6px; background: var(--deep); }
.opts { max-height: 290px; overflow-y: auto; overscroll-behavior: contain; }
.opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; cursor: pointer; font-size: 14px;
       transition: background .08s; }
.opt .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt.active { background: var(--accent); color: #fff; }
.opt.active .pre-x, .opt.active .opt-note { color: #e0e3ff; }
.opt.sel::after { content: "✓"; margin-left: auto; font-size: 13px; }
.opt.clear { color: var(--muted); font-style: italic; }
.opt-note { color: var(--yellow); font-size: 12px; }
.opt-group { padding: 8px 8px 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .02em; }
.opts .empty { padding: 10px 8px; color: var(--muted); font-size: 13px; }

/* ── role panel entries ─────────────────────────────────────────────────── */
.entry { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap;
         animation: fade-in var(--fast) both; }
.entry:first-of-type { border-top: 0; }
.order { display: flex; flex-direction: column; gap: 2px; }
.entry-add { padding-top: 8px; }

/* ── text pages ─────────────────────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { background: var(--deep); color: var(--muted); }
.tabs button:hover { background: var(--hover); color: var(--text); }
.tabs button.on { background: var(--accent); color: #fff; }
.field { display: block; margin-bottom: 12px; }
.field > b { display: block; color: var(--head); font-weight: 500; margin-bottom: 4px; }
.vars { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.vars .count { margin-left: auto; transition: color var(--fast); }
.count.over { color: var(--red); }
.dm { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.dmhead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.dmhead b { color: var(--head); }
.app-tag { background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; padding: 0 5px; border-radius: 3px; }
.cv2 { background: var(--side); border-left: 4px solid var(--bar, #3498db); border-radius: 4px; padding: 12px 14px;
       font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; transition: border-color var(--mid); }
.cv2-section { display: flex; gap: 12px; align-items: flex-start; }
.cv2-text { flex: 1; min-width: 0; }
.cv2-thumb { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; flex: none; }
.cv2 .sep { height: 1px; background: var(--line); margin: 12px 0; }
.md-h1 { color: var(--head); font-size: 22px; font-weight: 700; margin: 2px 0 4px; }
.md-h2 { color: var(--head); font-size: 19px; font-weight: 700; margin: 2px 0 6px; }
.md-h3 { color: var(--head); font-size: 16px; font-weight: 700; margin: 2px 0 4px; }
.md-sub { color: var(--muted); font-size: 12px; }
.md-quote { border-left: 4px solid #4e5058; padding-left: 10px; }
.md-gap { height: .6em; }
.cv2 b { color: var(--head); }
.mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.link { color: #00a8fc; }
img.emoji { width: 1.375em; height: 1.375em; vertical-align: -.3em; object-fit: contain; }
.dbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.dbtn { display: inline-flex; align-items: center; gap: 2px; background: #4e5058; color: #fff; border-radius: 4px; padding: 3px 10px;
        font-size: 13px; transition: background var(--mid); }
.dbtn.on { background: var(--accent); }
.dbtn.link::after { content: " \2197"; font-size: 11px; }
.dbtn img.emoji { width: 1.1em; height: 1.1em; }

/* ── moderation: cases ──────────────────────────────────────────────────── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters input[type=search], .filters input[type=text] { flex: 1; min-width: 200px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
table.cases { table-layout: fixed; }
table.cases col.c-id { width: 56px; }
table.cases col.c-type { width: 84px; }
table.cases col.c-user { width: 28%; }
table.cases col.c-date { width: 128px; }
table.cases tbody tr { cursor: pointer; transition: background .12s; }
table.cases tbody tr:hover, table.cases tbody tr:focus { background: var(--hover); outline: none; }
table.cases tbody tr.sel { background: #404249; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.r { color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; color: #111; background: var(--c); }
.person { display: flex; align-items: center; gap: 8px; min-width: 0; }
.person > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 4px 6px; }
.pager .note { margin-right: auto; }
.tbl-fade { transition: opacity var(--fast); }
.tbl-fade.busy { opacity: .45; }

/* details panel, slides in from the right */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; z-index: 40;
         transition: opacity var(--mid); }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--side); z-index: 41;
          box-shadow: -12px 0 32px rgba(0, 0, 0, .4); transform: translateX(104%); transition: transform .32s var(--ease);
          overflow-y: auto; padding: 22px 22px 40px; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.drawer-head h3 { margin: 0; color: var(--head); font-size: 18px; flex: 1; }
.drawer dl { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.drawer dt { color: var(--muted); }
.drawer dd { margin: 0; min-width: 0; }
.drawer h4 { margin: 18px 0 8px; color: var(--head); font-size: 14px; font-weight: 500; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--deep); border-radius: 6px; padding: 8px 10px; }
.history { display: flex; flex-direction: column; gap: 4px; }
button.hist { background: var(--deep); text-align: left; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
button.hist:hover { background: var(--hover); }
button.hist .when { margin-left: auto; color: var(--muted); }

/* ── moderation: mod stats ──────────────────────────────────────────────── */
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sheet-head b { color: var(--head); font-size: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--deep); border-radius: 8px; padding: 10px 12px; border-top: 3px solid var(--c, var(--accent));
        animation: page-in .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.stat span { color: var(--muted); font-size: 12px; display: block; }
.stat b { color: var(--head); font-size: 22px; font-weight: 600; }
h3.gap { margin-top: 22px; }
.chart { display: flex; align-items: stretch; height: 200px; margin: 6px 0 4px; }
.bar { flex: 1; display: flex; flex-direction: column; min-width: 0; cursor: default; }
.bar .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
            border-bottom: 1px solid var(--line); padding: 0 4px; }
.bar .val { font-size: 12px; font-weight: 600; color: var(--head); margin-bottom: 4px; line-height: 1;
            animation: fade-in .3s both; animation-delay: calc(var(--i) * 30ms + .25s); }
.bar i { display: block; width: 100%; max-width: 46px; height: var(--h); min-height: 3px; border-radius: 6px 6px 2px 2px;
         background: var(--accent); transform-origin: bottom; transition: background var(--fast);
         animation: grow .55s var(--ease) both; animation-delay: calc(var(--i) * 30ms); }
.bar.zero i { background: var(--line); }
.bar.now i { background: var(--accent-2); }
.bar:hover i { background: #8f98f7; }
.bar .lab { text-align: center; font-size: 11px; color: var(--muted); padding-top: 6px; white-space: nowrap; overflow: hidden; }
.bar.now .lab { color: var(--text); font-weight: 600; }

/* ── command permissions ────────────────────────────────────────────────── */
table.perms td { vertical-align: middle; }
tr.ghead td { background: var(--deep); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
.cmd { color: var(--head); }
.twin { color: var(--muted); font-size: 12px; margin-left: 6px; }
.dflt { color: var(--muted); font-size: 13px; }
.who { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.who .chip { padding: 0 4px 0 0; }

/* ── overview ───────────────────────────────────────────────────────────── */
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; background: var(--card); border-radius: 10px;
          padding: 10px 16px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.status b { color: var(--head); font-weight: 600; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 600; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative; }
.live i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green);
                 animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live i::after { animation: none !important; } }

.pill { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.foot { display: flex; justify-content: flex-end; padding-top: 8px; }
.foot a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 4px 8px; border-radius: 6px;
          transition: background var(--fast), color var(--fast); }
.foot a:hover { background: var(--hover); color: var(--text); }

/* needs attention */
.ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; color: var(--c);
      background: color-mix(in srgb, var(--c) 15%, transparent); }
.ic svg { width: 18px; height: 18px; }
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line);
        animation: fade-in var(--mid) both; }
.todo .t { flex: 1; min-width: 0; }
.todo .t b { color: var(--head); font-weight: 500; display: block; overflow-wrap: anywhere; }
.todo .t span { color: var(--muted); font-size: 13px; }
a.go { color: var(--text); text-decoration: none; font-size: 13px; background: var(--deep); padding: 6px 10px; border-radius: 6px;
       white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; transition: background var(--fast); }
a.go:hover { background: var(--hover); }
a.go.ext::after { content: " \2197"; color: var(--muted); }
a.go.int::after { content: " \2192"; color: var(--muted); }

/* this week */
.week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* number with the change beside it; "counting since" on its own line; bars at the bottom */
.week .stat { display: flex; flex-direction: column; min-width: 0; }
.stat .val { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; min-width: 0; }
.stat .delta { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.stat .since { font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week .spark { margin-top: auto; padding-top: 8px; height: 34px; }
.delta.up::before { content: "\25B2 "; font-size: 9px; }
.delta.down::before { content: "\25BC "; font-size: 9px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: 6px; }
.spark i { flex: 1; background: var(--c, var(--accent)); opacity: .45; border-radius: 2px 2px 0 0; min-height: 2px;
           height: var(--h); transform-origin: bottom; animation: grow .5s var(--ease) both; }
.spark i:last-child { opacity: 1; }
.spark i.none { background: var(--line); }

.badge.chg { background: #4e5058; color: #fff; }
.seg.small button { padding: 3px 10px; font-size: 13px; }

.tag-new { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; border-radius: 4px;
           padding: 1px 5px; margin-left: 6px; vertical-align: 1px; letter-spacing: .02em; }

@media (max-width: 640px) {
  .status { gap: 4px 16px; padding: 10px 14px; }
  .todo { flex-wrap: wrap; }
  .todo .t { flex: 1 1 calc(100% - 46px); }
  .todo a.go { margin-left: 46px; max-width: calc(100% - 46px); }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── announce ───────────────────────────────────────────────────────────── */
.ping-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.msg-body { padding-left: 36px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.msg-body .mention { display: inline-block; margin-bottom: 2px; }
.note.posted { color: var(--green); }
.note.posted a { margin-left: 4px; }
@media (max-width: 640px) { .msg-body { padding-left: 0; } }

/* ── save bar and toast ─────────────────────────────────────────────────── */
.savebar { position: fixed; left: calc(50% + 120px); bottom: 20px; transform: translate(-50%, 140px); opacity: 0;
           background: #111214; border-radius: 10px; padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 12px;
           box-shadow: var(--shadow); width: min(700px, calc(100% - 32px)); z-index: 30;
           transition: transform .35s var(--ease), opacity .25s; }
.savebar.show { transform: translate(-50%, 0); opacity: 1; }
.savebar span { flex: 1; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--green); color: #fff; padding: 10px 14px; border-radius: 8px;
         box-shadow: var(--shadow); opacity: 0; transform: translateY(14px); pointer-events: none; max-width: 380px; z-index: 60;
         transition: opacity .2s, transform .3s var(--ease); }
.toast.err { background: var(--red); }
.toast.show { opacity: 1; transform: none; }


body.lock { overflow: hidden; }

@media (max-width: 1100px) {
  .grid2 { grid-template-columns: 1fr; }
  main { padding: 24px 28px 120px; }
}

@media (max-width: 900px) {
  main { padding: 20px 20px 130px; }
  .savebar { left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  main { padding: 16px 14px 140px; }
  h1 { font-size: 20px; }
  .lead { margin-bottom: 16px; font-size: 14px; }
  .card { padding: 14px; }
  .card.tight { padding: 4px 8px; }

  /* label above its controls; a lone on/off switch stays on the right */
  .row { flex-wrap: wrap; gap: 8px 12px; }
  .row > .lbl { flex-basis: 100%; }
  .row:has(> .ctl > .sw:only-child) > .lbl { flex-basis: 0; }
  .ctl { max-width: none; justify-content: flex-start; flex: 1 1 100%; }
  .row:has(> .ctl > .sw:only-child) > .ctl { flex: 0 0 auto; }
  .pick-btn, select { max-width: 100%; }
  .filters > select, .filters > .seg { flex: 1 1 auto; }

  /* role panel entries: description on its own line */
  .entry input.grow { order: 5; flex-basis: 100%; }
  .entry .ghost { margin-left: auto; }

  /* cases as cards: "#60 warn  date" / user / reason */
  table.cases, table.cases tbody { display: block; }
  table.cases colgroup, table.cases thead { display: none; }
  table.cases tbody tr { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 4px 8px;
                         padding: 10px 6px; border-bottom: 1px solid var(--line); border-radius: 8px; }
  table.cases tbody tr:last-child { border-bottom: 0; }
  table.cases td { display: block; border: 0; padding: 0; min-width: 0; }
  table.cases td.c-id { grid-column: 1; grid-row: 1; color: var(--muted); }
  table.cases td.c-id::before { content: "#"; }
  table.cases td.c-type { grid-column: 2; grid-row: 1; }
  table.cases td.c-date { grid-column: 3; grid-row: 1; justify-self: end; font-size: 12px; }
  table.cases td.c-user { grid-column: 1 / -1; grid-row: 2; }
  table.cases td.reason { grid-column: 1 / -1; grid-row: 3; font-size: 13px; }
  .pager { flex-wrap: wrap; }
  .pager .note { flex-basis: 100%; }

  /* command permissions as cards */
  table.perms, table.perms tbody { display: block; }
  table.perms thead { display: none; }
  table.perms tr { display: block; padding: 10px 6px; border-bottom: 1px solid var(--line); }
  table.perms td { display: block; border: 0; padding: 2px 0; }
  table.perms tr.ghead { padding: 0; border: 0; }
  table.perms tr.ghead td { padding: 7px 8px; border-radius: 6px; margin-top: 6px; }
  table.perms td.dflt::before { content: "Default: "; }
  table.perms .who { margin-top: 6px; }
  tr.changed td:first-child { box-shadow: none; }
  table.perms tr.changed { box-shadow: inset 3px 0 0 var(--yellow); padding-left: 12px; }

  /* charts: fewer date labels, tighter bars */
  .chart { height: 170px; }
  .bar .col { padding: 0 2px; }
  .bar .val { font-size: 11px; }
  .bar:nth-child(odd) .lab { visibility: hidden; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .savebar { padding: 8px 8px 8px 14px; gap: 6px; }
  .savebar span { font-size: 14px; }
  .toast { left: 12px; right: 12px; max-width: none; bottom: auto; top: max(12px, env(safe-area-inset-top));
           transform: translateY(-14px); text-align: center; }
  .drawer { padding: 18px 16px calc(32px + env(safe-area-inset-bottom)); padding-top: max(18px, env(safe-area-inset-top)); }
  .drawer dl { grid-template-columns: 84px 1fr; }
  .login-card { padding: 26px 20px; }
}

/* picker as a sheet from the bottom on phones */
@keyframes sheet-in { from { transform: translateY(100%); } }
.pop.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto !important; width: auto !important;
             max-height: 72dvh; display: flex; flex-direction: column; border-radius: 14px 14px 0 0; padding: 10px 10px 0;
             padding-bottom: max(10px, env(safe-area-inset-bottom)); animation: sheet-in .28s var(--ease) both; }
.pop.sheet.closing { animation: pop-out .15s ease both; }
.pop.sheet::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: #4e5058; margin: 0 auto 10px; flex: none; }
.pop.sheet .opts { max-height: none; flex: 1; }
.pop.sheet .opt { padding: 11px 10px; font-size: 15px; }
.sheet-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 49; animation: fade-in .2s both; }
.sheet-scrim.closing { animation: pop-out .15s ease both; }

/* touch screens: bigger targets, and 16px text so iPhones do not zoom into fields */
@media (pointer: coarse) {
  input[type=text], input[type=search], input[type=number], select, textarea { font-size: 16px; }
  button, .pick-btn { min-height: 40px; }
  button.mini { min-height: 30px; min-width: 30px; }
  .chip .x, .role .x { min-width: 26px; min-height: 26px; font-size: 17px; }
  .seg button { padding: 8px 14px; }
  .opt { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important;
                           transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── SPBoard ────────────────────────────────────────────────────────────── */
.sp-nav { font-size: 10px; font-weight: 700; color: #16121f; background: #9b84ec; border-radius: 4px; padding: 0 5px;
          margin-left: 8px; vertical-align: 1px; }
h1 .badge.sp-only { font-size: 11px; vertical-align: 3px; }
.sp-tabs { margin-bottom: 16px; }
.sp-strip { grid-template-columns: repeat(4, minmax(110px, 1fr)) minmax(220px, 2fr); margin-bottom: 14px; }
.sp-hours { display: flex; align-items: flex-end; gap: 3px; height: 38px; margin-top: 4px; }
.sp-hours i { flex: 1; height: var(--h); background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.sp-hours i.now { background: var(--accent-2); opacity: 1; }
.sp-hours i.later { opacity: .15; }
.live.off { color: var(--muted); }
.live.off i, .live.off i::after { background: var(--muted); animation: none; }
.btn-link { color: var(--muted); font-size: 14px; text-decoration: none; padding: 7px 6px; }
.btn-link:hover { color: var(--text); }
.sp-person { display: inline-flex; align-items: center; gap: 4px; background: var(--deep); border-radius: 6px; padding: 4px 4px 4px 10px;
             font-size: 14px; color: var(--muted); }
.sp-person b { color: var(--head); font-weight: 500; }
.sp-person .x { background: none; color: var(--muted); padding: 0 6px; font-size: 16px; }
.sp-person .x:hover { color: var(--red); }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sp-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); color: var(--muted); border: 1px solid var(--line);
           border-radius: 999px; padding: 3px 11px 3px 9px; font-size: 13px; }
.sp-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.sp-chip small { color: var(--muted); font-size: 12px; }
.sp-chip:hover { background: var(--hover); }
.sp-chip.on { color: var(--head); border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--card)); }
.sp-day { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700;
          text-transform: uppercase; letter-spacing: .03em; margin: 16px 0 6px; }
.sp-day:first-child { margin-top: 0; }
.sp-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sp-log { background: var(--card); border-radius: 10px; overflow: hidden; }
.sp-entry { display: grid; grid-template-columns: 70px 4px minmax(0, 1fr) auto; gap: 12px; align-items: center;
            padding: 9px 14px; border-top: 1px solid var(--line); cursor: pointer; transition: background var(--fast); }
.sp-entry:first-child { border-top: 0; }
.sp-entry:hover { background: var(--hover); }
.sp-entry.sel { background: #3a3c42; }
.sp-entry:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sp-entry time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sp-bar { align-self: stretch; border-radius: 2px; background: var(--c); }
.sp-entry .what { min-width: 0; }
.sp-entry .what p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-entry .what b, .sp-title b, .sp-mini b { color: var(--head); font-weight: 600; }
.sp-entry .what small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-tag { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; white-space: nowrap; color: var(--c);
          background: color-mix(in srgb, var(--c) 15%, transparent); }
.sp-entry.failed { background: rgba(242, 63, 67, .07); }
.sp-entry.failed .sp-tag { color: #fff; background: var(--red); }
@keyframes sp-new { from { background: rgba(88, 101, 242, .28); } }
.sp-entry.fresh { animation: sp-new 2.4s ease-out; }
.sp-more { display: block; margin: 12px auto 0; }
.sp-empty { text-align: center; padding: 28px; }
.sp-searched { text-align: center; margin: 10px 0 0; }
.drawer-head .grow { flex: 1; }
.sp-title { color: var(--text); font-size: 17px; font-weight: 500; line-height: 1.4; margin: 0 0 16px; }
.drawer code { overflow-wrap: anywhere; }
.sp-ok { color: var(--green); font-weight: 600; }
.sp-bad { color: var(--red); font-weight: 600; }
.sp-people { flex-wrap: wrap; padding-top: 0; }
.sp-chain { display: flex; flex-direction: column; gap: 2px; }
.sp-mini { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; font-size: 13px; padding: 5px 8px; border-radius: 6px;
           border-left: 3px solid var(--c); background: var(--deep); }
.sp-mini time { color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-mini.this { outline: 1px solid var(--accent); }
.sp-mini.failed { background: rgba(242, 63, 67, .1); }
.sp-add { position: relative; display: flex; margin-top: 12px; }
.sp-results { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: var(--raised); border-radius: 8px;
              padding: 4px; box-shadow: var(--shadow); z-index: 5; }
.sp-result { display: flex; align-items: center; gap: 8px; width: 100%; background: none; color: var(--text); text-align: left; padding: 6px 8px; }
.sp-result:hover { background: var(--hover); }
.sp-result small { color: var(--muted); margin-left: auto; }
.sp-results .note { margin: 6px 8px; }
@media (max-width: 1100px) { .sp-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sp-hours-tile { grid-column: 1 / -1; } }
@media (max-width: 700px) {
  .sp-entry { grid-template-columns: 54px 4px minmax(0, 1fr); gap: 10px; padding: 9px 12px; }
  .sp-tag { display: none; }
}

/* SPBoard › Server */
.filters .grow { flex: 1; }
.sp-health { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 10px; padding: 12px 16px;
             margin-bottom: 14px; border-left: 4px solid var(--st); font-size: 14px; }
.sp-health .ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--st);
                  color: #111; font-weight: 800; flex: none; }
.sp-health b { color: var(--head); }
.sp-health span { color: var(--muted); }
.sp-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.sp-tile { background: var(--card); border-radius: 10px; padding: 12px 14px 10px; min-width: 0; animation: page-in .35s var(--ease) both; }
.sp-tile > span { color: var(--muted); font-size: 12px; display: block; }
.sp-tile > b { color: var(--head); font-size: 22px; font-weight: 600; display: block; line-height: 1.3; }
.sp-tile > small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-tile > small::before { content: ""; display: none; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.sp-tile > small.good::before { display: inline-block; background: var(--green); }
.sp-tile > small.warn::before { display: inline-block; background: var(--yellow); }
.sp-tile > small.bad::before { display: inline-block; background: var(--red); }
.sp-meter { height: 6px; border-radius: 3px; background: #3a3f6b; margin-top: 8px; overflow: hidden; }
.sp-meter i { display: block; height: 100%; width: var(--w); border-radius: 3px; background: var(--fill); transition: width var(--mid) var(--ease); }
.sp-spark { display: block; width: 100%; height: 26px; margin-top: 6px; }
.sp-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sp-chart-card { margin: 0; min-width: 0; }
.sp-chart-card h3 { margin-bottom: 2px; }
.sp-chart-card .note { margin: 0 0 8px; }
.sp-chart { position: relative; outline: none; }
.sp-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.sp-chart:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 6px; }
.sp-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: -4px 0 6px; }
.sp-legend i { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: var(--c); vertical-align: 4px; margin-right: 6px; }
.sp-tip { position: absolute; pointer-events: none; background: var(--deep); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
          font-size: 12.5px; box-shadow: var(--shadow); white-space: nowrap; z-index: 3; transform: translate(-50%, -100%); }
.sp-tip .t { color: var(--muted); margin-bottom: 3px; }
.sp-tip .r { display: flex; align-items: center; gap: 8px; }
.sp-tip .r i { width: 12px; height: 2px; background: var(--c); border-radius: 1px; }
.sp-tip .r b { color: var(--head); font-variant-numeric: tabular-nums; }
.sp-tip .r span { color: var(--muted); }
.sp-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.sp-two > .card { margin: 0; }
.sp-two + .card { margin-top: 14px; }
.sp-warn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0;
           border-top: 1px solid var(--line); }
.sp-warn .badge { white-space: nowrap; }
.sp-warn b { color: var(--head); font-weight: 500; display: block; }
.sp-warn small { color: var(--muted); font-size: 12.5px; }
.sp-none { margin: 6px 0 0; }
.sp-field { display: inline-flex; align-items: center; gap: 6px; }
.sp-crit { margin: 10px 0 0; }
.sp-inside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.sp-inside div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sp-inside span { color: var(--muted); }
.sp-inside b { color: var(--head); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.sp-tablewrap { max-height: 320px; overflow: auto; }
table.sp-numbers th, table.sp-numbers td { text-align: right; font-variant-numeric: tabular-nums; }
table.sp-numbers th:first-child, table.sp-numbers td:first-child { text-align: left; }
@media (max-width: 1300px) { .sp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sp-charts, .sp-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .sp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sp-inside { grid-template-columns: minmax(0, 1fr); } }

/* ── Appeals ────────────────────────────────────────────────────────────── */
.nav-pill { float: right; margin-top: 2px; }
button.bad { background: var(--red); }
button.bad:hover { background: #d1353a; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.card.ap-list { padding: 0; overflow: hidden; }
.ap-item { display: grid; grid-template-columns: 36px minmax(0, 1.4fr) minmax(0, 1fr) 120px 110px; gap: 12px; align-items: center;
           width: 100%; background: none; color: var(--text); border-radius: 0; padding: 11px 16px; text-align: left;
           border-top: 1px solid var(--line); }
.ap-item:first-child { border-top: 0; }
.ap-item:hover { background: var(--hover); }
.ap-item:active { transform: none; }
.ap-item.sel { background: #404249; }
.ap-main, .ap-ban { min-width: 0; }
.ap-item b { color: var(--head); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-item small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-item .badge { justify-self: start; }
.ap-votes, .ap-when { color: var(--muted); font-size: 13px; }
.ap-when { text-align: right; }
.ap-empty { padding: 18px; margin: 0; }
.ap-drawer { width: min(480px, 100%); }
.ap-drawer .drawer-head .ava { width: 44px; height: 44px; }
.ap-drawer .drawer-head .grow { min-width: 0; }
.ap-drawer .drawer-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-chips .chip { gap: 6px; color: var(--text); text-decoration: none; font-size: 13px; cursor: pointer; }
.ap-chips button.chip { padding: 3px 8px; }
.ap-chips .chip:hover { background: var(--hover); }
.ap-qa { background: var(--deep); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.ap-qa b { color: var(--head); display: block; font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.ap-vote { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ap-vote button.on { box-shadow: inset 0 0 0 2px var(--green); }
.ap-note { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; margin-bottom: 10px; font-size: 14px; }
.ap-note .ava { margin-top: 2px; }
.ap-note b { color: var(--head); font-weight: 500; }
.ap-note small { color: var(--muted); }
.ap-add { display: flex; gap: 8px; align-items: flex-start; }
.ap-add textarea { flex: 1; min-width: 0; }
.ap-decide { background: var(--deep); border-radius: 10px; padding: 12px; margin-top: 18px; }
.ap-decide h4 { margin-top: 0; }
.ap-decide textarea { width: 100%; background: var(--side); }
.ap-result { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 18px; font-size: 14px; }
.ap-result b { color: var(--head); font-weight: 500; display: block; }
.ap-result .pre { margin-top: 8px; }
.ap-result.accepted { background: rgba(35, 165, 90, .12); border-color: rgba(35, 165, 90, .5); }
.ap-result.denied { background: rgba(242, 63, 67, .1); border-color: rgba(242, 63, 67, .45); }
.ap-qedit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ap-qedit input { flex: 1; min-width: 200px; }
@media (max-width: 900px) {
  .ap-item { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 10px 12px; }
  .ap-item .ava { width: 32px; height: 32px; }
  .ap-item .hide-sm, .ap-item .ap-when { display: none; }
}

/* ── Blacklist (blacklist.js) and the wait choices it shares with Deny ──── */
.bl-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.bl-tile { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px 14px; text-align: left; color: var(--text);
           background: var(--card); border: 1px solid var(--line); border-radius: 10px; transition: border-color var(--fast), background var(--fast); }
.bl-tile:hover { background: var(--hover); }
.bl-tile:active { transform: none; }
.bl-tile.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--card)); }
.bl-tile-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; color: var(--c);
              background: color-mix(in srgb, var(--c) 16%, transparent); }
.bl-tile-ic svg { width: 18px; height: 18px; }
.bl-tile b { display: block; color: var(--head); font-size: 20px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.bl-tile small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.bl-list { padding: 0; overflow: hidden; }
.bl-head, .bl-row { display: grid; grid-template-columns: 36px minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1.2fr) 16px; gap: 12px;
                    align-items: center; padding: 0 16px; }
.bl-head span:first-child { grid-column: span 2; }
.bl-head { min-height: 36px;
           color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
           border-bottom: 1px solid var(--line); }
.bl-row { width: 100%; min-height: 60px; background: none; color: var(--text); border-radius: 0; text-align: left;
          border-top: 1px solid var(--line); }
.bl-head + .bl-row { border-top: 0; }
.bl-row:hover { background: var(--hover); }
.bl-row:active { transform: none; }
.bl-row.sel { background: #404249; }
.bl-who, .bl-ban, .bl-rule { min-width: 0; }
.bl-who b, .bl-ban span { display: block; color: var(--head); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-ban span { color: var(--text); font-weight: 400; font-size: 14px; }
.bl-row small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-row .mono, .bl-drawer .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.bl-rule { display: grid; justify-items: start; gap: 3px; }
.bl-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 1px 9px 1px 7px; border-radius: 999px;
           font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.bl-chip svg { width: 13px; height: 13px; flex: none; }
.bl-chev { width: 16px; height: 16px; color: var(--muted); }
.bl-foot { margin: 8px 2px 0; }
.bl-closed { background: rgba(240, 178, 50, .12); border: 1px solid rgba(240, 178, 50, .4); border-radius: 8px; padding: 8px 12px; color: var(--text); }
.bl-drawer .drawer-head .note { display: block; }
.bl-save { align-items: center; }
.bl-save .note { margin-right: auto; }
.bl-msg { margin: 0 0 8px; }
.bl-log { border-left: 2px solid var(--line); margin-left: 6px; }
.bl-log div { position: relative; padding: 0 0 10px 16px; font-size: 13.5px; color: var(--muted); }
.bl-log div::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
                      background: var(--line); box-shadow: 0 0 0 3px var(--side); }
.bl-log b { color: var(--head); font-weight: 500; }
.bl-unban { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.bl-unban div { flex: 1; min-width: 0; }
.bl-unban b { display: block; color: var(--head); font-weight: 500; }
.bl-unban small { color: var(--muted); font-size: 13px; }
.bl-unban button { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.bl-unban button svg { width: 16px; height: 16px; }

.wo { display: grid; gap: 8px; }
.wo-opt { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 11px 13px;
          border: 1px solid var(--line); border-radius: 10px; background: var(--deep); cursor: pointer; transition: border-color var(--fast); --t: var(--accent); }
.wo-opt.block { --t: var(--red); }
.wo-opt:hover { border-color: var(--muted); }
.wo-opt > input { position: absolute; opacity: 0; pointer-events: none; }
.wo-radio { width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; }
.wo-text b { display: block; color: var(--head); font-weight: 600; font-size: 14.5px; }
.wo-text small { display: block; color: var(--muted); font-size: 13px; }
.wo-extra { display: none; grid-column: 2; gap: 8px; margin-top: 6px; }
.wo-opt:has(> input:checked) { border-color: var(--t); background: color-mix(in srgb, var(--t) 8%, var(--deep)); }
.wo-opt:has(> input:checked) .wo-radio { border-color: var(--t); }
.wo-opt:has(> input:checked) .wo-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--t); }
.wo-opt:has(> input:checked) .wo-extra { display: grid; }
.wo-opt:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.wo-days { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.wo-days input { width: 96px; }
.wo-extra textarea { width: 100%; min-height: 70px; resize: vertical; }
.wo-calc { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.wo-calc svg { width: 15px; height: 15px; flex: none; }
.modal.wo-modal { width: min(480px, 100%); }
.wo-modal .wo { padding: 14px 20px 0; }
.wo-modal .wo-opt { background: var(--card); }
@media (max-width: 900px) {
  .bl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bl-tiles .bl-tile:first-child { grid-column: span 2; }
  .bl-row { grid-template-columns: 32px minmax(0, 1fr) 16px; row-gap: 6px; padding: 10px 12px; }
  .bl-row .ava { width: 32px; height: 32px; }
  .bl-row .bl-rule { grid-column: 2; grid-row: 2; }
  .bl-row .bl-chev { grid-column: 3; grid-row: 1; }
  .bl-row .hide-sm, .bl-head.hide-sm { display: none; }
}

/* ── Data requests (owner only) ─────────────────────────────────────────── */
.sp-nav.owner { background: #ed6fa4; }
.card input[type=search] { width: 100%; }
.dr-results { margin-top: 8px; border-radius: 8px; overflow: hidden; background: var(--deep); }
.dr-results:empty { display: none; }
.dr-res { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px;
          color: var(--text); text-decoration: none; border-top: 1px solid var(--side); }
.dr-res:first-child { border-top: 0; }
.dr-res:hover { background: var(--hover); }
.dr-res b { color: var(--head); font-weight: 500; display: block; }
.dr-res small { color: var(--muted); font-size: 12.5px; }
.dr-none { padding: 12px 14px; margin: 0; }
table.dr-reqs { width: 100%; }
.dr-reqs td.r { text-align: right; }
.dr-due { font-variant-numeric: tabular-nums; }
.dr-due.soon { color: var(--yellow); }
.dr-due.late { color: var(--red); font-weight: 600; }
.dr-back { color: var(--muted); font-size: 13px; text-decoration: none; }
.dr-back:hover { color: var(--text); }
.dr-who { display: flex; gap: 14px; align-items: center; margin: 10px 0 18px; flex-wrap: wrap; }
.dr-who .ava { width: 56px; height: 56px; }
.dr-name { min-width: 0; }
.dr-name b { color: var(--head); font-size: 20px; display: block; line-height: 1.2; }
.dr-name small { color: var(--muted); }
.dr-acts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.dr-side { position: sticky; top: 16px; }
.dr-side .card { margin-bottom: 14px; }
.dr-kind { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.dr-kind input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--red); }
.dr-kind b { color: var(--head); font-weight: 500; }
.dr-kind .note { margin: 0; }
.dr-n { color: var(--head); font-variant-numeric: tabular-nums; }
.dr-warn { color: var(--yellow); font-size: 12.5px; display: block; margin-top: 2px; }
.dr-cases { display: grid; gap: 6px; margin-top: 8px; }
.dr-case { display: grid; grid-template-columns: 18px 48px auto minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--deep);
           border-radius: 6px; padding: 7px 10px; font-size: 13.5px; cursor: pointer; }
.dr-case input { margin: 0; accent-color: var(--red); }
.dr-case .id { color: var(--muted); }
.dr-case .r { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-outside { font-size: 13px; color: var(--muted); background: var(--deep); border-radius: 8px; padding: 10px 12px; margin: 12px 0 0; }
.dr-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dr-opt small { display: block; color: var(--muted); font-size: 12.5px; }
.dr-download { display: flex; justify-content: center; margin-top: 12px; background: var(--accent); color: #fff; border-radius: 6px; padding: 9px 14px;
               text-decoration: none; font-weight: 500; font-size: 14px; transition: background var(--fast); }
.dr-download:hover { background: #4752c4; }
.dr-wide { width: 100%; margin: 4px 0 2px; }
.dr-modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 60; display: grid; place-items: center; padding: 16px;
                 animation: fade-in var(--fast) both; }
.dr-modal { width: min(540px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--side); border-radius: 12px; padding: 22px 24px;
            box-shadow: var(--shadow); }
.dr-modal h2 { margin: 0 0 4px; color: var(--head); font-size: 19px; }
.dr-modal h4 { margin: 14px 0 2px; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.dr-modal ul { margin: 6px 0 4px; padding-left: 18px; font-size: 14px; }
.dr-modal .gone li::marker { color: var(--red); }
.dr-modal .keep li::marker { color: var(--green); }
.dr-modal label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.dr-modal input { width: 100%; }
@media (max-width: 900px) {
  .dr-layout { grid-template-columns: minmax(0, 1fr); }
  .dr-side { position: static; }
  .dr-acts { margin-left: 0; width: 100%; }
  .dr-case { grid-template-columns: 18px 44px minmax(0, 1fr); }
  .dr-case .r, .dr-case > :last-child { grid-column: 3; }
  .dr-reqs .hide-sm { display: none; }
}

/* ── Reported bugs (the list and panel styles are the Appeals ones) ─────── */
.ap-item.bg-item { grid-template-columns: 12px minmax(0, 1.6fr) 130px 150px 90px; }
.bg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.bg-item .person { font-size: 13.5px; }
.bg-status { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }
.bg-status button { background: var(--deep); border: 1px solid var(--line); color: var(--text); border-radius: 99px; padding: 4px 12px; font-size: 13px; }
.bg-status button:hover { background: var(--hover); }
.bg-status button.on { background: var(--c); border-color: var(--c); color: #111; font-weight: 600; }
.bg-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.bg-shots a { display: block; border-radius: 8px; overflow: hidden; background: var(--deep); aspect-ratio: 4 / 3; }
.bg-shots img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--mid) var(--ease); }
.bg-shots a:hover img { transform: scale(1.04); }
.bg-ctx { background: var(--deep); border-radius: 8px; overflow: hidden; font-size: 13px; }
.bg-ctx > div { display: grid; grid-template-columns: 44px 16px minmax(0, 1fr); gap: 8px; padding: 7px 10px; border-top: 1px solid var(--side); }
.bg-ctx > div:first-child { border-top: 0; }
.bg-ctx .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.bg-ctx .k { color: var(--green); font-weight: 700; }
.bg-ctx .x { color: var(--red); font-weight: 700; }
.bg-ctx .err { background: rgba(242, 63, 67, .08); }
.bg-ctx code { color: #f8a5a7; background: none; padding: 0; font-size: 12px; overflow-wrap: anywhere; }
.bg-send { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.bg-dm { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
@media (max-width: 900px) {
  .ap-item.bg-item { grid-template-columns: 12px minmax(0, 1fr) auto; }
}

/* ── Squadron applications ──────────────────────────────────────────────── */
.sq-item { grid-template-columns: 36px minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, .8fr) auto; }
.sq-flags { display: flex; gap: 4px; flex-wrap: wrap; overflow: hidden; max-height: 22px; }
.sq-flag { font-size: 12px; font-weight: 600; color: #f5d38a; background: rgba(240, 178, 50, .14); border-radius: 10px; padding: 1px 8px;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sq-warn { display: grid; gap: 4px; background: rgba(240, 178, 50, .12); color: #f5d38a; border-radius: 8px; padding: 10px 12px;
           margin-bottom: 14px; font-size: 13.5px; }
.sq-bad { color: var(--red); }
.sq-drawer dl { grid-template-columns: 116px 1fr; }
.sq-drawer dd a { color: #00a8fc; text-decoration: none; }
.sq-drawer dd a:hover { text-decoration: underline; }
.sq-shot { display: block; border-radius: 8px; overflow: hidden; background: var(--deep); }
.sq-shot img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.sq-claim { margin-right: auto; }
.sq-claim:disabled { opacity: .7; }
.sq-reasons { display: grid; gap: 4px; margin-top: 12px; animation: fade-in var(--mid) both; }
.sq-reasons > b { color: var(--head); font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.sq-reason { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px;
             transition: background var(--fast); }
.sq-reason:hover { background: var(--hover); }
.sq-reason input { accent-color: var(--red); width: 16px; height: 16px; margin: 0; flex: none; }
.sq-reasons textarea { width: 100%; background: var(--side); margin-top: 6px; }
.sq-dm { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); cursor: pointer; margin-top: 4px; }
.sq-dm input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.ap-result.expired, .ap-result.cancelled { background: var(--deep); }
@media (max-width: 900px) {
  .sq-item { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .sq-drawer dl { grid-template-columns: 96px 1fr; }
}

/* ── Announce ───────────────────────────────────────────────────────────── */
.an-grid { align-items: start; }
.an-side { position: sticky; top: 16px; }
.an-where { margin: 0 0 10px; }
.an-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.an-editor { background: var(--deep); border: 1px solid transparent; border-radius: 8px; transition: border-color var(--fast), box-shadow var(--fast); }
.an-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 101, 242, .25); }
.an-editor textarea, .an-editor textarea:focus { width: 100%; border: 0; box-shadow: none; background: none; min-height: 180px; display: block; }
.an-tools { position: relative; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid #2a2b30; }
.an-tools > button { min-width: 30px; height: 30px; min-height: 30px; padding: 0 7px; background: none; color: var(--muted);
                     font-weight: 700; font-size: 14px; border-radius: 6px; transition: background var(--fast), color var(--fast); }
.an-tools > button:hover, .an-tools > button[aria-expanded="true"] { background: var(--hover); color: var(--head); }
.an-tools > button.i { font-style: italic; }
.an-tools > button.u { text-decoration: underline; }
.an-tools > button.s { text-decoration: line-through; }
.an-tools .sep { width: 1px; background: var(--line); margin: 5px 4px; }
.an-drop { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 14px; border: 2px dashed var(--line);
           border-radius: 10px; color: var(--muted); font-size: 13px; cursor: pointer;
           transition: border-color var(--fast), background var(--fast), color var(--fast); }
.an-drop b { color: var(--text); font-weight: 500; font-size: 14px; }
.an-drop:hover, .an-drop.over, .an-drop:focus-visible { border-color: var(--accent); background: rgba(88, 101, 242, .08); color: var(--text); outline: none; }
.an-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.an-thumbs:empty { display: none; }
.an-thumb { position: relative; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--deep);
            animation: fade-in var(--mid) both; }
.an-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.an-thumb .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%;
               background: rgba(0, 0, 0, .65); color: #fff; font-size: 14px; line-height: 1; opacity: 0; transition: opacity var(--fast); }
.an-thumb:hover .x, .an-thumb .x:focus-visible { opacity: 1; }
@media (hover: none) { .an-thumb .x { opacity: 1; } }
.an-links { display: grid; gap: 6px; }
.an-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 6px; animation: fade-in var(--mid) both; }
.an-link input { width: 100%; min-width: 0; }
.an-link input.bad { border-color: var(--red); }
.an-add { justify-self: start; border: 1px dashed var(--line); }
.an-add:hover { border-color: var(--accent); }
.an-gal { display: grid; gap: 4px; border-radius: 8px; overflow: hidden; max-width: 420px; margin-top: 6px; }
.an-gal.n2, .an-gal.n3, .an-gal.n4 { grid-template-columns: 1fr 1fr; }
.an-gal.n3 img:first-child { grid-column: span 2; }
.an-gal img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--deep); }
.an-gal.n1 img { aspect-ratio: auto; max-height: 300px; object-fit: contain; }
@media (max-width: 1100px) { .an-side { position: static; } }
@media (max-width: 640px) { .an-link { grid-template-columns: minmax(0, 1fr) auto; } .an-link input:nth-child(2) { grid-column: 1; grid-row: 2; } }

/* ── Editor: message styles ─────────────────────────────────────────────── */
.ed-side { position: sticky; top: 16px; display: grid; gap: 10px; }
.ed-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ed-mini { position: relative; height: 54px; border-radius: 6px; background: var(--side); overflow: hidden; display: grid; gap: 4px;
           align-content: start; padding: 8px 10px 8px 13px; }
.ed-mini::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, #4e5058); }
.ed-mini.embed { border-radius: 3px; }
.ed-mini.orig::before { background: linear-gradient(#ed4245 0 33%, #e67e22 33% 66%, #5865f2 66%); }
.ed-mini.custom { place-items: center; padding: 0; font-size: 24px; color: var(--muted); }
.ed-mini.custom::before { background: conic-gradient(#f23f43, #f0b232, #23a55a, #00a8fc, #5865f2, #a3478f, #f23f43); }
.ed-mini i { display: block; height: 6px; border-radius: 3px; background: #4e5058; }
.ed-mini i.t { background: #dbdee1; width: 58%; height: 7px; }
.ed-mini i.w { width: 82%; }
.ed-mini i.s { width: 44%; }
.ed-mini .th { position: absolute; right: 8px; top: 8px; width: 16px; height: 16px; border-radius: 4px; background: #5f6b8a; }
.ed-mini .dots { position: absolute; right: 8px; bottom: 7px; display: flex; gap: 3px; }
.ed-mini .dots b { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.ed-opts .row { padding: 10px 0; }
.ed-swatches, .ed-emos, .ed-toggles { display: flex; gap: 10px 14px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.ed-sw { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ed-emo { width: 34px; height: 34px; min-height: 0; padding: 0; display: grid; place-items: center; background: var(--deep); border-radius: 8px; }
.ed-emo:hover { background: var(--hover); }
.ed-emo img.emoji { width: 22px; height: 22px; vertical-align: 0; }
.ed-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.ed-toggle.off { color: var(--muted); cursor: not-allowed; }
.ed-toggle.off .sw { opacity: .45; }
.ed-states { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-states button { min-height: 0; border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 999px; padding: 3px 11px;
                    font-size: 13px; font-weight: 600; transition: color var(--fast), border-color var(--fast), background var(--fast); }
.ed-states button:hover { color: var(--text); background: none; border-color: #5c5f66; }
.ed-states button.on { background: var(--raised); color: var(--head); border-color: var(--raised); }
.ed-preview { transition: opacity var(--fast); min-height: 120px; }
.ed-preview.busy { opacity: .6; }
.ed-body { display: grid; gap: 6px; }
.ed-cv2 { max-width: 520px; display: grid; gap: 8px; }
.ed-cv2 .cv2-section { align-items: flex-start; }
.ed-sep { height: 1px; background: var(--line); margin: 2px 0; }
.ed-sep.big { margin: 8px 0; }
.ed-sep.blank { background: none; }
.ed-text { min-width: 0; }
.md-time { background: rgba(255, 255, 255, .06); border-radius: 3px; padding: 0 2px; }
.emb { display: flex; gap: 12px; max-width: 520px; background: var(--side); border-left: 4px solid var(--bar); border-radius: 4px;
       padding: 10px 14px 12px 12px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.emb-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.emb-title { color: var(--head); font-weight: 700; font-size: 16px; }
.emb-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px 12px; margin-top: 2px; }
.emb-field { grid-column: span 12; min-width: 0; }
.emb-field.inline { grid-column: span 4; }
.emb-fname { color: var(--head); font-weight: 600; font-size: 13.5px; margin-bottom: 1px; }
.emb-foot { color: var(--muted); font-size: 12px; margin-top: 2px; }
.emb-thumb { width: 72px; height: 72px; border-radius: 4px; object-fit: cover; flex: none; }
@media (max-width: 1100px) { .ed-side { position: static; } }
@media (max-width: 640px) { .ed-swatches, .ed-emos, .ed-toggles { justify-content: flex-start; } }

/* ── Dashboard access: what moderators can use ──────────────────────────── */
.cap-group { padding-top: 12px; }
.cap-group + .cap-group { border-top: 1px solid var(--line); margin-top: 12px; }
.cap-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cap-head h4 { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.mini-link { min-height: 0; padding: 1px 8px; font-size: 12px; }
.cap-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.cap { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--deep); cursor: pointer;
       border: 1px solid transparent; transition: background var(--fast), border-color var(--fast); }
.cap:hover { background: var(--hover); }
.cap.on { border-color: rgba(88, 101, 242, .55); background: rgba(88, 101, 242, .1); }
.cap input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.cap b { display: block; color: var(--head); font-weight: 500; font-size: 14px; }
.cap small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 1px; }

/* ── Squadron: members and history ──────────────────────────────────────── */
.sq-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.sq-tabs button { background: none; color: var(--muted); padding: 8px 14px; border-radius: 6px 6px 0 0; font-weight: 600; position: relative;
                  display: inline-flex; align-items: center; gap: 6px; }
.sq-tabs button:hover { background: none; color: var(--text); }
.sq-tabs button.on { color: var(--head); }
.sq-tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
/* fade only: a transform (the page's slide-in) would pin the Applications tab's fixed drawer to this box */
.sq-view, main.enter > .sq-view { animation: fade-in var(--mid) both; }
.sq-tab-lead { margin: 0 0 12px; }
.sq-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.sq-tile { display: block; text-align: left; background: var(--card); color: var(--text); border: 1px solid transparent; border-radius: 10px; padding: 12px 14px;
           transition: border-color var(--fast), background var(--fast); }
.sq-tile:hover { background: #2f3136; border-color: var(--line); }
.sq-tile:active { transform: none; }
.sq-tile.on { border-color: var(--accent); }
.sq-tile small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.sq-tile b { display: block; color: var(--head); font-size: 22px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.sq-tile.warn b { color: var(--yellow); }
.sq-tile span { color: var(--muted); font-size: 12.5px; }
.sq-slots { height: 6px; border-radius: 3px; background: var(--deep); overflow: hidden; margin-top: 6px; }
.sq-slots i { display: block; height: 100%; width: var(--w); border-radius: 3px; background: var(--accent); }
.sq-tablewrap { overflow-x: auto; }
table.sq-table { min-width: 720px; }
.sq-table th.num, .sq-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sq-table tbody tr { cursor: pointer; transition: background .12s; }
.sq-table tbody tr:hover, .sq-table tbody tr:focus-visible, .sq-table tbody tr.sel { background: var(--hover); outline: none; }
.sq-name b { color: var(--head); font-weight: 600; }
.sq-name small { display: block; color: var(--muted); font-size: 12.5px; }
.sq-none { color: var(--muted); font-style: italic; }
.sq-rank { font-size: 10.5px; font-weight: 700; color: #7984f5; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
.sq-rank.hi { color: var(--yellow); }
.sq-delta { font-size: 12px; margin-left: 6px; }
.sq-delta.up { color: var(--green); }
.sq-delta.down { color: var(--red); }
.sq-delta.flat { color: var(--muted); }
.sq-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 9px; margin: 1px 4px 1px 0;
           color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); white-space: nowrap; }
.sq-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sq-linkbtn { min-height: 0; border: 1px dashed var(--line); background: none; color: #00a8fc; border-radius: 6px; padding: 2px 9px; font-size: 13px; font-weight: 600; }
.sq-linkbtn:hover { border-color: #00a8fc; background: rgba(0, 168, 252, .08); }
.sq-initial { display: grid; place-items: center; color: #fff; font-weight: 700; background: #4e5058; }
.sq-mdrawer { width: min(500px, 100%); }
.sq-mdrawer .drawer-head .grow { min-width: 0; }
.sq-mdrawer .drawer-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.sq-mdrawer dl { grid-template-columns: 128px 1fr; }
.sq-mdrawer dd a { color: #00a8fc; text-decoration: none; }
.sq-mdrawer dd a:hover { text-decoration: underline; }
.sq-warn { display: grid; gap: 6px; background: rgba(240, 178, 50, .12); color: #f5d38a; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13.5px; }
.sq-warn .mini-act { justify-self: start; min-height: 0; padding: 3px 10px; font-size: 13px; background: rgba(242, 63, 67, .85); }
.sq-bad { color: var(--red); }
.sq-chart { position: relative; }
.sq-chart svg { display: block; width: 100%; height: auto; touch-action: none; }
.sq-grid { stroke: var(--line); stroke-width: 1; opacity: .6; }
.sq-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.sq-area { fill: #7984f5; opacity: .14; }
.sq-line { fill: none; stroke: #7984f5; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sq-end { fill: #7984f5; stroke: var(--side); stroke-width: 2; }
.sq-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.sq-tip { position: absolute; top: 4px; left: calc(var(--x) + 10px); background: #111214; color: var(--text); font-size: 12.5px; padding: 4px 8px;
          border-radius: 6px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.sq-tip.flip { left: auto; right: calc(100% - var(--x) + 10px); }
.sq-tip b { color: var(--head); font-variant-numeric: tabular-nums; }
.sq-edit { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; }
.sq-field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.sq-field input { width: 100%; }
.sq-sugg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.sq-sugg button { min-height: 0; background: var(--deep); color: var(--text); padding: 2px 9px; font-size: 13px; }
.sq-sugg button:hover { background: var(--hover); }
.sq-sugg.col { display: grid; gap: 4px; margin: 0 0 8px; }
.sq-confirm { display: grid; gap: 6px; border: 1px solid rgba(240, 178, 50, .45); background: rgba(240, 178, 50, .08); border-radius: 8px; padding: 10px 12px;
              margin-top: 10px; font-size: 13.5px; animation: fade-in var(--mid) both; }
.sq-confirm.bad { border-color: rgba(242, 63, 67, .45); background: rgba(242, 63, 67, .1); }
.sq-confirm b { color: var(--head); font-weight: 600; }
.sq-timeline { display: grid; gap: 8px; border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; font-size: 13.5px; }
.sq-timeline > div { position: relative; }
.sq-timeline > div::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--c);
                             border: 2px solid var(--side); }
.sq-timeline time { color: var(--muted); font-size: 12px; margin-right: 6px; }
.sq-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 0; padding: 6px 8px; background: none; color: var(--text); text-align: left; border-radius: 6px; }
.sq-opt:hover { background: var(--hover); }
.sq-opt small { display: block; color: var(--muted); font-size: 12px; }
.sq-check { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.sq-check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.sq-day h4 { margin: 14px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.sq-ev { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 9px 12px; margin-bottom: 4px;
         background: var(--card); color: var(--text); border-radius: 8px; text-align: left; font-size: 14px; }
button.sq-ev:hover { background: var(--hover); }
button.sq-ev:active { transform: none; }
.sq-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; color: var(--c);
         background: color-mix(in srgb, var(--c) 18%, transparent); }
.sq-evtext { min-width: 0; }
.sq-evtext b { color: var(--head); font-weight: 500; }
.sq-evtext small { display: block; color: var(--muted); font-size: 12.5px; }
.sq-evacts { display: flex; gap: 8px; align-items: center; }
.sq-evacts time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sq-todo { font-size: 12px; font-weight: 600; color: #00a8fc; border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; }
@media (max-width: 1100px) { .sq-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .sq-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sq-edit { grid-template-columns: minmax(0, 1fr); }
  .sq-mdrawer dl { grid-template-columns: 104px 1fr; }
}

/* ── Confirmation box ───────────────────────────────────────────────────── */
.modal-scrim { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55);
               animation: fade-in .16s ease both; }
.modal-scrim.closing { animation: pop-out .14s ease both; }
.modal { width: min(440px, 100%); background: var(--bg); border-radius: 12px; box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
         overflow: hidden; animation: modal-in .2s var(--ease) both; }
@keyframes modal-in { from { opacity: 0; transform: scale(.94); } }
.modal h3 { margin: 0; padding: 20px 20px 0; color: var(--head); font-size: 19px; }
.modal p { margin: 8px 0 0; padding: 0 20px; color: var(--text); font-size: 15px; line-height: 1.45; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding: 14px 16px; background: var(--side); }
.modal-btns button { min-width: 92px; padding: 9px 16px; font-weight: 600; }
.modal-btns .ghost { color: var(--text); }
.modal-btns .ghost:hover { text-decoration: underline; background: none; }

/* ── Floating panels (emoji, colour, people) ────────────────────────────── */
.pop.float { padding: 10px; display: grid; gap: 8px; background: var(--side); border-color: #1a1b1e; border-radius: 10px; }
.pop.float.sheet { padding: 10px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.pop.float input[type=search], .pop.float input[type=text] { margin: 0; }

/* emoji */
.emo-pop { gap: 6px; }
.emo-search { width: 100%; }
.emo-tabs { justify-self: start; }
.emo-tabs button { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); grid-auto-rows: 40px; gap: 2px;
            height: 252px; overflow-y: auto; overscroll-behavior: contain; align-content: start; padding-right: 2px; }
.pop.sheet .emo-grid { height: 46dvh; }
/* fixed rows: each emoji keeps a 40px square, however many there are */
.emo-cell { width: 100%; height: 40px; min-height: 40px; padding: 0; display: grid; place-items: center; background: none;
            border-radius: 8px; overflow: hidden; transition: background .1s; }
.emo-cell:hover, .emo-cell:focus-visible { background: var(--hover); outline: none; }
.emo-cell:active { transform: scale(.92); }
.emo-cell img { width: 30px; height: 30px; max-width: none; object-fit: contain; display: block; pointer-events: none;
                transition: transform .12s var(--ease); }
.emo-cell:hover img { transform: scale(1.12); }
.emo-cell .emo-char { font-size: 24px; line-height: 1; }
.emo-cell.none { color: var(--muted); font-size: 18px; border: 1px dashed var(--line); }
.emo-group { grid-column: 1 / -1; padding: 8px 4px 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.emo-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin: 8px 4px; }
.emo-foot { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px 0; border-top: 1px solid var(--line); }
.emo-big { width: 32px; height: 32px; display: grid; place-items: center; font-size: 26px; flex: none; }
.emo-big img { width: 32px; height: 32px; object-fit: contain; }
.emo-name { color: var(--head); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* colour */
.cp-pop { gap: 10px; }
.cp-sv { position: relative; height: 150px; border-radius: 8px; cursor: crosshair; touch-action: none; outline: none;
         background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--hue, red)); }
.cp-sv:focus-visible { box-shadow: 0 0 0 2px var(--accent-2); }
.cp-hue { position: relative; height: 14px; border-radius: 7px; cursor: pointer; touch-action: none; outline: none;
          background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.cp-hue:focus-visible { box-shadow: 0 0 0 2px var(--accent-2); }
.cp-knob { position: absolute; left: var(--x, 0); top: var(--y, 50%); width: 18px; height: 18px; translate: -50% -50%; border-radius: 50%;
           background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .45);
           pointer-events: none; transition: width .1s, height .1s; }
.cp-sv:active .cp-knob, .cp-hue:active .cp-knob { width: 22px; height: 22px; }
.cp-row { display: flex; align-items: center; gap: 8px; }
.cp-now { width: 32px; height: 32px; border-radius: 8px; flex: none; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.cp-hex { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; text-transform: lowercase; }
.cp-drop { min-height: 32px; padding: 0 10px; font-size: 18px; }
.cp-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.cp-sw { aspect-ratio: 1; width: 100%; min-height: 0; padding: 0; border-radius: 50%; background: var(--sw);
         box-shadow: 0 0 0 2px transparent; transition: transform .1s, box-shadow .1s; }
.cp-sw:hover { background: var(--sw); transform: scale(1.12); }
.cp-sw.on { box-shadow: 0 0 0 2px var(--side), 0 0 0 4px var(--head); }
.colour-btn { width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 8px; flex: none; background: var(--sw);
              box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); transition: transform .12s var(--ease), box-shadow .12s; }
.colour-btn:hover { background: var(--sw); transform: scale(1.08); }
.colour-btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--side), 0 0 0 4px var(--accent-2); }
.colour-btn.round { border-radius: 50%; }

/* people (squadron linking) */
.ppl-pop .opts { max-height: 260px; }
.ppl-pop .opt { padding: 6px 8px; }
.ppl-pop .opt .ava { flex: none; }
.ppl-pop .opt .who { flex: 1; min-width: 0; }
.ppl-pop .opt .who b { display: block; color: var(--head); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-pop .opt .who small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-pop .opt.active .who b, .ppl-pop .opt.active .who small { color: #fff; }
.ppl-pop .likely { font-size: 10.5px; font-weight: 700; color: var(--green); flex: none; }
.ppl-pop .opt.active .likely { color: #dfffe9; }
.ppl-pop .ppl-title { color: var(--head); font-weight: 600; font-size: 14px; padding: 0 2px; }
.ppl-pop .ppl-msg { color: var(--red); font-size: 13px; margin: 0; }
.ppl-pop .sq-check { padding: 4px 2px 0; border-top: 1px solid var(--line); padding-top: 8px; }

/* ── Announce: styles, blocks, picture picks ────────────────────────────── */
.an-style-note { display: block; margin-top: 6px; }
.an-style-area { display: grid; gap: 0; animation: fade-in var(--mid) both; }
.an-count { display: flex; justify-content: flex-end; padding: 0 10px 6px; font-size: 12px; color: var(--muted); }
.an-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.an-colour { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.an-fields { display: grid; gap: 8px; }
.an-field { display: grid; gap: 6px; padding: 8px; border-radius: 8px; background: var(--deep); animation: fade-in var(--mid) both; }
.an-field-top { display: flex; gap: 8px; align-items: center; }
.an-field-top input[type=text] { flex: 1; min-width: 0; background: var(--side); }
.an-field textarea { width: 100%; background: var(--side); }
.an-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.an-inline input { accent-color: var(--accent); margin: 0; }
.an-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.an-pick-img, .an-pick-none { position: relative; width: 64px; height: 48px; min-height: 0; padding: 0; border-radius: 8px; overflow: hidden;
                              background: var(--deep); border: 2px solid transparent; transition: border-color var(--fast), transform var(--fast); }
.an-pick-img:hover, .an-pick-none:hover { background: var(--deep); transform: translateY(-1px); }
.an-pick-img img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .55; transition: opacity var(--fast); }
.an-pick-img.on, .an-pick-none.on { border-color: var(--accent); }
.an-pick-img.on img, .an-pick-img:hover img { opacity: 1; }
.an-pick-none { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.an-pick-none.on { color: var(--head); }
.an-pick-n { position: absolute; top: 3px; left: 3px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px; background: var(--accent);
             color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.an-blocks { display: grid; gap: 8px; }
.an-block { display: grid; gap: 8px; padding: 10px; border-radius: 10px; background: var(--deep); border-left: 3px solid var(--bc, #4e5058);
            animation: fade-in var(--mid) both; }
.an-block.t-text { --bc: #5865f2; } .an-block.t-section { --bc: #00a8fc; } .an-block.t-gallery { --bc: #3ba55d; }
.an-block.t-sep { --bc: #949ba4; } .an-block.t-buttons { --bc: #e8a33d; }
.an-block-head { display: flex; align-items: center; gap: 8px; }
.an-block-kind { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.an-block-acts { margin-left: auto; display: flex; gap: 2px; }
.an-block-acts button { min-height: 0; width: 28px; height: 28px; padding: 0; }
.an-block .an-editor { background: var(--side); }
.an-block .an-link input { background: var(--side); }
.an-sub { display: grid; gap: 6px; }
.an-sep-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.an-addblocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.an-addblock { display: grid; gap: 1px; text-align: left; min-height: 0; padding: 8px 10px; border-radius: 8px; background: none;
               border: 1px dashed var(--line); color: var(--text); transition: border-color var(--fast), background var(--fast); }
.an-addblock:hover { background: var(--hover); border-color: var(--accent); }
.an-addblock b { font-size: 13.5px; font-weight: 600; color: var(--head); }
.an-addblock small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.an-send { align-items: center; flex-wrap: wrap; }
.an-total { margin-left: auto; }
.an-total.bad { color: var(--red); }
.emb-author { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--head); }
.emb-author img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.emb-image { display: block; max-width: 100%; max-height: 300px; border-radius: 4px; margin-top: 6px; object-fit: contain; }
.cv2.no-edge { border-left-color: transparent; }

/* Editor: groups of options, wording */
.ed-group { margin: 14px 0 2px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ed-group:first-child { margin-top: 0; }
.ed-opts .ed-group + .row { border-top: 0; }
.ed-var { min-height: 0; padding: 1px 7px; font-size: 12px; font-family: ui-monospace, Consolas, monospace; background: var(--deep); color: #00a8fc; }
.ed-var:hover { background: var(--hover); }
.sq-likely { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--green); }
.an-tools > .an-emo-btn { font-size: 18px; font-weight: 400; }
.an-block .an-editor textarea, .an-block .an-editor textarea:focus { min-height: 84px; }
.emo-grid .emo-group { align-self: end; padding: 0 4px 4px; }

/* ── Setup → Verification (settings.js) ── */
.vf-looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 0 16px 16px; }
.vf-look { display: grid; gap: 6px; padding: 6px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line);
           color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: center; cursor: pointer; }
.vf-look img { width: 100%; height: auto; border-radius: 8px; display: block; }
.vf-look.on { border-color: var(--accent); color: var(--head); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.vf-text { width: 420px; max-width: 55vw; min-height: 70px; resize: vertical; }
.vf-note { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); }

/* ── Levels: the Leaderboard and Setup → Levels (levels.js) ── */
table.lv-table { table-layout: fixed; }
.lv-table th:first-child { width: 52px; }
.lv-table th:nth-child(3) { width: 30%; }
.lv-table th.lv-xp { width: 110px; }
.lv-table th:nth-child(5) { width: 96px; }
.lv-rank { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.lv-rank.top1 { color: #f1c40f; } .lv-rank.top2 { color: #c0c6cf; } .lv-rank.top3 { color: #d4874a; }
.lv-level { display: flex; align-items: center; gap: 10px; }
.lv-level b { color: var(--head); min-width: 2ch; font-variant-numeric: tabular-nums; }
.lv-bar { flex: 1; max-width: 160px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lv-bar i { display: block; height: 100%; width: var(--p); background: var(--accent); border-radius: 3px; }
td.lv-xp, th.lv-xp { text-align: right; font-variant-numeric: tabular-nums; }
td.lv-xp { color: var(--head); font-weight: 600; }
td.lv-act { text-align: right; }
.lv-edit { display: grid; gap: 10px; padding: 14px; }
.lv-edit .btn-row { margin: 0; }
.lv-edit input.wide { width: 100%; }
.lv-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lv-reward { display: grid; grid-template-columns: auto minmax(0, 1fr) 90px auto; gap: 10px; align-items: center;
             padding: 10px 16px; border-top: 1px solid var(--line); }
.lv-reward.add { grid-template-columns: auto minmax(0, 1fr); }
.lv-reward .note { text-align: right; }
.lv-lvl { display: inline-flex; gap: 8px; align-items: center; color: var(--head); font-weight: 600; white-space: nowrap; }
.lv-msg { width: min(420px, 100%); }
.lv-preview { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.lv-note { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); }
.lv-pad { margin: 0; padding: 0 16px 12px; }
.lv-own { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.lv-own .lv-msg { flex: 1; min-width: 200px; }
@media (max-width: 640px) {
  .lv-table th:first-child { width: 34px; }
  .lv-table th:nth-child(3) { width: 44px; }
  .lv-table th.lv-xp { width: 72px; }
  .lv-table th:nth-child(5) { width: 70px; }
  .lv-table td, .lv-table th { padding-left: 4px; padding-right: 4px; }
  .lv-bar { display: none; }
  .lv-reward { grid-template-columns: auto minmax(0, 1fr); }
  .lv-reward .note { display: none; }
}

/* ── Role counts (rolecounts.js; the chart is the SPBoard's svChart) ── */
.rc-chart-card .rc-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.rc-chart-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rc-chart-card > .note { margin: 4px 0 10px; }
.rc-empty { margin: 6px 0 0; }
.rc-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.rc-check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
table.rc-table { table-layout: fixed; }
.rc-table th.rc-n { width: 110px; }
.rc-table th.rc-share { width: 22%; }
.rc-table th.rc-d { width: 84px; }
.rc-table .rc-n, .rc-table .rc-d { text-align: right; font-variant-numeric: tabular-nums; }
.rc-table td.rc-n b { color: var(--head); }
.rc-row { cursor: pointer; }
.rc-row:hover td { background: var(--hover); }
.rc-row.on td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rc-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rc-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rc-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-name small { flex: none; }
.rc-ch { font-weight: 600; }
.rc-ch.up { color: #23a55a; } .rc-ch.down { color: #f23f43; } .rc-ch.zero, .rc-ch.none { color: var(--muted); font-weight: 400; }
@media (max-width: 640px) {
  .rc-table th.rc-share, .rc-table td.rc-share { display: none; }
  .rc-table th.rc-n { width: 72px; }
  .rc-table th.rc-d { width: 58px; }
  .rc-table td, .rc-table th { padding-left: 4px; padding-right: 4px; }
}

/* ── Setup → Tag filter (texts.js) ── */
.tf-off { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); color: #f0b232; }
.tf-test { width: min(220px, 100%); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.tf-result { padding: 0 16px; }
.tf-result:not(:empty) { padding-bottom: 14px; }
.tf-hit, .tf-miss { display: flex; gap: 8px; flex-wrap: wrap; border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.tf-hit { background: color-mix(in srgb, #f23f43 14%, transparent); border: 1px solid color-mix(in srgb, #f23f43 40%, transparent); }
.tf-miss { background: color-mix(in srgb, #23a55a 14%, transparent); border: 1px solid color-mix(in srgb, #23a55a 40%, transparent); }
.tf-hit b { color: #f38b8b; } .tf-miss b { color: #57d28a; }
.card h3 .tf-h-count { float: right; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.tf-group { border-top: 1px solid var(--line); }
.tf-ghead { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.tf-chev { width: 22px; height: 22px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; flex: none; }
.tf-chev::before { content: "\25B8"; display: inline-block; transition: transform var(--fast); }
.tf-chev.open::before { transform: rotate(90deg); }
.tf-gname { border: 0; background: none; padding: 0; color: var(--head); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.tf-count { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.sw.part input:checked + i { opacity: .6; }
.tf-tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px 48px; }
.tf-tag, .tf-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.tf-tag.off { color: var(--muted); text-decoration: line-through; }
.tf-note { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); }
.tf-new { width: 140px; text-transform: uppercase; }
.tf-new::placeholder { text-transform: none; }
.tf-own { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 14px; }
.tf-id { width: 200px; }
.tf-allow { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
            padding: 10px 16px; border-top: 1px solid var(--line); }
.tf-allow code { color: var(--head); font-size: 13px; }
.tf-sec { margin: 22px 0 10px; }
@media (max-width: 640px) {
  .tf-allow { grid-template-columns: 1fr auto; }
  .tf-tags { padding-left: 16px; }
}

/* ── Setup → Starboard (starboard.js) ── */
.sb-emo { min-width: 44px; height: 36px; padding: 0 10px; font-size: 20px; line-height: 1; }
.sb-emo img.emoji { width: 22px; height: 22px; vertical-align: middle; }
.sb-tier { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 90px; gap: 12px; align-items: center;
           padding: 10px 16px; border-top: 1px solid var(--line); }
.sb-tier .ghost { justify-self: end; }
.sb-min { display: inline-flex; align-items: center; gap: 6px; color: var(--head); }
.sb-min input { width: 90px; }
.sb-add { padding: 4px 16px 14px; margin: 0; }
.sb-pad { margin: 0; padding: 0 16px 12px; }
.sb-sum { padding-top: 12px; border-top: 1px solid var(--line); }
.sb-top { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
          padding: 10px 16px; border-top: 1px solid var(--line); }
.sb-n { color: #f0b232; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.sb-what { display: grid; min-width: 0; }
.sb-what small { color: var(--muted); font-size: 12.5px; }
