/* ALWTO Support - player and staff pages. Same palette as alwto.net. */
:root {
  --bg: #0f1116;
  --surface: #1b1f27;
  --surface-2: #161a21;
  --surface-3: #222733;
  --border: #2b313c;
  --text: #e8eaed;
  --muted: #a8b0bd;
  --dim: #8a93a3;
  --blue: #4fc3fe;
  --blue-d: #1b6f99;
  --red: #ff5f4a;
  --accent: #ff5f4a;
  --soft: #c9d1dc;
  --amber: #ffb02e;
  --gold: #ffc42e;
  --green: #3ddc84;
  --purple: #b38cff;
  --discord: #5865f2;
  --note: #2b2616;
  --note-border: #6b5a1f;
  --radius: 12px;
  --wrap: 1080px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.05rem; font-weight: 700; }
p { margin: .4em 0; }
.dim { color: var(--dim); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
button, input, select, textarea { font: inherit; color: inherit; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; font-size: .88em; }
pre { background: var(--surface-2); border: 1px solid var(--border); padding: 10px; border-radius: 8px; overflow: auto; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 40; background: rgba(15,17,22,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; gap: 18px; height: 58px; }
.top-in.wide { padding: 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--blue); font-weight: 800; }
.brand img { object-fit: contain; }
.top-nav { display: flex; gap: 18px; margin-left: auto; }
.top-nav a { color: var(--muted); font-weight: 600; font-size: .93rem; white-space: nowrap; }
.top-nav a:hover { color: var(--text); text-decoration: none; }
.account { position: relative; margin-left: 4px; }
.staff .account { margin-left: auto; }
.pill-user { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; max-width: 220px; }
.pill-user img { border-radius: 50%; }
.pill-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.45); z-index: 60; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; color: var(--text); background: none; border: 0; cursor: pointer; font-size: .93rem; }
.menu a:hover, .menu button:hover { background: var(--surface-3); text-decoration: none; }
.menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-3); color: var(--text); font-weight: 600; cursor: pointer; font-size: .93rem; white-space: nowrap; }
.btn:hover { border-color: #3d4554; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: 5px 10px; font-size: .86rem; border-radius: 8px; }
.btn.big { padding: 12px 20px; font-size: 1rem; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #06202d; }
.btn.primary:hover { background: #7ad3ff; }
.btn.danger { color: #ffb3a8; }
.btn.primary.danger { background: var(--red); border-color: var(--red); color: #2a0600; }
.btn.discord { background: var(--discord); border-color: var(--discord); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #14161b; font-weight: 700; }
.btn.accent:hover { background: #ff7866; border-color: #ff7866; }
.btn.ghost { background: transparent; border-style: dashed; }
.btn.on { border-color: var(--blue); color: var(--blue); }
select.btn { appearance: auto; padding-right: 6px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.15rem; padding: 6px 8px; border-radius: 8px; line-height: 1; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }
.dc-icon { display: inline-flex; }
input[type=text], input[type=search], input[type=url], input:not([type]), textarea, select {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; width: 100%; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue-d); box-shadow: 0 0 0 3px rgba(79,195,254,.12); }
textarea { resize: vertical; min-height: 44px; }
input[type=checkbox] { accent-color: var(--blue); width: 16px; height: 16px; vertical-align: -3px; }

/* ---------- small things ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.st-open { background: rgba(79,195,254,.12); color: var(--blue); border-color: rgba(79,195,254,.3); }
.st-claimed { background: rgba(61,220,132,.1); color: var(--green); border-color: rgba(61,220,132,.3); }
.st-waiting { background: rgba(255,176,46,.1); color: var(--amber); border-color: rgba(255,176,46,.35); }
.st-closed { background: var(--surface-3); color: var(--dim); }
.st-urgent { background: rgba(255,95,74,.12); color: var(--red); border-color: rgba(255,95,74,.35); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: .76rem; font-weight: 600; background: var(--surface-3); color: var(--muted); margin-left: 5px; white-space: nowrap; }
.tag.blue { background: rgba(79,195,254,.14); color: var(--blue); }
.tag.red { background: rgba(255,95,74,.14); color: var(--red); }
.tag.amber { background: rgba(255,176,46,.14); color: var(--amber); }
.tag.gold { background: rgba(255,196,46,.12); color: var(--gold); }
.tag.purple { background: rgba(179,140,255,.14); color: var(--purple); }
.tag.gray { color: var(--dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); display: inline-block; flex: none; box-shadow: 0 0 0 3px rgba(79,195,254,.18); }
.face { width: 20px; height: 20px; image-rendering: pixelated; border-radius: 4px; vertical-align: -5px; margin-right: 6px; background: var(--surface-3); }
.big-emoji { font-size: 2rem; line-height: 1; }
.notice { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.notice.bad { border-color: rgba(255,95,74,.45); background: rgba(255,95,74,.07); color: #ffc9c1; }
.notice .btn { margin-left: 10px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--dim); padding: 40px 0; justify-content: center; }
.spin { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spoiler { background: var(--surface-3); color: transparent; border-radius: 4px; cursor: pointer; }
.spoiler:hover, .spoiler:focus { color: inherit; }
.emoji { width: 1.25em; height: 1.25em; vertical-align: -.25em; }

/* ---------- markdown ---------- */
.md .md-h1 { font-size: 1.25rem; font-weight: 800; margin: .5em 0 .2em; }
.md .md-h2 { font-size: 1.1rem; font-weight: 800; margin: .5em 0 .2em; }
.md .md-h3 { font-size: 1rem; font-weight: 700; margin: .45em 0 .15em; }
.md .md-sub { color: var(--dim); font-size: .84rem; }
.md .md-gap { height: .5em; }
.md ul { margin: .2em 0; padding-left: 1.3em; }
.md blockquote { margin: .2em 0; padding-left: 10px; border-left: 3px solid var(--border); color: var(--muted); }
.md > :first-child { margin-top: 0; }

/* ---------- player pages: laid out like alwto.net (banner, centred section titles, info cards) ---------- */
.player .top-in { height: 64px; gap: 22px; }
.player .brand { font-weight: 800; font-size: 1.15rem; gap: 11px; }
.player .brand img { width: 34px; height: 34px; }
.brand-tag { font-style: normal; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(255,95,74,.45); border-radius: 6px; padding: 2px 7px; margin-left: -3px; }
.player .top-nav { gap: 22px; }
.player .top-nav a.on { color: var(--text); }
.player main { min-height: calc(100vh - 170px); padding-bottom: 46px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.grow { flex: 1; min-width: 0; }

/* banner */
.banner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: center; margin: 26px 0 6px; padding: 44px 38px; border-radius: 16px; border: 1px solid var(--border); background: #12151b url(/assets/banner.webp) center / cover no-repeat; }
.banner::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, rgba(15,17,22,.78), rgba(15,17,22,.2) 70%); pointer-events: none; }
.banner > * { position: relative; }
.eyebrow { display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.banner h1 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); font-weight: 900; color: #fff; letter-spacing: .3px; margin-bottom: 10px; }
.banner p { color: var(--soft); max-width: 560px; margin: 0 0 22px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.finder { position: relative; max-width: 540px; }
.finder .finder-input { padding: 13px 16px 13px 44px; font-size: 1rem; border-radius: 11px; background: rgba(22,26,33,.94) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8b0bd' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E") 15px center / 18px no-repeat; }
.finder-hits { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: 0 16px 40px rgba(0,0,0,.55); overflow: hidden; z-index: 30; }
.hit { display: flex; align-items: center; gap: 11px; padding: 9px 13px; color: var(--text); }
.hit:hover, .hit.sel { background: var(--surface-3); text-decoration: none; }
.hit-ico, .prow-ico { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 1.05rem; background: color-mix(in srgb, var(--tint) 15%, transparent); }
.hit-text { display: flex; flex-direction: column; min-width: 0; }
.hit-text small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hits-empty { padding: 12px 14px; color: var(--muted); font-size: .92rem; }
.banner-side { background: rgba(20,23,30,.9); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.banner-side p { margin: 0; font-size: .9rem; }
.banner-side .btn { align-self: flex-start; }
.bs-title { color: #fff; font-size: 1.05rem; }
.bs-who { display: flex; gap: 11px; align-items: center; margin-bottom: 4px; }
.bs-who img { border-radius: 50%; }
.bs-who div { display: flex; flex-direction: column; min-width: 0; }
.bs-who b { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-who .muted { font-size: .84rem; }
.bs-link { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: .92rem; }
.bs-link:hover { border-color: #3d4554; color: var(--text); text-decoration: none; }
.bs-val { color: #fff; font-weight: 800; }
.bs-val.warn { color: var(--amber); font-weight: 700; }

/* sections */
.block { padding: 34px 0 4px; }
.section-title { text-align: center; font-size: 1.8rem; font-weight: 800; margin: 0 0 6px; }
.section-sub { text-align: center; color: var(--muted); margin: 0 0 24px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 16px; }
.info-card b { display: block; margin-bottom: 6px; color: #fff; }
.info-card span { font-size: .9rem; color: var(--muted); }

/* topics */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; }
.topic { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--tint); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; }
.topic-head { display: flex; align-items: center; gap: 14px; color: var(--text); }
.topic-head:hover { text-decoration: none; }
.topic-head:hover b { color: var(--tint); }
.topic-ico { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; line-height: 1; border-radius: 11px; background: color-mix(in srgb, var(--tint) 15%, transparent); border: 1px solid color-mix(in srgb, var(--tint) 30%, transparent); }
.topic-ico.big { width: 54px; height: 54px; font-size: 1.75rem; border-radius: 13px; }
.topic-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.topic-text b { font-size: 1.06rem; transition: color .12s; }
.topic-text span { color: var(--muted); font-size: .9rem; }
.topic-go { color: var(--muted); font-size: 1.7rem; line-height: 1; padding: 0 2px 4px; }
.topic-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.opt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--soft); font-size: .85rem; font-weight: 600; }
.opt-chip:hover { border-color: var(--tint); color: #fff; text-decoration: none; }

/* the player's tickets */
.mine-strip { margin-top: 26px; }
.strip-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.strip-head h2 { font-size: 1.1rem; }
.strip-head a { margin-left: auto; font-size: .9rem; }
.prows { display: flex; flex-direction: column; gap: 7px; }
.prow { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--st, var(--border)); border-radius: 10px; padding: 10px 16px 10px 12px; color: var(--text); }
.prow:hover { background: #1f242d; text-decoration: none; }
.prow.s-open { --st: var(--blue); }
.prow.s-claimed { --st: var(--green); }
.prow.s-waiting { --st: var(--amber); }
.prow.s-closed { --st: #3a404c; }
.prow.unread { background: #1a2230; }
.prow-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.prow-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-main .muted { font-size: .85rem; }
.prows.closed .prow { opacity: .72; }
.page-top { display: flex; align-items: flex-end; gap: 16px; margin: 30px 0 18px; flex-wrap: wrap; }
.page-top h1 { font-size: 1.9rem; font-weight: 900; }
.page-top p { margin: 4px 0 0; }
.page-top > .btn { margin-left: auto; }
.sub-head { font-size: 1rem; color: var(--muted); margin: 26px 0 10px; }
.empty-box { background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); }

/* one topic */
.crumbs { display: flex; gap: 8px; align-items: center; margin: 24px 0 10px; font-size: .88rem; color: var(--dim); flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: #3d4554; }
.head-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--tint); border-radius: 14px; padding: 18px 20px; margin: 0 0 18px; }
.head-card h1 { font-size: 1.5rem; font-weight: 800; }
.head-card p { margin: 3px 0 0; }
.cat-layout { display: grid; gap: 16px; align-items: start; }
.cat-layout.has-info { grid-template-columns: minmax(0, 1fr) 350px; }
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt-row { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; color: var(--text); }
a.opt-row:hover { border-color: color-mix(in srgb, var(--tint) 55%, var(--border)); text-decoration: none; }
.opt-ico { font-size: 1.35rem; width: 30px; text-align: center; flex: none; }
.opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.opt-text span { color: var(--muted); font-size: .88rem; }
.faq { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: -2px 0 4px; }
.read-first { background: var(--surface-2); border: 1px solid var(--border); border-top: 3px solid var(--tint); border-radius: 12px; padding: 14px 18px; position: sticky; top: 84px; font-size: .93rem; }
.read-first-title { font-weight: 800; margin-bottom: 6px; color: #fff; }

/* the form */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; align-items: start; }
.ticket-form { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.ticket-form.drag, .composer.drag { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,195,254,.15); }
.form-title { display: flex; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.form-title h1 { font-size: 1.35rem; }
.form-title p { margin: 2px 0 0; }
.read-fold { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--tint); border-radius: 10px; padding: 10px 16px; font-size: .93rem; }
.read-fold summary { cursor: pointer; font-weight: 700; color: #fff; }
.read-fold .md { margin-top: 8px; }
.fields { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field > span, .flabel { font-weight: 700; font-size: .95rem; }
.field .hint { color: var(--dim); font-size: .85rem; margin-top: -3px; }
.field .count { align-self: flex-end; color: var(--dim); font-size: .78rem; }
.opt-tag { font-weight: 500; color: var(--dim); font-size: .8rem; margin-left: 8px; }
.from-profile { font-weight: 600; font-size: .74rem; margin-left: 8px; color: var(--blue); background: rgba(79,195,254,.1); border-radius: 5px; padding: 1px 6px; }
.field input.bad { border-color: rgba(255,95,74,.75); }
.id-check { font-size: .86rem; color: var(--muted); }
.id-check.good { color: var(--green); }
.id-check.bad { color: #ff9c8f; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { padding: 8px 16px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 600; }
.choice[aria-pressed=true] { border-color: var(--accent); color: #ffb3a8; background: rgba(255,95,74,.1); }
.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.form-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 84px; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: .9rem; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.side-card p { margin: 0; }
.side-card .who { display: flex; gap: 10px; align-items: center; }
.side-card .who img { border-radius: 50%; }
.side-card .who div { display: flex; flex-direction: column; line-height: 1.3; }
.side-card .who .muted { font-size: .82rem; }

/* profile */
.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.p-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.p-card.wide { grid-column: 1 / -1; }
.p-card p { margin: 0; }
.p-title { font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.p-row { display: flex; align-items: center; gap: 14px; }
.p-face { width: 56px; height: 56px; flex: none; border-radius: 10px; image-rendering: pixelated; background: var(--surface-3); }
.p-avatar { width: 56px; height: 56px; flex: none; border-radius: 50%; }
.p-big { font-size: 1.15rem; color: #fff; }
.seg { display: inline-flex; align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; gap: 2px; }
.seg button { background: none; border: 0; color: var(--muted); font-weight: 700; padding: 7px 18px; border-radius: 7px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed=true] { background: var(--accent); color: #14161b; }
.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.soc { display: grid; grid-template-columns: 38px 84px minmax(0, 1fr); align-items: center; gap: 10px; }
.soc-ico { width: 38px; height: 38px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--c); }
.soc-name { font-weight: 700; font-size: .92rem; }
.p-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.p-state.warn { color: var(--amber); }
.p-state.good { color: var(--green); }
.profile .notice { margin-top: 16px; }

/* footer */
.foot { border-top: 1px solid var(--border); }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 18px 28px; flex-wrap: wrap; font-size: .88rem; }
.foot-brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 800; }
.foot-brand:hover { text-decoration: none; }
.foot-links { display: flex; gap: 20px; }
.foot-links a { color: var(--muted); font-weight: 600; }
.foot-links a:hover { color: var(--text); text-decoration: none; }
.empty-page { text-align: center; padding: 70px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-page h1 { font-size: 1.8rem; font-weight: 900; }
.empty-page p { margin: 0 0 6px; }

@media (max-width: 900px) {
  .banner { grid-template-columns: minmax(0, 1fr); padding: 32px 24px; gap: 22px; }
  .cat-layout.has-info, .form-layout { grid-template-columns: minmax(0, 1fr); }
  .read-first, .form-side { position: static; }
  .cat-layout.has-info .read-first { order: -1; }
}
@media (max-width: 700px) {
  .p-grid, .socials { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .banner { padding: 26px 18px; margin-top: 16px; }
  .section-title { font-size: 1.45rem; }
  .player .top-in { gap: 12px; }
  .player .top-nav { gap: 14px; }
  .player .top-nav .out, #nav-staff { display: none; }
  .player .brand span { display: none; }
  .ticket-form { padding: 16px; }
  .opt-row { flex-wrap: wrap; }
  .opt-row .btn { margin-left: 44px; }
  .soc { grid-template-columns: 38px minmax(0, 1fr); }
  .soc-name { display: none; }
  .page-top h1 { font-size: 1.6rem; }
  .pill-user span { display: none; }
  .pill-user { padding: 3px; }
}

/* ticket page (player) */
.t-head { flex-wrap: wrap; }
.t-head h1 { font-size: 1.3rem; }
.player .btn.primary.danger { background: transparent; border-color: rgba(255,95,74,.6); color: #ff9c8f; }
.answers { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 16px; }
.answers summary { cursor: pointer; font-weight: 600; color: var(--muted); }
dl { margin: 8px 0 0; }
dt { font-weight: 700; font-size: .85rem; color: var(--muted); margin-top: 8px; }
dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.convo { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; }
.msg.mine { align-self: flex-end; background: #17303f; border-color: #1f4a61; }
.msg.them { align-self: flex-start; }
.player .msg.staff { border-color: #2e4c63; }
.msg.note { align-self: stretch; max-width: none; background: var(--note); border-color: var(--note-border); }
.msg.deleted { opacity: .55; }
.msg-meta { display: flex; align-items: baseline; gap: 6px; font-size: .84rem; margin-bottom: 3px; flex-wrap: wrap; }
.msg-meta .tag { margin-left: 0; }
.msg-meta time { margin-left: auto; font-size: .78rem; }
.msg-text { overflow-wrap: anywhere; }
.event { align-self: center; font-size: .82rem; color: var(--dim); display: flex; gap: 8px; background: var(--surface-2); border-radius: 999px; padding: 3px 12px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: flex-start; }
.att-pic { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); max-width: 100%; }
.att-pic img { display: block; max-width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.att-vid { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.att-vid video { max-width: 420px; width: 100%; max-height: 300px; border-radius: 8px; background: #000; }
.att-name { font-size: .8rem; }
.att-file { display: inline-flex; padding: 6px 10px; background: var(--surface-3); border-radius: 8px; font-size: .88rem; }
.att-file.gone { color: var(--dim); }
.composer-wrap { position: sticky; bottom: 0; padding: 14px 0 10px; background: linear-gradient(transparent, var(--bg) 30%); margin-top: 14px; }
.composer { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer-row textarea { flex: 1; min-height: 42px; max-height: 300px; resize: none; }
.composer-foot { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; flex-wrap: wrap; }
.tray { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: flex; align-items: center; gap: 8px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px 4px 10px; font-size: .84rem; max-width: 100%; }
.chip.ok { border-color: rgba(61,220,132,.35); }
.chip.bad { border-color: rgba(255,95,74,.5); }
.chip-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-size { color: var(--dim); }
.chip-err { color: #ffb3a8; }
.chip-x { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 4px; }
.bar { width: 70px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); transition: width .15s; }

/* ---------- toasts, modals ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; }
.toast { background: var(--surface-3); border: 1px solid var(--border); padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); transition: opacity .4s, transform .4s; max-width: min(560px, 92vw); white-space: pre-line; }
.toast.ok { border-color: rgba(61,220,132,.45); }
.toast.bad { border-color: rgba(255,95,74,.55); }
.toast.out { opacity: 0; transform: translateY(8px); }
.modal-back { position: fixed; inset: 0; background: rgba(5,6,9,.62); display: flex; align-items: center; justify-content: center; z-index: 90; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.modal-body { padding: 6px 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal-actions .danger:first-child { margin-right: auto; }
label.field > span { font-size: .88rem; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-size: .84rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--blue-d); }

/* ---------- staff desk ---------- */
.staff { overflow: hidden; }
.top-search { flex: 1; max-width: 560px; margin-left: 10px; }
.top-search input { padding: 7px 12px; }
.desk { display: grid; grid-template-columns: 216px 360px minmax(0, 1fr); height: calc(100vh - 59px); }
.desk.wide-page { grid-template-columns: 216px 0 minmax(0, 1fr); }
.desk.wide-page .list { display: none; }
.side { border-right: 1px solid var(--border); overflow-y: auto; padding: 12px 8px; background: var(--surface-2); display: flex; flex-direction: column; }
.side-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 14px 10px 4px; font-weight: 700; }
.side-group { display: flex; flex-direction: column; gap: 1px; }
.side-link { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.side-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.side-link.on { background: rgba(79,195,254,.12); color: var(--text); }
.side-ico { width: 20px; text-align: center; }
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .count { font-size: .78rem; background: var(--surface-3); color: var(--text); border-radius: 999px; padding: 0 8px; font-weight: 700; }
.side-link.on .count { background: var(--blue); color: #06202d; }
.side-foot { margin-top: auto; padding: 14px 10px 4px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.side-small { font-size: .82rem; color: var(--muted); }
.list { border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
.list.is-loading .list-rows { opacity: .5; }
.list-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.list-head h2 { flex: 1; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-head .sort { width: auto; padding: 4px 8px; font-size: .84rem; }
.list-empty { color: var(--dim); padding: 30px 18px; text-align: center; }
.trow { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px 11px; border-bottom: 1px solid var(--border); color: var(--text); border-left: 3px solid transparent; }
.trow:hover { background: var(--surface-2); text-decoration: none; }
.trow.on { background: #1a2433; border-left-color: var(--blue); }
.trow.new .trow-title { font-weight: 800; }
.trow-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.trow-n { color: var(--dim); font-size: .84rem; font-variant-numeric: tabular-nums; }
.trow-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.trow-age { color: var(--dim); font-size: .8rem; font-variant-numeric: tabular-nums; }
.trow-who { font-size: .86rem; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0; min-width: 0; }
.trow-who .tag { font-size: .72rem; }
.trow-sn { font-size: .83rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 1rem; padding: 0 2px; line-height: 1; }
.star.on, .star:hover { color: var(--gold); }
.detail { overflow: hidden; display: flex; flex-direction: column; container-type: inline-size; min-width: 0; }
.detail-empty { margin: auto; text-align: center; color: var(--muted); padding: 30px; }
.d-head { padding: 14px 18px 10px; border-bottom: 1px solid var(--border); }
.d-title { display: flex; align-items: center; gap: 12px; }
.d-title-text { flex: 1; min-width: 0; }
.d-title h1 { font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-sub { font-size: .86rem; }
.d-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.d-actions select { width: auto; }
.d-head .notice { margin: 10px 0 0; padding: 8px 12px; font-size: .9rem; }
/* narrow: the whole ticket scrolls as one page, the reply box stays at the bottom of the conversation */
.d-body { flex: 1; min-height: 0; overflow-y: auto; position: relative; }
.d-main { display: flex; flex-direction: column; }
.d-convo { padding: 16px 18px; }
.d-composer { padding: 0 18px 14px; position: sticky; bottom: 0; z-index: 3; background: linear-gradient(transparent, var(--bg) 18px); padding-top: 18px; }
/* wide: conversation and the player panel side by side, each scrolling on its own */
@container (min-width: 900px) {
  .d-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; overflow: hidden; }
  .d-main { min-height: 0; }
  .d-convo { flex: 1; overflow-y: auto; }
  .d-composer { position: static; background: none; padding-top: 0; }
  .d-info { border-left: 1px solid var(--border); }
}
.d-composer .composer.is-note { background: var(--note); border-color: var(--note-border); }
.modes { display: flex; gap: 4px; }
.mode { background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 10px; color: var(--muted); cursor: pointer; font-weight: 600; font-size: .86rem; }
.mode.on { background: var(--surface-3); border-color: var(--border); color: var(--text); }
.mode.note-mode.on { background: #3b3217; border-color: var(--note-border); color: #ffe39a; }
.mode:disabled { opacity: .4; cursor: default; }
.d-info { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.form-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--blue); border-radius: 12px; padding: 12px 16px; }
.staff .msg.mine { background: #16283a; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.card-title { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.card-title .dim { font-weight: 500; font-size: .78rem; }
.player-card .pc-top { display: flex; gap: 12px; align-items: center; }
.pc-face { image-rendering: pixelated; border-radius: 8px; background: var(--surface-3); }
.pc-name { font-weight: 800; font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chips .tag { margin-left: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin-top: 10px; font-size: .88rem; }
.facts dt { margin: 0; font-weight: 600; }
.facts dd { margin: 0; }
.discord-card { font-size: .9rem; }
.dc-top { display: flex; gap: 10px; align-items: center; }
.dc-top img { border-radius: 50%; }
.soc-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.soc-link { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 4px; border-radius: 7px; background: var(--surface-3); color: var(--text); font-size: .82rem; font-weight: 600; }
.soc-link:hover { text-decoration: none; background: #2a303c; }
.soc-link .soc-ico { width: 22px; height: 22px; border-radius: 5px; }
.data-item { border-top: 1px solid var(--border); padding: 7px 0; }
.data-item summary { cursor: pointer; font-size: .88rem; }
.data-item.older summary { opacity: .6; }
.data-item .md { font-size: .86rem; margin-top: 6px; overflow-wrap: anywhere; }
.tools .tool-row { display: flex; gap: 6px; margin-top: 6px; }
.tools input, .tools select { padding: 5px 9px; font-size: .88rem; min-width: 0; }
.mini-rows { display: flex; flex-direction: column; }
.mini-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); font-size: .86rem; color: var(--text); }
.mini-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { display: none; }
.only-narrow { display: none; }
.access { padding: 22px 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.found { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.found-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; text-align: left; }
.found-row img { border-radius: 50%; }
.grants { width: 100%; border-collapse: collapse; font-size: .9rem; }
.grants th { text-align: left; color: var(--dim); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.grants td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.grants .tag { margin: 0 4px 4px 0; }

@media (max-width: 1180px) {
  .desk { grid-template-columns: 190px 310px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .only-narrow { display: inline-flex; }
  .desk { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 59px; bottom: 0; left: 0; width: 240px; z-index: 30; transform: translateX(-100%); transition: transform .18s; }
  .desk.side-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .desk .detail { display: none; }
  .desk.has-open .list { display: none; }
  .desk.has-open .detail { display: flex; }
  .desk.wide-page .detail { display: flex; }
  .back { display: block; background: none; border: 0; color: var(--blue); padding: 10px 18px 0; text-align: left; cursor: pointer; }
  .top-search { margin-left: 0; }
  .staff .brand span { display: none; }
  .msg { max-width: 92%; }
}
@media (max-width: 640px) {
  .top-nav { gap: 12px; }
  .top-in { gap: 10px; }
  .pill-user span { display: none; }
  .pill-user { padding: 3px; }
}
