:root {
    --bg: #eef4ff;
    --bg-deep: #d9e7ff;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: #ffffff;
    --line: rgba(36, 85, 180, 0.14);
    --line-strong: rgba(36, 85, 180, 0.24);
    --text: #163050;
    --muted: #5d7699;
    --brand: #1163ff;
    --brand-strong: #0d4dd9;
    --brand-soft: #e9f1ff;
    --danger: #d63d57;
    --danger-soft: #ffe9ee;
    --success: #13885c;
    --success-soft: #e9fff4;
    --warning: #d97706;
    --warning-soft: #fff3dc;
    --shadow: 0 28px 70px rgba(17, 68, 160, 0.14);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(17, 99, 255, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(8, 145, 178, 0.12), transparent 26%),
        linear-gradient(180deg, #f7fbff 0%, var(--bg) 52%, var(--bg-deep) 100%);
}

a {
    color: var(--brand-strong);
}

img {
    max-width: 100%;
}

.app-shell {
    width: min(1880px, calc(100vw - 24px));
    max-width: none;
    margin: 0 auto;
    padding: 20px 12px 28px;
}

.surface,
.hero,
.panel,
.modal-card,
.login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: center;
    padding: 24px 26px;
    margin-bottom: 20px;
    position: relative;
    z-index: 30;
    isolation: isolate;
    overflow: visible;
}

.hero-brand {
    display: flex;
    gap: 18px;
    align-items: center;
}

.brand-mark,
.brand-logo {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(17, 99, 255, 0.14), rgba(8, 145, 178, 0.12));
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.brand-mark span {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-strong);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero h1,
.page-header h1,
.login-card h1 {
    margin: 10px 0 6px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.04;
}

.hero p,
.page-header p,
.muted,
.hint {
    color: var(--muted);
}

.hero-subtitle {
    margin: 0;
    max-width: 72ch;
}

.top-actions,
.nav-pills,
.button-row,
.row-actions,
.toolbar,
.stats-grid,
.footer-row,
.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.nav-pills {
    margin-top: 16px;
}

.top-actions {
    position: relative;
    z-index: 120;
    overflow: visible;
}

.lang-switch {
    justify-content: flex-end;
}

.nav-pill,
.btn,
button,
.icon-btn {
    border: 0;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
}

.nav-pill,
.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    box-shadow: 0 14px 30px rgba(17, 99, 255, 0.2);
}

.nav-pill.secondary,
.btn.secondary,
button.secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn.ghost,
.nav-pill.ghost {
    background: rgba(255, 255, 255, 0.62);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn.is-active {
    background: var(--brand-soft);
    color: var(--brand-strong);
    border-color: rgba(17, 99, 255, 0.16);
}

.btn.danger,
button.danger {
    background: var(--danger);
    box-shadow: 0 14px 28px rgba(214, 61, 87, 0.18);
}

.icon-btn {
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    display: inline-grid;
    place-items: center;
    color: var(--text);
    box-shadow: none;
}

.icon-btn svg,
.btn svg,
.nav-pill svg {
    width: 18px;
    height: 18px;
}

.icon-btn.is-favorite {
    background: rgba(255, 214, 102, 0.28);
    border-color: rgba(217, 119, 6, 0.25);
    color: #b45309;
}

.icon-btn.static-indicator {
    cursor: default;
    pointer-events: none;
}

.icon-btn.static-indicator span {
    font-size: 18px;
    line-height: 1;
}

.icon-btn.note-btn {
    background: var(--brand-soft);
    border-color: rgba(17, 99, 255, 0.14);
    color: var(--brand-strong);
}

.notification-trigger {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d63d57;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(214, 61, 87, 0.28);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(17, 99, 255, 0.12), rgba(8, 145, 178, 0.12));
    display: grid;
    place-items: center;
    color: var(--brand-strong);
    font-weight: 700;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu {
    position: relative;
    z-index: 160;
}

.user-menu.is-open {
    z-index: 10020;
}

.user-menu-trigger {
    min-width: 0;
    padding: 9px 12px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    box-shadow: none;
}

.user-menu-trigger:hover,
.user-menu-trigger:focus-visible,
.user-menu.is-open .user-menu-trigger {
    background: rgba(255, 255, 255, 0.98);
    border-color: var(--line-strong);
}

.user-menu-trigger-copy {
    display: grid;
    gap: 2px;
    text-align: left;
    line-height: 1.1;
}

.user-menu-trigger-copy strong {
    font-size: 14px;
    font-weight: 700;
}

.user-menu-trigger-copy .muted {
    font-size: 12px;
}

.user-menu-trigger-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(17, 99, 255, 0.05);
    display: inline-grid;
    place-items: center;
    color: var(--brand-strong);
    flex: 0 0 auto;
}

