@font-face {
    font-family: "Gabarito";
    src: url("../fonts/Gabarito-Regular.ttf") format("truetype");
    font-weight: 400;
}

@font-face {
    font-family: "Gabarito";
    src: url("../fonts/Gabarito-SemiBold.ttf") format("truetype");
    font-weight: 600;
}

:root {
    color-scheme: light;
    --ink: #221b36;
    --muted: #6f687c;
    --surface: #ffffff;
    --canvas: #f7f5fa;
    --purple: #560bad;
    --purple-dark: #3f0780;
    --pink: #b5179e;
    --edition-accent: #7c3aed;
    --edition-accent-dark: #5b21b6;
    --edition-soft: #f5f3ff;
    --line: #e8e3ed;
    --danger: #a32145;
    --success: #087a37;
    --green-bright: #16e329;
    --green-soft: #f1fff2;
    --shadow: 0 24px 70px rgba(48, 22, 72, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Gabarito", system-ui, sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

.admin-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(320px, 0.85fr) minmax(480px, 1.15fr);
}

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(2rem, 6vw, 5rem);
    background:
        radial-gradient(circle at 12% 88%, rgba(181, 23, 158, 0.92), transparent 35%),
        radial-gradient(circle at 90% 12%, rgba(114, 9, 183, 0.75), transparent 38%),
        #250744;
    color: #fff;
}

.brand-panel::after {
    position: absolute;
    right: -8rem;
    bottom: -11rem;
    width: 28rem;
    height: 28rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    box-shadow: 0 0 0 4rem rgba(255, 255, 255, 0.035), 0 0 0 8rem rgba(255, 255, 255, 0.025);
    content: "";
}

