:root {
    --bg: #090c10;
    --panel: #161b22;
    --panel-strong: #1d2630;
    --ink: #edf2f7;
    --muted: #a3afbf;
    --red: #b84436;
    --red-bright: #e06351;
    --gold: #d0ab57;
    --line: rgba(206, 216, 228, 0.12);
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    --body-bg:
        radial-gradient(circle at top, rgba(189, 61, 44, 0.22), transparent 30%),
        linear-gradient(180deg, #4f0d0d 0%, #230707 45%, #140404 100%);
    --header-ink: #f7ecd3;
    --header-border: rgba(255, 224, 155, 0.18);
    --status-bg: rgba(242, 230, 200, 0.1);
    --status-border: rgba(255, 224, 155, 0.2);
    --status-meta: #dbcaa3;
    --nav-border: rgba(255, 224, 155, 0.12);
    --nav-bg: rgba(255, 255, 255, 0.04);
    --nav-active-bg: var(--panel-strong);
    --nav-active-ink: #f6d488;
    --nav-active-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
    --session-bg: rgba(0, 0, 0, 0.25);
    --panel-bg: linear-gradient(180deg, rgba(24, 31, 39, 0.98), rgba(18, 24, 32, 0.98));
    --panel-border: rgba(208, 171, 87, 0.18);
    --accent-surface: rgba(184, 68, 54, 0.14);
    --card-bg: rgba(255, 255, 255, 0.04);
    --page-banner-bg: linear-gradient(135deg, rgba(29, 38, 48, 0.98), rgba(22, 29, 37, 0.98));
    --input-border: rgba(208, 171, 87, 0.18);
    --input-bg: rgba(9, 12, 16, 0.92);
    --placeholder: rgba(163, 175, 191, 0.7);
    --auth-aside-bg:
        linear-gradient(145deg, rgba(74, 19, 15, 0.96), rgba(23, 9, 11, 0.98)),
        linear-gradient(180deg, rgba(24, 31, 39, 0.98), rgba(18, 24, 32, 0.98));
    --auth-aside-lead: rgba(247, 236, 211, 0.82);
    --auth-note-bg: rgba(255, 255, 255, 0.05);
    --auth-note-border: rgba(255, 224, 155, 0.16);
    --auth-note-copy: rgba(247, 236, 211, 0.78);
    --choice-border: rgba(208, 171, 87, 0.14);
    --choice-bg: rgba(255, 255, 255, 0.04);
    --choice-hover-border: rgba(224, 99, 81, 0.36);
    --choice-hover-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    --choice-checked-border: rgba(224, 99, 81, 0.55);
    --choice-checked-shadow: inset 0 0 0 2px rgba(224, 99, 81, 0.2);
    --choice-checked-bg: linear-gradient(180deg, rgba(43, 22, 20, 0.95), rgba(31, 18, 19, 0.95));
    --toggle-border: rgba(224, 99, 81, 0.28);
    --toggle-bg: rgba(184, 68, 54, 0.14);
    --toggle-ink: #ffd79a;
    --pill-bg: rgba(184, 68, 54, 0.16);
    --pill-ink: #ffd79a;
    --subtle-panel-bg: rgba(255, 255, 255, 0.04);
    --identity-bg:
        linear-gradient(160deg, rgba(29, 38, 48, 0.99), rgba(20, 27, 35, 0.96)),
        linear-gradient(145deg, rgba(184, 68, 54, 0.08), rgba(13, 18, 24, 0.04));
    --identity-field-bg: rgba(255, 255, 255, 0.05);
    --identity-footer-border: rgba(208, 171, 87, 0.18);
    --editor-border: rgba(208, 171, 87, 0.18);
    --editor-bg: rgba(9, 12, 16, 0.92);
    --scrollbar-border: rgba(22, 29, 37, 0.9);
    --footer-ink: #d8c79d;
}

html[data-theme="light"] {
    --bg: #f4e7cb;
    --panel: #f2e6c8;
    --panel-strong: #e5d2a2;
    --ink: #1a1612;
    --muted: #675d4c;
    --red: #8c1c13;
    --red-bright: #bd3d2c;
    --gold: #b49343;
    --line: rgba(33, 25, 18, 0.15);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    --body-bg:
        radial-gradient(circle at top, rgba(189, 61, 44, 0.22), transparent 30%),
        linear-gradient(180deg, #4f0d0d 0%, #230707 45%, #140404 100%);
    --header-ink: #f7ecd3;
    --header-border: rgba(255, 224, 155, 0.18);
    --status-bg: rgba(242, 230, 200, 0.1);
    --status-border: rgba(255, 224, 155, 0.2);
    --status-meta: #dbcaa3;
    --nav-border: rgba(255, 224, 155, 0.12);
    --nav-bg: rgba(255, 255, 255, 0.04);
    --nav-active-bg: var(--panel);
    --nav-active-ink: var(--red);
    --nav-active-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
    --session-bg: rgba(0, 0, 0, 0.25);
    --panel-bg: linear-gradient(180deg, rgba(248, 240, 222, 0.99), rgba(236, 220, 186, 0.99));
    --panel-border: rgba(76, 47, 28, 0.18);
    --accent-surface: rgba(140, 28, 19, 0.08);
    --card-bg: rgba(255, 252, 245, 0.88);
    --page-banner-bg: linear-gradient(135deg, rgba(250, 242, 226, 0.99), rgba(235, 219, 184, 0.99));
    --input-border: rgba(88, 60, 38, 0.24);
    --input-bg: rgba(255, 250, 242, 0.98);
    --placeholder: rgba(103, 93, 76, 0.78);
    --auth-aside-bg:
        linear-gradient(145deg, rgba(90, 17, 13, 0.94), rgba(43, 8, 8, 0.98)),
        linear-gradient(180deg, rgba(242, 230, 200, 0.98), rgba(228, 211, 169, 0.98));
    --auth-aside-lead: rgba(247, 236, 211, 0.82);
    --auth-note-bg: rgba(255, 255, 255, 0.05);
    --auth-note-border: rgba(255, 224, 155, 0.16);
    --auth-note-copy: rgba(247, 236, 211, 0.78);
    --choice-border: rgba(51, 34, 23, 0.16);
    --choice-bg: rgba(255, 251, 240, 0.78);
    --choice-hover-border: rgba(140, 28, 19, 0.28);
    --choice-hover-shadow: 0 10px 24px rgba(70, 23, 18, 0.12);
    --choice-checked-border: rgba(140, 28, 19, 0.42);
    --choice-checked-shadow: inset 0 0 0 2px rgba(140, 28, 19, 0.14);
    --choice-checked-bg: linear-gradient(180deg, rgba(255, 248, 233, 0.95), rgba(241, 225, 188, 0.95));
    --toggle-border: rgba(140, 28, 19, 0.24);
    --toggle-bg: rgba(140, 28, 19, 0.06);
    --toggle-ink: var(--red);
    --pill-bg: rgba(140, 28, 19, 0.1);
    --pill-ink: var(--red);
    --subtle-panel-bg: rgba(255, 251, 240, 0.58);
    --identity-bg:
        linear-gradient(160deg, rgba(242, 230, 200, 0.99), rgba(229, 210, 162, 0.96)),
        linear-gradient(145deg, rgba(90, 17, 13, 0.08), rgba(43, 8, 8, 0.04));
    --identity-field-bg: rgba(255, 251, 240, 0.72);
    --identity-footer-border: rgba(41, 24, 15, 0.18);
    --editor-border: rgba(51, 34, 23, 0.28);
    --editor-bg: rgba(255, 251, 241, 0.95);
    --scrollbar-border: rgba(255, 251, 240, 0.6);
    --footer-ink: #d8c79d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.6;
    background: var(--body-bg);
}

body.page-is-loading .site-header,
body.page-is-loading .page-shell,
body.page-is-loading .site-footer {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
}

body.page-is-ready .site-header,
body.page-is-ready .page-shell,
body.page-is-ready .site-footer,
body.page-is-leaving .site-header,
body.page-is-leaving .page-shell,
body.page-is-leaving .site-footer {
    transition:
        opacity 240ms ease,
        transform 240ms ease,
        filter 240ms ease;
}

body.page-is-ready .site-header,
body.page-is-ready .page-shell,
body.page-is-ready .site-footer {
    opacity: 1;
    transform: translateY(0) scale(1);
}

body.page-is-leaving .site-header,
body.page-is-leaving .page-shell,
body.page-is-leaving .site-footer {
    opacity: 0;
    transform: translateY(-12px) scale(0.992);
    filter: blur(3px);
}

a {
    color: inherit;
}

.site-shell {
    min-height: 100vh;
}

.site-header {
    padding: 32px clamp(20px, 4vw, 48px) 20px;
    color: var(--header-ink);
    border-bottom: 1px solid var(--header-border);
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
}

.logo {
    width: 82px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.eyebrow,
.section-kicker {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--gold);
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}

.status-card {
    min-width: 170px;
    padding: 14px 16px;
    background: var(--status-bg);
    border: 1px solid var(--status-border);
    backdrop-filter: blur(10px);
    text-align: right;
}

.status-label,
.status-meta {
    display: block;
    font-size: 0.8rem;
    color: var(--status-meta);
}

.status-clock {
    display: grid;
    gap: 2px;
    margin-top: 4px;
}

.status-time {
    display: block;
    margin-top: 4px;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.main-nav a {
    position: relative;
    padding: 10px 14px;
    border: 1px solid var(--nav-border);
    background: var(--nav-bg);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 6px;
    height: 2px;
    background: currentColor;
    opacity: 0;
    transform: scaleX(0.35);
    transform-origin: center;
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.main-nav a.active,
.main-nav a:hover {
    background: var(--nav-active-bg);
    color: var(--nav-active-ink);
    transform: translateY(-1px);
    box-shadow: var(--nav-active-shadow);
}

.main-nav a.active::after,
.main-nav a:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

.session-banner {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--session-bg);
    padding: 10px 14px;
    border-left: 4px solid var(--gold);
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 48px;
}

.hero-panel,
.content-grid,
.strip-panel {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.hero-panel {
    grid-template-columns: 2fr 1fr;
    align-items: stretch;
}

.panel,
.hero-panel,
.strip-panel,
.flash {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
}

.hero-panel,
.strip-panel,
.page-banner,
.panel {
    padding: clamp(20px, 3vw, 30px);
}

.hero-aside {
    display: grid;
    gap: 14px;
}

.metric-card,
.feature-item {
    padding: 16px;
    background: var(--accent-surface);
    border-left: 4px solid var(--red);
}

.metric-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.8rem;
}

.lead {
    max-width: 60ch;
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: 0;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.button-primary {
    background: linear-gradient(135deg, var(--red), var(--red-bright));
    color: #fff5e6;
}

.button-secondary {
    background: transparent;
    color: var(--red);
    box-shadow: inset 0 0 0 1px var(--red);
}

.button-danger {
    background: #5e120d;
    color: #fff5e6;
}

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

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

.content-card,
.dashboard-card {
    padding: 18px;
    background: var(--card-bg);
    border: 1px solid var(--line);
    margin-bottom: 16px;
}

.content-card:last-child,
.dashboard-card:last-child {
    margin-bottom: 0;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.card-actions form {
    margin: 0;
}

.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.meta-stack {
    display: grid;
    gap: 6px;
}

.page-banner {
    margin-bottom: 24px;
    background: var(--page-banner-bg);
    box-shadow: var(--shadow);
}

.panel-list {
    display: grid;
    gap: 18px;
}

.feature-list {
    display: grid;
    gap: 14px;
}

.feature-link {
    text-decoration: none;
    font-weight: 700;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.form-stack label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--ink);
    font: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--placeholder);
}

textarea {
    resize: vertical;
}

.auth-shell {
    display: block;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(340px, 1.05fr);
    gap: 24px;
    align-items: stretch;
}

.auth-layout-register {
    grid-template-columns: minmax(320px, 1.15fr) minmax(340px, 0.95fr);
}

.auth-panel {
    width: 100%;
}

.auth-panel-rich {
    display: grid;
    gap: 22px;
}

.auth-aside {
    display: grid;
    align-content: start;
    gap: 18px;
    background: var(--auth-aside-bg);
    color: #f7ecd3;
}

.auth-aside-register {
    min-height: 100%;
    padding: 24px 20px 28px;
    overflow: hidden;
}

.auth-aside .lead {
    color: var(--auth-aside-lead);
}

.auth-note-stack {
    display: grid;
    gap: 14px;
}

.auth-seal {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: calc(100% + 40px);
    margin-inline: -20px;
    padding: 10px 0 8px;
}

.auth-seal-logo {
    display: block;
    width: 100%;
    max-width: none;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.35));
}

.auth-seal-motto {
    color: #d53b2b;
    font-size: clamp(1rem, 1.15vw, 1.25rem);
    letter-spacing: 0.18em;
    text-align: center;
}

.auth-seal-caption {
    color: rgba(247, 236, 211, 0.72);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
}

.auth-note-card {
    padding: 16px;
    border: 1px solid var(--auth-note-border);
    background: var(--auth-note-bg);
}

.auth-note-card p {
    margin-bottom: 0;
    color: var(--auth-note-copy);
}

.auth-aside-register .section-kicker {
    font-size: 0.82rem;
}

.auth-aside-register h2 {
    font-size: clamp(2rem, 3vw, 2.9rem);
    line-height: 0.98;
    max-width: 10ch;
}

.auth-aside-register .lead {
    font-size: 1.08rem;
    max-width: 34ch;
}

.auth-section-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.choice-card {
    display: grid !important;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--choice-border);
    background: var(--choice-bg);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.choice-card:hover {
    transform: translateY(-2px);
    border-color: var(--choice-hover-border);
    box-shadow: var(--choice-hover-shadow);
}

.choice-card input {
    width: auto;
    margin: 0 0 4px;
}

.choice-title {
    font-size: 1.05rem;
}

.choice-copy {
    color: var(--muted);
    font-size: 0.92rem;
}

.choice-card:has(input:checked) {
    border-color: var(--choice-checked-border);
    box-shadow: var(--choice-checked-shadow);
    background: var(--choice-checked-bg);
}

.field-shell {
    display: grid;
    gap: 8px;
}

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

.password-toggle {
    padding: 12px 14px;
    border: 1px solid var(--toggle-border);
    background: var(--toggle-bg);
    color: var(--toggle-ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.theme-toggle {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--toggle-border);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
        var(--toggle-bg);
    color: var(--toggle-ink);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.theme-toggle:focus-visible {
    outline: 2px solid rgba(255, 215, 154, 0.55);
    outline-offset: 2px;
}

.theme-toggle-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 44px;
    height: 24px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.theme-toggle-thumb {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff5d8, #e5b95a);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    transform: translateX(0);
    transition: transform 180ms ease, background 180ms ease;
}

html[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(20px);
    background: linear-gradient(180deg, #fffdf7, #f0dbc2);
}

.theme-toggle-label {
    min-width: 76px;
    text-align: left;
}

.field-hint {
    color: var(--muted);
    font-size: 0.85rem;
}

.auth-submit {
    min-height: 52px;
}

.switch-link {
    margin-bottom: 0;
    color: var(--muted);
}

.flash {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-left: 5px solid var(--gold);
}

.flash-success {
    border-left-color: #2f6f43;
}

.flash-error {
    border-left-color: var(--red);
}

.role-pill,
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--pill-bg);
    color: var(--pill-ink);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.role-assignment-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.role-assignment-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.role-assignment-form select.role-select {
    max-width: 100%;
    min-height: 0;
    font: inherit;
}

.admin-permission-form {
    margin-top: 12px;
}

.work-permit-form {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.work-permit-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.user-search-form {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--subtle-panel-bg);
}

.user-search-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.search-summary {
    margin-bottom: 16px;
    color: var(--muted);
}

.identity-summary-panel {
    margin-bottom: 24px;
}

.identity-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.identity-summary-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    background: var(--subtle-panel-bg);
    border: 1px solid var(--line);
}

.identity-summary-grid-admin {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.identity-summary-label {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.identity-summary-card strong {
    font-size: 1.25rem;
    letter-spacing: 0.08em;
}

.identity-summary-copy {
    margin: 0;
    color: var(--muted);
}

.identity-summary-card-admin {
    align-content: start;
}

.work-permit-admin-form {
    display: grid;
    gap: 14px;
}

.work-permit-admin-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.work-permit-actions {
    align-items: stretch;
}

.identity-summary-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.identity-summary-line strong {
    font-size: 1.2rem;
    letter-spacing: 0.08em;
}

.identity-link {
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(140, 28, 19, 0.35);
}

.identity-inline {
    margin: 12px 0 0;
    color: var(--muted);
}

.identity-inline-separator {
    margin: 0 10px;
    color: var(--line);
}

.identity-card-shell {
    display: grid;
    place-items: center;
}

.identity-card-panel {
    width: min(820px, 100%);
    background: var(--identity-bg);
}

.identity-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.identity-card-logo {
    width: 112px;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22));
}

.work-permit-logo {
    width: 148px;
    height: auto;
}

.wanted-admin-panel,
.wanted-list-panel {
    margin-bottom: 24px;
}

.wanted-admin-form {
    margin-top: 16px;
}

.wanted-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.wanted-form-grid label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.wanted-photo-field,
.wanted-description-field {
    grid-column: 1 / -1;
}

.wanted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 280px));
    justify-content: center;
    align-items: start;
    gap: 16px;
}