.user-menu-trigger-icon svg {
    width: 14px;
    height: 14px;
}

.user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(11, 42, 102, 0.14);
    display: none;
    grid-template-columns: 1fr;
    gap: 2px;
}

.user-menu.is-open .user-menu-panel {
    display: grid;
}

.user-menu-panel::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 22px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    transform: rotate(45deg);
}

.user-menu-item,
.user-menu-item-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    box-shadow: none;
    font-size: 14px;
    text-align: left;
}

.user-menu-item + .user-menu-item,
.user-menu-panel form + form,
.user-menu-panel a + form,
.user-menu-panel form + a {
    margin-top: 2px;
}

.user-menu-item:hover,
.user-menu-item:focus-visible,
.user-menu-item-button:hover,
.user-menu-item-button:focus-visible {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel,
.surface {
    padding: 24px;
    margin-bottom: 18px;
}

.stats-grid {
    align-items: stretch;
}

.stat-card {
    flex: 1 1 180px;
    min-width: 180px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(240,247,255,0.92));
    border: 1px solid var(--line);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.section-title {
    margin: 8px 0 0;
    font-size: 24px;
    line-height: 1.15;
}

.flash {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.flash.success {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(19, 136, 92, 0.14);
}

.flash.error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(214, 61, 87, 0.16);
}

.filters,
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.editor-form {
    margin-top: 6px;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
    gap: 22px;
    align-items: start;
}

.editor-layout-wide {
    grid-template-columns: minmax(0, 1.9fr) minmax(340px, 0.95fr);
}

.editor-main,
.editor-sidebar-stack {
    display: grid;
    gap: 18px;
}

.editor-sidebar {
    min-width: 0;
}

.editor-sidebar-stack {
    position: sticky;
    top: 18px;
}

.editor-section {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(245,250,255,0.94));
    box-shadow: 0 18px 40px rgba(17, 68, 160, 0.08);
    min-width: 0;
}

.editor-section-compact {
    padding: 20px;
}

.editor-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.editor-section-title {
    margin: 8px 0 0;
    font-size: 22px;
    line-height: 1.15;
}

.editor-meta-pill {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(240, 247, 255, 0.78);
    text-align: right;
}

.editor-meta-pill span,
.editor-meta-pill strong {
    display: block;
}

.editor-meta-pill span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.editor-meta-pill strong {
    margin-top: 6px;
    font-size: 14px;
    color: var(--brand-strong);
}

.editor-grid {
    display: grid;
    gap: 16px;
}

.editor-grid-main {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.editor-field {
    min-width: 0;
}

.editor-field-span-2 {
    grid-column: span 2;
}

.editor-field-span-3 {
    grid-column: span 3;
}

.editor-field-span-4 {
    grid-column: span 4;
}

.editor-field-span-6 {
    grid-column: 1 / -1;
}

.editor-checkbox-panel {
    margin: 0;
    min-height: 54px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.96);
}

.editor-inline-check {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.editor-upload-preview {
    margin-top: 12px;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.9);
}

.editor-upload-preview img {
    display: block;
    max-width: min(320px, 100%);
    border-radius: 18px;
    border: 1px solid rgba(36, 85, 180, 0.14);
}

.editor-photo-panel {
    display: grid;
    gap: 12px;
}

.editor-file-list {
    display: grid;
    gap: 10px;
}

.editor-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(248, 251, 255, 0.9);
}

.editor-file-row a {
    min-width: 0;
    overflow-wrap: anywhere;
}

.editor-actions-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(238,245,255,0.96));
}

.editor-actions {
    display: grid;
    gap: 12px;
}

.editor-accordion-stack,
.editor-check-grid {
    display: grid;
    gap: 16px;
}

.editor-choice-grid {
    margin-top: 12px;
}

.editor-preview-tile {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.9);
}

