:root {
    color-scheme: light;
    --green-950: #06351f;
    --green-900: #0b4529;
    --green-800: #0f5a34;
    --green-700: #146c3f;
    --green-100: #e4f2e9;
    --green-50: #f2f8f4;
    --gold-500: #e3a514;
    --gold-100: #fff3cf;
    --ink-950: #15201a;
    --ink-800: #2d3a32;
    --ink-600: #59675e;
    --ink-500: #718078;
    --line: #dce4df;
    --line-strong: #c8d4cc;
    --surface: #ffffff;
    --surface-soft: #f7f9f7;
    --surface-muted: #eef3ef;
    --danger-700: #a22c2c;
    --danger-100: #fbe6e6;
    --info-100: #e8f1fb;
    --info-700: #285f91;
    --shadow-sm: 0 1px 2px rgba(19, 40, 28, 0.07);
    --shadow-md: 0 12px 30px rgba(19, 40, 28, 0.09);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --content-width: 1440px;
    font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--surface-soft);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink-950);
    background: var(--surface-soft);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
label[for] {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--green-700);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--gold-500);
    outline-offset: 3px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--ink-950);
    line-height: 1.18;
    letter-spacing: -0.02em;
}

h1 {
    margin-bottom: 0.7rem;
    font-size: clamp(2rem, 3.4vw, 3.15rem);
    font-weight: 720;
}

h2 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

h3 {
    margin-bottom: 0.35rem;
    font-size: 1.08rem;
}

.app-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.4rem 1rem;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.06), transparent 35%),
        var(--green-950);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 58px;
    padding: 0 0.65rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand__mark {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: var(--green-950);
    background: var(--gold-500);
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 800;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 0.98rem;
}

.brand span {
    margin-top: 0.05rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.79rem;
}

.nav-list {
    display: grid;
    gap: 0.32rem;
    margin-top: 1.3rem;
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    min-height: 48px;
    padding: 0.65rem 0.72rem;
    color: rgba(255, 255, 255, 0.78);
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 0.91rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nav-list a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-list a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 3px 0 0 var(--gold-500);
}

.nav-list__number {
    display: grid;
    place-items: center;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    color: var(--green-950);
    background: rgba(255, 255, 255, 0.88);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
}

.nav-list a.active .nav-list__number {
    background: var(--gold-500);
}

.sidebar__help {
    margin-top: auto;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.82rem;
}

.sidebar__help strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #fff;
}

.sidebar__help p {
    margin-bottom: 0;
}

