:root {
  --ink: #070706;
  --ink-soft: #0b0b09;
  --surface: #10100d;
  --surface-raised: #15140f;
  --surface-hover: #1b1a14;
  --paper: #f3f0e8;
  --muted: #a6a197;
  --muted-dark: #6f6b63;
  --gold: #d6b467;
  --gold-light: #f1dfa8;
  --gold-deep: #836a35;
  --gold-soft: rgba(214, 180, 103, .1);
  --line: rgba(225, 204, 153, .14);
  --line-strong: rgba(225, 204, 153, .28);
  --danger: #e98b7e;
  --success: #86c9a6;
  --display: "Iowan Old Style", "Baskerville", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--paper); background: var(--ink); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
body::selection, ::selection { color: var(--ink); background: var(--gold-light); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { border: 2px solid var(--ink); border-radius: 99px; background: var(--gold-deep); }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 9999; padding: 10px 14px; color: var(--ink); background: var(--gold-light); font-weight: 700; text-decoration: none; transform: translateY(-160%); transition: transform .2s ease; }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin-bottom: 0; color: var(--gold); font-size: .68rem; font-weight: 700; letter-spacing: .22em; line-height: 1.5; text-transform: uppercase; }
.signal-dot { display: inline-block; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(214, 180, 103, .09), 0 0 18px rgba(214, 180, 103, .55); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 40px; height: 37px; object-fit: contain; filter: drop-shadow(0 5px 13px rgba(214, 180, 103, .15)); }
.brand-name { color: var(--paper); font-family: var(--display); font-size: .96rem; letter-spacing: .085em; line-height: 1; text-transform: uppercase; }
.brand-name i { color: var(--gold); font-style: normal; }

/* Login */
.login-page { min-height: 100vh; overflow-x: hidden; background: #080807; }
.login-header { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 98px; width: min(1360px, calc(100vw - 96px)); margin-inline: auto; }
.back-link { display: inline-flex; gap: 18px; align-items: center; color: #c2beb5; font-size: .73rem; letter-spacing: .08em; text-decoration: none; }
.back-link span { color: var(--gold); }
.login-hero { position: relative; display: flex; min-height: 100svh; overflow: hidden; border-bottom: 1px solid var(--line); isolation: isolate; }
.login-hero::before { position: absolute; inset: 0; z-index: -2; background: radial-gradient(circle at 73% 43%, rgba(214,180,103,.065), transparent 34%); content: ""; }
.login-hero::after { position: absolute; top: 0; bottom: 0; left: 57%; z-index: -1; width: 1px; background: linear-gradient(180deg, transparent 7%, var(--line) 25%, var(--line) 78%, transparent 94%); content: ""; }
.login-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, .72fr); gap: clamp(60px, 8vw, 130px); align-items: center; width: min(1360px, calc(100vw - 96px)); margin: auto; padding: 150px 0 125px; }
.login-copy h1 { max-width: 780px; margin: 23px 0 30px; font-family: var(--display); font-size: clamp(4rem, 6.7vw, 7.2rem); font-weight: 400; letter-spacing: -.055em; line-height: .91; }
.login-copy h1 em, .login-panel h2 em, .page-heading h1 em, .action-card h2 em, .future-panel h2 em { color: var(--gold-light); font-style: normal; font-weight: 400; }
.login-lead { max-width: 650px; margin-bottom: 45px; color: var(--muted); font-family: var(--display); font-size: clamp(1.05rem, 1.4vw, 1.28rem); line-height: 1.7; }
.login-panel-wrap { position: relative; }
.login-panel { position: relative; max-width: 500px; margin-left: auto; padding: clamp(34px, 4vw, 58px); border: 0; background: transparent; box-shadow: none; }
.login-panel::before { position: absolute; top: -1px; left: -1px; width: 70px; height: 1px; background: var(--gold); content: ""; }
.card-number { margin: 0; color: var(--muted-dark); font-size: .64rem; letter-spacing: .18em; }
.login-panel h2 { margin: 36px 0 20px; font-family: var(--display); font-size: clamp(2.8rem, 4vw, 4.4rem); font-weight: 400; letter-spacing: -.04em; line-height: .98; }
.login-panel > p:not(.card-number, .privacy-note) { margin-bottom: 30px; color: var(--muted); }
.privacy-note { display: flex; gap: 10px; margin: 24px 0 0; color: var(--muted-dark); font-size: .75rem; line-height: 1.55; }
.privacy-note span { flex: none; color: var(--gold-deep); }