.editor-preview-tile img {
    display: block;
    max-width: min(220px, 100%);
    border-radius: 18px;
    border: 1px solid rgba(36, 85, 180, 0.14);
}

.editor-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 6px;
    accent-color: var(--brand);
    flex: 0 0 auto;
}

textarea {
    min-height: 132px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(17, 99, 255, 0.18);
    border-color: rgba(17, 99, 255, 0.36);
}

.field-builder {
    display: grid;
    gap: 14px;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) minmax(130px, 0.8fr) minmax(160px, 1fr) minmax(170px, 0.95fr) minmax(170px, 0.95fr) minmax(220px, 1.25fr) auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
}

.field-row-advanced {
    min-width: 0;
}

.field-row-advanced .hint {
    margin-top: 8px;
}

.choice-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.multi-select-field-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.choice-card {
    margin: 0;
    min-height: 58px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(36, 85, 180, 0.14);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.94));
    box-shadow: none;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
    cursor: pointer;
}

.choice-card:hover {
    border-color: rgba(17, 99, 255, 0.24);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 247, 255, 0.98));
    box-shadow: 0 12px 24px rgba(17, 68, 160, 0.08);
}

.choice-card input[type="checkbox"] {
    margin: 0;
    position: relative;
    top: -1px;
}

.choice-card span {
    min-width: 0;
    color: #18355a;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.choice-card:has(input[type="checkbox"]:checked) {
    border-color: rgba(17, 99, 255, 0.3);
    background: linear-gradient(180deg, rgba(235, 244, 255, 0.98), rgba(227, 239, 255, 0.96));
    box-shadow: inset 0 0 0 1px rgba(17, 99, 255, 0.08), 0 14px 28px rgba(17, 68, 160, 0.08);
}

.choice-card:has(input[type="checkbox"]:focus-visible) {
    outline: 2px solid rgba(17, 99, 255, 0.22);
    outline-offset: 2px;
}

.roles-grid {
    display: grid;
    grid-template-columns: minmax(160px, 1.7fr) repeat(3, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.roles-grid > div {
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.88);
}

.field-style-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.gallery-config-grid {
    grid-template-columns: minmax(160px, 1.7fr) minmax(90px, .7fr) minmax(110px, .8fr);
}

.gallery-config-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.gallery-config-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(130px, .8fr) minmax(120px, .8fr);
    gap: 12px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
}

.gallery-config-label strong,
.gallery-config-label span {
    display: block;
}

.gallery-config-label strong {
    font-size: 15px;
}

.gallery-config-label span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.gallery-config-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(240, 247, 255, 0.92);
    border: 1px solid var(--line);
}

.gallery-config-position label {
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.field-style-head,
.field-style-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(140px, 1fr));
    gap: 12px;
    align-items: end;
}

.field-style-head {
    padding: 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.field-style-row {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
}

.field-style-label {
    min-width: 0;
}

.field-style-label strong,
.field-style-label span {
    display: block;
}

.field-style-label strong {
    font-size: 15px;
}

.field-style-label span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.field-style-control {
    min-width: 0;
}

.field-style-control label {
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.field-style-color-control input[type="color"] {
    width: 100%;
    min-height: 46px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.95);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.entry-card {
    min-width: 0;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(240,247,255,0.9));
    box-shadow: 0 18px 46px rgba(17, 68, 160, 0.12);
}

.entry-card .row-actions {
    gap: 4px;
    flex-wrap: nowrap;
}

.entry-card .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
}

.entry-card .icon-btn svg {
    width: 16px;
    height: 16px;
}

.gallery.compact-search-gallery {
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
    justify-content: center;
    align-items: start;
}

.gallery.compact-search-gallery .entry-card {
    width: 100%;
}

.entry-card-no-media .entry-body {
    padding-top: 22px;
}

.entry-media {
    position: relative;
    aspect-ratio: 4 / 3;
    min-height: 220px;
    background: linear-gradient(135deg, rgba(17, 99, 255, 0.24), rgba(8, 145, 178, 0.2));
    display: grid;
    place-items: center;
    color: #fff;
    padding: 12px;
    overflow: hidden;
}

.entry-media-frame {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    box-sizing: border-box;
}

.entry-media-gender-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 10px 20px rgba(10, 25, 55, 0.16);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.gender-badge-male {
    color: #0f5bcc;
}

.gender-badge-female {
    color: #c2418c;
}