.main-shell {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 70px;
    padding: 0.8rem clamp(1rem, 3vw, 2.5rem);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.topbar > div:first-child {
    display: grid;
}

.topbar__label {
    color: var(--ink-500);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.topbar strong {
    font-size: 0.98rem;
}

.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    color: var(--ink-600);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.79rem;
    font-weight: 650;
}

.connection-badge__dot {
    width: 8px;
    height: 8px;
    background: var(--ink-500);
    border-radius: 50%;
}

.connection-badge--online {
    color: var(--green-800);
    background: var(--green-50);
    border-color: #c8e2d1;
}

.connection-badge--online .connection-badge__dot {
    background: #24a05a;
    box-shadow: 0 0 0 3px rgba(36, 160, 90, 0.13);
}

.connection-badge--offline {
    color: var(--danger-700);
    background: #fff7f7;
    border-color: #efc5c5;
}

.connection-badge--offline .connection-badge__dot {
    background: var(--danger-700);
}

.content {
    width: min(100%, var(--content-width));
    min-height: calc(100vh - 130px);
    margin: 0 auto;
    padding: clamp(1.4rem, 3vw, 2.8rem);
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem clamp(1rem, 3vw, 2.5rem);
    color: var(--ink-500);
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
}

.eyebrow {
    margin-bottom: 0.4rem;
    color: var(--green-700);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.4rem;
}

.page-heading__copy {
    max-width: 820px;
}

.page-heading__description {
    max-width: 730px;
    margin-bottom: 0;
    color: var(--ink-600);
    font-size: 1.04rem;
}

.page-heading__actions {
    flex: 0 0 auto;
    padding-bottom: 0.25rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.button:hover:not(:disabled):not(.is-disabled) {
    transform: translateY(-1px);
}

.button:disabled,
.button.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.button--primary {
    color: #fff;
    background: var(--green-700);
    border-color: var(--green-700);
    box-shadow: 0 5px 12px rgba(15, 90, 52, 0.16);
}

.button--primary:hover:not(:disabled) {
    background: var(--green-800);
}

.button--secondary {
    color: var(--green-800);
    background: #fff;
    border-color: var(--line-strong);
}

.button--secondary:hover:not(:disabled):not(.is-disabled) {
    background: var(--green-50);
    border-color: #a9c7b3;
}

.button--quiet {
    color: var(--ink-600);
    background: transparent;
    border-color: transparent;
}

.button--quiet:hover:not(:disabled) {
    color: var(--ink-950);
    background: var(--surface-muted);
}

.button--danger {
    margin-left: auto;
    color: var(--danger-700);
    background: #fff;
    border-color: #e6baba;
}

.button--danger:hover:not(:disabled) {
    background: var(--danger-100);
}

.button--small {
    min-height: 38px;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
}

.icon-button {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    color: currentColor;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
}

.icon-button:hover {
    background: rgba(0, 0, 0, 0.07);
}

.status-message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid;
    border-radius: var(--radius-md);
}

.status-message > div {
    display: grid;
    gap: 0.08rem;
}

.status-message strong {
    font-size: 0.88rem;
}

.status-message span {
    font-size: 0.9rem;
}

.status-message--success {
    color: var(--green-900);
    background: var(--green-100);
    border-color: #b8d8c4;
}

.status-message--error {
    color: #7c2222;
    background: var(--danger-100);
    border-color: #e4b6b6;
}

.status-message--info {
    color: var(--info-700);
    background: var(--info-100);
    border-color: #bed2e6;
}

.overview-status {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 2.2rem;
    padding: 1.4rem;
    color: #fff;
    background:
        radial-gradient(circle at 92% 15%, rgba(227, 165, 20, 0.22), transparent 28%),
        var(--green-900);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.overview-status .eyebrow {
    color: #f5cf6d;
}

.overview-status h2 {
    margin-bottom: 0.25rem;
    color: #fff;
}

.overview-status p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.76);
}

.overview-status__icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    color: var(--green-950);
    background: var(--gold-500);
    border-radius: 16px;
    font-size: 1.3rem;
    font-weight: 900;
}

.overview-status__details {
    display: flex;
    gap: 0.75rem;
    margin: 0;
}

.overview-status__details > div {
    min-width: 116px;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
}

.overview-status dt {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.overview-status dd {
    margin: 0.2rem 0 0;
    color: #fff;
    font-weight: 750;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1rem;
}

.section-heading > p {
    max-width: 560px;
    margin-bottom: 0.3rem;
    color: var(--ink-600);
    font-size: 0.9rem;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.workflow-card {
    display: flex;
    gap: 0.9rem;
    min-height: 164px;
    padding: 1.15rem;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.workflow-card:hover {
    transform: translateY(-3px);
    border-color: #abc9b5;
    box-shadow: var(--shadow-md);
}

.workflow-card__number {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    color: var(--green-900);
    background: var(--gold-100);
    border-radius: 10px;
    font-weight: 800;
}

.workflow-card p {
    margin-bottom: 0.75rem;
    color: var(--ink-600);
    font-size: 0.9rem;
}

.text-link {
    color: var(--green-700);
    font-size: 0.84rem;
    font-weight: 750;
}

.help-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) 1.25fr;
    gap: 2rem;
    padding: 1.4rem;
    background: var(--gold-100);
    border: 1px solid #f1d88f;
    border-radius: var(--radius-md);
}

.help-panel ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.2rem;
    color: var(--ink-800);
    font-size: 0.9rem;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
    align-items: end;
    gap: 2rem;
    margin-bottom: 1.25rem;
    padding: 1.15rem 1.25rem;
    background: var(--green-50);
    border: 1px solid #d3e5d9;
    border-radius: var(--radius-md);
}

