/* Fancy SMP — the application wizard, sign-in, the member's page and the staff dashboard.
   Loaded only on those pages; colours and buttons come from styles.css. */

:root { --danger: oklch(72% .17 22); --danger-soft: color-mix(in oklab, var(--danger) 14%, transparent); --amber: #f6b73c; }

.app-page { max-width: 680px; }
.app-page.app-dashboard { max-width: 1080px; }
.app-head { padding-block-end: 18px; margin-block-end: 22px; }
.app-loading { display: grid; place-items: center; gap: 12px; padding-block: 56px; color: var(--subtle); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--hairline); border-block-start-color: var(--brand-text); animation: spin .8s linear infinite; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; border-color: #ffffff55; border-block-start-color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn.danger { border-color: color-mix(in oklab, var(--danger) 55%, transparent); color: var(--danger); background: var(--danger-soft); }
.btn.danger:hover { background: color-mix(in oklab, var(--danger) 24%, transparent); border-color: var(--danger); color: #fff; }
.btn.wide { width: 100%; min-height: 48px; font-size: 15px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.muted { color: var(--subtle); font-size: .93em; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- panels ---------- */
.panel { border: 1px solid var(--hairline); border-radius: 14px; background: var(--elevated); padding: 20px; }
.panel + .panel { margin-block-start: 16px; }
.panel > h2 { font-size: 1.05rem; margin-block-end: 12px; }
.panel.glow { border-color: var(--brand-line); background: linear-gradient(160deg, color-mix(in oklab, var(--brand) 18%, var(--elevated)), var(--elevated) 60%); box-shadow: 0 14px 40px #59029255; }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; }
.field + .field, .field + .options, .options + .field, .field-pair + .field, .field + .field-pair { margin-block-start: 16px; }
.field > label, .field > .label { font-weight: 500; color: var(--strong); font-size: 14.5px; }
.input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--recessed); color: var(--strong);
  font: inherit; font-size: 16px; line-height: 1.5; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.field textarea { min-height: 132px; resize: vertical; }
.input::placeholder, .field textarea::placeholder { color: var(--inactive); }
.input:hover, .field textarea:hover, .field select:hover { border-color: var(--brand-line); }
.input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--brand-hover); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--base); }
.input.ltr { text-align: left; font-family: var(--mono); letter-spacing: .01em; }
.input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-hint { font-size: 13px; color: var(--subtle); line-height: 1.6; }
.field-note { min-height: 1.6em; font-size: 13.5px; line-height: 1.6; color: var(--subtle); }
.field-note.bad { color: var(--danger); }
.field-note.good { color: var(--success); }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-pair .field + .field { margin-block-start: 0; }
.with-toggle { position: relative; }
/* these fields are always typed left to right, so the button sits at the right end in both languages */
.with-toggle .input { padding-right: 84px; }
.with-toggle button { position: absolute; inset-block: 6px; right: 6px; padding-inline: 12px; border: 0; border-radius: 7px; background: var(--base); color: var(--subtle); font-size: 13px; cursor: pointer; }
.with-toggle button:hover { color: var(--strong); }
.counter { font-size: 12.5px; color: var(--inactive); font-variant-numeric: tabular-nums; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* choices drawn as cards: the real radio button stays in the page for keyboards and screen readers */
.options { display: grid; gap: 10px; }
.options.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--recessed); cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .12s ease; }
.option:hover { border-color: var(--brand-line); background: var(--base); }
.option:active { transform: scale(.985); }
.option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.option-icon { grid-row: span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-text); border: 1px solid color-mix(in oklab, var(--brand) 28%, transparent); transition: background-color .16s ease, color .16s ease; }
.option-icon .icon { width: 21px; height: 21px; }
.option-title { font-weight: 600; color: var(--strong); line-height: 1.4; }
.option-text { grid-column: 2; font-size: 13px; color: var(--subtle); line-height: 1.5; }
.option:has(input:checked) { border-color: var(--brand-hover); background: linear-gradient(135deg, color-mix(in oklab, var(--brand) 26%, var(--elevated)), var(--elevated) 75%); box-shadow: 0 0 0 1px var(--brand-hover), 0 10px 28px #59029266; }
.option:has(input:checked) .option-icon { background: linear-gradient(180deg, var(--brand-hover), var(--brand)); color: #fff; }
.option:has(input:focus-visible) { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--recessed); color: var(--soft-text); font-size: 13.5px; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, color .16s ease; }
.pill:hover { border-color: var(--brand-line); color: var(--strong); }
.pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pill:has(input:checked), .pill[aria-pressed="true"] { background: var(--brand); border-color: var(--brand-hover); color: #fff; }
.pill:has(input:focus-visible) { outline: 2px solid var(--brand-text); outline-offset: 2px; }
button.pill { font: inherit; font-size: 13.5px; }

/* ---------- the application wizard ---------- */
.wizard-top { display: grid; gap: 8px; margin-block-end: 18px; }
.wizard-count { font-size: 13px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 999px; background: var(--recessed); border: 1px solid var(--hairline); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #c9a8ff); box-shadow: 0 0 14px var(--brand-hover); transition: width .45s var(--ease-spring); }
.tg-chip { display: inline-flex; align-items: center; gap: 8px; margin-block-end: 14px; padding: 4px 12px; border-radius: 999px; font-size: 13px; color: var(--soft-text); background: var(--brand-soft); border: 1px solid color-mix(in oklab, var(--brand) 40%, transparent); }
.tg-chip .icon { width: 15px; height: 15px; color: var(--brand-text); }
.step { border: 0; margin: 0; padding: 0; min-width: 0; display: none; }
.step.is-active { display: block; animation: step-in .34s var(--ease-spring) both; }
.wizard.is-back .step.is-active { animation-name: step-back; }
.step > legend { padding: 0; font-size: clamp(1.25rem, 1.05rem + 1vw, 1.55rem); font-weight: 650; color: var(--strong); line-height: 1.4; margin-block-end: 6px; text-wrap: balance; }
.step-lead { color: var(--subtle); margin-block-end: 18px; max-width: 60ch; }
.step-error { margin-block-start: 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in oklab, var(--danger) 50%, transparent); background: var(--danger-soft); color: #ffd9d6; font-size: 14px; }
.wizard-foot { display: flex; gap: 10px; margin-block-start: 26px; }
.wizard-foot .btn { min-height: 48px; font-size: 15px; }
.wizard-foot .btn.primary { flex: 1; }
.wizard-foot .btn .icon { width: 18px; height: 18px; }
/* "back" points to where the reader came from: right in Arabic, left in English */
#wizard-back .icon { transform: scaleX(-1); }
[dir="rtl"] #wizard-back .icon { transform: none; }
.summary { display: grid; gap: 0; border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; background: var(--recessed); }
.summary > div { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 14px; }
.summary > div + div { border-block-start: 1px solid var(--hairline); }
.summary dt { color: var(--subtle); font-size: 13px; padding-block-start: 2px; }
.summary dd { margin: 0; color: var(--strong); overflow-wrap: anywhere; white-space: pre-line; }
[dir="rtl"] .summary dd.ltr { text-align: right; }
.summary button { all: unset; cursor: pointer; color: var(--brand-text); font-size: 13px; padding: 2px 4px; border-radius: 5px; }
.summary button:hover { color: var(--strong); text-decoration: underline; }
.summary button:focus-visible { outline: 2px solid var(--brand-text); }
.agree { margin-block-start: 14px; font-size: 13.5px; color: var(--subtle); }

.done { text-align: center; padding-block: 18px 6px; }
.done-mark { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; color: #fff; background: linear-gradient(180deg, var(--brand-hover), var(--brand)); box-shadow: 0 0 0 8px var(--brand-soft), 0 16px 40px #7c2ad880; animation: pop-in .6s var(--ease-spring) both; }
.done-mark .icon { width: 36px; height: 36px; stroke-width: 2.4; }
.done h2, .to-bot h2 { font-size: 1.5rem; margin-block-end: 8px; }
.to-bot { text-align: center; padding-block: 26px 20px; }
.to-bot > p { color: var(--subtle); max-width: 48ch; margin-inline: auto; }
.to-bot .next { display: grid; gap: 10px; margin: 22px auto 0; max-width: 380px; }
.done p { color: var(--subtle); max-width: 48ch; margin-inline: auto; }
.done .next { display: grid; gap: 10px; margin: 22px auto 0; max-width: 380px; }
.next-list { text-align: start; margin: 20px auto 0; max-width: 440px; display: grid; gap: 10px; }
.next-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--soft-text); font-size: 14.5px; }
.next-list b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-text); font-size: 13px; }