.entry-media-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    z-index: 3;
}

.entry-inline-badges {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.winner-badge {
    position: relative;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 24px rgba(10, 25, 55, 0.18);
    font-size: 18px;
    border: 1px solid rgba(255, 255, 255, 0.56);
}

.winner-state-won {
    background: rgba(34, 197, 94, 0.92);
    color: #fff;
}

.winner-state-lost {
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
}

.winner-state-blocked {
    background: rgba(185, 28, 28, 0.95);
    color: #fff;
}

.winner-state-neutral {
    background: rgba(148, 163, 184, 0.92);
    color: #fff;
}

.entry-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 18px;
}

.entry-media-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.entry-body {
    padding: 18px;
}

.entry-title {
    margin: 0 0 8px;
    font-size: 24px;
}

.entry-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.entry-id {
    margin-bottom: 6px;
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 14px;
}

.tag {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 500;
}

.tag-company {
    font-size: 11px;
    font-weight: 500;
}

.inline-icon-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    font-size: 1.25em;
    line-height: 1;
}

.multi-value-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.multi-inline-icon {
    padding: 4px;
    border-radius: 999px;
    background: rgba(240, 247, 255, 0.9);
}

.birthday-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 999px;
    color: #d97706;
    background: rgba(255, 247, 237, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.28);
    box-shadow: 0 6px 14px rgba(10, 25, 55, 0.12);
}

.birthday-marker svg {
    width: 15px;
    height: 15px;
}

.name-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bulk-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(240, 247, 255, 0.92);
    border: 1px solid rgba(36, 85, 180, 0.14);
}

.bulk-actions-bar select {
    min-width: 220px;
}

.bulk-select-col {
    width: 44px;
    text-align: center;
}

.pager-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}

.pager-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.pager-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.pager-size-form {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(240, 247, 255, 0.92);
    border: 1px solid rgba(36, 85, 180, 0.14);
}

.pager-size-form select {
    min-width: 90px;
}

.role-access-grid {
    grid-template-columns: minmax(220px, 1.8fr) repeat(3, minmax(92px, 0.7fr));
    align-items: start;
}

.role-access-label {
    display: grid;
    gap: 4px;
}

.permission-select {
    width: auto;
    min-width: 72px;
    max-width: 88px;
    padding-right: 34px;
}

.detail-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(36, 85, 180, 0.08);
}

.detail-row span:first-child {
    color: var(--muted);
}

.detail-row span:last-child {
    min-width: 0;
    text-align: right;
    word-break: break-word;
}

.detail-row-stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.detail-row-stack span:last-child {
    width: 100%;
    text-align: left;
}

.gallery-text-block-list {
    display: grid;
    gap: 12px;
    margin: 14px 0 4px;
}

.gallery-text-block {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(36, 85, 180, 0.1);
    background: rgba(247, 250, 255, 0.96);
}

.gallery-text-block-title {
    min-width: 0;
}

.gallery-text-block-title-label {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gallery-text-block-body {
    width: 100%;
    color: var(--text);
    line-height: 1.55;
    white-space: normal;
    word-break: break-word;
}

.gallery-text-block-expand {
    display: grid;
    gap: 8px;
}

.gallery-text-block-more {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: rgba(79, 98, 132, 0.82);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

.gallery-text-block-more:hover,
.gallery-text-block-more:focus-visible {
    color: rgba(56, 74, 108, 0.92);
}

.gallery-text-block-rest {
    width: 100%;
    color: var(--text);
    line-height: 1.55;
    white-space: normal;
    word-break: break-word;
}

.field-emphasis {
    display: inline;
}

.field-style-none {
    font-weight: inherit;
    font-style: normal;
    text-decoration: none;
}

.field-style-bold {
    font-weight: 800;
}

.field-style-italic {
    font-style: italic;
}

.field-style-underline {
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.field-style-color {
    font-weight: inherit;
}

.field-size-sm {
    font-size: 0.9em;
}

.field-size-md {
    font-size: 1em;
}

.field-size-lg {
    font-size: 1.08em;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.72);
    width: 100%;
}

table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(36, 85, 180, 0.1);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: rgba(17, 99, 255, 0.04);
}

tr:hover td {
    background: rgba(17, 99, 255, 0.03);
}

.cell-stack {
    display: grid;
    gap: 4px;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(17, 99, 255, 0.08);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 700;
}

.submission-badge {
    gap: 5px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 600;
}

.submission-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.submission-badge-icon svg {
    width: 11px;
    height: 11px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 25, 55, 0.5);
    z-index: 1000;
}