.brand-panel > div,
.back-link {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 0.7rem;
    color: var(--pink);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-panel .eyebrow {
    color: #f4a8e8;
}

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

h1 {
    max-width: 650px;
    margin-bottom: 1.5rem;
    font-size: clamp(2.5rem, 5vw, 5.5rem);
    line-height: 0.96;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: -0.025em;
}

h3 {
    margin-bottom: 0.65rem;
    font-size: 1.35rem;
}

h4 {
    margin-top: 0;
}

h5 {
    margin-top: 0;
}

.intro {
    max-width: 590px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 1.12rem;
    line-height: 1.6;
}

.back-link {
    margin: 2rem 0 0;
}

.back-link a {
    color: rgba(255, 255, 255, 0.74);
    text-decoration: none;
}

.back-link a:hover {
    color: #fff;
}

.workspace {
    display: grid;
    place-items: center;
    padding: clamp(1.25rem, 6vw, 6rem);
}

.card,
.dashboard {
    width: min(100%, 520px);
    padding: clamp(1.6rem, 4vw, 3rem);
    border: 1px solid rgba(86, 11, 173, 0.08);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.dashboard {
    width: min(100%, 940px);
}

.card-centered {
    text-align: center;
}

.two-factor-card {
    max-width: 520px;
}

#clear-log-dialog { border-radius: 28px; }
#clear-log-dialog .two-factor-card { padding: clamp(1.6rem, 4vw, 3rem); }
#cancel-clear-log { margin-top: 0.65rem; }

.two-factor-qr-wrap {
    display: grid;
    margin: 1.25rem 0;
    padding: 1rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.two-factor-qr-wrap img {
    display: block;
    width: min(280px, 100%);
    height: auto;
}

.two-factor-manual {
    margin-bottom: 1.25rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8f5fa;
}

.two-factor-manual summary {
    cursor: pointer;
    font-weight: 600;
}

.two-factor-manual code {
    display: block;
    margin-top: 0.75rem;
    overflow-wrap: anywhere;
    color: var(--purple-dark);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.two-factor-code {
    font-size: 1.45rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.28em;
    text-align: center;
}

.two-factor-back {
    margin-top: 0.65rem;
}

.muted {
    color: var(--muted);
    line-height: 1.55;
}

label {
    display: block;
    margin: 1.4rem 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid #d9d3df;
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--ink);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(86, 11, 173, 0.11);
}

button {
    width: 100%;
    margin-top: 1.6rem;
    padding: 0.95rem 1.2rem;
    border: 0;
    border-radius: 12px;
    background: var(--purple);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

button:hover {
    background: var(--purple-dark);
    transform: translateY(-1px);
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.button-secondary {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.button-secondary:hover {
    background: #f5f1f8;
}

.button-secondary.compact {
    width: auto;
    margin: 0;
    padding: 0.75rem 1rem;
}

.message {
    margin: 1rem 0 0;
    padding: 0.8rem 1rem;
    border-radius: 10px;
}

.error {
    background: #fff0f3;
    color: var(--danger);
}

.success {
    background: #edf9f1;
    color: var(--success);
}

.status-icon,
.empty-state-mark {
    display: grid;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1.5rem;
    place-items: center;
    border-radius: 50%;
    background: #f4eafb;
    color: var(--purple);
    font-size: 1.5rem;
    font-weight: 600;
}

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    margin-bottom: 1rem;
    border: 3px solid #e7d9f2;
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}

.dashboard-header p:last-child {
    margin-bottom: 0;
}

code {
    padding: 0.15rem 0.35rem;
    border-radius: 5px;
    background: #f1edf4;
    font-size: 0.88em;
}

.admin-panels {
    padding-top: 2rem;
}

.admin-panel-item.access-management-panel {
    margin-bottom: 2rem;
    border-color: #8fcfa6;
    background: linear-gradient(135deg, #edf9f1, #fff);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.admin-panel-item.access-management-panel::before {
    background: var(--success);
}

.admin-panel-item.access-management-panel:hover,
.admin-panel-item.access-management-panel:focus-visible {
    border-color: var(--success);
    box-shadow: 0 12px 30px rgba(8, 122, 55, 0.13);
    outline: none;
    transform: translateY(-1px);
}

.access-management-panel .admin-panel-icon {
    border: 0;
    background: var(--success);
    color: #fff;
}

.access-management-panel .admin-panel-kicker {
    color: var(--success);
}

.access-panel-action {
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    background: #d8f2e1;
    color: #086c33;
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-panel-item.logging-management-panel {
    margin-bottom: 2rem;
    border-color: #91a7e8;
    background: linear-gradient(135deg, #eef2ff, #fff);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.admin-panel-item.logging-management-panel::before,
.logging-management-panel .admin-panel-icon {
    background: #3155b7;
}

.logging-management-panel .admin-panel-icon {
    border: 0;
    color: #fff;
}

.logging-management-panel .admin-panel-kicker {
    color: #3155b7;
}

.admin-panel-item.logging-management-panel:hover,
.admin-panel-item.logging-management-panel:focus-visible {
    border-color: #3155b7;
    box-shadow: 0 12px 30px rgba(49, 85, 183, 0.14);
    outline: none;
    transform: translateY(-1px);
}

.logging-panel-action {
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    background: #dfe7ff;
    color: #233f91;
    font-size: 0.78rem;
    font-weight: 700;
}

.logging-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(140px, 0.7fr));
    align-items: end;
    gap: 0.85rem;
    padding: 1.1rem;
    border: 1px solid #d9dff2;
    border-radius: 16px;
    background: #f7f9ff;
}

.logging-filters input {
    margin-bottom: 0;
}

.logging-filter-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 0.5rem;
}

.logging-filter-actions button {
    width: auto;
    margin: 0;
    white-space: nowrap;
}

.logging-filter-hint {
    margin-top: 0.65rem;
    font-size: 0.82rem;
}

.logging-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.4rem 0 0.65rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.logging-results-heading p {
    margin: 0;
}

.logging-results-heading button {
    width: auto;
    margin: 0;
    padding: 0.6rem 0.8rem;
    font-size: 0.78rem;
}

.logging-table-wrap {
    overflow-x: auto;
    border: 1px solid #d8dce8;
    border-radius: 15px;
    background: #fff;
}

.logging-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.logging-table th,
.logging-table td {
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid #e5e7ee;
    text-align: left;
    vertical-align: top;
}

.logging-table th {
    background: #f1f3f9;
    color: #282334;
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.logging-table tbody tr:last-child td {
    border-bottom: 0;
}

.logging-time {
    white-space: nowrap;
}

.logging-actor strong,
.logging-action strong {
    display: block;
}

.logging-actor span,
.logging-action span {
    color: var(--muted);
    font-size: 0.76rem;
}

.logging-result {
    display: inline-block;
    padding: 0.28rem 0.48rem;
    border-radius: 999px;
    background: #edf9f1;
    color: var(--success);
    font-size: 0.72rem;
    font-weight: 700;
}

.logging-result.is-failed {
    background: #fff0f3;
    color: var(--danger);
}

.logging-details summary {
    color: var(--purple-dark);
    cursor: pointer;
    font-weight: 600;
}

.logging-details pre {
    max-width: 440px;
    max-height: 280px;
    overflow: auto;
    margin: 0.65rem 0 0;
    padding: 0.75rem;
    border-radius: 9px;
    background: #f5f3f7;
    color: #312a39;
    font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
}

.logging-load-more-actions {
    justify-content: center;
}

.user-list-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
}

.user-list {
    display: grid;
    gap: 0.8rem;
}

.user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.user-row-copy strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--ink);
}

.user-email {
    display: block;
    margin-top: 0.15rem;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.86rem;
}

.user-username {
    display: block;
    margin-top: 0.15rem;
    color: var(--success);
    font-size: 0.82rem;
    font-weight: 700;
}

.user-status {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.3rem 0.5rem;
    border-radius: 999px;
    background: #edf9f1;
    color: var(--success);
    font-size: 0.72rem;
    font-weight: 600;
}

.user-status.is-disabled {
    background: #f1edf4;
    color: var(--muted);
}

.two-factor-status {
    margin-left: 0.35rem;
}

.user-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.user-row-actions button {
    width: auto;
    margin: 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.78rem;
}

.user-row-actions .remove-user-button {
    border: 1px solid #ead4da;
    background: #fff;
    color: var(--danger);
}

.user-row-actions .remove-user-button:hover {
    background: #fff0f3;
}

.edit-user-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.edit-user-fields .muted {
    font-size: 0.76rem;
    font-weight: 400;
}

.user-enabled-control {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.2rem;
    cursor: pointer;
}

.user-enabled-control input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
}

@media (max-width: 620px) {
    .edit-user-fields {
        grid-template-columns: 1fr;
    }
}

.admin-panels-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.4rem;
}

.admin-panels-heading h3,
.admin-panels-heading p {
    margin-bottom: 0;
}

.create-edition-button {
    display: inline-flex;
    width: auto;
    min-width: max-content;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.8rem 1rem;
}

.create-edition-button span {
    font-size: 1.15rem;
    line-height: 1;
}

.edition-panels {
    display: grid;
    gap: 0.9rem;
}

.admin-panel-item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.4rem;
    overflow: hidden;
    padding: 1.4rem;
    border: 1px solid #c4b5fd;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--edition-soft), #fff);
}

.edition-panels .admin-panel-item {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.edition-drag-handle {
    display: grid;
    width: 34px;
    height: 54px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 1px solid #c4b5fd;
    border-radius: 11px;
    background: #fff;
    color: var(--edition-accent-dark);
    cursor: grab;
    touch-action: none;
}

.edition-drag-handle:hover,
.edition-drag-handle:focus-visible {
    border-color: var(--edition-accent);
    background: var(--edition-soft);
    color: var(--edition-accent-dark);
}

.edition-drag-handle:active {
    cursor: grabbing;
}

.edition-drag-handle svg {
    width: 18px;
    height: 28px;
    fill: currentColor;
}

.admin-panel-item.is-dragging {
    opacity: 0.48;
}

.admin-panel-item.is-drag-target {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(86, 11, 173, 0.14);
}

.admin-panel-item.is-current {
    border-color: var(--edition-accent);
    box-shadow: 0 12px 30px rgba(91, 33, 182, 0.12);
}

.admin-panel-item::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 7px;
    background: var(--edition-accent);
    content: "";
}

.admin-panel-icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid #6d28d9;
    border-radius: 16px;
    background: var(--edition-accent);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 600;
}