/* ---------- status, chips ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; padding: 2px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; line-height: 1.7; white-space: nowrap; border: 1px solid; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.pending { color: var(--amber); background: color-mix(in oklab, var(--amber) 12%, transparent); border-color: color-mix(in oklab, var(--amber) 40%, transparent); }
.status.active { color: var(--success); background: color-mix(in oklab, var(--success) 12%, transparent); border-color: color-mix(in oklab, var(--success) 40%, transparent); }
.status.rejected, .status.banned { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in oklab, var(--danger) 45%, transparent); }
.status.suspended, .status.muted, .status.inactive { color: var(--subtle); background: var(--recessed); border-color: var(--line); }
.chip { --chip: #c9a8ff; display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; line-height: 1.8; white-space: nowrap; color: var(--chip);
  background: color-mix(in oklab, var(--chip) 14%, transparent); border: 1px solid color-mix(in oklab, var(--chip) 45%, transparent); }
.tag { display: inline-flex; align-items: center; padding: 0 8px; border-radius: 5px; font-size: 11.5px; line-height: 1.8; color: var(--subtle); background: var(--base); border: 1px solid var(--hairline); white-space: nowrap; }
.tag.good { color: var(--success); border-color: color-mix(in oklab, var(--success) 40%, transparent); }

/* ---------- the member's page ---------- */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.hello h2 { margin: 0; font-size: 1.35rem; }
.hello-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-block-start: 6px; }
.state-text { margin-block-start: 14px; color: var(--soft-text); }
.state-text + .row, .state-text + .address-list { margin-block-start: 14px; }
.notice { margin-block-start: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid color-mix(in oklab, var(--danger) 50%, transparent); background: var(--danger-soft); color: #ffd9d6; font-size: 14px; }
.notice.soft { border-color: var(--line); background: var(--recessed); color: var(--soft-text); }
.notice strong { color: #fff; }
.address-list { display: grid; gap: 8px; }
.accounts { display: grid; gap: 8px; }
.accounts li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--recessed); }
.accounts code { font-size: 14.5px; }
.accounts .tag:last-child, .accounts .btn.small { margin-inline-start: auto; }
/* What a member does with their own accounts: the list, the buttons under it, and the one form that is open. */
.account-tools { margin-block-start: 16px; }
.tool-panel { margin-block-start: 16px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--recessed); }
.tool-form h3 { font-size: 1rem; margin-block-end: 6px; }
.tool-form .options { margin-block: 14px; }
.tool-form .field { margin-block-start: 14px; }
details.fold-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; font-weight: 600; color: var(--strong); }
details.fold-panel > summary::-webkit-details-marker { display: none; }
details.fold-panel > summary .icon { color: var(--inactive); transition: transform .28s var(--ease-spring); }
details.fold-panel[open] > summary .icon { transform: rotate(180deg); }
details.fold-panel > form { margin-block-start: 16px; }
.form-actions { margin-block-start: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sign { max-width: 440px; margin-inline: auto; }
.sign-links { margin-block-start: 16px; font-size: 14px; color: var(--subtle); text-align: center; }
.sign-links p + p { margin-block-start: 6px; }

/* ---------- dashboard ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block-end: 14px; }
.dash-head h1 { font-size: 1.5rem; }
.dash-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--recessed); border: 1px solid var(--hairline); overflow-x: auto; scrollbar-width: none; margin-block-end: 20px; }
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px; border-radius: 8px; color: var(--subtle); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background-color .16s ease, color .16s ease; }
.dash-tabs a:hover { color: var(--strong); text-decoration: none; background: var(--base); }
.dash-tabs a[aria-current] { background: linear-gradient(180deg, var(--brand-hover), var(--brand)); color: #fff; box-shadow: inset 0 1px 0 #ffffff33, 0 4px 14px #7c2ad866; }
.dash-tabs .count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber); color: #201400; font-size: 11.5px; font-weight: 700; line-height: 1.7; text-align: center; }
.dash-view { animation: fade .22s var(--ease-out) both; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { display: block; padding: 16px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--elevated); color: inherit; transition: border-color .16s ease, transform .16s ease; }
a.stat:hover { border-color: var(--brand-line); transform: translateY(-2px); text-decoration: none; color: inherit; }
.stat b { display: block; font-size: 1.9rem; line-height: 1.2; color: var(--strong); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--subtle); }
.stat.alert { border-color: color-mix(in oklab, var(--amber) 55%, transparent); background: color-mix(in oklab, var(--amber) 8%, var(--elevated)); }
.stat.alert b { color: var(--amber); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block: 24px 12px; }
.section-title h2 { margin: 0; font-size: 1.05rem; }
.online { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { padding: 30px 16px; text-align: center; color: var(--subtle); border: 1px dashed var(--line); border-radius: 12px; }
.toolbar { display: grid; gap: 12px; margin-block-end: 14px; }
.toolbar .search-field { max-width: 420px; }

.app-card { border: 1px solid var(--hairline); border-radius: 14px; background: var(--elevated); padding: 16px; }
.app-card + .app-card { margin-block-start: 12px; }
.app-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.app-card-names { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-card-names code { font-size: 15px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-block: 14px; }
.facts div { padding: 8px 12px; border-radius: 9px; background: var(--recessed); border: 1px solid var(--hairline); min-width: 0; }
.facts dt { font-size: 12px; color: var(--inactive); }
.facts dd { margin: 0; color: var(--strong); overflow-wrap: anywhere; }
.quote { padding: 12px 14px; border-radius: 10px; background: var(--recessed); border-inline-start: 3px solid var(--brand-hover); color: var(--soft-text); white-space: pre-line; overflow-wrap: anywhere; }
.app-card .form-actions { margin-block-start: 14px; }
.reject-note { flex: 1 1 220px; min-height: 40px; font-size: 14px; padding: 6px 12px; }

.rows { border: 1px solid var(--hairline); border-radius: 12px; background: var(--elevated); overflow: hidden; }
.rows > li + li { border-block-start: 1px solid var(--hairline); }
.member-row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; cursor: pointer; transition: background-color .16s ease; }
.member-row:hover { background: var(--recessed); }
.member-row:focus-visible { outline: 2px solid var(--brand-text); outline-offset: -2px; }
.member-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.member-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.member-sub { font-size: 12.5px; color: var(--inactive); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-flags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.log li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 11px 14px; font-size: 14px; }
.log .when { color: var(--inactive); font-size: 12.5px; white-space: nowrap; }
.log .what { color: var(--soft-text); overflow-wrap: anywhere; }
.log .what b { color: var(--strong); font-weight: 600; }
.log .detail { grid-column: 1 / -1; color: var(--subtle); font-size: 13px; overflow-wrap: anywhere; }
.log li > .btn { grid-column: 1 / -1; justify-self: start; margin-block-start: 4px; }
.log .revoked { text-decoration: line-through; opacity: .6; }
.pager { display: flex; justify-content: center; gap: 10px; margin-block-start: 14px; }

.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; }
.rank-row .member-sub { white-space: normal; }
.rank-form { padding: 16px; border-block-start: 1px solid var(--hairline); background: var(--recessed); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-block-start: 6px; }
.perm { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--hairline); background: var(--elevated); cursor: pointer; font-size: 13.5px; color: var(--soft-text); }
.perm:has(input:checked) { border-color: var(--brand-line); background: var(--brand-soft); color: var(--strong); }
.perm input { margin-block-start: 4px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.perm input[disabled] + span { opacity: .5; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type="color"] { width: 48px; height: 48px; padding: 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--recessed); cursor: pointer; }
/* Rank colour picker: ready colours, any colour, and the tag as the game shows it. */
.color-picker { display: grid; gap: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { --swatch: #fff; width: 34px; height: 34px; border-radius: 9px; border: 2px solid color-mix(in oklab, var(--swatch) 55%, var(--line)); background: var(--swatch); cursor: pointer; padding: 0; }
.swatch.on { outline: 3px solid var(--text, #fff); outline-offset: 2px; }
.swatch:focus-visible { outline: 3px solid var(--accent, #c9a8ff); outline-offset: 2px; }
.game-preview { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 10px; padding: 10px 12px; border-radius: 10px;
  background: #1b1b1f; border: 1px solid var(--line); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.game-label { font-size: 11.5px; color: #9a9aa4; }
.game-line { direction: ltr; text-align: left; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-bracket { color: #555555; }
.game-text { color: #ffffff; }

dialog.sheet { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--elevated); color: var(--text); box-shadow: 0 30px 90px #000c; overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: pop .24s var(--ease-spring); }
dialog.sheet::backdrop { background: #0b0514cc; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; border-block-end: 1px solid var(--hairline); }
[dir="rtl"] .sheet-head { padding: 12px 18px 12px 12px; }
.sheet-head h2 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.sheet-body { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-body h3 { margin-block: 22px 10px; font-size: .95rem; color: var(--brand-text); }
.sheet-body h3:first-child { margin-block-start: 0; }
.action { padding: 14px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--recessed); }
.action + .action { margin-block-start: 10px; }
.action > strong { display: block; margin-block-end: 10px; font-size: 14px; }
.action .pills + .field, .action .field + .pills { margin-block-start: 12px; }
.action .input, .action select { min-height: 42px; font-size: 15px; }
.copy-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-block-start: 10px; }
.copy-line code { display: block; padding: 9px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; }

@keyframes step-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes step-back { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .step.is-active { animation-name: step-back; }
[dir="rtl"] .wizard.is-back .step.is-active { animation-name: step-in; }
@keyframes pop-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* ---------- inside Telegram: the page is the whole app, so the site's own bars go away ---------- */
.tg .top, .tg .side, .tg .tabs, .tg .foot, .tg .skip, .tg .crumbs { display: none !important; }
.tg .shell { display: block; }
.tg body { padding-block-end: 0; }
.tg main { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
.tg .app-head { padding-block-end: 12px; margin-block-end: 16px; }
.tg .app-head h1 { font-size: 1.45rem; }
.tg .app-head .lead { font-size: .97em; }
.tg-only { display: none; }
.tg .tg-only { display: revert; }
.tg .web-only { display: none !important; }

@media (max-width: 760px) {
  .panel { padding: 16px; }
  .options.two, .field-pair { grid-template-columns: minmax(0, 1fr); }
  .field-pair .field + .field { margin-block-start: 16px; }
  .summary > div { grid-template-columns: 92px minmax(0, 1fr) auto; padding: 10px 12px; }
  .wizard-foot { position: sticky; inset-block-end: calc(var(--tabs) + env(safe-area-inset-bottom)); z-index: 5; margin-inline: -16px; padding: 10px 16px; background: color-mix(in oklab, var(--canvas) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-block-start: 1px solid var(--hairline); }
  .tg .wizard-foot { inset-block-end: 0; padding-block-end: calc(10px + env(safe-area-inset-bottom)); }
  .member-row { grid-template-columns: minmax(0, 1fr) auto; }
  .member-row .member-sub.wide { display: none; }
  dialog.sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .log li { grid-template-columns: minmax(0, 1fr); }
  .stat b { font-size: 1.6rem; }
}

/* A member's own activity numbers, under the state card. */
.activity-mine { margin-block-start: 22px; }
.activity-mine h2 { font-size: 1.05rem; margin-block-end: 4px; }
.table-lines .field-hint { margin-block: 4px; }

/* The follow-up page: the choice of time span, and rows that are not buttons. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--subtle); font-size: 13.5px; text-decoration: none; }
.chip-link:hover { border-color: var(--brand-line); color: var(--strong); text-decoration: none; }
.chip-link.is-on { background: var(--brand-soft, var(--recessed)); border-color: var(--brand-line); color: var(--strong); }
div.member-row { cursor: default; }
div.member-row:hover { background: transparent; }
a.member-row { text-decoration: none; color: inherit; }
.link-button { all: unset; cursor: pointer; }
.link-button:hover b, .link-button:focus-visible b { text-decoration: underline; }
.log .detail.pre { white-space: pre-line; }

/* The bot check (Cloudflare Turnstile) in the last step of the website's form. */
.robot-check { min-height: 65px; display: flex; justify-content: center; }
.robot-check[hidden] { display: none; }

/* Two ways to apply (30 Nov 2026): Telegram or Discord. */
.apply-doors { display: grid; gap: .5rem; margin: 1rem 0; }
.apply-doors .btn { justify-content: center; }
.apply-doors .muted { margin: 0 0 .75rem; font-size: .92em; }

/* The Discord apply link: confirm through Telegram (30 Nov 2026 evening). */
.dc-tg { display: grid; gap: .5rem; margin: 0 0 1rem; padding: .85rem 1rem; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; }
.dc-tg p { margin: 0; }
#dc-known { display: grid; gap: .6rem; }
#dc-known[hidden], .dc-tg[hidden] { display: none; }

/* The replay videos tab (dashboard.js replayTab, 1 Dec 2026): a finished video under its row. */
.replay-video { display: block; width: 100%; max-width: 960px; margin-top: 10px; border-radius: 10px; background: #000; }
