/* Pixora - modern minimal gallery */

:root {
    --bg: #f4f4f1;
    --surface: #ffffff;
    --surface-soft: #fafaf7;
    --mat: #ecece6;
    --ink: #111110;
    --ink-soft: #3b3b36;
    --muted: #5c5c55;
    --muted-soft: #6f6f67;
    --line: #e3e3dc;
    --line-strong: #cecec4;
    --accent: #ff3d00;
    --accent-strong: #d63200;
    --accent-soft: #fff1ec;
    --accent-line: #ffd6c7;

    --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;

    --r-xl: 24px;
    --r-lg: 18px;
    --r-md: 14px;
    --r-sm: 10px;

    --shadow: 0 1px 2px rgba(17, 17, 16, 0.04);
    --shadow-lift: 0 18px 40px -24px rgba(17, 17, 16, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--ink);
    color: var(--bg);
}

img {
    max-width: 100%;
    display: block;
}

button,
textarea,
input {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page {
    min-height: calc(100vh - 96px);
}

.shell {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ---------- topbar ---------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 78px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    margin-right: 4px;
}

.brand-mark {
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex: none;
}

.brand-word {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.brand-note {
    padding-left: 14px;
    border-left: 1px solid var(--line-strong);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.account {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line);
}

.avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

.account-name {
    font-size: 0.86rem;
    font-weight: 500;
}

.link-muted {
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
    padding: 6px 2px;
}

.link-muted:hover {
    color: var(--ink);
}

/* ---------- page head ---------- */

main {
    display: block;
}

/* ---------- workspace ---------- */

.workspace {
    display: grid;
    grid-template-columns: minmax(320px, 408px) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    padding-top: 32px;
}

.composer,
.stage-panel {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow);
    padding: 24px;
}

.composer {
    gap: 18px;
}

.stage-panel {
    gap: 14px;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 18px;
}

.step {
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent-strong);
    font-variant-numeric: tabular-nums;
}

.card-title {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-value {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.counter {
    margin-left: auto;
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted-soft);
}

.counter-total {
    color: var(--muted-soft);
}

/* ---------- prompt ---------- */

.field {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px 16px 12px;
    transition: border-color 160ms ease, background 160ms ease;
}

.field:focus-within {
    border-color: var(--ink);
    background: var(--surface);
}

.prompt-input {
    display: block;
    width: 100%;
    min-height: 132px;
    resize: none;
    border: 0;
    padding: 0;
    background: transparent;
    font-size: 1rem;
    line-height: 1.6;
    outline: none;
}

.prompt-input::placeholder {
    color: var(--muted-soft);
}

.prompt-input:disabled {
    opacity: 0.6;
}

.field-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-soft);
}

.quota-note {
    text-align: right;
}

.quota-note.is-empty {
    color: var(--accent-strong);
}

/* ---------- ratios ---------- */

.ratios {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.ratio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 64px;
    padding: 10px 2px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.ratio:hover:not(:disabled) {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.ratio-shape {
    display: block;
    height: 15px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    opacity: 0.42;
}

.ratio-key {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
}

.ratio.selected {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

.ratio.selected .ratio-shape {
    opacity: 0.85;
}

.ratio.selected .ratio-key {
    color: var(--bg);
}

.ratio:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ---------- settings ---------- */

.settings {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

.setting {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-name {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.setting-hint {
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--muted);
}

.setting-toggle {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    cursor: pointer;
}

.setting-toggle .setting-text {
    flex: 1;
}

.creativity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.creativity-end {
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-soft);
    white-space: nowrap;
}

.creativity-range {
    flex: 1;
    min-width: 0;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.creativity-range:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.toggle {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ink);
    cursor: pointer;
}

.toggle:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.btn-primary {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
    border-color: var(--ink);
    background: var(--surface-soft);
}

.btn-small {
    min-height: 36px;
    padding: 8px 13px;
    font-size: 0.76rem;
}

.icon {
    width: 16px;
    height: 16px;
    flex: none;
}

.btn-generate {
    width: 100%;
    min-height: 56px;
    margin-top: auto;
    padding: 0 18px;
    justify-content: space-between;
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    border-radius: var(--r-md);
}

.btn-generate:hover:not(:disabled) {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: #fff;
}

.btn-generate:disabled {
    opacity: 0.32;
}

/* ---------- status + alert ---------- */

.stage-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

.stage {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-soft);
}

.alert {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--accent-line);
    border-radius: var(--r-md);
    background: var(--accent-soft);
    font-size: 0.84rem;
    line-height: 1.5;
    color: #63210b;
}

.alert strong {
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

/* ---------- stage ---------- */

.stage-mat {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 420px;
    padding: 28px;
    background: var(--mat);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.canvas {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    height: 100%;
}

.canvas-frame {
    display: block;
    width: 58%;
    max-width: 210px;
    height: auto;
    max-height: 210px;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.55);
}

.canvas-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.16rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-align: center;
}

.canvas-note {
    margin: -6px 0 0;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}

.result-canvas {
    gap: 0;
}

.result-canvas img {
    max-width: 100%;
    max-height: min(56vh, 520px);
    width: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-lift);
}

.progress-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(17, 17, 16, 0.06);
    overflow: hidden;
}

.progress-line span {
    display: block;
    width: 34%;
    height: 100%;
    background: var(--accent);
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.stage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stage-actions .btn {
    flex: 1 1 auto;
}

/* ---------- spinner ---------- */

.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 1.5px;
    border-color: rgba(244, 244, 241, 0.28);
    border-top-color: var(--bg);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- archive ---------- */

.archive {
    margin-top: 56px;
}

.archive-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.archive-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.hint {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-soft);
}

.history-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
}

.thumb {
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface-soft);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 160ms ease, transform 200ms ease;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.thumb:hover {
    border-color: var(--ink);
}

