:root {
    color-scheme: light;
    --canvas: #f4f6f9;
    --surface: #fff;
    --paper: #eaf0f8;
    --ink: #1c2533;
    --muted: #536278;
    --line: #d9e1ec;
    --accent: #244f99;
    --accent-strong: #193d7b;
    --accent-soft: #e3ecfa;
    --link: #2456a6;
    --danger: #983d38;
    --good: #285a40;
    --rail-width: 182px;
    --radius: 12px;
    --panel-pad: clamp(14px, 2vw, 20px);
    --control-height: 40px;
    --compact-height: 34px;
    --action-gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.55;
    color: var(--ink);
    background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--link); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.icon { flex: 0 0 auto; vertical-align: middle; }
.muted { color: var(--muted); }
h1 { font-size: clamp(1.72rem, 3.5vw, 2.55rem); letter-spacing: -.045em; line-height: 1.2; }
h2 { font-size: 1.12rem; line-height: 1.4; }
h3 { font-size: .94rem; }

.shell { display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); min-height: 100dvh; }
.rail {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 25px 13px 18px;
    background: var(--paper);
    border-right: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand .icon { width: 29px; height: 29px; color: var(--accent); }
.rail .brand { padding-inline: 5px; }
.rail nav { display: grid; gap: 4px; }
.rail nav a, .logout {
    display: flex;
    gap: 9px;
    align-items: center;
    min-height: 44px;
    padding: 8px 10px;
    color: var(--muted);
    text-align: left;
    text-decoration: none;
    border-radius: 8px;
    font-size: .88rem;
    white-space: nowrap;
}
.rail nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); font-weight: 700; }
.rail nav a:hover, .logout:hover { background: var(--surface); color: var(--ink); }
.rail-end { display: grid; gap: 4px; margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.rail-end > span { padding-inline: 10px; font-size: .82rem; }
.logout { width: 100%; }
.bare { border: 0; background: transparent; }
.workspace { width: min(100%, 1460px); min-width: 0; margin-inline: auto; padding: 28px clamp(16px, 3vw, 42px) 44px; }
.back { display: inline-block; margin-bottom: 15px; color: var(--muted); text-decoration: none; font-size: .88rem; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 22px; }
.page-heading > div:first-child { flex: 1 1 245px; min-width: 0; }
.page-heading p { margin-top: 8px; font-size: .92rem; }
.heading-actions { max-width: 100%; flex: 0 1 auto; }
.heading-actions.row-actions { justify-content: flex-end; gap: var(--action-gap) 12px; }
.action-cluster { display: flex; align-items: center; flex-wrap: wrap; gap: var(--action-gap); min-width: 0; }
.heading-actions .collection-board-select { width: clamp(110px, 11vw, 160px); max-width: 100%; }
.collection-board-link { max-width: 100%; }
.collection-board-link span { max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
.collection-empty { font-size: .82rem; }
.collection-copy-status { flex-basis: 100%; color: var(--muted); font-size: .82rem; text-align: end; }
.collection-copy-status:empty { display: none; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: var(--panel-pad); }
.panel-heading p { font-size: .84rem; margin-top: 4px; }
.count { display: inline-block; padding: 2px 7px; color: var(--muted); background: var(--paper); border-radius: 5px; font-size: .75rem; }
.count { margin-left: 4px; vertical-align: 2px; font-variant-numeric: tabular-nums; }
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    min-height: var(--control-height);
    padding: 7px 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
}
.button:hover:enabled, a.button:hover { background: var(--paper); border-color: #aebed4; }
.button.primary { color: #fff; border-color: var(--accent); background: var(--accent); }
.button.primary:hover:enabled, a.button.primary:hover { color: #fff; background: var(--accent-strong); border-color: var(--accent-strong); }
.button.danger { color: var(--danger); border-color: #e4bfba; }
.button.danger:hover { background: #faeeeb; border-color: #d49b93; }
.button.small { min-height: var(--compact-height); padding: 5px 9px; font-size: .81rem; }
.button.small .icon { width: 16px; height: 16px; }
.quiet-link { display: inline-flex; gap: 4px; align-items: center; color: var(--link); font-size: .85rem; }
.quiet-link .icon { width: 16px; height: 16px; }

label, legend { color: var(--ink); font-size: .83rem; font-weight: 650; }
label { display: grid; gap: 5px; min-width: 0; }
input:not([type=checkbox], [type=radio]), select, textarea {
    width: 100%;
    min-width: 0;
    min-height: var(--control-height);
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 400;
    line-height: 1.4;
}
input:not([type=checkbox], [type=radio], [type=hidden]), select { height: var(--control-height); }
input[type=file] { padding: 7px; }
input[readonly] { background: var(--paper); color: var(--muted); }
input::file-selector-button { margin-right: 7px; color: var(--ink); background: var(--paper); border: 0; padding: 4px 7px; border-radius: 4px; cursor: pointer; }
textarea { resize: vertical; min-height: 110px; }
small.muted { font-weight: 400; }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--action-gap); min-width: 0; }
.filters label { min-width: min(100%, 128px); }
.filters input, .filters select { max-width: 245px; }
.filters .quiet-link { min-height: var(--control-height); margin-inline: 3px; }
.empty { padding: 32px 20px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }
.empty p + a { margin-top: 7px; }
.empty.compact { padding: 16px; font-size: .88rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .88rem; }
table thead { color: var(--muted); background: #f3f6fb; }
th, td { padding: 13px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-inline-start: var(--panel-pad); }
th:last-child, td:last-child { padding-inline-end: var(--panel-pad); }
thead th { white-space: nowrap; font-size: .79rem; }
.row-title { display: block; max-width: 30ch; overflow-wrap: anywhere; }
td time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: var(--action-gap); flex-wrap: wrap; min-width: 0; }
.work-table th[scope="row"] { min-width: 11ch; }
.work-table td:nth-child(2) { width: 1%; white-space: nowrap; }
.work-table td:last-child { width: min(55%, 530px); }
.work-url { display: block; max-width: 46ch; overflow-wrap: anywhere; }

.submission-limit-panel, .video-upload-limit-panel { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 16px; padding: var(--panel-pad); }
.submission-limit-panel p, .video-upload-limit-panel p { margin-top: 4px; font-size: .83rem; }
.submission-limit-panel input, .video-upload-limit-panel input { max-width: 150px; }
.submission-ip { display: block; margin-top: 3px; max-width: 28ch; font-size: .76rem; overflow-wrap: anywhere; }
.submission-filters { border-bottom: 1px solid var(--line); }
.submission-filters .filters { width: 100%; }
.submission-overview { padding: var(--panel-pad); }
.submission-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
    gap: 9px;
    margin: 9px 0 0;
}
.submission-stats > div { min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #f6f8fc; }
.submission-stats > div:last-child { border-color: #c9d8ee; background: var(--accent-soft); }
.submission-stats dt { color: var(--muted); font-size: .8rem; font-weight: 600; }
.submission-stats dd { margin: 2px 0 0; font-size: 1.32rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.submission-stats .submission-total { color: var(--accent-strong); }
.submission-table .work-url { min-width: 16ch; white-space: pre-wrap; }
.submission-cell-label { display: none; }
.submission-work-image { margin-top: 5px; }
.submission-status { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.submission-status.pending { color: #755421; background: #fff1d9; }
.submission-status.processed { color: var(--good); background: #e9f1e9; }
.submission-processed-at { display: block; margin-top: 3px; font-size: .75rem; }
.submission-amount { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.submission-action { min-width: 126px; }
.submission-action summary::-webkit-details-marker { display: none; }
.submission-action form { display: grid; justify-items: start; gap: 6px; margin-top: 8px; }
.submission-action label { width: 100%; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 390px); gap: clamp(14px, 2vw, 22px); align-items: start; }
.editor-form { min-width: 0; }
.editor-settings, .content-panel { padding: var(--panel-pad); }
.editor-settings h2 { margin-bottom: 12px; }
.share-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.editor-board { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f6f8fc; }
.editor-board-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--action-gap); }
.editor-board-create { grid-template-columns: minmax(0, 1fr) auto auto; }
.editor-board-create, .editor-board-links { margin-top: 9px; }
.editor-board-note, .editor-board-status { font-size: .8rem; }
.editor-board-note, .editor-board-status:not(:empty) { margin-top: 6px; }
.editor-board-status { color: var(--muted); }
.editor-board-status.error { color: var(--danger); }
.artwork-themes { min-width: 0; margin: 14px 0 0; padding: 0; border: 0; }
.artwork-themes legend { padding: 0; margin-bottom: 5px; }
.theme-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 98px), 1fr)); gap: 10px; }
.theme-option {
    position: relative;
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
    padding: 6px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
}
.theme-option:hover { border-color: #9eafc9; }
.theme-option:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.theme-option:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.theme-option input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.theme-option-title { padding: 1px 3px 0; overflow-wrap: anywhere; font-size: .88rem; font-weight: 750; }
.theme-option small { padding: 0 3px; color: var(--muted); font-size: .72rem; font-weight: 500; }
.theme-sample {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 84px;
    padding: 10px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--sample-canvas, #e8f0fa);
}
.theme-sample-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 96px;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}
.theme-app-icon {
    position: absolute;
    z-index: 1;
    top: 9px;
    left: 9px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 0 0 2px rgb(255 255 255 / 85%), 0 3px 8px rgb(22 32 51 / 20%);
    object-fit: contain;
}
.theme-option-check {
    position: absolute;
    z-index: 1;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    visibility: hidden;
}
.theme-option input:checked + .theme-sample .theme-option-check { visibility: visible; }
.theme-option-check .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.theme-sample-default .theme-mini-page {
    position: relative;
    width: min(100%, 94px);
    height: 58px;
    overflow: hidden;
    border: 1px solid #adc3df;
    border-radius: 7px;
    background: linear-gradient(to bottom, #eef4fb 23px, #fff 23px);
    box-shadow: inset 0 2px #355d91;
}
.theme-mini-page::before, .theme-mini-page::after {
    position: absolute;
    left: 11%;
    height: 3px;
    border-radius: 2px;
    content: '';
}
.theme-sample-default .theme-mini-page::before { top: 11px; width: 41%; background: #355d91; }
.theme-sample-default .theme-mini-page::after { top: 33px; width: 64%; background: #adc3df; box-shadow: 0 8px #adc3df; }
.theme-sample:not(.theme-sample-default) { padding: 0; }
:where(.theme-sample:not(.theme-sample-default)) .theme-mini-page {
    position: relative;
    width: 64%;
    height: 42px;
    margin-inline-start: 12%;
    border: 1px solid currentColor;
    border-radius: 5px;
    background: #fff;
}
:where(.theme-sample:not(.theme-sample-default)) .theme-mini-page::before,
:where(.theme-sample:not(.theme-sample-default)) .theme-mini-page::after {
    left: 14%;
    height: 2px;
    background: currentColor;
}
.theme-mini-page::before { top: 12px; width: 56%; }
.theme-mini-page::after { top: 19px; width: 38%; }
:where(.theme-sample:not(.theme-sample-default)) .theme-mini-page::after { opacity: .46; }
.theme-sample-xianyu { --sample-canvas: #ffe68e; color: #8b600f; }
.theme-sample-kuaishou { --sample-canvas: #ffe8dc; color: #ac3a17; }
.theme-sample-douyin { --sample-canvas: #1a1925; color: #8de7de; }
.theme-sample-bilibili { --sample-canvas: #fceaf4; color: #3a879f; }
.theme-sample-xianyu .theme-mini-page { border-style: dashed; border-radius: 2px; background: #fff8da; box-shadow: 3px 4px #d3983766; transform: rotate(-6deg); }
.theme-sample-kuaishou .theme-mini-page { border-left-width: 7px; border-radius: 0 3px 3px 0; box-shadow: 4px 4px #ecae94; }
.theme-sample-kuaishou .theme-mini-page::before { height: 4px; border-radius: 0; }
.theme-sample-douyin .theme-mini-page { width: 49%; border-radius: 1px; background: #2a2939; box-shadow: 3px 3px #fb779b; }
.theme-sample-douyin .theme-mini-page::before { top: 8px; width: 29%; }
.theme-sample-douyin .theme-mini-page::after { inset: auto 14% 7px auto; width: 54%; opacity: .8; }
.theme-sample-bilibili .theme-mini-page { height: 36px; margin-bottom: 4px; border-radius: 11px 11px 11px 2px; box-shadow: 3px 4px #edbad3; }
.theme-sample-bilibili .theme-mini-page::before { left: 23%; width: 54%; }
.theme-sample-bilibili .theme-mini-page::after { left: 29%; width: 42%; }
.content-panel { margin-top: 16px; }
.content-heading p { margin-top: 3px; font-size: .8rem; }
.content-panel .empty { margin-top: 12px; }
.library-bulk { display: grid; gap: 9px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f6f8fc; }
.library-bulk textarea { min-height: 88px; }
.library-upload { position: relative; cursor: pointer; }
.library-upload input { position: absolute; inset: 0; height: 100%; min-height: 0; opacity: 0; cursor: inherit; }
.library-upload:focus-within { outline: 2px solid var(--link); outline-offset: 3px; }
.library-upload:has(input:disabled) { cursor: default; opacity: .55; }
.editor-add-tools { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.editor-add-group { display: grid; grid-template-columns: 6em minmax(0, 1fr); align-items: start; gap: var(--action-gap); }
.editor-add-label { display: flex; align-items: center; min-height: var(--compact-height); color: var(--muted); font-size: .8rem; font-weight: 650; }
.library-group-block strong { flex: 1 1 150px; overflow-wrap: anywhere; }
.library-picker {
    width: min(760px, calc(100% - 24px));
    max-height: 88dvh;
    padding: clamp(14px, 4vw, 22px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 18px 54px #18283a38;
    overflow: auto;
}
.library-picker::backdrop { background: #17243975; }
.library-picker-heading, .library-picker-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--action-gap); }
.library-picker-heading p { margin-top: 4px; font-size: .85rem; }
.library-picker-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; margin: 12px 0; }
.library-picker h3 { margin: 8px 0 4px; }
.library-picker-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(210px, 78%);
    gap: 9px;
    padding: 4px 3px 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
}
.library-picker-card {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f6f8fc;
    scroll-snap-align: start;
}
.library-picker-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.library-picker-card :is(img, video) { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 5px; background: #e4ebf4; }
.library-picker-card .media-pending { border-radius: 5px; }
.library-picker-card video { background: #111; }
.library-picker-card label { overflow-wrap: anywhere; cursor: pointer; }
.library-picker-text { min-height: 74px; max-height: 114px; padding: 7px; overflow: auto; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.library-picker-actions { margin-top: 12px; }
.library-picker-actions .button { margin-inline-start: auto; }
.library-picker-card > p { font-size: .84rem; overflow-wrap: anywhere; }
.material-platform-nav { display: grid; gap: 8px; margin-bottom: 16px; }
.material-platform-nav .button[aria-pressed="true"] {
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-color: #8ba9d4;
}
.material-platform-nav .count { margin-left: 0; }
.material-platform-nav .button[aria-pressed="true"] .count { background: var(--surface); }
.material-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 16px;
}
.material-group-panel { display: flex; flex-direction: column; }
.material-group-panel .panel-heading { display: grid; justify-items: start; }
.material-group-panel .empty { display: grid; flex: 1; place-items: center; }
.material-group-list { margin: 0; padding: 0; list-style: none; }
.material-group-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px var(--panel-pad);
    border-top: 1px solid var(--line);
}
.material-group-list li div { display: grid; min-width: 0; }
.material-group-list strong { overflow-wrap: anywhere; }
.material-group-list span { font-size: .82rem; }
.material-groups-status:not(:empty) { margin-top: 10px; font-size: .86rem; }
.material-video-settings { margin-top: 18px; }
.material-group-dialog fieldset { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.material-group-dialog .library-picker-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.material-group-classification {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--action-gap);
    margin-bottom: 12px;
}
.material-copy-format { max-width: 17rem; }
.material-items:not(:empty) { display: grid; gap: 8px; margin-top: 12px; }
.material-item { padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; }
.material-item .block-heading h3 { display: block; overflow-wrap: anywhere; }
.material-item .media-pending { width: min(100%, 187px); aspect-ratio: 4 / 3; border-radius: 5px; }
.material-item img { display: block; width: 100%; height: 100%; object-fit: contain; }
.material-item video { display: block; width: min(100%, 300px); max-height: 170px; border-radius: 5px; background: #111; }
.material-item textarea { min-height: 72px; }
#editor-blocks { display: grid; gap: 10px; }
#editor-blocks:not(:empty) { margin-top: 13px; }
.editor-block { border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: #f7f9fc; }
.block-heading { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 9px; }
.block-heading h3 { display: flex; gap: 7px; align-items: center; }
.block-heading .block-number { color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.block-heading [data-action="remove"] { color: var(--danger); }
.block-text, .block-image, .block-video, .block-action { display: grid; gap: 8px; }
.text-copy-option { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.text-style-toolbar, .link-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.text-style-label { color: var(--muted); font-size: .78rem; }
.text-style-toolbar .button[aria-pressed="true"] {
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-color: #8ba9d4;
}
.link-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; max-width: 100%; }
.link-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--link); padding: 3px 6px; border: 0; background: #e6eef8; border-radius: 5px; font-size: .76rem; }
.link-editor { display: flex; align-items: flex-end; gap: 5px; flex-wrap: wrap; }
.link-editor label { flex: 1 1 170px; }
.link-editor .button.small { min-height: var(--control-height); }
.block-image img { display: block; max-width: 100%; max-height: 160px; object-fit: contain; object-position: left; border-radius: 5px; }
.block-image .media-pending { width: min(100%, 213px); aspect-ratio: 4 / 3; border-radius: 5px; }
.block-image .media-pending img { width: 100%; height: 100%; }
.block-video video { display: block; width: min(100%, 320px); max-height: 200px; border-radius: 5px; background: #111; }
.video-download-option { margin-top: 8px; }
.block-upload { display: flex; gap: 9px; align-items: center; }
.block-upload progress { display: block; flex: 1; min-width: 0; height: 8px; accent-color: var(--accent); }
.block-upload progress[value] { appearance: none; overflow: hidden; border: 0; border-radius: 999px; background: var(--accent-soft); }
.block-upload progress[value]::-webkit-progress-bar { background: var(--accent-soft); }
.block-upload progress[value]::-webkit-progress-value { border-radius: 999px; background: var(--accent); }
.block-upload progress[value]::-moz-progress-bar { border-radius: 999px; background: var(--accent); }
.block-upload span { min-width: 4ch; text-align: right; font-size: .77rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.block-message { min-width: 0; font-size: .77rem; color: var(--muted); overflow-wrap: anywhere; }
.block-message.error { color: var(--danger); }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--action-gap); padding-top: 14px; }
.preview-panel { width: min(100%, 390px); position: sticky; top: 16px; }
.preview-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.preview-heading span { font-size: .76rem; text-align: right; }
.preview-frame { height: min(720px, calc(100dvh - 105px)); min-height: 480px; background: var(--paper); border: 1px solid #c2d0e2; border-radius: 14px; overflow: hidden; }
.preview-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.category-editor { overflow: hidden; }
.category-preview { display: grid; place-content: center; text-align: center; min-height: 130px; aspect-ratio: 2.8; position: relative; overflow: hidden; background: #ece2d2; color: #6b4c39; }
.category-editor:nth-child(2n) .category-preview { background: #e9e1d9; }
.category-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.category-preview span { font-size: 2.15rem; font-family: Georgia, serif; line-height: 1.1; font-variant-numeric: tabular-nums; }
.category-preview p { font-size: .78rem; }
.stack { display: grid; gap: 13px; }
.delete-panel { max-width: 560px; padding: 18px; overflow-wrap: anywhere; }
.category-fields { padding: 16px; }
.category-fields > .button { justify-self: end; }
.checkbox { display: flex; align-items: center; gap: 6px; }
.checkbox input { width: auto; accent-color: var(--accent); }

.notice { border: 1px solid #c8d6c9; background: #e9f1e9; color: var(--good); padding: 10px 13px; border-radius: 8px; margin-bottom: 14px; font-size: .88rem; }
.notice.error { background: #faeeeb; border-color: #e4bfba; color: var(--danger); }
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 18px; }
.login-layout { display: grid; gap: 16px; width: min(100%, 408px); }
.login-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(19px, 5vw, 30px); }
.login-panel h1 { font-size: 1.85rem; }
.login-panel > p { margin: 6px 0 18px; font-size: .91rem; }

@media (max-width: 1120px) {
    :root { --rail-width: 165px; }
    .rail { padding-inline: 8px; }
    .workspace { padding-inline: 18px; }
}
@media (max-width: 940px) {
    .editor-layout { grid-template-columns: minmax(0, 1fr); }
    .preview-panel { position: static; }
    .preview-frame { height: 560px; }
}
@media (max-width: 760px) {
    .shell { display: block; }
    .rail { position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; border-right: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; }
    .rail .brand { padding-inline: 0; }
    .rail nav { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rail nav a { justify-content: center; min-height: 44px; padding: 4px; font-size: .78rem; gap: 4px; }
    .rail nav .icon { width: 15px; height: 15px; }
    .rail-end { margin: 0; padding: 0; border: 0; }
    .workspace { padding: 19px 12px 32px; }
    .page-heading { align-items: flex-start; margin-bottom: 18px; }
    .page-heading > div:first-child { flex-basis: 100%; }
    .heading-actions.row-actions { justify-content: flex-start; gap: var(--action-gap); }
    .heading-actions .action-cluster { display: contents; }
    .collection-copy-status { text-align: start; }
    .submission-panel .table-scroll, .table-scroll:has(.work-table) { overflow: visible; }
    .submission-table, .submission-table tbody, .work-table, .work-table tbody { display: block; }
    .submission-table thead, .work-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .work-table tr { display: grid; gap: 6px; padding: 12px var(--panel-pad); border-top: 1px solid var(--line); }
    .work-table tr > :is(th, td) { width: auto; min-width: 0; padding: 0; border: 0; }
    .work-table td:nth-child(2), .work-table td:last-child { width: auto; }
    .work-table .row-title { max-width: none; }
    .work-table time { color: var(--muted); font-size: .8rem; }
    .work-row-actions { margin-top: 4px; }
    .submission-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
        gap: 10px 12px;
        padding: 12px var(--panel-pad);
        border-top: 1px solid var(--line);
    }
    .submission-table tr > td { min-width: 0; padding: 0; border: 0; }
    .submission-table :is(.submission-work, .submission-operation) { grid-column: 1 / -1; }
    .submission-table :is(.submission-created, .submission-amount) { text-align: right; }
    .submission-created { font-size: .8rem; }
    .submission-cell-label { display: block; color: var(--muted); font-size: .72rem; font-weight: 500; }
}
@media (max-width: 610px) {
    :root { --control-height: 44px; --compact-height: 44px; }
    .category-grid { grid-template-columns: minmax(0, 1fr); }
    .editor-add-group { grid-template-columns: minmax(0, 1fr); gap: 5px; }
    .editor-add-label { min-height: 0; }
    .submission-filters .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .submission-filters .filters label { min-width: 0; }
    .submission-filters .filters .row-actions { grid-column: 1 / -1; }
    .submission-limit-panel .filters, .video-upload-limit-panel .filters { flex-basis: 100%; }
}
@media (max-width: 390px) {
    .share-fields { grid-template-columns: minmax(0, 1fr); }
    .editor-board-create { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .editor-board-create label { grid-column: 1 / -1; }
}