.filter-panel h2 {
    font-size: 1.2rem;
}

.filter-panel p {
    margin-bottom: 0;
    color: var(--ink-600);
    font-size: 0.88rem;
}

.filter-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.filter-fields--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-panel--two {
    grid-template-columns: minmax(240px, 0.65fr) minmax(480px, 1.35fr);
}

.workspace {
    display: grid;
    grid-template-columns: minmax(300px, 0.72fr) minmax(500px, 1.28fr);
    align-items: start;
    gap: 1.2rem;
}

.record-panel,
.editor-panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.record-panel {
    position: sticky;
    top: 88px;
    overflow: hidden;
}

.editor-panel {
    padding-bottom: 1.1rem;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.15rem 1rem;
    border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
    margin-bottom: 0.2rem;
    font-size: 1.2rem;
}

.panel-heading p:last-child {
    margin-bottom: 0;
    color: var(--ink-600);
    font-size: 0.84rem;
}

.record-list {
    display: grid;
    gap: 0.55rem;
    max-height: calc(100vh - 255px);
    padding: 0.75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.record-card {
    display: grid;
    width: 100%;
    padding: 0.85rem;
    color: var(--ink-950);
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.record-card:hover {
    background: var(--surface-soft);
    border-color: #b9cabf;
}

.record-card.is-selected {
    background: var(--green-50);
    border-color: var(--green-700);
    box-shadow: inset 3px 0 0 var(--green-700);
}

.record-card__title {
    font-weight: 750;
}

.record-card__description {
    display: -webkit-box;
    margin-top: 0.18rem;
    color: var(--ink-600);
    overflow: hidden;
    font-size: 0.84rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.record-card__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    color: var(--ink-500);
    border-top: 1px solid var(--line);
    font-size: 0.7rem;
    font-weight: 650;
}

.user-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.18rem 0.48rem;
    color: var(--ink-700);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 750;
    line-height: 1;
}

.status-pill--active {
    color: var(--green-800);
    background: var(--green-50);
    border-color: #b9d7c4;
}

.status-pill--disabled,
.status-pill--locked {
    color: var(--danger-700);
    background: var(--danger-100);
    border-color: #e8bcbc;
}

.status-pill--role {
    color: var(--info-700);
    background: var(--info-100);
    border-color: #bfd4e8;
}

.status-pill--current {
    color: #684a00;
    background: var(--gold-100);
    border-color: #eed17d;
}

.record-card--media {
    grid-template-columns: 58px minmax(0, 1fr);
    column-gap: 0.75rem;
}

.record-card--media .record-card__description {
    grid-column: 2;
}

.record-card__thumbnail {
    grid-row: 1 / span 2;
    width: 58px;
    height: 58px;
    object-fit: cover;
    background: var(--surface-muted);
    border-radius: 8px;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 210px;
    padding: 2rem 1rem;
    color: var(--ink-600);
    text-align: center;
}

.empty-state strong {
    color: var(--ink-800);
}

.empty-state p {
    max-width: 290px;
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
}

.list-feedback {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.9rem;
    min-height: 210px;
    padding: 2rem;
    color: var(--ink-600);
    background: var(--surface-soft);
    text-align: left;
}

.list-feedback strong {
    color: var(--ink-800);
}

.list-feedback p {
    max-width: 420px;
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
}

.list-feedback--error {
    grid-template-columns: minmax(0, 1fr) auto;
    border-top: 1px solid var(--danger-100);
    background: var(--danger-100);
}

.list-feedback--error strong {
    color: var(--danger-700);
}

.list-feedback__spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--green-100);
    border-top-color: var(--green-700);
    border-radius: 50%;
    animation: spin 850ms linear infinite;
}