.wanted-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    min-height: 420px;
    max-height: 460px;
    padding: 14px;
    overflow: hidden;
}

.wanted-admin-details {
    display: grid;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: var(--subtle-panel-bg);
    max-height: 116px;
    overflow: auto;
}

.wanted-admin-details[open] {
    max-height: 210px;
}

.wanted-admin-details > summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--gold);
}

.wanted-admin-details > summary::-webkit-details-marker {
    color: var(--gold);
}

.wanted-delete-form {
    margin-top: 8px;
}

.wanted-admin-details .wanted-admin-form {
    gap: 10px;
    margin-top: 10px;
}

.wanted-admin-details input,
.wanted-admin-details select,
.wanted-admin-details textarea {
    padding: 9px 10px;
    font-size: 0.9rem;
}

.wanted-admin-details textarea {
    min-height: 86px;
}

.wanted-admin-details .button {
    min-height: 0;
    padding: 9px 12px;
}

.wanted-photo-frame {
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.18);
    aspect-ratio: 5 / 3;
    min-height: 0;
}

.wanted-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.wanted-photo-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
}

.wanted-card-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    min-width: 0;
    min-height: 0;
}

.wanted-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.wanted-card-header h4 {
    margin-bottom: 0;
    font-size: 1.05rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.wanted-description {
    margin-bottom: 0;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow-wrap: anywhere;
}

.wanted-card .meta-line {
    gap: 6px 10px;
    font-size: 0.82rem;
}

.wanted-card .meta-line span,
.wanted-card .meta-line time {
    min-width: 0;
    overflow-wrap: anywhere;
}

.wanted-danger-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    flex: 0 0 auto;
}