/* Buttons and fields */
.primary-button, .secondary-button, .text-button, .logout-button { border: 0; text-decoration: none; }
.primary-button { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; min-height: 55px; padding: 14px 18px 14px 21px; color: #090806; background: linear-gradient(135deg, var(--gold-light), var(--gold)); font-size: .76rem; font-weight: 700; letter-spacing: .07em; transition: transform .25s var(--ease), box-shadow .25s ease, background .25s ease; }
.primary-button:hover, .primary-button:focus-visible { background: var(--gold-light); box-shadow: 0 14px 38px rgba(214,180,103,.16); transform: translateY(-2px); }
.primary-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.discord-button > svg:first-child { fill: currentColor; stroke: none; }
.discord-button > span { margin-right: auto; }
.secondary-button { padding: 10px 14px; color: var(--paper); border: 1px solid var(--line-strong); background: transparent; font-size: .69rem; font-weight: 600; letter-spacing: .05em; transition: border-color .2s ease, background .2s ease; }
.secondary-button:hover { border-color: var(--gold); background: var(--gold-soft); }
.small-button { white-space: nowrap; }
.text-button { display: inline-flex; align-items: center; gap: 8px; padding: 0; color: var(--muted); background: transparent; font-size: .73rem; font-weight: 600; }
.text-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.danger-text { color: var(--danger); }
.compact-button { width: auto; min-height: 44px; margin: 22px 0 0 auto; padding-inline: 18px; }
label { color: #d0cbc1; font-size: .73rem; font-weight: 600; letter-spacing: .04em; }
input[type="search"], select { width: 100%; min-height: 48px; padding: 11px 14px; color: var(--paper); border: 1px solid var(--line-strong); border-radius: 0; outline: 0; background: #0b0b09; }
input[type="search"]:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,180,103,.08); }

/* App chrome */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column; width: 286px; padding: 35px 28px 26px; border-right: 1px solid var(--line); background: #090908; }
.sidebar::after { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle at 5% 12%, rgba(214,180,103,.055), transparent 26%); content: ""; }
.product-label { display: flex; align-items: center; gap: 9px; margin: 27px 0 44px; color: var(--muted-dark); font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; }
.product-label span { width: 20px; height: 1px; background: var(--gold-deep); }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-link { position: relative; display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 12px 13px; color: #858177; font-size: .76rem; font-weight: 600; letter-spacing: .035em; text-decoration: none; transition: color .2s ease, background .2s ease; }
.sidebar-link::before { position: absolute; top: 50%; left: -28px; width: 2px; height: 0; background: var(--gold); content: ""; transform: translateY(-50%); transition: height .3s var(--ease); }
.sidebar-link svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-link:hover { color: var(--paper); background: rgba(255,255,255,.025); }
.sidebar-link.is-active { color: var(--gold-light); background: var(--gold-soft); }
.sidebar-link.is-active::before { height: 26px; }
.sidebar-footer { margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-chip img, .ranking-user img { flex: none; border-radius: 50%; object-fit: cover; }
.user-chip img { border: 1px solid var(--line-strong); }
.user-chip div, .ranking-user div { min-width: 0; }
.user-chip strong, .user-chip span, .ranking-user strong, .ranking-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: .76rem; }
.user-chip span { color: var(--gold); font-size: .62rem; letter-spacing: .06em; }
.logout-button { display: flex; justify-content: space-between; width: 100%; margin-top: 16px; padding: 9px 0 0; color: var(--muted-dark); background: transparent; font-size: .66rem; letter-spacing: .06em; }
.logout-button:hover { color: var(--paper); }
.mobile-header, .sidebar-scrim { display: none; }
.app-main { min-height: 100vh; margin-left: 286px; padding: 58px clamp(34px, 5vw, 78px) 90px; background: linear-gradient(145deg, rgba(214,180,103,.018), transparent 34%), var(--ink); }
.app-main > * { width: min(1220px, 100%); margin-inline: auto; }

/* App typography */
.page-heading { display: grid; grid-template-columns: minmax(155px, .28fr) minmax(0, 1fr); gap: clamp(35px, 6vw, 95px); align-items: start; margin-bottom: 48px; padding-bottom: 46px; border-bottom: 1px solid var(--line); }
.page-heading > div:first-child { display: flex; justify-content: space-between; min-height: 90px; padding-top: 8px; flex-direction: column; }
.page-index { color: var(--muted-dark); font-size: .61rem; letter-spacing: .18em; }
.page-heading h1 { margin: 0; font-family: var(--display); font-size: clamp(2.9rem, 5vw, 5.4rem); font-weight: 400; letter-spacing: -.045em; line-height: .98; }
.page-heading > div:last-child > p { max-width: 650px; margin: 22px 0 0; color: var(--muted); font-family: var(--display); font-size: 1.08rem; }
.notice { display: flex; gap: 13px; align-items: flex-start; margin: -20px 0 32px; padding: 15px 17px; border: 1px solid var(--line); background: var(--surface); }
.notice-dot { flex: none; width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; }
.notice-success { border-color: rgba(134,201,166,.22); }
.notice-success .notice-dot { background: var(--success); box-shadow: 0 0 12px rgba(134,201,166,.5); }
.notice-error { border-color: rgba(233,139,126,.24); }
.notice-error .notice-dot { background: var(--danger); box-shadow: 0 0 12px rgba(233,139,126,.4); }
.notice strong { font-size: .76rem; }
.notice p { margin: 1px 0 0; color: var(--muted); font-size: .75rem; }

/* Overview */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 70px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.metric-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card { position: relative; min-height: 180px; padding: 27px 26px; overflow: hidden; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(145deg, rgba(21,20,15,.76), rgba(11,11,9,.88)); }
.metric-card::after { position: absolute; top: 0; right: 0; width: 42px; height: 1px; background: var(--line-strong); content: ""; }
.metric-primary::after { background: var(--gold); }
.metric-label { display: block; color: var(--muted-dark); font-size: .61rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.metric-card > strong { display: block; margin: 21px 0 13px; font-family: var(--display); font-size: clamp(2.5rem, 3.4vw, 4.3rem); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.metric-card > strong.metric-duration { font-size: clamp(1.7rem, 2.5vw, 3rem); line-height: 1.1; }
.metric-card p { margin: 0; color: var(--muted); font-size: .7rem; }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 9px rgba(134,201,166,.55); }
.live-dot.is-pending { background: var(--gold); }
.content-section { margin-top: 25px; }
.section-title { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 28px; }
.section-title h2, .data-panel-head h2 { margin: 10px 0 0; font-family: var(--display); font-size: 2rem; font-weight: 400; letter-spacing: -.025em; }
.section-title > p { max-width: 490px; margin: 0; color: var(--muted); font-size: .82rem; }
.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.module-card { min-height: 225px; padding: 25px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); transition: background .25s ease, transform .3s var(--ease); }
.module-card:hover { z-index: 1; background: var(--surface-raised); transform: translateY(-3px); }
.module-card > div { display: flex; justify-content: space-between; align-items: center; }
.status-pill { padding: 4px 8px; border: 1px solid var(--line); color: var(--muted-dark); font-size: .55rem; letter-spacing: .1em; text-transform: uppercase; }
.status-pill.is-online { color: var(--success); border-color: rgba(134,201,166,.25); background: rgba(134,201,166,.06); }
.status-pill.is-offline { color: var(--muted-dark); }
.module-card h3 { margin: 53px 0 8px; font-family: var(--display); font-size: 1.42rem; font-weight: 400; }
.module-card > p { margin: 0; color: var(--muted); font-size: .75rem; }

/* Data and rankings */
.data-panel { border: 1px solid var(--line); background: var(--surface); }
.data-panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 25px 28px; border-bottom: 1px solid var(--line); }
.data-panel-head > span { color: var(--muted-dark); font-size: .64rem; letter-spacing: .06em; }
.ranking-row, .limit-row { display: grid; grid-template-columns: 65px 1fr auto; gap: 18px; align-items: center; min-height: 78px; padding: 14px 28px; border-bottom: 1px solid var(--line); transition: background .2s ease; }
.ranking-row:last-child, .limit-row:last-child { border-bottom: 0; }
.ranking-row:hover, .limit-row:hover { background: rgba(255,255,255,.018); }
.rank { color: var(--gold-deep); font-family: var(--display); font-size: 1.3rem; }
.ranking-user { display: flex; align-items: center; gap: 13px; min-width: 0; }
.ranking-user strong { color: #e4e0d7; font-size: .8rem; }
.ranking-user span { margin-top: 2px; color: var(--muted-dark); font-size: .66rem; }
.ranking-user span .live-dot { margin-right: 5px; }
.avatar-placeholder { display: block; flex: none; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; background: linear-gradient(135deg, var(--surface-raised), var(--gold-soft)); }
.ranking-time { color: var(--paper); font-family: var(--display); font-size: 1rem; font-weight: 400; }
.empty-state { padding: 45px 28px; text-align: center; }
.empty-state strong { font-family: var(--display); font-size: 1.4rem; font-weight: 400; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: .78rem; }

/* Join sound */
.join-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 24px; align-items: start; }
.action-card, .countdown-card, .future-panel { position: relative; padding: clamp(28px, 3.4vw, 46px); border: 1px solid var(--line); background: linear-gradient(145deg, var(--surface-raised), var(--ink-soft)); }
.action-card::before, .countdown-card::before, .future-panel::before { position: absolute; top: -1px; left: -1px; width: 62px; height: 1px; background: var(--gold); content: ""; }
.action-card h2, .future-panel h2 { margin: 15px 0 15px; font-family: var(--display); font-size: clamp(2.2rem, 3.2vw, 3.6rem); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.action-card > div > p:last-child, .future-panel > div > p:last-child { color: var(--muted); font-size: .8rem; }
.upload-card > form { margin-top: 24px; }
.file-drop { display: flex; align-items: center; gap: 15px; min-height: 82px; margin-bottom: 13px; padding: 17px; border: 1px dashed var(--line-strong); background: rgba(0,0,0,.16); transition: border-color .2s ease, background .2s ease; }
.file-drop:hover { border-color: var(--gold); background: var(--gold-soft); }
.file-drop > span { display: grid; place-items: center; flex: none; width: 42px; height: 42px; color: var(--gold); border: 1px solid var(--line); }
.file-drop svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.file-drop strong, .file-drop small { display: block; }
.file-drop strong { font-size: .76rem; }
.file-drop small { color: var(--muted-dark); font-size: .64rem; font-weight: 400; }
.upload-card > form:last-child { margin-top: 18px; }
.empty-sound { display: flex; align-items: center; gap: 16px; margin-top: 28px; padding: 19px; border: 1px solid var(--line); background: rgba(0,0,0,.18); }
.empty-sound > span { display: grid; place-items: center; flex: none; width: 46px; height: 46px; color: var(--gold-deep); border: 1px solid var(--line); }
.empty-sound svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.empty-sound strong { font-size: .77rem; }
.empty-sound p { margin: 2px 0 0; color: var(--muted-dark); font-size: .67rem; }
.sound-player { margin-top: 28px; padding: 19px; border: 1px solid var(--line); background: rgba(0,0,0,.2); }
.sound-player > div { display: flex; align-items: center; gap: 14px; }
.sound-player strong, .sound-player span { display: block; }
.sound-player strong { font-size: .78rem; }
.sound-player span:not(.sound-wave) { color: var(--muted-dark); font-size: .64rem; }
.sound-wave { display: flex !important; align-items: center; gap: 3px; height: 36px; padding-inline: 10px; border: 1px solid var(--line); }
.sound-wave i { width: 2px; height: 10px; background: var(--gold); }
.sound-wave i:nth-child(2), .sound-wave i:nth-child(4) { height: 20px; }
.sound-wave i:nth-child(3) { height: 28px; }
.sound-player audio { width: 100%; height: 36px; margin-top: 16px; filter: sepia(.4) saturate(.7); }
.side-stack { display: grid; gap: 24px; }
.countdown-card > span { display: block; margin: 18px 0 7px; color: var(--muted); font-size: .7rem; }
.countdown-card > strong { display: block; color: var(--gold-light); font-family: var(--display); font-size: clamp(2.6rem, 4vw, 4rem); font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.countdown-card > p:last-child { margin: 5px 0 0; color: var(--muted-dark); font-size: .67rem; }
.prank-card form { margin-top: 26px; }
.prank-card label { display: block; margin-bottom: 7px; }
.prank-card select { margin-bottom: 12px; }
.compact-panel { margin-top: 24px; }
.compact-panel .data-panel-head form { margin: 0; }
.limit-row { grid-template-columns: 1fr auto; }

/* Moderation */
.future-panel { display: grid; grid-template-columns: 100px 1fr; gap: 10px 35px; align-items: center; min-height: 330px; }
.future-mark { display: grid; place-items: center; width: 90px; height: 90px; color: var(--gold); border: 1px solid var(--line-strong); background: var(--gold-soft); }
.future-mark svg { width: 42px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.future-panel h2 { margin-top: 12px; }
.future-tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; }
.future-tags span { padding: 7px 11px; color: var(--muted); border: 1px solid var(--line); font-size: .63rem; letter-spacing: .08em; text-transform: uppercase; }

/* Access control */
.access-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 22px; padding: 22px; border: 1px solid var(--line); background: var(--surface); }
.access-toolbar > div { width: min(510px, 100%); }
.access-toolbar label { display: block; margin-bottom: 6px; }
.access-toolbar p { margin: 0; color: var(--muted); font-size: .72rem; }
.access-toolbar p strong { color: var(--gold-light); font-family: var(--display); font-size: 1.5rem; font-weight: 400; }
.role-legend { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 25px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.role-legend > div { min-height: 145px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(16,16,13,.6); }
.role-legend span { color: var(--gold-light); font-family: var(--display); font-size: 1.1rem; }
.role-legend p { margin: 8px 0 13px; color: var(--muted); font-size: .66rem; line-height: 1.5; }
.role-legend small { color: var(--muted-dark); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; }
.access-list { display: grid; gap: 14px; }
.access-card { padding: 24px; border: 1px solid var(--line); background: var(--surface); }
.access-card[hidden] { display: none; }
.access-card header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.access-card .ranking-user span { max-width: 520px; }
.role-select-wrap { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); }
.permission-details { border-top: 1px solid var(--line); }
.permission-details summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 0; color: var(--paper); font-size: .72rem; font-weight: 600; cursor: pointer; list-style: none; }
.permission-details summary::-webkit-details-marker { display: none; }
.permission-details summary::before { margin-right: 9px; color: var(--gold); content: "+"; }
.permission-details[open] summary::before { content: "−"; }
.permission-details summary span { margin-left: auto; color: var(--muted-dark); font-size: .62rem; }
.permission-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 26px; padding: 6px 0 18px; }
.permission-group > p { margin: 0 0 9px; color: var(--gold-deep); font-size: .59rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.permission-option { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 8px 0; cursor: pointer; }
.permission-option input { position: absolute; opacity: 0; pointer-events: none; }
.permission-check { position: relative; display: block; width: 16px; height: 16px; margin-top: 2px; border: 1px solid var(--line-strong); background: #0b0b09; }
.permission-option input:checked + .permission-check { border-color: var(--gold); background: var(--gold); }
.permission-option input:checked + .permission-check::after { position: absolute; top: 2px; left: 5px; width: 3px; height: 7px; border: solid var(--ink); border-width: 0 2px 2px 0; content: ""; transform: rotate(45deg); }
.permission-option input:focus-visible + .permission-check { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.permission-option strong, .permission-option small { display: block; }
.permission-option strong { color: #d8d3c9; font-size: .69rem; }
.permission-option small { margin-top: 1px; color: var(--muted-dark); font-size: .61rem; font-weight: 400; line-height: 1.45; }
.owner-note { margin: 15px 0 0; color: var(--muted-dark); font-size: .66rem; }

.simple-message { display: grid; place-items: start; align-content: center; min-height: calc(100vh - 150px); }
.simple-message h1 { margin: 20px 0; font-family: var(--display); font-size: clamp(3rem, 6vw, 6rem); font-weight: 400; line-height: 1; }
.simple-message > p:last-of-type { max-width: 550px; color: var(--muted); }
.simple-message .primary-button { width: auto; margin-top: 20px; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .role-legend { grid-template-columns: repeat(2, 1fr); }
  .join-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .login-header { width: calc(100vw - 48px); }
  .login-grid { grid-template-columns: 1fr; width: calc(100vw - 48px); padding-top: 145px; }
  .login-hero::after { display: none; }
  .login-panel { max-width: none; margin: 0; }
  .sidebar { visibility: hidden; width: min(320px, 86vw); transform: translateX(-100%); transition: visibility .35s, transform .35s var(--ease); }
  .menu-open .sidebar { visibility: visible; transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 40; display: block; visibility: hidden; background: rgba(0,0,0,.62); opacity: 0; transition: opacity .3s ease, visibility .3s; }
  .menu-open .sidebar-scrim { visibility: visible; opacity: 1; }
  .mobile-header { position: sticky; top: 0; z-index: 35; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(7,7,6,.9); backdrop-filter: blur(18px); }
  .menu-toggle { display: grid; gap: 6px; width: 42px; height: 42px; padding: 12px; border: 1px solid var(--line); background: transparent; }
  .menu-toggle i { display: block; width: 100%; height: 1px; background: var(--gold); }
  .app-main { margin-left: 0; padding: 42px 24px 75px; }
  .page-heading { grid-template-columns: 1fr; gap: 25px; }
  .page-heading > div:first-child { min-height: 0; }
  .page-index { display: none; }
}

@media (max-width: 650px) {
  .login-header .back-link { font-size: 0; gap: 0; }
  .login-header .back-link span { font-size: 1rem; }
  .login-copy h1 { font-size: clamp(3.3rem, 17vw, 5rem); }
  .metric-grid, .metric-grid-three, .module-grid, .role-legend, .side-stack, .permission-grid { grid-template-columns: 1fr; }
  .section-title { grid-template-columns: 1fr; gap: 12px; }
  .ranking-row { grid-template-columns: 38px 1fr; padding-inline: 16px; }
  .ranking-time { grid-column: 2; }
  .data-panel-head { align-items: flex-start; flex-direction: column; padding-inline: 18px; }
  .limit-row { align-items: stretch; grid-template-columns: 1fr; padding-inline: 18px; }
  .limit-row form, .limit-row button { width: 100%; }
  .future-panel { grid-template-columns: 1fr; }
  .future-tags { grid-column: 1; }
  .access-toolbar, .access-card header { align-items: stretch; flex-direction: column; }
  .role-select-wrap { grid-template-columns: 1fr; gap: 7px; }
  .access-card { padding: 18px; }
  .compact-button { width: 100%; }
}

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