.editor-load-feedback {
    min-height: 360px;
    border-top: 1px solid var(--line);
}

.editor-form {
    display: grid;
    gap: 1.1rem;
    padding: 1.15rem;
}

.form-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.form-field label,
.field-heading label {
    color: var(--ink-800);
    font-size: 0.85rem;
    font-weight: 750;
}

.form-field--compact {
    gap: 0.25rem;
}

.text-input,
.text-area,
.select-input,
.number-input {
    width: 100%;
    min-height: 46px;
    padding: 0.68rem 0.78rem;
    color: var(--ink-950);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.text-area {
    min-height: 130px;
    resize: vertical;
}

.text-area--large {
    min-height: 190px;
}

.select-input {
    padding-right: 2rem;
}

.text-input:hover:not(:disabled),
.text-area:hover:not(:disabled),
.select-input:hover:not(:disabled),
.number-input:hover:not(:disabled) {
    border-color: #9eb2a5;
}

.text-input:focus,
.text-area:focus,
.select-input:focus,
.number-input:focus {
    border-color: var(--green-700);
    box-shadow: 0 0 0 3px rgba(20, 108, 63, 0.11);
}

.text-input:disabled,
.text-area:disabled,
.select-input:disabled,
.number-input:disabled,
fieldset:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.field-help {
    color: var(--ink-500);
    font-size: 0.76rem;
}

.field-error,
.validation-message {
    margin: 0.15rem 0 0;
    color: var(--danger-700);
    font-size: 0.78rem;
    font-weight: 650;
}

.invalid:not(form) {
    border-color: var(--danger-700);
}

.valid.modified:not([type="checkbox"]) {
    border-color: #5d9c73;
}

.validation-summary {
    margin: 0;
    padding: 0.8rem 1rem;
    color: var(--danger-700);
    background: #fff7f7;
    border: 1px solid #e9c1c1;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.validation-summary:empty {
    display: none;
}

.validation-summary ul {
    margin: 0;
    padding-left: 1.1rem;
}

.field-heading {
    display: grid;
    gap: 0.2rem;
}

.media-picker {
    display: grid;
    gap: 0.65rem;
}

.media-picker__surface {
    display: grid;
    place-items: center;
    min-height: 250px;
    padding: 0.75rem;
    background:
        linear-gradient(45deg, #f1f4f2 25%, transparent 25%),
        linear-gradient(-45deg, #f1f4f2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f4f2 75%),
        linear-gradient(-45deg, transparent 75%, #f1f4f2 75%),
        #fafbfa;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
    border: 1px dashed #b8c5bd;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.media-picker__surface img {
    display: block;
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 6px;
}

.media-picker__empty {
    display: grid;
    gap: 0.25rem;
    color: var(--ink-500);
    text-align: center;
}

.media-picker__empty span {
    color: var(--ink-600);
    font-weight: 700;
}

.media-picker__actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.video-upload {
    padding: 1rem;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.video-upload input[type="file"] {
    width: 100%;
    padding: 0.7rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.upload-progress {
    display: grid;
    gap: 0.4rem;
    padding: 0.75rem;
    color: var(--ink-700);
    background: #eef8f2;
    border: 1px solid #b8d9c4;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
}

.upload-progress progress {
    width: 100%;
    height: 0.85rem;
    accent-color: var(--green-700);
}

.stored-video-path {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.7rem;
    color: var(--ink-700);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-wrap: anywhere;
}

.check-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.7rem;
    padding: 0.85rem;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.check-field input {
    width: 19px;
    height: 19px;
    margin-top: 0.1rem;
    accent-color: var(--green-700);
}

.check-field strong,
.check-field small {
    display: block;
}

.check-field strong {
    color: var(--ink-800);
    font-size: 0.85rem;
}

.check-field small {
    margin-top: 0.15rem;
    color: var(--ink-600);
    font-size: 0.76rem;
}

.check-field:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.65;
}

.user-system-panel,
.user-security-panel {
    margin: 1.15rem;
    padding: 1.15rem;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.user-system-panel h3,
.user-security-panel h3 {
    margin: 0.7rem 0 0.35rem;
}

.user-system-panel p,
.user-security-panel p {
    margin: 0;
    color: var(--ink-600);
    font-size: 0.86rem;
}

.user-security-panel {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
    gap: 1rem;
    border-color: #d7e1db;
}

.user-security-form {
    display: grid;
    gap: 0.8rem;
}

.user-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 1.15rem 1.15rem;
    padding: 1rem;
    color: #792323;
    background: var(--danger-100);
    border: 1px solid #e8bcbc;
    border-radius: var(--radius-sm);
}

.user-danger-zone p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
}

.nav-list__admin {
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 0 10px 10px !important;
}

.form-actions {
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
}

.danger-note,
.guidance-card {
    margin: 0 1.15rem;
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.danger-note {
    color: #792323;
    background: var(--danger-100);
    border: 1px solid #e8bcbc;
}

.move-panel {
    display: grid;
    gap: 0.9rem;
    margin: 0 1.15rem 1.15rem;
    padding: 1rem;
    color: var(--info-700);
    background: var(--info-100);
    border: 1px solid #bfd4e8;
    border-radius: var(--radius-sm);
}

.move-panel h3,
.move-panel p {
    margin: 0;
}

.move-panel .form-field {
    margin: 0;
}

.move-panel__current,
.move-panel__selection {
    font-size: 0.86rem;
}

.move-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.guidance-card {
    margin-top: 1.15rem;
    color: var(--info-700);
    background: var(--info-100);
    border: 1px solid #bfd4e8;
}

.guidance-card strong {
    display: block;
    margin-bottom: 0.2rem;
}

.guidance-card p {
    margin-bottom: 0;
}

.coordinate-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.coordinate-fields legend {
    grid-column: 1 / -1;
    margin-bottom: 0.15rem;
    color: var(--ink-800);
    font-size: 0.85rem;
    font-weight: 800;
}

.geometry-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.2rem 0.75rem;
    padding: 0.8rem;
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.geometry-summary span {
    color: var(--ink-600);
}

.empty-page {
    max-width: 660px;
    margin: 10vh auto 0;
    padding: 2rem;
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.empty-page p:not(.eyebrow) {
    color: var(--ink-600);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.topbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.account-menu {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding-left: 0.65rem;
    border-left: 1px solid var(--line);
}

.account-menu > span {
    max-width: 220px;
    overflow: hidden;
    color: var(--ink-600);
    font-size: 0.8rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(227, 165, 20, 0.16), transparent 25rem),
        linear-gradient(145deg, var(--green-950), var(--green-800));
}

.auth-header {
    padding: 1.25rem clamp(1rem, 4vw, 3rem);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
}

.auth-brand > span:last-child,
.auth-brand strong,
.auth-brand small {
    display: block;
}

.auth-brand strong {
    font-size: 1rem;
}

.auth-brand small {
    margin-top: 0.08rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
}

.auth-main {
    display: grid;
    place-items: center;
    width: 100%;
    padding: 1rem clamp(1rem, 4vw, 3rem) 3rem;
}

.auth-card {
    width: min(100%, 520px);
    padding: clamp(1.35rem, 4vw, 2.25rem);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 70px rgba(3, 31, 18, 0.3);
}

.auth-card__intro {
    margin-bottom: 1.4rem;
}

.auth-card__intro h1 {
    margin: 0.25rem 0 0.65rem;
    font-size: clamp(1.65rem, 4vw, 2.15rem);
    line-height: 1.15;
}

.auth-card__intro p:last-child,
.auth-help {
    color: var(--ink-600);
}

.auth-card form,
.auth-fields {
    display: grid;
    gap: 1rem;
}

.auth-submit {
    width: 100%;
    margin-top: 0.2rem;
}

.auth-help {
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
}

.auth-footer {
    padding: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
    text-align: center;
}

.route-loading {
    max-width: 520px;
    margin: 14vh auto;
    padding: 1.25rem;
    color: var(--ink-600);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    text-align: center;
}

.loading-screen {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1rem;
    min-height: 100vh;
    color: var(--ink-600);
    background: var(--surface-soft);
}

.loading-brand {
    color: var(--green-800);
    font-size: 1.7rem;
    font-weight: 850;
    letter-spacing: 0.14em;
}

.loading-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid var(--green-100);
    border-top-color: var(--green-700);
    border-radius: 50%;
    animation: spin 850ms linear infinite;
}

.loading-screen p {
    font-size: 0.9rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#blazor-error-ui {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 1000;
    display: none;
    max-width: 760px;
    margin: 0 auto;
    padding: 0.9rem 3rem 0.9rem 1rem;
    color: #fff;
    background: #752323;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

#blazor-error-ui .reload {
    margin-left: 0.6rem;
    color: #fff;
    font-weight: 700;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    color: #fff;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
}

.delete-dialog {
    width: min(92vw, 590px);
    max-height: min(88vh, 720px);
    margin: auto;
    padding: 0;
    overflow: auto;
    color: var(--ink-950);
    background: transparent;
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(6, 35, 21, 0.3);
}

.delete-dialog::backdrop {
    background: rgba(6, 35, 21, 0.62);
    backdrop-filter: blur(3px);
}

.delete-dialog__surface {
    display: grid;
    gap: 1.25rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: var(--surface);
}

.delete-dialog__heading,
.delete-dialog__result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
}

.delete-dialog__heading h2,
.delete-dialog__result h2 {
    margin-bottom: 0;
}

.delete-dialog__heading .eyebrow,
.delete-dialog__result .eyebrow {
    margin-bottom: 0.2rem;
}

.delete-dialog__warning,
.delete-dialog__result-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--danger-700);
    background: var(--danger-100);
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 800;
}

.move-dialog__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--info-700);
    background: var(--info-100);
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 800;
}