.wanted-danger-level-1 {
    background: rgba(74, 131, 74, 0.16);
    color: #9ee39f;
}

.wanted-danger-level-2 {
    background: rgba(140, 134, 54, 0.16);
    color: #efe27a;
}

.wanted-danger-level-3 {
    background: rgba(184, 122, 54, 0.18);
    color: #ffbf7a;
}

.wanted-danger-level-4 {
    background: rgba(184, 68, 54, 0.2);
    color: #ff9f95;
}

.wanted-danger-level-5 {
    background: rgba(132, 28, 19, 0.32);
    color: #ffcfca;
}

.wanted-empty-state {
    padding: 18px;
    border: 1px solid var(--line);
    background: var(--subtle-panel-bg);
}

.wanted-empty-state p {
    margin-bottom: 0;
    color: var(--muted);
}

.inspector-top-grid {
    align-items: start;
}

.inspector-message-panel,
.inspector-wanted-panel {
    margin-bottom: 24px;
}

.inspector-message-form {
    margin-top: 12px;
}

.inspector-wanted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 190px));
    justify-content: start;
    gap: 12px;
}

.inspector-wanted-card {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.inspector-wanted-photo {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.18);
}

.inspector-wanted-body {
    display: grid;
    gap: 8px;
}

.inspector-wanted-body p {
    margin-bottom: 0;
    color: var(--muted);
}

