/* Site + admin. Dark, glass-inspired; no inline styles (CSP style-src 'self'). */
:root {
  color-scheme: dark;
  --bg: #070a0e;
  --bg-2: #0b1016;
  --surface: #10161d;
  --text: #f2f6f7;
  --muted: #9aa8b1;
  --subtle: #82939d;
  --line: rgba(214, 240, 244, .10);
  --line-strong: rgba(214, 240, 244, .18);
  --accent: #b6efec;
  --accent-2: #83d9d5;
  --accent-ink: #061215;
  --danger: #ffb0a8;
  --warn: #ffd59a;
  --glass: rgba(200, 228, 234, .07);
  --glass-strong: rgba(200, 228, 234, .11);
  --glass-border: rgba(226, 246, 249, .14);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .10);
  --blur: blur(22px) saturate(160%);
  --shadow-lg: 0 40px 90px rgba(0, 0, 0, .45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --header-h: 68px;
  --gutter: 40px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-family: var(--font);
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: #7ed7d1; color: #081116; }
[hidden] { display: none !important; }
.wrap { width: min(1240px, calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.skip-link:focus { top: 12px; }

/* Ambient light: gives the frosted surfaces something real to blur. */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: var(--bg); }
.orb { position: absolute; border-radius: 50%; opacity: .9; }
.orb-a { width: 720px; height: 720px; top: -320px; right: -160px; background: radial-gradient(circle, rgba(52, 128, 134, .30), rgba(52, 128, 134, 0) 68%); }
.orb-b { width: 620px; height: 620px; top: 38%; left: -300px; background: radial-gradient(circle, rgba(46, 82, 120, .26), rgba(46, 82, 120, 0) 70%); }
.orb-c { width: 560px; height: 560px; bottom: -260px; right: 12%; background: radial-gradient(circle, rgba(92, 150, 138, .18), rgba(92, 150, 138, 0) 70%); }

/* Header: sticky frosted bar; content scrolls underneath it. */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(7, 10, 14, .58); border-bottom: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.topbar-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; font-size: 18px; font-weight: 700; letter-spacing: .2em; white-space: nowrap; line-height: 1; color: var(--text); }
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.brand-dot { color: var(--accent); letter-spacing: 0; }
.glass-nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--glass-border); border-radius: 999px; background: var(--glass); box-shadow: var(--glass-hi), 0 14px 40px rgba(0, 0, 0, .25); }
.glass-nav a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 18px; color: #d3dde2; border-radius: 999px; font-size: 14px; transition: background .2s, color .2s; }
.glass-nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.header-action { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* Buttons */
.button { border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 22px; min-height: 48px; border-radius: 999px; font-weight: 600; font-size: 14px; line-height: 1.2; white-space: nowrap; transition: background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s; }
.button:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px rgba(123, 210, 211, .18), inset 0 1px 0 rgba(255, 255, 255, .5); }
.button-primary:hover:not(:disabled) { background: #d8fbf9; }
.button-quiet { border-color: var(--line-strong); color: #e5ecf0; background: rgba(255, 255, 255, .03); }
.button-quiet:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }
.button-secondary { background: #1f2a31; border-color: rgba(220, 240, 243, .12); color: #ecf6f7; }
.button-secondary:hover:not(:disabled) { background: #283840; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-border); background: rgba(12, 18, 24, .6); color: #fff; font-size: 20px; line-height: 1; }
.icon-button:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }

/* Hero */
.hero { display: flex; justify-content: center; text-align: center; padding: 24px 0 16px; }
.hero-copy { width: min(820px, 100%); }
.eyebrow, .section-kicker, .card-index { letter-spacing: .22em; font-size: 12px; font-weight: 700; color: var(--accent); }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; }
.signal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px rgba(182, 239, 236, .85); }
.hero h1 { font-size: clamp(44px, 4.4vw, 64px); font-weight: 650; line-height: 1.14; letter-spacing: -.02em; margin: 0; }
.muted-line { display: block; color: #c4d0d5; }
.hero-lead { font-size: 17px; color: var(--muted); line-height: 1.85; max-width: 560px; margin: 16px auto 22px; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.hero-meta { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 12px; color: var(--subtle); letter-spacing: .07em; }
.meta-line { height: 1px; width: 26px; background: var(--accent); opacity: .7; }

/* Media frame: the whole screenshot stays visible (contain); the same image, blurred, fills the letterbox. */
.media { position: relative; display: block; overflow: hidden; background: #0a0f14; }
.media-backdrop { position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none; object-fit: cover; filter: blur(26px) saturate(1.25) brightness(.55); opacity: 0; transition: opacity .4s; }
.media-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .35s; }
.media.is-loaded .media-photo, .media.is-loaded .media-backdrop { opacity: 1; }
.media.is-broken { background: repeating-linear-gradient(135deg, #0d141a 0 12px, #0b1116 12px 24px); }

/* Sections */
.section-wrap { padding-top: 88px; padding-bottom: 80px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.records { width: min(900px, calc(100% - var(--gutter) * 2)); border-top: 1px solid var(--line); padding-top: 64px; padding-bottom: 72px; }
.records .section-heading { flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 22px; }
.records .section-heading h2 { font-size: clamp(28px, 2.7vw, 36px); }
.section-kicker { margin: 0 0 11px; }
.section-heading h2, .download-info h2 { font-size: clamp(34px, 3.6vw, 50px); font-weight: 650; line-height: 1.16; letter-spacing: -.02em; margin: 0; }
.section-note { font-size: 14px; color: var(--muted); margin: 0 0 4px; }

/* Gallery */
.gallery-state { margin-bottom: 8px; }
.state-card { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: linear-gradient(125deg, rgba(17, 29, 37, .8), rgba(10, 17, 23, .8)); }
.state-card h3 { font-size: 18px; font-weight: 550; margin: 0 0 6px; }
.state-card p { color: var(--muted); font-size: 14px; margin: 0; }
.state-card .button { margin-top: 20px; }
.empty-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 22px; color: #91d9d7; }
.state-error .empty-symbol { color: var(--danger); }
#state-loading { padding: 0; border: 0; background: none; min-height: 0; display: block; }
.skeleton-grid { width: min(760px, 100%); margin-inline: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.skeleton-grid span { aspect-ratio: 16 / 10; border-radius: var(--radius-md); background: linear-gradient(100deg, #0f161c 30%, #16212a 50%, #0f161c 70%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

.record-grid { list-style: none; width: min(760px, 100%); margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 24px; }
.record-grid > :only-child { grid-column: 1 / -1; width: min(368px, 100%); justify-self: center; }
.record-tile { min-width: 0; }
.tile-open { position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: zoom-in; border-radius: var(--radius-md); }
.tile-open .media { aspect-ratio: 16 / 10; border-radius: var(--radius-md); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .25); transition: border-color .2s, transform .25s, box-shadow .25s; }
.tile-open:hover .media { border-color: rgba(182, 239, 236, .45); transform: translateY(-2px); box-shadow: 0 24px 50px rgba(0, 0, 0, .35); }
/* A dark halo keeps the focus ring visible on bright screenshots. */
.tile-open:focus-visible { outline: none; }
.tile-open:focus-visible .media { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 7px rgba(0, 0, 0, .7); }
.tile-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 2px 0; font-size: 14px; }
.tile-title { min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; color: #e9f1f3; line-height: 1.45; }
.tile-caption time { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-badge { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 650; line-height: 18px; vertical-align: 1px; color: var(--accent-ink); background: var(--accent); }
.records-more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 22px; }
.more-error { min-height: 1.2em; margin: 0; font-size: 13px; color: var(--danger); }

/* Download */
.download-section { display: flex; flex-direction: column; align-items: center; gap: 28px; margin-top: 20px; padding-top: 64px; padding-bottom: 104px; }
.download-info { max-width: 640px; text-align: center; }
.download-section .download-info h2 { font-size: clamp(40px, 4vw, 58px); }
.download-description { font-size: 17px; color: var(--muted); line-height: 1.85; max-width: 520px; margin: 16px auto 20px; }
.release-detail { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 14px; color: #d7e6e9; min-width: 0; }
.release-led { flex: none; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 15px rgba(182, 239, 236, .5); }
.release-text { min-width: 0; overflow-wrap: anywhere; }
.download-stage { position: relative; width: min(560px, 100%); }
.preview-release-panel { align-items: center; justify-content: center; min-height: 210px; text-align: center; }
.preview-release-panel h3 { margin: 0 0 8px; font-size: clamp(22px, 2.5vw, 28px); }
.preview-release-panel .download-description { margin: 0; font-size: 14px; }
.download-stage::before { content: ""; position: absolute; inset: -60px 0; z-index: -1; pointer-events: none; background: radial-gradient(40% 45% at 22% 30%, rgba(88, 196, 190, .30), transparent 70%), radial-gradient(38% 40% at 82% 76%, rgba(84, 118, 196, .26), transparent 70%); -webkit-mask-image: radial-gradient(closest-side, #000 45%, transparent); mask-image: radial-gradient(closest-side, #000 45%, transparent); }
.glass-panel { background: linear-gradient(145deg, rgba(225, 246, 249, .10), rgba(160, 205, 212, .04)); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), 0 30px 70px rgba(0, 0, 0, .35); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.download-form { display: flex; flex-direction: column; padding: 34px; border-radius: 26px; }
.download-form > label, .stack-form > label { font-size: 14px; font-weight: 600; color: #e6f0f1; margin-bottom: 10px; }
.code-field { display: flex; position: relative; }
.code-field input { padding-right: 76px; width: 100%; }
#card-code.is-visible { font-family: var(--mono); letter-spacing: .03em; }
input, textarea { border: 1px solid #5b6d74; background: rgba(6, 10, 14, .72); color: var(--text); padding: 13px 15px; min-height: 50px; border-radius: var(--radius-sm); outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus { border-color: rgba(182, 239, 236, .75); box-shadow: 0 0 0 3px rgba(182, 239, 236, .12); }
input::placeholder, textarea::placeholder { color: #71848f; }
textarea { resize: vertical; min-height: 128px; line-height: 1.6; font-family: var(--mono); font-size: 14px; }
.show-code { position: absolute; right: 3px; top: 3px; bottom: 3px; min-width: 60px; background: transparent; border: 0; border-radius: 9px; color: var(--accent); font-size: 13px; font-weight: 600; padding: 0 14px; }
.show-code:hover { background: rgba(182, 239, 236, .08); }
.submit-button { margin-top: 16px; width: 100%; justify-content: space-between; }
.form-message { min-height: 1.4em; margin: 12px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--accent); }
.form-message.warn { color: var(--warn); }

.inapp-hint { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; color: var(--warn); background: rgba(255, 213, 154, .08); border: 1px solid rgba(255, 213, 154, .25); }
.download-ticket { margin-top: 14px; padding: 16px; border-radius: 18px; background: rgba(146, 227, 223, .07); border: 1px solid rgba(182, 239, 236, .22); display: grid; gap: 12px; }
.ticket-file { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ticket-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(182, 239, 236, .12); color: var(--accent); font-weight: 700; }
.ticket-text { display: flex; flex-direction: column; min-width: 0; }
.ticket-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 14px; font-weight: 600; line-height: 1.45; overflow: hidden; overflow-wrap: anywhere; }
.ticket-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-go { width: 100%; }
.ticket-timer { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ticket-timer span { display: block; height: 100%; background: var(--accent); transform-origin: left center; transition: transform 1s linear; }
.ticket-hint { margin: 0; font-size: 13px; color: var(--muted); }
.download-ticket.is-used .ticket-go, .download-ticket.is-expired .ticket-go { opacity: .45; pointer-events: none; box-shadow: none; }
.download-ticket.is-expired .ticket-timer span { background: var(--danger); }
.ticket-again { width: 100%; }

/* Footer */
.site-footer { min-height: 96px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 24px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a:hover { color: var(--accent); }

/* Lightbox */
.image-dialog { width: min(1200px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; overflow: hidden; border: 1px solid var(--glass-border); border-radius: 22px; background: #060a0e; color: var(--text); box-shadow: 0 45px 100px rgba(0, 0, 0, .6); }
.image-dialog[open] { display: flex; flex-direction: column; }
.image-dialog::backdrop { background: rgba(0, 4, 8, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.viewer-stage { position: relative; flex: 1 1 auto; height: min(78vh, calc(100dvh - 120px)); min-height: 240px; overflow: hidden; background: #05080b; }
.viewer-backdrop { position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none; object-fit: cover; filter: blur(30px) saturate(1.2) brightness(.45); }
.viewer-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 20px; border-top: 1px solid var(--line); }
.viewer-bar p { margin: 0; min-width: 0; font-size: 14px; color: #d3e2e6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.viewer-controls { display: flex; align-items: center; gap: 8px; flex: none; }
.viewer-count { font-size: 12px; color: var(--muted); margin-right: 4px; font-variant-numeric: tabular-nums; }

/* Admin */
.admin-page .topbar-inner { gap: 16px; }
.admin-pill { margin: auto; border: 1px solid var(--line); background: var(--glass); color: #c5d7dc; padding: 6px 14px; border-radius: 999px; font-size: 12px; }
.admin-main { padding-top: 64px; padding-bottom: 120px; }
.admin-footer { border-top: 1px solid var(--line); padding-block: 20px 24px; color: var(--subtle); font-size: 12px; }
.admin-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.admin-footer a:hover { color: var(--accent); }
.login-panel { width: min(440px, 100%); margin: 24px auto 0; padding: 38px; border-radius: 26px; }
.login-panel h1, .dashboard-intro h1 { font-size: clamp(30px, 3vw, 44px); letter-spacing: -.02em; line-height: 1.2; font-weight: 650; margin: 0 0 11px; }
.login-panel > p:not(.section-kicker), .dashboard-intro p:not(.section-kicker) { color: var(--muted); font-size: 14px; margin: 0 0 30px; }
.stack-form { display: flex; flex-direction: column; min-width: 0; }
.stack-form input, .stack-form textarea { width: 100%; }
.stack-form .button { margin-top: 16px; justify-content: space-between; }
.stack-form label:not(:first-child) { margin-top: 16px; }
.stack-form label small { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--subtle); }
.dashboard-intro { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 26px; }
.dashboard-intro p:not(.section-kicker) { margin-bottom: 0; }
.status-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 22px; }
.status-chip { min-width: 0; padding: 16px 18px; border-radius: 18px; }
.status-chip dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.status-chip dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.status-chip small { display: block; font-size: 12px; font-weight: 400; color: var(--subtle); margin-top: 2px; }
.status-chip.is-warn { border-color: rgba(255, 213, 154, .45); }
.status-chip.is-warn dd { color: var(--warn); }
.status-chip.is-bad { border-color: rgba(255, 176, 168, .5); }
.status-chip.is-bad dd { color: var(--danger); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(330px, .95fr); gap: 22px; align-items: start; }
.admin-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.admin-card { min-width: 0; padding: 28px; border-radius: 22px; background: linear-gradient(145deg, rgba(21, 29, 37, .88), rgba(14, 20, 27, .88)); border: 1px solid var(--line); box-shadow: 0 22px 50px rgba(0, 0, 0, .18); }
.card-heading { margin-bottom: 24px; }
.card-index { display: block; margin-bottom: 11px; }
.card-heading h2 { font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -.035em; margin: 0 0 8px; }
.card-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.approval-divider { height: 1px; background: var(--line); margin: 28px 0; }
.search-row { display: flex; gap: 9px; }
.search-row input { flex: 1; min-width: 0; font-family: var(--mono); }
.search-row .button { margin: 0; }
.approval-result { padding: 20px; margin-top: 16px; border-radius: 16px; background: rgba(7, 11, 16, .55); border: 1px solid var(--line); }
.approval-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.approval-code { font-family: var(--mono); font-size: 14px; letter-spacing: .06em; color: #d4e4e7; }
.status-pill { display: inline-block; padding: 5px 11px; border-radius: 30px; background: rgba(250, 181, 143, .12); color: #ffc7a8; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill.allowed { background: rgba(143, 226, 213, .14); color: var(--accent); }
.card-note { font-size: 13px; color: #a9bcc3; margin: 12px 0 0; }
.decision-row { display: flex; gap: 9px; margin-top: 20px; }
.decision-row .button { flex: 1; }
.decision-allow { background: var(--accent); color: var(--accent-ink); }
.decision-allow:hover:not(:disabled) { background: #d3f9f7; }
.decision-deny { background: rgba(245, 160, 153, .08); color: #ffc2bc; border-color: rgba(248, 169, 163, .28); }
.decision-deny:hover:not(:disabled) { background: rgba(245, 160, 153, .15); }
.decision-row .button[aria-current="true"] { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.current-release { border: 1px solid var(--line); background: rgba(6, 10, 14, .6); color: #c4d6dc; border-radius: var(--radius-sm); font-size: 13px; padding: 12px 14px; margin-bottom: 16px; overflow-wrap: anywhere; }
.version-history { margin: 0 0 18px; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.version-history li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(220, 240, 243, .06); }
.version-history li:first-child { border-top: 0; }
.version-history span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version-history span:last-child { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.version-history .is-active { color: var(--accent); }
.import-report { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 176, 168, .07); border: 1px solid rgba(255, 176, 168, .2); font-size: 12px; color: #ffcdc7; font-family: var(--mono); white-space: pre-wrap; max-height: 160px; overflow: auto; }
input[type="file"] { padding: 8px; min-height: 52px; font-size: 13px; color: var(--muted); cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 9px 16px; min-height: 34px; border: 1px solid var(--line-strong); border-radius: 999px; background: #1f2a31; color: #ecf6f7; font: inherit; font-weight: 600; cursor: pointer; transition: background .2s; }
input[type="file"]::file-selector-button:hover { background: #283840; }
.file-note { margin: 8px 0 0; font-size: 12px; color: var(--subtle); overflow-wrap: anywhere; }
.upload-progress { width: 100%; height: 6px; margin-top: 12px; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.upload-progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transform-origin: left center; transform: scaleX(0); transition: transform .2s linear; }
.published-results { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.published-results h3 { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.published-results h3 small { font-size: 12px; font-weight: 400; color: var(--muted); }
.published-empty { font-size: 13px; color: var(--muted); margin: 0; }
.published-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(220, 240, 243, .07); }
.published-item:first-child { border-top: 0; }
.published-item img { flex: none; width: 64px; height: 44px; object-fit: contain; background: #0a0f14; border-radius: 8px; border: 1px solid var(--line); }
.published-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.published-item-text strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.published-item-text time { font-size: 12px; color: var(--muted); }
.published-item button { flex: none; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: #ffb5af; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.published-item button:hover { background: rgba(245, 160, 153, .1); }
.published-more { width: 100%; margin-top: 14px; }
.audit-list { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.audit-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid rgba(220, 240, 243, .07); min-width: 0; }
.audit-list li:first-child { border-top: 0; }
.audit-list li span:first-child { color: #dce8eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-list li span:last-child { color: var(--subtle); font-variant-numeric: tabular-nums; }
.audit-list li.is-warn span:first-child { color: var(--warn); }

/* Responsive */
@media (max-width: 1020px) {
  :root { --gutter: 24px; }
  .download-section { gap: 28px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --gutter: 18px; --header-h: 60px; }
  .glass-nav { display: none; }
  .brand { font-size: 16px; letter-spacing: .16em; }
  .brand-mark { width: 27px; height: 27px; }
  .hero { padding: 28px 0 20px; }
  .hero h1 { font-size: clamp(38px, 10.5vw, 56px); }
  .hero-lead { font-size: 16px; margin: 18px 0 26px; }
  .hero-meta { margin-top: 18px; }
  .record-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(440px, 100%); gap: 16px; }
  .record-grid > :only-child { grid-column: 1 / -1; width: min(180px, 100%); justify-self: center; }
  .section-wrap { padding-top: 64px; padding-bottom: 56px; }
  .records { padding-top: 44px; padding-bottom: 56px; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; margin-bottom: 22px; }
  .download-section { gap: 24px; padding-top: 48px; padding-bottom: 76px; }
  .download-description { margin: 16px auto 20px; }
  .download-stage::before { inset: -40px 0; }
  .status-strip { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-intro { align-items: start; }
  .admin-main { padding-top: 40px; }
  .image-dialog { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .viewer-stage { height: auto; }
  .viewer-bar { flex-wrap: wrap; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .viewer-bar p { flex: 1 1 100%; }
  .viewer-controls { width: 100%; justify-content: flex-end; }
}
@media (max-width: 560px) {
  .record-grid, .skeleton-grid { gap: 12px; }
  .tile-open .media { border-radius: 13px; }
  .tile-open .media.is-portrait { aspect-ratio: 4 / 5; }
  .tile-caption { flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 8px; font-size: 13px; }
  .tile-caption time { white-space: normal; }
}
@media (max-width: 480px) {
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { justify-content: space-between; }
  .download-form, .login-panel { padding: 22px; border-radius: 22px; }
  .admin-card { padding: 20px; }
  .dashboard-intro { flex-direction: column; }
  .decision-row { flex-direction: column; }
  .search-row { flex-wrap: wrap; }
  .search-row input { flex-basis: 100%; }
  .search-row .button { width: 100%; justify-content: center; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 0; }
}
@media (hover: none) {
  .button:hover:not(:disabled), .tile-open:hover .media { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Download denial page */
.denial-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; }
.denial-card { width: min(460px, 100%); padding: 36px; border-radius: 26px; text-align: left; }
.denial-text { font-size: clamp(22px, 5vw, 28px); font-weight: 650; letter-spacing: -.02em; line-height: 1.4; color: var(--danger); margin: 0 0 28px; }
.denial-card .button { width: 100%; justify-content: space-between; }
.denial-attribution { display: inline-block; margin-top: 24px; color: var(--subtle); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.denial-attribution:hover { color: var(--muted); }

/* ==========================================================================
   Glass v2 (2026-09-24): a brighter light field under the glass, one layered
   material (rim light, inner shade, grain, pointer/tilt specular) and the
   naked-eye hero stage. Appended last so it overrides the base rules above.
   Custom properties that read --mx/--my are declared on the element itself,
   because a var() inside a :root custom property resolves at :root.
   ========================================================================== */
:root {
  --glass-fill: linear-gradient(158deg, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, .045) 36%, rgba(255, 255, 255, .02) 64%, rgba(255, 255, 255, .055) 100%);
  --glass-rim: linear-gradient(172deg, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, .16) 22%, rgba(255, 255, 255, .05) 52%, rgba(182, 239, 236, .26) 100%);
  --glass-depth: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(255, 255, 255, .05), inset 0 0 30px rgba(255, 255, 255, .025), 0 1px 1px rgba(0, 0, 0, .35), 0 26px 64px -22px rgba(0, 0, 0, .72);
  --blur: blur(30px) saturate(190%) brightness(1.05);
}

/* Light field: saturated, slowly drifting colour for the glass to refract. */
.ambient { background: radial-gradient(1400px 900px at 50% -18%, rgba(34, 96, 116, .38), rgba(34, 96, 116, 0) 62%), var(--bg); }
/* Static light field: a drifting one re-composited the whole glass UI at display rate on every page position. */
.orb { opacity: 1; }
.orb-a { width: 880px; height: 880px; top: -380px; right: -220px; background: radial-gradient(circle, rgba(64, 214, 204, .40), rgba(64, 214, 204, 0) 64%); }
.orb-b { width: 760px; height: 760px; top: 30%; left: -340px; background: radial-gradient(circle, rgba(88, 104, 255, .30), rgba(88, 104, 255, 0) 66%); }
.orb-c { width: 700px; height: 700px; bottom: -300px; right: 6%; background: radial-gradient(circle, rgba(168, 108, 255, .22), rgba(168, 108, 255, 0) 68%); }
.ambient::after { content: ""; position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* One glass material. */
.glass-panel, .glass-nav, .state-card, .button-quiet {
  --glass-spec: radial-gradient(360px circle at var(--mx, var(--gx, 28%)) var(--my, var(--gy, 0%)), rgba(255, 255, 255, .11), rgba(255, 255, 255, 0) 62%);
  position: relative;
  isolation: isolate;
  background: var(--glass-spec), var(--glass-fill);
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: var(--glass-depth);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.glass-panel::before, .glass-nav::before, .state-card::before, .button-quiet::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 1;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: var(--glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.button-quiet:hover:not(:disabled) { background: var(--glass-spec), linear-gradient(158deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .07) 45%, rgba(255, 255, 255, .05)); }
#state-loading { box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
#state-loading::before { display: none; }
.button-primary {
  background: linear-gradient(180deg, #e4fffd 0%, #b6efec 52%, #92dbd6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(6, 18, 21, .14), 0 0 0 1px rgba(255, 255, 255, .20), 0 12px 32px -8px rgba(110, 220, 214, .50), 0 0 46px -10px rgba(110, 220, 214, .40);
}
.button-primary:hover:not(:disabled) { background: linear-gradient(180deg, #f3fffe 0%, #cdf7f4 52%, #a6e7e3 100%); }
.topbar { background: linear-gradient(180deg, rgba(7, 10, 14, .74), rgba(7, 10, 14, .48)); border-bottom-color: rgba(255, 255, 255, .07); -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%); }
.tile-open .media { border-color: rgba(255, 255, 255, .10); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 1px rgba(0, 0, 0, .4), 0 22px 50px -18px rgba(0, 0, 0, .72); }
.tile-open .media::after {
  --glass-spec: radial-gradient(420px circle at var(--mx, var(--gx, 20%)) var(--my, var(--gy, 0%)), rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 60%);
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 34%), var(--glass-spec);
  mix-blend-mode: screen;
  opacity: .75;
  transition: opacity .25s;
}
.tile-open:hover .media::after { opacity: 1; }
.state-card { min-height: 240px; border-radius: var(--radius-xl); }
.empty-symbol { border-color: rgba(255, 255, 255, .16); background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .16), rgba(255, 255, 255, .02) 70%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 30px -10px rgba(110, 220, 214, .45); }

/* Tighter rhythm. */
.section-wrap { padding-top: 64px; padding-bottom: 64px; }
.records { padding-top: 0; }
.records-more { margin-top: 28px; }
.download-section { margin-top: 8px; padding-top: 84px; padding-bottom: 96px; gap: 64px; }
.site-footer { border-top-color: rgba(255, 255, 255, .07); }

/* Naked-eye background: the 3D T** lives in the page's own light field (fixed, behind all content). The hero keeps
   an open area under the buttons where it floats; the canvas fades in once the first frame is drawn. */
.ambient-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.ambient.is-live .ambient-canvas { opacity: 1; }
.hero { flex-direction: column; align-items: center; }
/* The open space is also bounded by the screen height (the hero copy above it is ~440px, plus a margin), so the mark is never cut by
   the bottom of the first screen; below 90px (where the script draws no mark) it folds to 24px instead of leaving an empty band. */
.hero-space { width: 100%; height: max(24px, min(min(34vw, 440px, 100vh - 470px), (min(34vw, 440px, 100vh - 470px) - 90px) * 10000)); height: max(24px, min(min(34vw, 440px, 100svh - 470px), (min(34vw, 440px, 100svh - 470px) - 90px) * 10000)); pointer-events: none; }
.ambient.no-mark ~ main .hero-space { height: 24px; }
@media (max-width: 760px) {
  .hero-space { height: max(24px, min(min(58vw, 280px, 100vh - 490px), (min(58vw, 280px, 100vh - 490px) - 90px) * 10000)); height: max(24px, min(min(58vw, 280px, 100svh - 490px), (min(58vw, 280px, 100svh - 490px) - 90px) * 10000)); }
  .section-wrap { padding-top: 48px; padding-bottom: 44px; }
  .download-section { padding-top: 60px; padding-bottom: 72px; }
}
/* Printed pages and forced colours (Windows high contrast) get the plain page. */
@media print { .ambient-canvas { display: none; } .hero-space { height: 24px; } }
@media (forced-colors: active) { .ambient-canvas { display: none; } .hero-space { height: 24px; } }

/* Layout reconciliation: keep the version area central and the records compact. */
.records { padding-top: 64px; padding-bottom: 72px; }
.records .state-card { min-height: 190px; }
.records-more { margin-top: 22px; }
.download-section { margin-top: 20px; padding-top: 64px; padding-bottom: 104px; gap: 28px; }
@media (max-width: 760px) {
  .records { padding-top: 44px; padding-bottom: 56px; }
  .download-section { padding-top: 48px; padding-bottom: 76px; gap: 24px; }
}

/* Compact rooms stay below the version download. */
.live-section {
  width: min(900px, calc(100% - var(--gutter) * 2));
  border-top: 1px solid var(--line);
  padding-top: 56px;
  padding-bottom: 72px;
}
.live-heading { text-align: center; margin-bottom: 22px; }
.live-heading h2 { margin: 0; font-size: clamp(28px, 2.7vw, 36px); font-weight: 650; line-height: 1.16; letter-spacing: -.02em; }
.live-heading > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.live-room {
  min-width: 0;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgba(225, 246, 249, .075), rgba(160, 205, 212, .025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 16px 36px -20px rgba(0, 0, 0, .7);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.live-room-index {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(182, 239, 236, .045);
  color: var(--accent);
  font: 600 13px/1 var(--mono);
  letter-spacing: .06em;
}
.live-room-copy { min-width: 0; flex: 1 1 auto; }
.live-room-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.live-room-copy h3 { margin: 0 0 4px; color: var(--text); font-size: 16px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.live-room-title > span { color: var(--accent); font-size: 11px; }
.live-room-status { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.live-status-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #82929a; }
.live-room-action, .live-dialog-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(182, 239, 236, .08);
  color: var(--accent);
  font: 600 13px/1.35 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.live-room-action:hover, .live-dialog-close:hover { background: rgba(182, 239, 236, .16); }
.live-room-action:focus-visible, .live-dialog-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.live-dialog {
  width: min(960px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 16px);
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: #090f15;
  color: var(--text);
  box-shadow: 0 45px 100px rgba(0, 0, 0, .7);
}
.live-dialog::backdrop { background: rgba(0, 4, 8, .84); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.live-dialog-head { position: sticky; top: -18px; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 0 10px; background: #090f15; }
.live-dialog-head .section-kicker { margin: 0 0 2px; }
.live-dialog-head h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.live-dialog-close { min-width: 70px; }
.live-dialog-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.live-dialog-hint a { color: var(--accent); text-underline-offset: 3px; }
.live-player-shell { width: min(100%, calc((100dvh - 165px) * 1.77778)); margin: 0 auto; aspect-ratio: 16 / 9; background: #030609; }
.live-player-shell iframe { display: block; width: 100%; height: 100%; border: 0; }
.release-retry { display: block; min-height: 44px; margin: 8px auto 0; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--accent); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.release-retry:hover { color: #e4fffd; }
@media (max-width: 760px) {
  .live-section { padding-top: 44px; padding-bottom: 56px; }
  .live-grid { grid-template-columns: 1fr; gap: 10px; }
  .live-room { min-height: 76px; padding: 12px 16px; }
  .live-room-index { width: 42px; height: 42px; }
}
@media (max-width: 380px) {
  .live-room { display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 12px; }
  .live-room-action { grid-column: 2; justify-self: start; }
}
@media (max-height: 440px) and (orientation: landscape) {
  .live-dialog { padding: 10px 14px; }
  .live-dialog-head { top: -10px; }
  .live-dialog-head h2 { font-size: 16px; }
  .live-dialog-hint { margin-bottom: 6px; }
  .live-player-shell { width: min(100%, calc((100dvh - 125px) * 1.77778)); }
}