.move-dialog__route {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--info-100);
    border: 1px solid #bfd4e8;
    border-radius: var(--radius-md);
}

.move-dialog__route div {
    display: grid;
    gap: 0.25rem;
}

.move-dialog__route span,
.move-dialog__assurance {
    color: var(--ink-600);
    font-size: 0.86rem;
}

.move-dialog__route-arrow {
    color: var(--info-700) !important;
    font-size: 1.2rem !important;
    font-weight: 800;
}

.move-dialog__assurance {
    margin: 0;
}

.delete-dialog__message {
    margin: 0;
    color: var(--ink-600);
}

.delete-dialog__progress,
.delete-dialog__error {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: var(--radius-md);
}

.delete-dialog__progress {
    color: var(--green-800);
    background: var(--green-50);
    border: 1px solid var(--green-100);
}

.delete-dialog__progress div,
.delete-dialog__error {
    display: grid;
}

.delete-dialog__progress span:last-child,
.delete-dialog__error span {
    font-size: 0.9rem;
}

.delete-dialog__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--green-100);
    border-top-color: var(--green-700);
    border-radius: 50%;
    animation: spin 850ms linear infinite;
}

.delete-dialog__error {
    color: var(--danger-700);
    background: var(--danger-100);
    border: 1px solid #efcaca;
}

