/* Jam Boys demo v2 — shared styles. Plain CSS, no build step. */
@font-face { font-family: Fredoka; font-weight: 500; font-display: swap; src: url(fonts/fredoka-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(fonts/fredoka-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 400; font-display: swap; src: url(fonts/figtree-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 500; font-display: swap; src: url(fonts/figtree-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 600; font-display: swap; src: url(fonts/figtree-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 700; font-display: swap; src: url(fonts/figtree-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #0d0f14;
  --panel: rgba(21, 24, 32, .9);
  --panel-solid: #161922;
  --panel-2: rgba(255, 255, 255, .035);
  --line: rgba(255, 255, 255, .09);
  --ink: #ecedf2;
  --ink-2: #c9cdd8;
  --muted: #a3a8b8;
  --faint: #7d8395;
  --jam: #a3184a;
  --jam-hi: #bd2158;
  --jam-ink: #f07aa2;
  --jam-pale: #ffd1df;
  --cream: #f3e6d8;
  --ok: #7fe0a4;
  --warn: #f5b26b;
  --bad: #f47e7e;
  --info: #86bdf7;
  --radius: 14px;
  --bar-h: 66px;
  --gap: 24px;
  --page-w: 1120px;
  --head: Fredoka, "Trebuchet MS", sans-serif;
  --body: Figtree, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg);
  font: 400 17px/1.55 var(--body); position: relative; overflow-x: hidden;
}
a { color: var(--jam-ink); text-underline-offset: 3px; }
a:hover { color: var(--jam-pale); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--jam-pale); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.num { font-family: var(--head); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ambient background: a dimmed city painting, chosen at random per load. */
.scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--bg); }
.scene img { width: 100%; height: 100%; object-fit: cover; opacity: .32; }
.scene::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 40%, rgba(13,15,20,.45), rgba(13,15,20,.88) 85%); }

/* Title bar: jam SVG is drawn behind; links sit on top. */
.bar { position: relative; z-index: 10; height: var(--bar-h); }
.bar .jam-layer { position: absolute; inset: 0; z-index: 0; overflow-x: clip; } /* drips may hang below, never sideways (window shrunk after load) */
.bar-inner { position: relative; z-index: 3; height: 100%; max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px; padding-inline: 32px; }
.logo { position: relative; flex: none; width: 104px; height: 100%; }
.logo img { position: absolute; inset-inline-start: -4px; top: 2px; width: 110px; height: 110px; object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.55)); }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.nav a { font: 600 17px/1 var(--body); color: rgba(255,236,242,.9); text-decoration: none;
  padding: 12px 16px; border-radius: 10px; white-space: nowrap; }
.nav a:hover { background: rgba(30,2,12,.3); color: #fff; }
.nav a[aria-current="page"] { color: #fff; background: rgba(30,2,12,.5); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.nav a.admin-link { margin-inline-start: 10px; color: var(--cream); }
.me { flex: none; display: flex; align-items: center; gap: 9px; font: 600 16px/1 var(--body); color: #fff; }
.me .dot { width: 10px; height: 10px; border-radius: 50%; background: #3FC7EB; box-shadow: 0 0 0 2px rgba(30,2,12,.5); }
.me small { font: 500 14px/1 var(--body); color: rgba(255,236,242,.75); }
.menu-btn { display: none; margin-inline-start: auto; background: rgba(30,2,12,.45); border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer; min-height: 44px; }

/* Page layout */
main { position: relative; z-index: 2; max-width: var(--page-w); margin: 0 auto; padding: 64px 32px 120px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 34px; letter-spacing: -.01em; }
.page-head .purpose { margin-top: 10px; font-size: 19px; color: var(--ink-2); max-width: 62ch; }
.section-title { font-size: 22px; margin: 0 0 14px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.panel + .panel { margin-top: var(--gap); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 15px; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 10px; border: 1px solid transparent; background: var(--jam); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--jam-hi); color: #fff; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.18); color: var(--ink); }
.btn.ghost:hover { background: rgba(255,255,255,.06); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 15px; }
.field { display: grid; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 600; color: var(--muted); }
.input, select.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px; background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14); color: var(--ink); }
.input::placeholder { color: var(--faint); }
.search { max-width: 420px; margin-bottom: 24px; }

/* Status words always carry a colour AND a label */
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.s-in, .s-present { color: var(--ok); }
.s-excused, .s-standby { color: var(--warn); }
.s-noshow, .s-away { color: var(--bad); }
.s-nolog { color: var(--faint); }

/* Class-coloured names */
.char { font-weight: 600; }
.role-label { font: 600 13px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Disclosure */
details > summary { cursor: pointer; list-style: none; color: var(--jam-ink); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; font-size: 13px; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }

/* Demo-only switch: small, fixed, clearly labelled */
.demo-foot { position: relative; z-index: 2; max-width: var(--page-w); margin: -72px auto 0; padding: 0 32px 40px; display: flex; flex-wrap: wrap; gap: 10px; }
.demo-switch { display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 12px; border-radius: 999px; background: rgba(13,15,20,.92); border: 1px dashed rgba(255,255,255,.22);
  font-size: 13px; color: var(--muted); }
.demo-switch button { border: 0; background: transparent; color: var(--ink-2); padding: 6px 10px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; min-height: 32px; }
.demo-switch button[aria-pressed="true"] { background: var(--cream); color: #4a0a1f; }

.toast { position: fixed; z-index: 60; inset-block-end: 20px; inset-inline-end: 20px; max-width: 360px; padding: 14px 18px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid rgba(127,224,164,.4); color: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 15px; }

.draft-flag { display: inline-block; font: 600 13px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--warn);
  border: 1px solid rgba(245,178,107,.45); border-radius: 6px; padding: 5px 8px; }

.officers-only { text-align: start; max-width: 560px; }
.officers-only img { width: 120px; height: 120px; object-fit: contain; opacity: .9; margin-bottom: 8px; }

/* Responsive */
@media (max-width: 1040px) {
  .nav a { padding: 10px 10px; font-size: 15px; }
  .me small { display: none; }
}
@media (max-width: 900px) {
  :root { --bar-h: 52px; }
  .bar-inner { padding-inline: 16px; gap: 12px; }
  .logo { width: 74px; }
  .logo img { width: 78px; height: 78px; }
  .me { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }
  .nav { display: none; position: absolute; top: calc(var(--bar-h) + 6px); inset-inline: 12px; flex-direction: column; align-items: stretch;
    background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
  .nav.open { display: flex; }
  .nav a { padding: 14px; font-size: 17px; }
  .nav a.admin-link { margin-inline-start: 0; }
  main { padding: 66px 18px 110px; }
  .demo-foot { padding: 0 18px 32px; }
  .page-head { margin-bottom: 24px; }
  .page-head h1 { font-size: 28px; }
  .page-head .purpose { font-size: 17px; }
  .panel { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Raids (landing page) ---------- */
.raids-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.week-range { margin: 0; font-size: 17px; color: var(--muted); }
.raid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.raid-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 8px; padding: 30px 32px 26px; min-height: 400px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, background .15s; }
.raid-card:hover { border-color: rgba(240,122,162,.5); background: rgba(30,24,34,.94); }
.raid-card:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 3px; }
/* Optional per-raid artwork: set --card-bg on the card; a dark gradient keeps the text readable. */
.raid-card { position: relative; overflow: hidden; isolation: isolate; }
.raid-card[style*="--card-bg"]::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--card-bg) var(--card-pos, center) / cover no-repeat; opacity: var(--card-op, .55); transition: opacity .2s, transform .4s; }
.raid-card[style*="--card-bg"]::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(13,15,20,0) 0%, rgba(13,15,20,.35) 40%, rgba(13,15,20,.88) 100%); }
.raid-card[style*="--card-bg"]:hover::before { opacity: 1; transform: scale(1.03); }
.raid-card.done { opacity: .6; }
.rc-top { display: flex; gap: 8px; margin-bottom: 4px; }
.rc-size, .rc-group { font: 700 13px/1 var(--body); letter-spacing: .07em; text-transform: uppercase; padding: 6px 9px; border-radius: 6px; }
.rc-size { color: var(--jam-pale); background: rgba(163,24,74,.45); }
.rc-group { color: var(--ink-2); background: rgba(255,255,255,.08); }
.rc-name { font: 600 34px/1.1 var(--head); color: var(--ink); }
.rc-date { font-size: 21px; color: var(--ink); font-weight: 600; margin-top: 6px; }
.rc-time { font-size: 17px; color: var(--ink-2); }
.rc-count { font: 600 26px/1.2 var(--head); color: var(--jam-pale); margin-top: 14px; font-variant-numeric: tabular-nums; }
.rc-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 14px 16px; border-radius: 10px;
  background: rgba(13,15,20,.55); border: 1px solid var(--line); font-size: 19px; }