.inspector-wanted-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.inspector-wanted-header h4 {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.identity-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.identity-card-field {
    display: grid;
    gap: 8px;
    padding: 16px;
    background: var(--identity-field-bg);
    border: 1px solid var(--line);
}

.identity-card-field span {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.identity-card-field strong {
    font-size: 1.05rem;
}

.identity-card-field-wide {
    grid-column: 1 / -1;
}

.identity-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--identity-footer-border);
}

.identity-card-footer strong {
    color: var(--red);
    letter-spacing: 0.1em;
}

.dashboard-scroll-panel {
    max-height: 540px;
    overflow-y: auto;
    padding-right: 8px;
}

.dashboard-scroll-panel-users {
    max-height: 860px;
}

.inspector-audit-panel {
    display: grid;
    gap: 16px;
}

.panel-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.inspector-audit-card {
    padding: 20px;
    text-align: center;
}

.inspector-audit-card h4 {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.audit-number {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.inspector-audit-list {
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.inspector-audit-user-card {
    padding: 16px;
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.inspector-audit-user-card .meta-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.government-messages-grid {
    align-items: start;
}

.government-search-panel {
    margin-bottom: 24px;
}

.labor-lottery-panel {
    display: grid;
    gap: 20px;
}

.labor-lottery-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.labor-lottery-note {
    min-width: 180px;
    display: grid;
    gap: 4px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: var(--subtle-panel-bg);
}

.labor-lottery-note-label,
.lottery-summary-label {
    color: var(--gold);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.labor-lottery-note strong {
    font-size: 1.8rem;
    line-height: 1;
}

.lottery-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.lottery-summary-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--choice-border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        var(--card-bg);
}

.lottery-summary-card strong {
    font-size: 1.1rem;
    line-height: 1.25;
}

.lottery-summary-card p {
    margin-bottom: 0;
    color: var(--muted);
}

.lottery-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 14px;
}

.lottery-admin-form {
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--subtle-panel-bg);
}

.lottery-admin-form-draw {
    align-content: start;
}

.lottery-admin-copy {
    margin: 0;
    color: var(--muted);
}

.lottery-history {
    display: grid;
    gap: 14px;
}

.lottery-history-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.lottery-history-card,
.lottery-history-empty {
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--card-bg);
}

.lottery-history-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.lottery-history-meta {
    margin-top: 10px;
}

.message-recipient-mode {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        var(--subtle-panel-bg);
}

.message-recipient-mode legend {
    padding: 0 8px;
    font-weight: 700;
}

.message-recipient-mode-copy {
    margin: 0;
    color: var(--muted);
}

.recipient-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.recipient-mode-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "check content"
        "check content";
    gap: 10px 12px;
    padding: 16px 15px;
    border: 1px solid var(--choice-border);
    background: var(--choice-bg);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
    align-items: start;
    min-height: 100%;
}