.delete-dialog__result--success {
    align-items: start;
    color: var(--green-800);
}

.delete-dialog__result--success .delete-dialog__result-icon {
    color: var(--green-800);
    background: var(--green-100);
}

.delete-dialog__result--success p:last-child {
    margin: 0.6rem 0 0;
    color: var(--ink-600);
}

.delete-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.25rem;
}

.delete-dialog__actions .button--danger {
    margin-left: 0;
    color: #fff;
    background: var(--danger-700);
    border-color: var(--danger-700);
}

.delete-dialog__actions .button--danger:hover:not(:disabled) {
    color: #fff;
    background: #832323;
}

.blazor-error-boundary {
    padding: 1rem;
    color: #fff;
    background: var(--danger-700);
    border-radius: var(--radius-sm);
}

.blazor-error-boundary::after {
    content: "This section could not be displayed. Reload the page and try again.";
}

@media (max-width: 1180px) {
    .workspace {
        grid-template-columns: minmax(270px, 0.8fr) minmax(440px, 1.2fr);
    }

    .filter-panel--two {
        grid-template-columns: 1fr;
    }

    .workflow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 0.8rem 1rem;
        overflow: visible;
    }

    .brand {
        min-height: 50px;
        padding: 0 0 0.75rem;
    }

    .brand__mark {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .nav-list {
        display: flex;
        gap: 0.45rem;
        margin-top: 0.75rem;
        padding-bottom: 0.25rem;
        overflow-x: auto;
        scroll-snap-type: x proximity;
    }

    .nav-list a {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 0.45rem 0.65rem;
        scroll-snap-align: start;
    }

    .nav-list a.active {
        box-shadow: inset 0 -3px 0 var(--gold-500);
    }

    .nav-list__admin {
        margin-top: 0;
        border-top: 0 !important;
        border-radius: 10px !important;
    }

    .nav-list__number {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .sidebar__help {
        display: none;
    }

    .topbar {
        top: 0;
        min-height: 60px;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .record-panel {
        position: static;
    }

    .record-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 430px;
    }

    .overview-status {
        grid-template-columns: auto 1fr;
    }

    .overview-status__details {
        grid-column: 1 / -1;
    }

    .filter-panel {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 680px) {
    .content {
        padding: 1.25rem 0.85rem 2rem;
    }

    .topbar {
        padding: 0.65rem 0.85rem;
    }

    .connection-badge {
        padding: 0.4rem 0.55rem;
    }

    .connection-badge span:last-child {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .page-heading,
    .section-heading {
        display: grid;
        align-items: start;
        gap: 0.8rem;
    }

    .page-heading__actions .button {
        width: 100%;
    }

    .overview-status {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .overview-status__details {
        grid-column: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workflow-grid,
    .record-list,
    .filter-fields,
    .filter-fields--three,
    .help-panel,
    .coordinate-fields {
        grid-template-columns: 1fr;
    }

    .record-list {
        max-height: 390px;
    }

    .list-feedback,
    .list-feedback--error {
        grid-template-columns: 1fr;
        justify-items: start;
        padding: 1.5rem;
    }

    .user-security-panel {
        grid-template-columns: 1fr;
    }

    .user-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .user-danger-zone .button {
        width: 100%;
    }

    .delete-dialog {
        width: calc(100vw - 1.25rem);
        max-height: calc(100vh - 1.25rem);
    }

    .delete-dialog__heading,
    .delete-dialog__result,
    .delete-dialog__progress,
    .delete-dialog__error {
        grid-template-columns: 1fr;
    }

    .move-dialog__route {
        grid-template-columns: 1fr;
    }

    .move-dialog__route-arrow {
        transform: rotate(90deg);
    }

    .delete-dialog__actions {
        flex-direction: column-reverse;
    }

    .delete-dialog__actions .button {
        width: 100%;
    }

    .panel-heading {
        padding: 1rem;
    }

    .editor-form {
        padding: 1rem;
    }

    .media-picker__surface {
        min-height: 210px;
    }

    .form-actions .button {
        flex: 1 1 150px;
    }

    .button--danger {
        margin-left: 0;
    }

    .footer {
        display: grid;
    }

    .topbar__actions {
        gap: 0.35rem;
    }

    .account-menu {
        padding-left: 0.35rem;
    }

    .account-menu > span {
        display: none;
    }

    .auth-main {
        align-items: start;
        padding-top: 0.5rem;
    }

    .auth-card {
        padding: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