.rc-char { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; min-width: 0; }
.rc-char .char { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-you .rc-char { margin-right: 4px; }
.rc-open { margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--jam-ink); }
.rc-open::after { content: " \2192"; }
.st-rostered .status { color: var(--ok); } .st-bench .status { color: var(--warn); } .st-away .status { color: var(--bad); } .st-elsewhere .status { color: var(--info); }
.st-rostered { border-color: rgba(127,224,164,.3); } .st-bench { border-color: rgba(245,178,107,.3); } .st-away { border-color: rgba(244,126,126,.3); }
.help { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; color: var(--ink-2); font-size: 16px; }
.help code, code.cmd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; background: rgba(255,255,255,.08); color: var(--jam-pale); padding: 2px 8px; border-radius: 6px; }
/* Roster window */
dialog.raid-sheet { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.sheet-body { padding: 24px 28px 26px; }
.rs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rs-kicker { margin: 0 0 4px; font: 700 12px/1 var(--body); letter-spacing: .07em; text-transform: uppercase; color: var(--jam-ink); }
.rs-head h2 { font-size: 28px; }
.rs-time { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.rs-close { flex: none; }
.rs-you { display: inline-flex; gap: 8px; align-items: center; margin: 16px 0 0; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font-weight: 600; }
.rs-section { margin: 20px 0 10px; font: 600 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rs-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.rs-extra { grid-template-columns: repeat(2, 1fr); margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.rs-group h3 { font-size: 17px; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.rs-group .count { font: 500 14px/1 var(--body); color: var(--muted); }
.rs-group.bench h3 { color: var(--warn); } .rs-group.away h3 { color: var(--bad); }
.rs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rs-list li { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 3px 6px; border-radius: 6px; }
.rs-list li.is-me { background: rgba(163,24,74,.25); }
.rs-list .ico { width: 20px; height: 20px; }
.rs-list .you { font: 600 10px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--jam-pale); background: rgba(163,24,74,.55); padding: 3px 5px; border-radius: 4px; }
@media (max-width: 1040px) { .raid-cards { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .raid-cards, .rs-cols, .rs-extra { grid-template-columns: 1fr; } .rc-name { font-size: 22px; } }

/* ---------- Roster ---------- */
.table-wrap { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table-count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: rgba(255,255,255,.14); transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.switch input:checked + .track { background: var(--jam-hi); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--jam-ink); outline-offset: 2px; }
.with-ico { display: inline-flex; align-items: center; gap: 9px; }
.ico { width: 22px; height: 22px; border-radius: 5px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 0 0 2px rgba(255,255,255,.08); }
.role-ico { width: 14px; height: 14px; fill: currentColor; flex: none; }
.roster-table { width: 100%; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; }
.roster-table th { text-align: left; padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.roster-table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 11px 14px;
  font: 600 13px/1 var(--body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.roster-table th button:hover, .roster-table th button:focus-visible { color: var(--ink); }
.roster-table th button:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: -4px; border-radius: 6px; }
.roster-table th[aria-sort="ascending"] button::after { content: "▲"; font-size: 9px; color: var(--jam-ink); }
.roster-table th[aria-sort="descending"] button::after { content: "▼"; font-size: 9px; color: var(--jam-ink); }
.att-head { display: flex; align-items: center; justify-content: space-between; padding-right: 16px; }
.roster-table { table-layout: auto; min-width: 1040px; }
body[data-page="roster"] main, body[data-page="roster"] .demo-foot,
body[data-page="home"] main, body[data-page="home"] .demo-foot { max-width: 1520px; }
.c-att { width: 30%; } .c-act { width: 60px; }
.att { min-width: 240px; }

.target-key { font: 500 12px/1 var(--body); color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }
.target-key::before { content: ""; width: 2px; height: 12px; background: var(--cream); border-radius: 1px; }
.roster-table td { padding: 7px 14px; border-bottom: 1px solid rgba(255,255,255,.05); white-space: nowrap; color: var(--ink-2); }
.roster-table tbody tr:last-child td { border-bottom: 0; }
.roster-table tbody tr:hover td { background: rgba(255,255,255,.025); }
.roster-table td.player { color: var(--ink); font-weight: 600; }
.roster-table tr.is-me td { background: rgba(163,24,74,.12); }
.roster-table .you { font: 600 11px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--jam-pale); background: rgba(163,24,74,.45); padding: 3px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 2px; }
.roster-table tr.alt-row td { padding-top: 5px; padding-bottom: 5px; font-size: 15px; background: rgba(0,0,0,.12); }
.alt-tag { font: 600 11px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding-left: 18px; }
.role { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); }
.role-T { color: #a9c7f5; } .role-H { color: #8fe3b0; } .role-D { color: #f5a8c2; }
.att { display: flex; align-items: center; gap: 12px; }
.att-track { position: relative; flex: 1; height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.att-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.att-fill.ok { background: var(--ok); } .att-fill.warn { background: var(--warn); } .att-fill.bad { background: var(--bad); }
.att-target { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--cream); border-radius: 1px; box-shadow: 0 0 0 1px rgba(13,15,20,.6); }
.att-val { width: 44px; text-align: right; font: 600 16px/1 var(--head); }
.att-val.ok { color: var(--ok); } .att-val.warn { color: var(--warn); } .att-val.bad { color: var(--bad); }
.table-note { margin-top: 12px; color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); padding: 24px 0; }


/* Roster: officer tools */
.table-actions { display: flex; align-items: center; gap: 18px; }
.char-name { font-weight: 600; white-space: nowrap; }
.tbc { font-style: italic; color: var(--faint); }
.roster-table td.act { text-align: right; padding-right: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
.icon-btn:hover, .icon-btn:focus-visible { color: var(--ink); background: rgba(255,255,255,.07); border-color: var(--line); }
.icon-btn:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 1px; }
.roster-table tr.no-char td { color: var(--faint); font-style: italic; }
.roster-table tr.no-char td.player { font-style: normal; color: var(--ink-2); }
.linkish { all: unset; cursor: pointer; color: var(--faint); text-decoration: underline; margin-left: 10px; font-size: 13px; }
.linkish:hover { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
dialog.sheet { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel-solid); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog.sheet::backdrop { background: rgba(5,6,10,.78); }
dialog.sheet form { display: grid; gap: 18px; padding: 26px 28px 24px; }
dialog.sheet h2 { font-size: 26px; }
dialog.sheet select.input:disabled { opacity: .75; }
.hint { font-size: 13px; color: var(--faint); margin: 0; }
.opt { font-weight: 500; color: var(--faint); text-transform: none; letter-spacing: 0; font-size: 13px; }
.name-row { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.name-row legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); grid-column: 1 / -1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.role-line { margin: -6px 0 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.hint-inline { color: var(--faint); font-size: 13px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.14); width: max-content; }
.seg label { position: relative; padding: 8px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--jam); color: #fff; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--jam-ink); outline-offset: 1px; }
.form-error { margin: 0; min-height: 1.2em; color: var(--bad); font-weight: 600; font-size: 14px; }
.sheet-actions { display: flex; align-items: center; gap: 10px; }
.sheet-actions .spacer { flex: 1; }
.btn.danger-ghost { background: transparent; border-color: rgba(244,126,126,.35); color: var(--bad); }
.btn.danger-ghost:hover { background: rgba(244,126,126,.1); color: var(--bad); }
.btn.danger-ghost[hidden] { display: none; }
@media (max-width: 560px) { .name-row, .two { grid-template-columns: 1fr; } .sheet-actions { flex-wrap: wrap; } }

/* Roster: rank (highest Discord role) */
.rank { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.rank-officer { color: #fff; background: rgba(163,24,74,.75); box-shadow: inset 0 0 0 1px rgba(255,209,223,.35); }
.rank-raiderplus { color: #cfe3ff; background: rgba(134,189,247,.16); box-shadow: inset 0 0 0 1px rgba(134,189,247,.35); }
.rank-raider { color: var(--ink-2); background: rgba(255,255,255,.07); }
.rank-social { color: var(--faint); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

/* Roster: attendance hover card */
.att[data-att] { cursor: help; border-radius: 6px; }
.att[data-att]:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 4px; }
.att-tip { position: fixed; z-index: 50; width: 340px; padding: 16px 18px; border-radius: 14px; background: var(--panel-solid); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 18px 50px rgba(0,0,0,.6); pointer-events: none; }
.att-tip[hidden] { display: none; }
.tip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 17px; }
.tip-head .att-val { width: auto; font-size: 22px; }
.tip-window { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.tip-months { display: grid; gap: 6px; }
.tip-month { display: grid; grid-template-columns: 34px 1fr; align-items: center; font-size: 13px; color: var(--muted); }
.tip-dots { display: flex; flex-wrap: wrap; gap: 4px; }
.tip-dots i, .tip-counts i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.dot-present { background: var(--ok); } .dot-excused { background: var(--warn); } .dot-noshow { background: var(--bad); }
.dot-nolog { background: transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.tip-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.tip-counts span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Attendance ---------- */
/* ---------- Home: my attendance + absences ---------- */
.me-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); margin-top: var(--gap); padding: 0; scroll-margin-top: 90px; }
.me-att, .me-abs { display: flex; flex-direction: column; padding: 24px 32px 28px; min-width: 0; }
.me-att { border-right: 1px solid var(--line); padding-right: 44px; }
/* Shared header row so both headings sit on the same line */
.me-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; margin-bottom: 18px; }
.me-head .section-title { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.att-row { display: flex; align-items: center; gap: 24px; }
.att-figures { display: grid; gap: 8px; justify-items: start; }
.att-pct-big .att-val { width: auto; font: 600 56px/1 var(--head); font-variant-numeric: tabular-nums; }
.att-of { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; white-space: nowrap; }
.att-goal { color: var(--muted); }
.link-btn { all: unset; cursor: pointer; margin-top: 2px; font-weight: 600; font-size: 15px; color: var(--jam-ink); }
.link-btn:hover { color: var(--jam-pale); } .link-btn:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 3px; border-radius: 4px; }
.jar-btn { all: unset; cursor: pointer; border-radius: 16px; transition: transform .2s; }
.jar-btn:hover { transform: translateY(-2px) rotate(-2deg); } .jar-btn:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 6px; }
/* History window */
dialog.hist-sheet { width: min(1440px, calc(100vw - 48px)); }
.hist-sheet .rs-head { align-items: center; }
.hist-sheet .rs-head > div:first-child { flex: none; }
.hist-sheet h2 { font-size: 30px; display: flex; align-items: baseline; gap: 10px; }
.hist-sheet h2 .att-val { width: auto; font-size: 40px; }
.hist-of { font: 500 16px/1 var(--body); color: var(--muted); }
.hist-sum { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-left: auto; font-size: 16px; }
.hist-sum strong { font: 600 22px/1 var(--head); margin-right: 5px; }
.hist-grid { display: grid; grid-template-columns: repeat(var(--months), minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.hist-month { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.hist-month h3 { margin: 2px 4px 10px; font: 600 18px/1 var(--head); }
.hist-month h3 span { font: 500 13px/1 var(--body); color: var(--muted); }
.hist-month ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.hist-month li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 6px; padding: 7px 9px; border-radius: 8px; font-size: 14px; border-left: 3px solid transparent; background: rgba(255,255,255,.03); }
.h-date { font-weight: 700; font-size: 15px; white-space: nowrap; } .h-raid { grid-column: 1 / -1; color: var(--muted); font-size: 13px; white-space: nowrap; }
.h-st { font-weight: 600; font-size: 14px; white-space: nowrap; }
.h-present { border-left-color: var(--ok) !important; } .h-present .h-st { color: var(--ok); }
.h-excused { border-left-color: var(--warn) !important; background: rgba(245,178,107,.07) !important; } .h-excused .h-st { color: var(--warn); }
.h-noshow { border-left-color: var(--bad) !important; background: rgba(244,126,126,.09) !important; } .h-noshow .h-st { color: var(--bad); }
.h-nolog { opacity: .5; border-left-color: rgba(255,255,255,.25) !important; } .h-nolog .h-st { color: var(--muted); font-weight: 500; }
.hist-help { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
@media (max-width: 1100px) { .hist-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } .hist-sum { margin-left: 0; } .hist-sheet .rs-head { flex-wrap: wrap; } }
/* Jam jar (from the Claude Design mock), liquid level = attendance */
.jar { position: relative; flex: none; width: 112px; height: 162px; filter: drop-shadow(0 10px 14px rgba(0,0,0,.45)); }
.jar-lid { position: absolute; left: 13px; right: 13px; top: 2px; height: 24px; border-radius: 8px 8px 4px 4px; z-index: 3;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.2) 0 1.5px, transparent 1.5px 4.5px), linear-gradient(90deg, #4a0820, #8f1740 22%, #d04a78 40%, #a3184a 55%, #6d0f2e 80%, #3d0518);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.35), 0 2px 3px rgba(0,0,0,.4); }
.jar-rim { position: absolute; left: 16px; right: 16px; top: 25px; height: 10px; z-index: 2; background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,.04) 40%, rgba(255,255,255,.1));
  box-shadow: inset 0 0 0 1.5px rgba(236,237,242,.28), inset 0 3px 0 -1.5px rgba(236,237,242,.25); }
.jar-glass { position: absolute; left: 0; right: 0; top: 32px; bottom: 0; overflow: hidden; border-radius: 22px 22px 17px 17px / 17px 17px 15px 15px;
  background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.03) 35%, rgba(255,255,255,0) 60%, rgba(255,255,255,.07));
  box-shadow: inset 0 0 0 2px rgba(236,237,242,.32), inset 0 -8px 14px rgba(0,0,0,.35); }
.jar-fill { position: absolute; inset: 0; width: 100%; height: 100%; }
.jf-bob { animation: jamBob 3.2s ease-in-out infinite; }
.jf-wave { animation: jamWave 3.6s linear infinite; } .jf-wave.slow { animation-duration: 5.5s; animation-direction: reverse; }
@keyframes jamWave { from { transform: translateX(0); } to { transform: translateX(-100px); } }
@keyframes jamBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .jf-bob, .jf-wave { animation: none; } }
.jar-target { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(255,255,255,.75); }
.jar-target span { position: absolute; right: 6px; bottom: 3px; font: 700 11px/1 var(--head); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.jar-label { position: absolute; left: 12px; right: 12px; top: 48px; height: 44px; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: radial-gradient(ellipse at 50% 40%, #fbf2e4, #ead7bd); box-shadow: 0 2px 4px rgba(0,0,0,.35), inset 0 0 0 1.5px rgba(143,23,64,.55), inset 0 0 0 3.5px #f3e6d8, inset 0 0 0 4.5px rgba(143,23,64,.35); }
.jar-label span { font: 700 13px/1 var(--head); letter-spacing: .02em; color: #8f1740; } .jar-label span + span { color: #2a1a1f; }
.jar-shine { position: absolute; border-radius: 6px; }
.jar-shine.a { left: 9px; top: 9px; bottom: 15px; width: 7px; background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.06)); }
.jar-shine.b { left: 19px; top: 13px; height: 30px; width: 3px; background: rgba(255,255,255,.28); }
.jar-shine.c { right: 9px; top: 18px; height: 54px; width: 4px; background: rgba(255,255,255,.16); }
/* Absences */
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; min-height: 44px; }
.panel-top .section-title { margin: 0; }
.me-abs .section-title .count { font: 500 16px/1 var(--body); color: var(--muted); }
/* 4 x 2 = 8 visible, scroll for more (scrollbar hidden) */
.abs-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 72px; gap: 12px; max-height: 156px; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior: contain; }
.abs-list::-webkit-scrollbar { display: none; width: 0; height: 0; }
.abs-list li { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 10px 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); border-left: 3px solid var(--bad); min-width: 0; }
.abs-list li.empty { grid-column: 1 / -1; border: 1px dashed var(--line); color: var(--muted); align-items: flex-start; }
.abs-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.abs-date { font: 600 18px/1.2 var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.abs-raid { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abs-cancel { all: unset; flex: none; cursor: pointer; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--muted); }
.abs-cancel svg { width: 16px; height: 16px; fill: currentColor; }
.abs-cancel:hover { color: #fff; background: rgba(244,126,126,.3); } .abs-cancel:focus-visible { outline: 2px solid var(--jam-ink); }
.abs-lock { font-size: 13px; color: var(--warn); }
.abs-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
dialog.abs-sheet { width: min(760px, calc(100vw - 32px)); }
.abs-weeks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.abs-week { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.abs-week-head { all: unset; box-sizing: border-box; grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font: 600 16px/1.2 var(--head); }
.abs-week-head .abs-both { font: 600 12px/1 var(--body); color: var(--jam-ink); text-transform: uppercase; letter-spacing: .06em; padding: 5px 8px; border-radius: 6px; border: 1px solid rgba(240,122,162,.35); }
.abs-week-head:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.abs-week-head.on { color: var(--jam-pale); } .abs-week-head.on .abs-both { color: #fff; background: rgba(163,24,74,.6); border-color: var(--jam-ink); }
.abs-week-head:disabled .abs-both { border-color: transparent; color: var(--muted); }
.abs-week-head:disabled { cursor: default; opacity: .5; }
.abs-raid-btn { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 3px; padding: 10px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.25); }
.abs-raid-btn:hover:not(:disabled) { border-color: rgba(240,122,162,.5); }
.abs-raid-btn.on { background: rgba(163,24,74,.55); border-color: var(--jam-ink); }
.abs-raid-btn:disabled { cursor: default; opacity: .45; }
.abs-raid-btn:focus-visible, .abs-week-head:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 2px; }
.abs-rn { font-weight: 700; font-size: 16px; } .abs-rs { font-size: 13px; color: var(--ink-2); }
.abs-sheet .sheet-actions { margin-top: 4px; }
@media (max-width: 1000px) { .me-panel { grid-template-columns: 1fr; } .me-att { border-right: 0; border-bottom: 1px solid var(--line); padding-right: 32px; } }
@media (max-width: 1300px) { .abs-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 324px; } }
@media (max-width: 640px) { .abs-weeks { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .att-big { font-size: 48px; }
  .legend div { grid-template-columns: 1fr; gap: 2px; }
  .history li { grid-template-columns: 1fr auto; }
  .history li .what { grid-column: 1 / -1; order: 3; color: var(--muted); font-size: 15px; }
}

/* ---------- Loot ---------- */
.raid-loot + .raid-loot { margin-top: 16px; }
.raid-loot > summary { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; color: var(--ink); padding: 4px 0; }
.raid-loot > summary .t { font: 600 22px/1.2 var(--head); }
.raid-loot > summary .m { color: var(--muted); font-weight: 500; font-size: 16px; }
.loot-list { list-style: none; margin: 12px 0 0; padding: 0; }
.loot-list li.head { color: var(--muted); font: 600 13px/1 var(--body); text-transform: uppercase; letter-spacing: .07em; border-top: 0; padding-top: 4px; }
.loot-list li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.loot-list .item { color: #c99bff; font-weight: 600; }
.loot-list .boss { color: var(--muted); }
.hit { background: rgba(240,122,162,.25); color: inherit; border-radius: 3px; }
@media (max-width: 640px) { .loot-list li { grid-template-columns: 1fr; gap: 2px; } .loot-list li.head { display: none; } }

/* ---------- Guild info (long-form) ---------- */
.prose { max-width: 68ch; font-size: 18px; line-height: 1.7; }
.prose h2 { font-size: 26px; margin: 40px 0 10px; }
.prose p + p, .prose ul { margin-top: 14px; }
.prose ul { padding-inline-start: 22px; }
.prose li + li { margin-top: 6px; }

/* ---------- Admin ---------- */
.admin-hub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.admin-hub .tile { min-height: 150px; }
.todo { color: var(--warn); font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th { text-align: start; font: 600 13px/1 var(--body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dropzone { border: 2px dashed rgba(255,255,255,.18); border-radius: 12px; padding: 32px; text-align: center; color: var(--ink-2); }
.dropzone strong { display: block; font: 600 20px/1.2 var(--head); color: var(--ink); margin-bottom: 6px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 40px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); cursor: pointer; font-weight: 600; }
.chip:hover { border-color: rgba(240,122,162,.5); }
.chip[aria-pressed="true"] { background: rgba(163,24,74,.35); border-color: rgba(240,122,162,.6); }
.discord-preview { background: #2b2d31; border-radius: 10px; padding: 16px; font-size: 15px; color: #dbdee1; white-space: pre-wrap; font-family: var(--body); }
.overflow { overflow-x: auto; }
@media (max-width: 900px) { .admin-hub, .split { grid-template-columns: 1fr; } }

.give-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: end; }
.give-form .btn { justify-self: start; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
#post[disabled] { background: transparent; border-color: rgba(255,255,255,.14); color: var(--muted); opacity: 1; }
@media (max-width: 900px) { .give-form { grid-template-columns: 1fr; } }

/* ---------- History (raids + loot) ---------- */
body[data-page="history"] main, body[data-page="history"] .demo-foot { max-width: 1520px; }
.hist-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.item-search { position: relative; width: min(420px, 100%); }
.item-search .input { padding-left: 42px; }
.item-search-ico { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: var(--muted); pointer-events: none; }
.item-results { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; list-style: none; margin: 0; padding: 6px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.55); }
.item-results li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.item-results li.on, .item-results li:hover { background: rgba(163,24,74,.35); }
.item-results li.none { color: var(--muted); cursor: default; } .item-results li.none:hover { background: none; }
.qr-name { color: #c99bff; font-weight: 600; } .qr-meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
mark.hit { background: rgba(240,122,162,.35); color: inherit; border-radius: 3px; padding: 0 1px; }
.hist-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.raid-picker { padding: 10px; position: sticky; top: 88px; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: none; }
.raid-picker::-webkit-scrollbar { display: none; }
.raid-picker ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rp-week { padding: 12px 10px 4px; font: 600 12px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rp-week:first-child { padding-top: 6px; }
.rp-raid { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; border-left: 3px solid transparent; }
.rp-raid:hover { background: rgba(255,255,255,.05); }
.rp-raid.on { background: rgba(163,24,74,.3); border-left-color: var(--jam-ink); }
.rp-raid:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: -2px; }
.rp-name { font: 600 17px/1.2 var(--head); } .rp-group { font: 500 14px/1 var(--body); color: var(--ink-2); }
.rp-meta { font-size: 13px; color: var(--muted); }
.raid-loot-panel { padding: 24px 28px; min-width: 0; margin-top: 0 !important; }
.rl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.rl-head h2 { font-size: 30px; } .rl-count { margin: 0; color: var(--muted); font-size: 15px; }
.loot-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.loot-table th { text-align: left; font: 600 12px/1 var(--body); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.loot-table td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.loot-table tbody tr:hover td { background: rgba(255,255,255,.03); }
.loot-table .c-item { width: 34%; } .loot-table .c-who { width: 26%; } .loot-table .c-boss { width: 28%; } .loot-table .c-award { width: 12%; }
.loot-table .boss { color: var(--ink-2); }
.item-link, .raid-link { all: unset; cursor: pointer; font-weight: 600; border-radius: 4px; }
.item-link { color: #c99bff; } .item-link:hover { color: #e0c4ff; text-decoration: underline; text-underline-offset: 3px; }
.raid-link { color: var(--ink); } .raid-link:hover { color: var(--jam-pale); text-decoration: underline; text-underline-offset: 3px; }
.item-link:focus-visible, .raid-link:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 2px; }
.award { display: inline-block; min-width: 38px; text-align: center; font: 700 12px/1 var(--body); letter-spacing: .05em; padding: 5px 8px; border-radius: 6px; border: 1px solid; }
.aw-bis { color: var(--ok); border-color: rgba(127,224,164,.45); background: rgba(127,224,164,.1); }
.aw-up { color: var(--info); border-color: rgba(134,189,247,.45); background: rgba(134,189,247,.1); }
.aw-os { color: var(--warn); border-color: rgba(245,178,107,.45); background: rgba(245,178,107,.1); }
.aw-de { color: var(--muted); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }
.nowrap { white-space: nowrap; }
/* Item window */
dialog.item-sheet { width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.item-name { color: #c99bff; font-size: 28px; }
.item-cols { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 18px; }
.wow-tip { padding: 12px 14px; border-radius: 8px; background: rgba(8,10,24,.95); border: 1px solid rgba(255,255,255,.25); font-size: 14px; line-height: 1.35; }
.wow-tip p { margin: 0; } .wow-tip .wt-name { color: #b86cff; font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.wow-tip .wt-split { display: flex; justify-content: space-between; gap: 12px; }
.item-hist { font-size: 15px; } .item-hist td { padding: 7px 10px; } .item-hist th { padding: 8px 10px; }
.item-sheet .item-cols > table { max-height: 60vh; }
@media (max-width: 1000px) { .hist-layout, .item-cols { grid-template-columns: 1fr; } .raid-picker { position: static; max-height: 300px; } }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--line); flex: none; }
.seg button { all: unset; cursor: pointer; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.seg button span { font-weight: 500; color: var(--muted); margin-left: 4px; }
.seg button:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.seg button.on { background: var(--jam); color: #fff; } .seg button.on span { color: var(--jam-pale); }
.seg button:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 2px; }
.rl-head { align-items: center; }
.rl-note { margin: 0 0 6px; padding: 10px 14px; border-radius: 10px; background: rgba(245,178,107,.08); border: 1px solid rgba(245,178,107,.3); color: var(--warn); font-size: 14px; }
.raid-loot-panel .rs-section { margin-top: 8px; }
.rl-extra { grid-template-columns: repeat(3, 1fr); }
.rs-group.excused h3 { color: var(--warn); }
.rs-group.bench h3 { color: var(--info); }

/* ---------- Admin: raid planner ---------- */
body[data-page="admin-planner"] main, body[data-page="admin-planner"] .demo-foot { max-width: 1680px; }
.pl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 26px; }
.pl-head h1 { font-size: 34px; margin-right: 6px; }
.pl-week { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--line); }
.pl-week .icon-btn { width: 34px; height: 34px; } .pl-week .icon-btn:disabled { opacity: .3; cursor: default; }
.pl-week-label { font: 600 18px/1 var(--head); padding: 0 8px; min-width: 150px; text-align: center; }
.pl-who { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2); }
.pl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(127,224,164,.2); }
.pl-state { margin-left: auto; font-size: 15px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid; }
.pl-state.draft { color: var(--warn); border-color: rgba(245,178,107,.4); background: rgba(245,178,107,.08); }
.pl-state.changed { color: var(--warn); border-color: rgba(245,178,107,.4); background: rgba(245,178,107,.08); }
.pl-state.posted { color: var(--ok); border-color: rgba(127,224,164,.35); background: rgba(127,224,164,.07); }
.pl-night + .pl-night { margin-top: 34px; }
.pl-night-title { font-size: 26px; margin: 0 0 14px; display: flex; align-items: baseline; gap: 14px; }
.pl-night-title span { font: 500 16px/1 var(--body); color: var(--muted); }
.pl-grid { display: grid; gap: 18px; align-items: start; }
.pl-wed { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); }
.pl-sun { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr) minmax(0, 1fr); }
.pl-grid > .panel { margin-top: 0; padding: 20px 22px; }
.pl-pool { position: sticky; top: 16px; }
.pl-pool-head, .pl-raid-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pl-pool-head h3, .pl-raid-head h3 { font-size: 21px; }
.pl-pool-head .count, .pl-pool-role .count { font: 500 14px/1 var(--body); color: var(--muted); margin-left: 4px; }
.pl-tools { display: inline-flex; align-items: center; gap: 4px; }
.pl-tools .linkish { margin-left: 8px; color: var(--muted); }
.pl-pool-role { margin-top: 14px; }
.pl-pool-role h4, .pl-role h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font: 600 13px/1 var(--body); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pl-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pl-chip { all: unset; box-sizing: border-box; cursor: grab; display: inline-flex; align-items: center; gap: 8px; padding: 6px 9px 6px 7px; min-height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.045); border: 1px solid var(--line); font-size: 15px; }
.pl-chip:hover { border-color: rgba(240,122,162,.5); background: rgba(255,255,255,.07); }
.pl-chip:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 2px; }
.pl-chip.on { background: rgba(163,24,74,.45); border-color: var(--jam-ink); box-shadow: 0 0 0 3px rgba(240,122,162,.18); }
.pl-chip .ico, .pl-row .ico { width: 20px; height: 20px; }
.pl-alts { font: 700 11px/1 var(--body); color: var(--muted); padding: 3px 5px; border-radius: 5px; background: rgba(255,255,255,.07); }
.pl-pct { font: 600 13px/1 var(--head); font-variant-numeric: tabular-nums; }
.pl-pct.ok { color: var(--ok); } .pl-pct.warn { color: var(--warn); } .pl-pct.bad { color: var(--bad); }
.pl-empty { color: var(--muted); margin: 14px 0 0; }
.pl-sort { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.pl-to { all: unset; cursor: pointer; font: 700 12px/1 var(--body); color: var(--ink-2); padding: 6px 7px; border-radius: 7px; border: 1px solid rgba(255,255,255,.14); margin-right: 2px; }
.pl-to:hover, .pl-to:focus-visible { color: #fff; border-color: var(--jam-ink); background: rgba(163,24,74,.35); }
.pl-to:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 1px; }
.pl-away { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.pl-away > span:first-child { font: 600 12px/1 var(--body); letter-spacing: .07em; text-transform: uppercase; color: var(--bad); margin-right: 6px; }
.pl-raid { transition: border-color .15s, box-shadow .15s; }
.pl-raid.is-target { border-color: rgba(240,122,162,.55); box-shadow: 0 0 0 3px rgba(240,122,162,.14); cursor: copy; }
.pl-raid.drop-on, .pl-pool.drop-on { border-color: var(--jam-ink); box-shadow: 0 0 0 3px rgba(240,122,162,.3); }
.pl-dragging .pl-raid, .pl-dragging .pl-pool { border-style: dashed; }
.pl-total { font: 600 30px/1 var(--head); font-variant-numeric: tabular-nums; color: var(--ink); }
.pl-total small { font-size: 17px; color: var(--muted); }
.pl-total.ok { color: var(--ok); } .pl-total.warn { color: var(--warn); }
.pl-needs { display: flex; gap: 8px; margin: 10px 0 12px; }
.pl-need { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1 var(--head); font-variant-numeric: tabular-nums; padding: 6px 10px; border-radius: 8px; border: 1px solid; }
.pl-need .role-ico { width: 13px; height: 13px; }
.pl-need.ok { color: var(--ok); border-color: rgba(127,224,164,.35); background: rgba(127,224,164,.07); }
.pl-need.short { color: var(--warn); border-color: rgba(245,178,107,.35); background: rgba(245,178,107,.07); }
.pl-need.over { color: var(--info); border-color: rgba(134,189,247,.35); background: rgba(134,189,247,.07); }
.pl-here { width: 100%; margin-bottom: 12px; }
.pl-roles { display: grid; gap: 14px; }
/* 20-man: tanks over healers on the left, DPS in two columns on the right */
.pl-roles.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-rows: auto 1fr; column-gap: 16px; }
.pl-roles.wide .pl-role:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
.pl-roles.wide .pl-role:nth-child(3) ul { grid-template-columns: 1fr 1fr; column-gap: 10px; }
.pl-role ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pl-row { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 3px 4px 3px 8px; border-radius: 8px; background: rgba(255,255,255,.035); font-size: 15px; cursor: grab; min-width: 0; }
.pl-row:hover { background: rgba(255,255,255,.065); }
.pl-row .char { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pl-row.is-away { background: rgba(244,126,126,.1); box-shadow: inset 3px 0 0 var(--bad); }
.pl-flag { font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--bad); padding: 3px 6px; border-radius: 5px; background: rgba(244,126,126,.15); }
.pl-row-act { margin-left: auto; display: inline-flex; align-items: center; flex: none; }
.pl-row-act .icon-btn { color: var(--ink-2); }
.pl-row:hover .pl-row-act, .pl-row:focus-within .pl-row-act { opacity: 1; }
.pl-row-act .icon-btn { width: 28px; height: 28px; }
.pl-char { all: unset; cursor: pointer; font-weight: 600; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 18px 2px 4px; border-radius: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a3a8b8'%3E%3Cpath d='m7 10 5 5 5-5z'/%3E%3C/svg%3E") right 0 center / 16px no-repeat; }
.pl-char:hover { background-color: rgba(255,255,255,.07); } .pl-char:focus-visible { outline: 2px solid var(--jam-ink); }
.pl-char option { color: var(--ink); background: var(--panel-solid); }
.pl-slot { min-height: 36px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; border: 1px dashed rgba(255,255,255,.12); color: var(--faint); font-size: 14px; }
.flash { animation: plFlash 1.5s ease-out; }
@keyframes plFlash { 0% { box-shadow: 0 0 0 2px var(--jam-ink); background: rgba(163,24,74,.4); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }
.pl-log { margin-top: 24px; padding: 10px 18px; width: max-content; max-width: 100%; }
.pl-log[open] { width: auto; }
.pl-log summary { cursor: pointer; font: 600 17px/1.2 var(--head); }
.pl-log summary .count { font: 500 14px/1 var(--body); color: var(--muted); margin-left: 4px; }
.pl-log-list { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); max-height: 260px; overflow-y: auto; }
dialog.pl-post { width: min(720px, calc(100vw - 32px)); }
.pl-preview { max-height: 52vh; overflow-y: auto; line-height: 1.5; }
.pl-preview strong { color: #f2f3f5; } .pl-preview u { text-decoration: none; font-weight: 600; color: #f2f3f5; }
.pl-warn { margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(245,178,107,.08); border: 1px solid rgba(245,178,107,.3); color: var(--warn); font-size: 14px; line-height: 1.5; }
.pl-warn[hidden] { display: none; }
@media (max-width: 1280px) { .pl-sun { grid-template-columns: 1fr 1fr; } .pl-sun .pl-pool { grid-column: 1 / -1; position: static; } }
@media (max-width: 900px) { .pl-wed, .pl-sun { grid-template-columns: 1fr; } .pl-pool { position: static; } .pl-state { margin-left: 0; } }

/* ---------- Guild info: tabs + officer editor ---------- */
/* Reading: a comfortable column. Editing: wide, so source and preview sit side by side. */
body[data-page="guild"] main, body[data-page="guild"] .demo-foot { max-width: 1040px; }
body.gi-editing main, body.gi-editing .demo-foot { max-width: 1520px; }
.gi-meta [hidden] { display: none; }
.gi-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gi-tabs { display: flex; gap: 4px; }
.gi-tabs [role=tab] { all: unset; cursor: pointer; padding: 13px 22px 12px; border-radius: 12px 12px 0 0; font: 600 18px/1 var(--head); color: var(--ink-2);
  background: rgba(21,24,32,.75); border: 1px solid var(--line); border-bottom: 0; }
.gi-tabs [role=tab]:hover { color: var(--ink); background: rgba(21,24,32,.8); }
.gi-tabs [role=tab][aria-selected="true"] { color: #fff; background: var(--panel); box-shadow: inset 0 3px 0 var(--jam-ink); }
.gi-tabs [role=tab]:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: -2px; }
.gi-tabs [aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.gi-meta { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.gi-updated { font-size: 14px; color: var(--muted); margin-right: 4px; }
.gi-editing .gi-updated { display: none; }
.gi-panel { border-top-left-radius: 0; padding: 34px 44px 40px; }
.gi-panel:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: 2px; }
.gi-read { max-width: 76ch; }
.prose > :first-child { margin-top: 0; }
.prose h3 { font-size: 20px; margin: 26px 0 8px; }
.prose ol { padding-inline-start: 24px; margin-top: 14px; }
.prose a { color: var(--jam-ink); text-underline-offset: 3px; } .prose a:hover { color: var(--jam-pale); }
.prose strong { color: #fff; }
.prose blockquote { margin: 0 0 6px; padding: 12px 18px; border-radius: 10px; border-left: 3px solid var(--jam-ink); background: rgba(163,24,74,.14); color: var(--ink-2); }
.prose blockquote + * { margin-top: 18px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.gi-edit-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.gi-edit-src { display: flex; flex-direction: column; min-width: 0; }
.gi-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border: 1px solid rgba(255,255,255,.14); border-bottom: 0; border-radius: 10px 10px 0 0; background: rgba(0,0,0,.25); }
.gi-toolbar button { all: unset; cursor: pointer; min-width: 22px; text-align: center; padding: 7px 10px; border-radius: 7px; font: 600 14px/1 var(--body); color: var(--ink-2); }
.gi-toolbar button:hover { background: rgba(255,255,255,.08); color: #fff; }
.gi-toolbar button:focus-visible { outline: 2px solid var(--jam-ink); }
.gi-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.gi-src { flex: 1; height: min(66vh, 760px); min-height: 360px; border-radius: 0 0 10px 10px; resize: vertical; font: 15px/1.6 ui-monospace, Menlo, Consolas, monospace; color: var(--ink); }
.gi-edit-prev { min-width: 0; }
.gi-prev-label { margin: 0 0 10px; font: 600 12px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 12px; }
.gi-preview { font-size: 16px; max-height: min(66vh + 46px, 806px); overflow-y: auto; padding-right: 8px; }
.gi-preview h2 { font-size: 22px; margin-top: 28px; }
.gi-edit .sheet-actions { margin-top: 18px; }
.gi-edit .form-error { margin-top: 12px; }
dialog.gi-hist { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.gi-hist-cols { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; margin-top: 18px; }
.gi-revs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; align-content: start; max-height: 62vh; overflow-y: auto; }
.gi-rev { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; border-left: 3px solid transparent; }
.gi-rev span { font-size: 13px; color: var(--muted); }
.gi-rev:hover { background: rgba(255,255,255,.05); } .gi-rev.on { background: rgba(163,24,74,.3); border-left-color: var(--jam-ink); }
.gi-rev:focus-visible { outline: 2px solid var(--jam-ink); outline-offset: -2px; }
.gi-hist-view { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px 22px; }
.gi-hist-act { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; margin-bottom: 12px; }
.gi-hist-act .btn[hidden] { display: none; }
.gi-hist-prev { font-size: 16px; max-height: 55vh; overflow-y: auto; }
@media (max-width: 900px) { .gi-edit-cols, .gi-hist-cols { grid-template-columns: 1fr; } .gi-panel { padding: 22px; } .gi-tabs [role=tab] { padding: 11px 12px; font-size: 15px; } .gi-src { min-height: 320px; } }