.admin-panel-kicker {
    margin-bottom: 0.3rem;
    color: var(--edition-accent-dark);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-panel-copy h4 {
    margin-bottom: 0.35rem;
    color: var(--ink);
    font-size: 1.45rem;
}

.admin-panel-copy > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.5;
}

.admin-panel-status {
    padding: 0.55rem 0.7rem;
    border: 1px solid #c4b5fd;
    border-radius: 999px;
    background: #ede9fe;
    color: var(--edition-accent-dark);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.admin-panel-status.is-current {
    border-color: var(--edition-accent-dark);
    background: var(--edition-accent);
    color: #fff;
}

.admin-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.set-current-button {
    width: auto;
    margin: 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid #c4b5fd;
    background: #fff;
    color: var(--edition-accent-dark);
    font-size: 0.78rem;
}

.set-current-button:hover {
    background: var(--edition-soft);
    color: var(--edition-accent-dark);
}

.edit-edition-button {
    width: auto;
    margin: 0;
    padding: 0.65rem 0.8rem;
    background: var(--purple);
    color: #fff;
    font-size: 0.78rem;
}

.copy-edition-button {
    width: auto;
    margin: 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid #d9cbe3;
    background: #fff;
    color: var(--purple-dark);
    font-size: 0.78rem;
}

.copy-edition-button:hover {
    background: #f4eafb;
}

.edit-edition-button:hover {
    background: var(--purple-dark);
}

.delete-edition-button {
    display: grid;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 1px solid #ead4da;
    border-radius: 11px;
    background: #fff;
    color: var(--danger);
}

.delete-edition-button:hover {
    background: #fff0f3;
    color: #7f1433;
}

.delete-edition-button svg {
    width: 18px;
    height: 18px;
}

.no-editions {
    padding: 3.5rem 1rem;
    border: 1px dashed #d8d1dd;
    border-radius: 20px;
    text-align: center;
}

.no-editions .empty-state-mark {
    margin-right: auto;
    margin-left: auto;
}

.no-editions h4 {
    margin-bottom: 0.45rem;
    font-size: 1.2rem;
}

.no-editions p {
    margin-bottom: 0;
    color: var(--muted);
}

.edition-editor {
    min-height: 420px;
}

.editor-back-button {
    display: inline-flex;
    width: auto;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 2rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 0.85rem;
}

.editor-back-button:hover {
    background: #f5f1f8;
}

.edition-editor-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.edition-editor-header .muted {
    margin-bottom: 0;
}

.edition-editor-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.edition-editor-title h3 {
    margin-bottom: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.edition-subpanels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.edition-subpanel {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-height: 154px;
    overflow: hidden;
    padding: 1.35rem;
    border: 1px solid #d91936;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff5f6, #fff);
}

.edition-subpanel::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 6px;
    background: #ef142f;
    content: "";
}

.edition-subpanel:first-child {
    grid-column: 1 / -1;
}

.edition-subpanel-icon {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 14px;
    background: #ef142f;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

.edition-subpanel-type {
    margin-bottom: 0.25rem;
    color: #ad1730;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.edition-subpanel h4 {
    margin-bottom: 0.35rem;
    color: var(--ink);
    font-size: 1.25rem;
}

.edition-subpanel div > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.edition-subpanel-arrow {
    color: #c4bbc7;
    font-size: 1.25rem;
}

.edition-subpanel-action {
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.edition-subpanel-action:hover,
.edition-subpanel-action:focus-visible {
    border-color: #b90d27;
    box-shadow: 0 12px 30px rgba(173, 23, 48, 0.1);
    transform: translateY(-1px);
}

.edition-subpanel-action:focus-visible {
    outline: 3px solid rgba(239, 20, 47, 0.18);
    outline-offset: 3px;
}

.edition-subpanel[data-subpanel="generic"] {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #fff);
}

.edition-subpanel[data-subpanel="generic"]::before,
.edition-subpanel[data-subpanel="generic"] .edition-subpanel-icon {
    background: #2563eb;
}

.edition-subpanel[data-subpanel="generic"] .edition-subpanel-type {
    color: #1d4ed8;
}

.edition-subpanel-action[data-subpanel="generic"]:hover,
.edition-subpanel-action[data-subpanel="generic"]:focus-visible {
    border-color: #1d4ed8;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.12);
}

.edition-subpanel-action[data-subpanel="generic"]:focus-visible {
    outline-color: rgba(37, 99, 235, 0.2);
}

.edition-subpanel[data-subpanel="runbook"] {
    border-color: #16a34a;
    background: linear-gradient(135deg, #f0fdf4, #fff);
}

.edition-subpanel[data-subpanel="runbook"]::before,
.edition-subpanel[data-subpanel="runbook"] .edition-subpanel-icon {
    background: #16a34a;
}

.edition-subpanel[data-subpanel="runbook"] .edition-subpanel-type {
    color: #15803d;
}

.edition-subpanel-action[data-subpanel="runbook"]:hover,
.edition-subpanel-action[data-subpanel="runbook"]:focus-visible {
    border-color: #15803d;
    box-shadow: 0 12px 30px rgba(22, 163, 74, 0.13);
}

.edition-subpanel-action[data-subpanel="runbook"]:focus-visible {
    outline-color: rgba(22, 163, 74, 0.22);
}

.edition-subpanel[data-subpanel="finance"] {
    border-color: #0d9488;
    background: linear-gradient(135deg, #f0fdfa, #fff);
}

.edition-subpanel[data-subpanel="finance"]::before,
.edition-subpanel[data-subpanel="finance"] .edition-subpanel-icon {
    background: #0d9488;
}

.edition-subpanel[data-subpanel="finance"] .edition-subpanel-type {
    color: #0f766e;
}

.edition-subpanel-action[data-subpanel="finance"]:hover,
.edition-subpanel-action[data-subpanel="finance"]:focus-visible {
    border-color: #0f766e;
    box-shadow: 0 12px 30px rgba(13, 148, 136, 0.13);
}

.edition-subpanel-action[data-subpanel="finance"]:focus-visible {
    outline-color: rgba(13, 148, 136, 0.22);
}

.edition-subpanel[data-subpanel="sponsors"] {
    border-color: #d946ef;
    background: linear-gradient(135deg, #fdf4ff, #fff);
}

.edition-subpanel[data-subpanel="sponsors"]::before,
.edition-subpanel[data-subpanel="sponsors"] .edition-subpanel-icon {
    background: #c026d3;
}

.edition-subpanel[data-subpanel="sponsors"] .edition-subpanel-type {
    color: #a21caf;
}

.edition-subpanel-action[data-subpanel="sponsors"]:hover,
.edition-subpanel-action[data-subpanel="sponsors"]:focus-visible {
    border-color: #a21caf;
    box-shadow: 0 12px 30px rgba(192, 38, 211, 0.13);
}

.sponsors-editor-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.sponsor-editor {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.15rem;
    border: 1px solid #e7c8eb;
    border-radius: 18px;
    background: #fdf8fe;
}

.sponsor-logo-column { display: grid; align-content: start; gap: 0.65rem; }
.sponsor-logo-preview {
    display: grid;
    min-height: 112px;
    padding: 1rem;
    place-items: center;
    border: 1px solid #ddcce2;
    border-radius: 14px;
    background: #fff;
}
.sponsor-logo-preview.is-empty { color: var(--muted); font-weight: 700; }
.sponsor-logo-preview img { max-width: 100%; max-height: 80px; object-fit: contain; }
.sponsor-upload-button {
    display: inline-flex;
    justify-content: center;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    background: #86198f;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}
.sponsor-upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sponsor-upload-status { min-height: 1.2em; color: var(--muted); }
.sponsor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; align-items: end; }
.sponsor-field { display: grid; gap: 0.35rem; }
.sponsor-field-wide { grid-column: 1 / -1; }
.sponsor-size-control { display: flex; align-items: center; gap: 0.75rem; min-height: 44px; }
.sponsor-size-control input { min-width: 0; padding: 0; }
.sponsor-size-control output { min-width: 3.4rem; color: #86198f; font-weight: 800; text-align: right; }
.sponsor-enabled { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; }
.sponsor-enabled input { width: auto; }
.remove-sponsor { justify-self: end; }

.generic-editor {
    margin-top: 1.5rem;
}

.generic-editor-header {
    margin-bottom: 1.5rem;
}

.generic-editor-header h4 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.generic-editor-header .muted {
    margin-bottom: 0;
}

.content-variable-hint {
    margin: 0 0 1.25rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #dfd2e9;
    border-radius: 11px;
    background: #faf7fc;
    color: var(--muted);
    font-size: 0.84rem;
}

.content-variable-hint code {
    color: var(--purple-dark);
    font-weight: 700;
}

.runbook-heading {
    margin-bottom: 0;
}

#runbook-editor-view,
#finance-editor-view,
#logging-editor-view {
    position: fixed;
    z-index: 1000;
    top: 5vh;
    left: 5vw;
    overflow-y: auto;
    width: 90vw;
    max-width: none;
    max-height: 90vh;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    border: 1px solid #ded6e4;
    border-radius: 24px;
    background: #fff;
    box-shadow:
        0 30px 100px rgba(23, 7, 43, 0.3),
        0 0 0 100vmax rgba(12, 4, 25, 0.62);
}

#runbook-editor-view .editor-back-button,
#finance-editor-view .editor-back-button,
#logging-editor-view .editor-back-button {
    position: sticky;
    z-index: 2;
    top: 0;
}

body.runbook-overlay-open,
body.finance-overlay-open,
body.logging-overlay-open {
    overflow: hidden;
}

.variable-suggestions {
    position: fixed;
    z-index: 3000;
    overflow-y: auto;
    max-height: 245px;
    padding: 0.35rem;
    border: 1px solid #cbbbd8;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(35, 12, 55, 0.22);
}

.variable-suggestions button {
    display: grid;
    grid-template-columns: minmax(125px, auto) minmax(0, 1fr);
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.65rem 0.7rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.variable-suggestions button:hover,
.variable-suggestions button.is-selected {
    background: #f1e8f7;
    color: var(--purple-dark);
}

.variable-suggestions code {
    color: inherit;
    font-weight: 700;
}

.variable-suggestions span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.runbook-table {
    overflow-x: auto;
    border: 1px solid #b9b4bd;
    background: #fff;
}

.runbook-table:focus-visible {
    outline: 3px solid rgba(86, 11, 173, 0.22);
    outline-offset: 3px;
}

.runbook-table-header {
    display: grid;
    grid-template-columns: 180px minmax(270px, 1.6fr) minmax(170px, 0.9fr) minmax(250px, 1.4fr) 150px 42px;
    min-width: 1060px;
    border-bottom: 1px solid #8e8991;
    background: #f4f2f5;
    color: #17131b;
    font-size: 0.8rem;
    font-weight: 700;
}

.runbook-table-header span {
    padding: 0.55rem 0.6rem;
    border-right: 1px solid #c9c5cc;
}

.runbook-table-header span:last-child {
    border-right: 0;
}

.runbook-topics-list {
    display: grid;
    min-width: 1060px;
}

.runbook-topic-editor {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    border-bottom: 10px solid #f4f2f5;
    background: #fff;
}

.runbook-topic-editor:last-child {
    border-bottom: 0;
}

.runbook-topic-header {
    display: block;
    padding: 0;
    border-right: 1px solid #c9c5cc;
    background: #fff;
}

.runbook-topic-header > div:first-child {
    padding: 0.45rem 0.5rem;
}

.runbook-task-row label {
    display: none;
}

.runbook-topic-header label {
    display: none;
}

.runbook-topic-header input {
    min-height: 36px;
    margin: 0;
    padding: 0.4rem 0.45rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-weight: 700;
}

.runbook-topic-header input:focus {
    outline: 2px solid var(--purple);
    outline-offset: -2px;
}

.runbook-topic-actions {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem 0.5rem 0.6rem;
}

.runbook-topic-actions button {
    width: 100%;
    margin: 0;
    padding: 0.5rem;
    font-size: 0.72rem;
}

.runbook-tasks-list {
    display: grid;
}

.runbook-task-row {
    display: grid;
    grid-template-columns: minmax(270px, 1.6fr) minmax(170px, 0.9fr) minmax(250px, 1.4fr) 150px 42px;
    align-items: stretch;
    border-bottom: 1px solid #d7d3d9;
}

.runbook-task-row:last-child {
    border-bottom: 0;
}

.runbook-task-row > div {
    border-right: 1px solid #d7d3d9;
}

.runbook-task-row input,
.runbook-task-row textarea,
.runbook-task-row select {
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 0.5rem 0.55rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.82rem;
}

.runbook-task-row input:focus,
.runbook-task-row textarea:focus,
.runbook-task-row select:focus {
    outline: 2px solid var(--purple);
    outline-offset: -2px;
}

.runbook-task-row textarea {
    min-height: 40px;
    resize: vertical;
}

.runbook-task-row select[data-status="Done"] {
    border-color: #94d7a6;
    background: #c6efce;
}

.runbook-task-row select[data-status="In progress"] {
    border-color: #e7c96d;
    background: #ffeb9c;
}

.runbook-task-row select[data-status="Action needed"] {
    border-color: #e49a9a;
    background: #ffc7ce;
}

.remove-runbook-task {
    display: grid;
    width: 42px;
    min-height: 40px;
    height: 100%;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: var(--danger);
}

.remove-runbook-task:hover {
    background: #fff0f3;
}

.finance-table-header {
    grid-template-columns: 180px minmax(240px, 1.2fr) minmax(300px, 1.5fr) 180px 90px 180px 42px;
    min-width: 1210px;
}

.finance-topics-list {
    min-width: 1210px;
}

.finance-item-row {
    grid-template-columns: minmax(240px, 1.2fr) minmax(300px, 1.5fr) 180px 90px 180px 42px;
}

.finance-item-row input[type="number"] {
    text-align: right;
}

.finance-table-totals {
    display: grid;
    grid-template-columns: 180px minmax(240px, 1.2fr) minmax(300px, 1.5fr) 180px 90px 180px 42px;
    min-width: 1210px;
    border-top: 2px solid #8e8991;
    background: #f4f2f5;
    color: #17131b;
}

.finance-table-totals > * {
    min-height: 44px;
    padding: 0.7rem 0.6rem;
    border-right: 1px solid #c9c5cc;
}

.finance-table-totals strong {
    grid-column: 1 / 4;
    text-align: right;
}

.finance-table-totals output {
    font-weight: 700;
    text-align: right;
}

.finance-table-totals > *:last-child {
    border-right: 0;
}

.generic-settings-form {
    display: grid;
    gap: 1rem;
}

.generic-field {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    overflow: hidden;
    padding: 1.3rem;
    border: 1px solid #18bd27;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--green-soft), #fff);
}

.generic-field::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 6px;
    background: var(--green-bright);
    content: "";
}

.generic-field-marker {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: var(--green-bright);
    color: #073f0c;
    font-weight: 600;
}

.generic-field label {
    margin-top: 0;
    color: var(--ink);
    font-size: 1rem;
}

.generic-field p {
    margin-bottom: 0.8rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.generic-checkbox-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.45rem;
    cursor: pointer;
}

.generic-checkbox-control input {
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    padding: 0;
    accent-color: var(--purple);
}

.generic-checkbox-control span {
    font-weight: 600;
}

.generic-checkbox-field p {
    margin-bottom: 0;
}

.generic-field .generic-aftermovie-autoplay {
    margin-top: 1rem;
}

#generic-aftermovie-url-field > label:first-child {
    margin-top: 1rem;
}

.field-hint {
    display: block;
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.form-actions button {
    width: auto;
    margin-top: 0.5rem;
}

.home-field-group {
    margin: 0;
    padding: 1.3rem;
    border: 1px solid #18bd27;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--green-soft), #fff);
}

.home-field-group legend {
    padding: 0 0.55rem;
    color: #087a14;
    font-size: 1rem;
    font-weight: 600;
}

.home-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.home-field-grid label {
    margin-top: 0;
}

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

.image-upload-input {
    padding: 0.7rem;
    background: #fff;
}

.image-upload-input::file-selector-button {
    margin-right: 0.8rem;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: var(--purple);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.image-upload-preview {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.75rem;
    padding: 0.65rem;
    border: 1px solid #dbe8dd;
    border-radius: 12px;
    background: #fff;
}

.image-upload-preview img {
    width: 72px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
}

.image-upload-preview span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-items-section {
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.agenda-items-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.agenda-items-heading p,
.agenda-items-heading h5 {
    margin-bottom: 0;
}

.agenda-items-heading h5 {
    font-size: 1.4rem;
}

.agenda-items-list {
    display: grid;
    gap: 1rem;
}

.agenda-item-editor {
    overflow: hidden;
    border: 1px solid #18bd27;
    border-radius: 18px;
    background: #fff;
}

.agenda-item-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--green-soft);
    border-bottom: 1px solid #cfead2;
}

.agenda-item-editor-header h6 {
    margin: 0;
    color: #087a14;
    font-size: 1rem;
}

.agenda-item-editor-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.2rem;
}

.agenda-item-editor-body label,
.presenter-row label {
    margin-top: 0;
}

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

.color-field {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 0.6rem;
}

.color-field input[type="color"] {
    height: 50px;
    padding: 0.25rem;
}

.presenters-editor {
    grid-column: 1 / -1;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--canvas);
}

.presenters-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.presenters-heading h6 {
    margin: 0;
    font-size: 0.95rem;
}

.small-action-button {
    width: auto;
    margin: 0;
    padding: 0.55rem 0.7rem;
    font-size: 0.76rem;
}

.presenters-list {
    display: grid;
    gap: 0.7rem;
}

.presenter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.7rem;
}

.remove-agenda-item,
.remove-presenter {
    width: auto;
    margin: 0;
    border: 1px solid #ead4da;
    background: #fff;
    color: var(--danger);
}

.remove-agenda-item {
    padding: 0.55rem 0.7rem;
    font-size: 0.76rem;
}

.remove-presenter {
    width: 42px;
    height: 42px;
    padding: 0;
}

.archive-photos-section {
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.upload-photos-button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: var(--purple);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.upload-photos-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.archive-photos-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.archive-photo-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    background: #e9e4ed;
}

.archive-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-archive-photo {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: rgba(33, 13, 29, 0.78);
    color: #fff;
    font-size: 1.15rem;
    backdrop-filter: blur(5px);
}

.team-members-list {
    display: grid;
    gap: 1rem;
}

.team-member-editor {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1.2rem;
    padding: 1.2rem;
    border: 1px solid #18bd27;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--green-soft), #fff);
}

.team-member-photo {
    display: grid;
    align-content: start;
    gap: 0.7rem;
}

.team-member-photo-preview {
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border: 1px dashed #9acaa0;
    border-radius: 16px;
    background: #fff;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.team-member-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member-photo-preview img:not([src]) {
    display: none;
}

.team-member-photo-input {
    padding: 0.55rem;
    font-size: 0.75rem;
}

.team-member-photo-input::file-selector-button {
    margin-right: 0.4rem;
    padding: 0.45rem 0.55rem;
    border: 0;
    border-radius: 7px;
    background: var(--purple);
    color: #fff;
    font: inherit;
    font-weight: 600;
}

.team-member-fields {
    display: grid;
    align-content: start;
    gap: 0.9rem;
}

.team-member-fields label {
    margin-top: 0;
}

.team-member-actions {
    display: flex;
    justify-content: flex-end;
}

.team-member-upload-status {
    min-height: 1.1em;
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
}

.admin-dialog {
    width: min(calc(100% - 2rem), 520px);
    padding: 0;
    border: 0;
    border-radius: 24px;
    color: var(--ink);
    box-shadow: 0 30px 100px rgba(23, 7, 43, 0.3);
}

.admin-dialog::backdrop {
    background: rgba(19, 9, 31, 0.65);
    backdrop-filter: blur(5px);
}

.admin-dialog form {
    padding: clamp(1.5rem, 5vw, 2.5rem);
}

.dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.dialog-heading h2 {
    margin-bottom: 0.5rem;
}

.dialog-close {
    width: 42px;
    min-width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 1.5rem;
}

.dialog-close:hover {
    background: #f5f1f8;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.dialog-actions button {
    width: auto;
    margin: 0;
}

.button-danger {
    background: var(--danger);
}

.button-danger:hover {
    background: #7f1433;
}

.admin-dialog-danger .eyebrow {
    color: var(--danger);
}

[hidden] {
    display: none !important;
}

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

@media (max-width: 860px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: auto;
        gap: 4rem;
        padding: 2rem;
    }

    h1 {
        font-size: clamp(2.5rem, 12vw, 4.5rem);
    }

    .workspace {
        min-height: 60vh;
        padding: 2rem 1rem;
    }

    #runbook-editor-view,
    #finance-editor-view,
    #logging-editor-view {
        top: 2vh;
        left: 2vw;
        width: 96vw;
        max-height: 96vh;
        padding: 1rem;
        border-radius: 18px;
    }

    .runbook-table {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .runbook-table-header {
        display: none;
    }

    .runbook-topics-list {
        min-width: 0;
        gap: 1rem;
    }

    .runbook-topic-editor {
        grid-template-columns: 1fr;
        overflow: hidden;
        border: 1px solid #d9cbe3;
        border-radius: 16px;
    }

    .runbook-topic-header {
        align-items: stretch;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        background: #faf7fc;
    }

    .runbook-topic-header label,
    .runbook-task-row label {
        display: block;
        margin-bottom: 0.3rem;
        color: var(--ink);
        font-size: 0.78rem;
    }

    .runbook-topic-header input,
    .runbook-task-row input,
    .runbook-task-row textarea,
    .runbook-task-row select {
        border: 1px solid #d9d2df;
        border-radius: 9px;
        background: #fff;
    }

    .runbook-topic-actions {
        flex-direction: row;
    }

    .runbook-topic-actions button {
        width: auto;
    }

    .runbook-task-row {
        grid-template-columns: 1fr;
        gap: 0.7rem;
        padding: 0.9rem;
    }

    .runbook-task-row > div {
        border-right: 0;
    }

    .remove-runbook-task {
        grid-column: 1;
        justify-self: start;
        width: 38px;
        height: 38px;
        min-height: 38px;
        border: 1px solid #ead4da;
        border-radius: 9px;
    }

    .finance-table-totals {
        grid-template-columns: 1fr 1fr;
        min-width: 0;
        overflow: hidden;
        border: 1px solid #b9b4bd;
        border-radius: 12px;
    }

    .finance-table-totals strong {
        grid-column: 1 / -1;
        border-right: 0;
        border-bottom: 1px solid #c9c5cc;
        text-align: left;
    }

    .finance-table-totals output:last-of-type {
        border-right: 0;
    }

    .finance-table-totals > .finance-vat-total,
    .finance-table-totals > span:last-child {
        display: none;
    }
}

@media (max-width: 520px) {
    .dashboard-header {
        display: block;
    }

    .button-secondary.compact {
        width: 100%;
        margin-top: 1.25rem;
    }

    .admin-panels-heading {
        display: block;
    }

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

    .user-row-actions {
        justify-content: flex-start;
    }

    .runbook-topic-header input {
        max-width: none;
    }

    .create-edition-button {
        width: 100%;
        margin-top: 1rem;
        justify-content: center;
    }

    .admin-panel-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .edition-panels .admin-panel-item {
        grid-template-columns: auto auto minmax(0, 1fr);
    }

    .admin-panel-actions {
        grid-column: 1 / -1;
        flex-wrap: wrap;
        margin-left: 0.2rem;
    }

    .logging-filters {
        grid-template-columns: 1fr;
    }

    .logging-filter-actions {
        flex-direction: column;
    }

    .logging-filter-actions button {
        width: 100%;
    }

    .edit-edition-button,
    .copy-edition-button,
    .set-current-button {
        flex: 1;
    }

    .edition-editor-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .edition-subpanels {
        grid-template-columns: 1fr;
    }

    .edition-subpanel:first-child {
        grid-column: auto;
    }

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

    .form-actions button {
        width: 100%;
    }

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

    .home-field-wide {
        grid-column: auto;
    }

    .agenda-items-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-items-heading .create-edition-button {
        margin-top: 0;
    }

    .agenda-item-editor-body,
    .presenter-row {
        grid-template-columns: 1fr;
    }

    .agenda-field-wide,
    .presenters-editor {
        grid-column: auto;
    }

    .remove-presenter {
        width: 100%;
    }

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

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

    .sponsor-editor,
    .sponsor-fields {
        grid-template-columns: 1fr;
    }

    .sponsor-field-wide {
        grid-column: auto;
    }

    .team-member-photo {
        max-width: 220px;
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .dialog-actions button {
        width: 100%;
    }
}

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

.finance-topic-editor input[data-finance-item="priceExclVat"],
.finance-topic-editor input[data-finance-item="priceInclVat"],
.finance-table-totals output {
    color: #8b1e1e;
    font-weight: 700;
}

.finance-topic-editor[data-topic-id="budget"] input[data-finance-item="priceExclVat"],
.finance-topic-editor[data-topic-id="budget"] input[data-finance-item="priceInclVat"],
.finance-table-totals output[data-finance-total^="budget-"] {
    color: #166534;
}

#finance-total-excl-vat,
#finance-total-incl-vat {
    color: #000;
}

#finance-total-excl-vat.over-budget,
#finance-total-incl-vat.over-budget {
    color: #8b1e1e;
}

.finance-export-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }

#log-retention-form { grid-template-columns: max-content auto; justify-content: start; }
#log-retention-form > div:first-child { width: max-content; max-width: 100%; }
#log-retention-days { width: 100%; min-width: 0; }
.log-retention-actions { display: flex; align-items: center; gap: 0.75rem; }
.log-retention-actions button,
.log-retention-actions #clear-log-button {
    width: auto;
    height: 46px;
    margin: 0;
    padding: 0.75rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
@media (max-width: 760px) {
    #log-retention-form { grid-template-columns: 1fr; }
    .log-retention-actions { flex-wrap: wrap; }
}

.team-tag-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.team-tag-colors input[type="color"] { display: block; width: 120px; height: 52px; padding: 4px; margin: 0.4rem 0 0; cursor: pointer; }
.team-tag-colors input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.team-tag-colors input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.team-tag-colors input[type="color"]::-moz-color-swatch { border: 0; border-radius: 6px; }
.team-tag-preview { display: inline-block; max-width: 100%; overflow-wrap: anywhere; border-radius: 8px; padding: 0.4rem 0.6rem; font-weight: 600; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