.recipient-mode-option input {
    grid-area: check;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--red);
}

.recipient-mode-option:hover {
    transform: translateY(-2px);
    border-color: var(--choice-hover-border);
    box-shadow: var(--choice-hover-shadow);
}

.recipient-mode-content {
    grid-area: content;
    display: grid;
    gap: 6px;
}

.recipient-mode-title {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.recipient-mode-copy {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.recipient-mode-option:has(input:checked) {
    border-color: var(--choice-checked-border);
    box-shadow: var(--choice-checked-shadow);
    background: var(--choice-checked-bg);
}

.message-recipient-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    max-height: 380px;
    overflow-y: auto;
    padding: 14px;
    border: 1px solid var(--line);
    background: var(--subtle-panel-bg);
}

.recipient-picker-disabled {
    opacity: 0.58;
}

.recipient-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "content check"
        "content check";
    gap: 10px 14px;
    padding: 16px;
    border: 1px solid var(--choice-border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
        var(--card-bg);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
    cursor: pointer;
    align-items: start;
}

.recipient-card input {
    grid-area: check;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--red);
}

.recipient-card-content {
    grid-area: content;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.recipient-card:hover {
    transform: translateY(-2px);
    border-color: var(--choice-hover-border);
    box-shadow: var(--choice-hover-shadow);
}

.recipient-card:has(input:checked) {
    border-color: var(--choice-checked-border);
    box-shadow: var(--choice-checked-shadow);
    background: var(--choice-checked-bg);
}

.recipient-card-name {
    font-weight: 700;
    line-height: 1.2;
}

.recipient-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.recipient-card-pill {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pill-bg);
    color: var(--pill-ink);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

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

.message-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.message-editor-toolbar .button {
    padding: 10px 14px;
}

.editor-color-picker {
    display: inline-grid;
    gap: 6px;
    font-weight: 700;
}

.editor-color-picker input {
    width: 56px;
    min-height: 42px;
    padding: 4px;
}

.message-editor {
    min-height: 220px;
    padding: 14px;
    border: 1px solid var(--editor-border);
    background: var(--editor-bg);
    overflow-y: auto;
}

.message-editor:focus {
    outline: 2px solid rgba(140, 28, 19, 0.22);
    outline-offset: 0;
}

.government-message-card {
    display: grid;
    gap: 14px;
}

.government-message-body {
    display: grid;
    gap: 10px;
}

.government-message-body p,
.government-message-body ul,
.government-message-body ol {
    margin-bottom: 0;
}

.dashboard-scroll-panel::-webkit-scrollbar {
    width: 10px;
}

.dashboard-scroll-panel::-webkit-scrollbar-thumb {
    background: rgba(140, 28, 19, 0.38);
    border: 2px solid var(--scrollbar-border);
}

.dashboard-scroll-panel::-webkit-scrollbar-track {
    background: rgba(140, 28, 19, 0.05);
}

.notice-panel {
    text-align: center;
}

.site-footer {
    padding: 22px;
    text-align: center;
    color: var(--footer-ink);
}

@media (max-width: 860px) {
    .brand-row,
    .hero-panel,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .brand-row {
        align-items: flex-start;
    }

    .status-card {
        text-align: left;
    }

    .auth-layout,
    .choice-grid,
    .wanted-form-grid,
    .wanted-grid,
    .inspector-top-grid,
    .inspector-wanted-grid,
    .identity-summary-grid,
    .identity-card-grid,
    .lottery-summary-grid,
    .lottery-admin-grid,
    .recipient-mode-grid,
    .message-recipient-picker {
        grid-template-columns: 1fr;
    }

    .auth-aside-register {
        padding: 18px 14px 22px;
    }

    .identity-summary-grid-admin {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
    }

    .main-nav {
        gap: 8px;
    }

    .main-nav a,
    .button {
        width: 100%;
    }

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

    .password-toggle {
        width: 100%;
    }

    .wanted-card-header {
        flex-direction: column;
    }

    .inspector-wanted-header {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.page-is-loading .site-header,
    body.page-is-loading .page-shell,
    body.page-is-loading .site-footer,
    body.page-is-ready .site-header,
    body.page-is-ready .page-shell,
    body.page-is-ready .site-footer,
    body.page-is-leaving .site-header,
    body.page-is-leaving .page-shell,
    body.page-is-leaving .site-footer,
    .main-nav a,
    .main-nav a::after {
        transition: none;
        transform: none;
        filter: none;
        opacity: 1;
    }
}