.modal.is-open {
    display: flex;
}

.modal-card {
    width: min(980px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 26px;
}

.note-content {
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    line-height: 1.7;
    white-space: normal;
}

.panel-subsection {
    margin-bottom: 18px;
}

.quick-action-card {
    padding: 18px;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.admin-summary-grid-compact {
    margin-bottom: 0;
}

.admin-summary-card {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
}

.admin-summary-card strong {
    font-size: 18px;
    line-height: 1.2;
}

.admin-accordion {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.84);
    padding: 0 18px 18px;
    margin-bottom: 16px;
}

.admin-accordion[open] {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.admin-accordion summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 4px;
    font-size: 16px;
    font-weight: 700;
}

.admin-summary-note {
    margin-left: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.admin-accordion summary::-webkit-details-marker {
    display: none;
}

.admin-checkbox-grid {
    display: grid;
    gap: 10px;
}

.admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
}

.admin-filter-actions {
    align-self: end;
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
}

.mini-list-row strong,
.mini-list-row span {
    display: block;
}

.modal-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.detail-photo-frame {
    width: 100%;
    min-height: 320px;
    border-radius: 24px;
    border: 1px solid rgba(36, 85, 180, 0.14);
    background: linear-gradient(135deg, rgba(17, 99, 255, 0.12), rgba(8, 145, 178, 0.08));
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 14px;
}

.detail-photo {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: contain;
    object-position: center;
}

.detail-photo-fallback {
    width: 100%;
    min-height: 290px;
    border-radius: 20px;
}

.detail-entry-id {
    margin-bottom: 10px;
}

.form-photo-frame {
    max-width: 340px;
    min-height: 240px;
}

.history-list {
    display: grid;
    gap: 12px;
}

.history-item {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
}

.footer {
    margin-top: 26px;
    padding: 18px 0 8px;
    color: var(--muted);
    font-size: 14px;
}

.footer .footer-row {
    justify-content: space-between;
    align-items: flex-end;
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.footer a {
    color: inherit;
}

.online-popover {
    position: relative;
}

.notification-popover {
    position: relative;
    z-index: 200;
}

.notification-popover[open] {
    z-index: 10000;
}

.online-popover summary {
    list-style: none;
}

.notification-popover summary {
    list-style: none;
}

.online-popover summary::-webkit-details-marker {
    display: none;
}

.notification-popover summary::-webkit-details-marker {
    display: none;
}

.online-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.online-popover-card {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(380px, 90vw);
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 50px rgba(11, 42, 102, 0.18);
    z-index: 40;
}

.notification-popover-card {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: min(430px, 92vw);
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 50px rgba(11, 42, 102, 0.18);
    z-index: 9999;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    gap: 18px;
}

.login-card {
    width: min(460px, 100%);
    padding: 30px;
}

.login-branding {
    margin-bottom: 18px;
}

.login-subtle-text {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.login-logo,
.login-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    margin: 0 auto 18px;
}

.login-logo img {
    display: block;
    width: auto;
    max-width: min(250px, 100%);
    max-height: 60px;
    height: auto;
    object-fit: contain;
}

.login-logo-fallback span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(17, 99, 255, 0.1);
    color: var(--brand-strong);
    font-size: 24px;
    font-weight: 800;
}

.login-actions {
    justify-content: flex-start;
}

.login-helper-links {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.login-helper-links-left {
    justify-content: flex-start;
    margin-top: 10px;
}

.login-text-link {
    color: #7b8798;
    text-decoration: none;
    font-size: 14px;
}

.login-text-link:hover {
    color: #5f6c7e;
    text-decoration: none;
}

.login-submit {
    min-width: 118px;
    padding: 8px 14px;
    box-shadow: none;
}

.compact-submit {
    min-width: 136px;
    padding: 9px 15px;
    background: var(--brand);
    box-shadow: none;
}

.center {
    text-align: center;
}

.login-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    width: min(460px, 100%);
    margin: 0 auto;
    padding: 0 8px 4px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.login-footer a {
    color: inherit;
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--brand-ink);
}

@media (max-width: 980px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-layout-wide {
        grid-template-columns: 1fr;
    }

    .editor-sidebar-stack {
        position: static;
    }

    .editor-grid-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .editor-field-span-2,
    .editor-field-span-3,
    .editor-field-span-4,
    .editor-field-span-6 {
        grid-column: 1 / -1;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-brand,
    .top-actions {
        width: 100%;
    }

    .top-actions {
        justify-content: space-between;
    }

    .modal-grid,
    .field-row {
        grid-template-columns: 1fr;
    }

    .field-style-head {
        display: none;
    }

    .field-style-row {
        grid-template-columns: 1fr 1fr;
    }

    .field-style-label {
        grid-column: 1 / -1;
    }

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .gallery.compact-search-gallery {
        grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
    }

    .page-toolbar {
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .app-shell {
        width: calc(100vw - 12px);
        padding: 10px 6px 18px;
    }

    .login-shell {
        min-height: 100svh;
        place-items: start center;
        padding: 14px 10px 20px;
        gap: 14px;
    }

    .hero,
    .panel,
    .surface,
    .login-card,
    .modal-card {
        padding: 18px;
        border-radius: 24px;
    }

    .editor-section,
    .editor-section-compact {
        padding: 18px;
        border-radius: 22px;
    }

    .editor-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .editor-meta-pill {
        text-align: left;
    }

    .editor-grid-main {
        grid-template-columns: 1fr;
    }

    .editor-file-row {
        grid-template-columns: 1fr;
    }

    .editor-inline-form {
        grid-template-columns: 1fr;
    }

    .login-logo,
    .login-logo-fallback {
        margin-bottom: 16px;
    }

    .login-logo img {
        max-width: min(220px, 100%);
        max-height: 56px;
    }

    .login-submit {
        width: 100%;
        min-width: 0;
        padding: 8px 13px;
    }

    .login-actions {
        width: 100%;
    }

    .login-card .button-row {
        width: 100%;
        flex-wrap: wrap;
    }

    .login-card .button-row .btn {
        flex: 1 1 auto;
    }

    .compact-submit {
        min-width: 126px;
        padding: 9px 14px;
    }

    .hero-brand {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-toolbar,
    .mini-list-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .field-style-row {
        grid-template-columns: 1fr;
    }

    .login-footer {
        width: min(100%, 420px);
        font-size: 0.85rem;
    }

    .top-actions,
    .toolbar,
    .button-row,
    .segmented,
    .nav-pills {
        width: 100%;
    }

    .top-actions {
        gap: 10px;
    }

    .top-actions > * {
        max-width: 100%;
    }

    .user-menu {
        margin-left: auto;
    }

    .user-menu-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .user-menu-panel {
        right: 0;
        left: auto;
        min-width: min(220px, calc(100vw - 36px));
        max-width: calc(100vw - 36px);
    }

    .lang-switch {
        justify-content: flex-start;
    }

    .segmented .btn,
    .button-row .btn,
    .button-row button,
    .nav-pills .nav-pill {
        flex: 1 1 auto;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .entry-media {
        height: 190px;
        min-height: 190px;
        padding: 10px;
    }

    .winner-badge {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .entry-media img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .detail-photo-frame {
        min-height: 240px;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .detail-row span:last-child {
        text-align: left;
    }

    .gallery-text-block {
        padding: 13px 14px;
    }

    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap td,
    .table-wrap th {
        display: block;
        width: 100%;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap tr {
        border-bottom: 1px solid var(--line);
        padding: 10px 0;
    }

    .table-wrap td {
        white-space: normal;
        padding: 10px 14px;
        border-bottom: 0;
    }

    .table-wrap td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: var(--muted);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .bulk-actions-bar {
        align-items: stretch;
    }

    .bulk-actions-bar select,
    .bulk-actions-bar button {
        width: 100%;
    }

    .gallery-config-grid,
    .gallery-config-row {
        grid-template-columns: 1fr;
    }

    .pager-bar,
    .role-access-grid,
    .pager-summary,
    .pager-controls,
    .pager-size-form {
        width: 100%;
    }

    .pager-bar,
    .role-access-grid,
    .pager-summary,
    .pager-controls,
    .pager-size-form {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (min-width: 1600px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }

    .gallery.compact-search-gallery {
        grid-template-columns: repeat(auto-fit, minmax(300px, 380px));
    }
}