.thumb:hover img {
    transform: scale(1.04);
}

/* ---------- lightbox ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(14, 14, 13, 0.92);
    backdrop-filter: blur(8px);
    animation: fade 180ms ease;
}

.lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 100%;
}

.lightbox-inner img {
    max-width: min(90vw, 1100px);
    max-height: 78vh;
    width: auto;
    border-radius: var(--r-sm);
}

.lightbox-bar {
    display: flex;
    gap: 8px;
}

.lightbox-bar .btn-ghost {
    border-color: rgba(244, 244, 241, 0.35);
    color: var(--bg);
}

.lightbox-bar .btn-ghost:hover {
    border-color: var(--bg);
    background: rgba(244, 244, 241, 0.08);
}

.lightbox-bar .btn-primary {
    background: var(--bg);
    border-color: var(--bg);
    color: var(--ink);
}

.lightbox-bar .btn-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: #fff;
}

@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- access states ---------- */

.center-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 52vh;
    color: var(--muted);
    font-size: 0.82rem;
}

.center-state p {
    margin: 0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.66rem;
    font-weight: 500;
}

.denied-card {
    max-width: 560px;
    margin: 76px auto;
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow);
}

.denied-card h1 {
    margin: 10px 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.denied-card > p:not(.section-label) {
    margin: 0 0 22px;
    color: var(--ink-soft);
    font-size: 0.94rem;
}

.denied-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.section-label {
    margin: 0;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- admin panel ---------- */

.admin-main {
    display: grid;
    gap: 20px;
    padding-top: 32px;
}

.admin-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow);
}

.admin-empty {
    margin: 0;
    padding: 6px 0;
    color: var(--muted-soft);
    font-size: 0.85rem;
}

.admin-notice {
    margin: 0;
    padding: 10px 14px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: var(--r-sm);
    color: var(--accent-strong);
    font-size: 0.8rem;
}

.admin-users {
    display: flex;
    flex-direction: column;
}

.admin-user {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 72px auto;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.admin-user:first-child {
    border-top: 0;
}

.admin-user-id {
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-meter {
    display: block;
    height: 6px;
    overflow: hidden;
    background: var(--mat);
    border-radius: 999px;
}

.admin-meter > span {
    display: block;
    height: 100%;
    background: var(--ink);
    border-radius: inherit;
}

.admin-user-count {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--ink-soft);
}

.admin-user-count.is-empty {
    color: var(--accent-strong);
}

.admin-entries {
    display: flex;
    flex-direction: column;
}

.admin-entry {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.admin-entry:first-child {
    border-top: 0;
    padding-top: 0;
}

.admin-thumb {
    aspect-ratio: 1;
    width: 120px;
    padding: 0;
    overflow: hidden;
    background: var(--mat);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    cursor: zoom-in;
}

.admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.admin-thumb:hover img {
    transform: scale(1.04);
}

.admin-thumb-empty {
    display: block;
    cursor: default;
}

.admin-entry-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.admin-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.admin-sep {
    color: var(--line-strong);
}

.admin-status {
    padding: 1px 8px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    color: var(--accent-strong);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-prompt {
    margin: 0;
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.admin-toggle {
    align-self: flex-start;
    padding: 2px 0;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 0.74rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.admin-toggle:hover {
    color: var(--ink);
}

.admin-details {
    display: grid;
    gap: 8px;
    margin: 4px 0 0;
    padding: 12px 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

.admin-details > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
}

.admin-details dt {
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-details dd {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.admin-more {
    align-self: center;
}

/* ---------- footer ---------- */

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1240px;
    margin: 72px auto 0;
    padding: 24px 40px 34px;
    border-top: 1px solid var(--line);
    font-size: 0.68rem;
    color: var(--muted-soft);
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.footer-note {
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.6rem;
    font-weight: 500;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
    .shell {
        padding: 0 28px;
    }

    .site-footer {
        padding-left: 28px;
        padding-right: 28px;
    }

    .workspace {
        grid-template-columns: minmax(300px, 376px) minmax(0, 1fr);
    }
}

@media (max-width: 940px) {
    .workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .stage-panel {
        min-height: 0;
    }

    .stage-mat {
        min-height: 340px;
    }
}

@media (max-width: 640px) {
    .shell {
        padding: 0 16px;
    }

    .topbar {
        height: 64px;
        gap: 10px;
    }

    .brand-note {
        display: none;
    }

    .account-name {
        display: none;
    }

    .composer,
    .stage-panel {
        padding: 18px;
        border-radius: var(--r-lg);
    }

    .ratios {
        gap: 5px;
    }

    .ratio {
        min-height: 58px;
    }

    .ratio-shape {
        height: 13px;
    }

    .ratio-key {
        font-size: 0.64rem;
    }

    .stage-mat {
        min-height: 260px;
        padding: 18px;
        border-radius: var(--r-md);
    }

    .canvas-frame {
        max-width: 52%;
    }

    .result-canvas img {
        max-height: 60vh;
    }

    .stage-actions {
        flex-direction: column;
    }

    .stage-actions .btn {
        width: 100%;
    }

    .history-strip {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 8px;
    }

    .denied-card {
        margin: 40px auto;
        padding: 26px;
        border-radius: var(--r-lg);
    }

    .admin-card {
        padding: 18px;
        border-radius: var(--r-lg);
    }

    .admin-user {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 6px;
    }

    .admin-user .admin-meter {
        grid-column: 1 / -1;
        order: 3;
    }

    .admin-entry {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 12px;
    }

    .admin-thumb {
        width: 88px;
    }

    .admin-details > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }

    .denied-actions {
        flex-direction: column;
    }

    .site-footer {
        margin-top: 52px;
        padding: 20px 16px 28px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

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