:root {
    --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #f7f9fb;
    --surface: #ffffff;
    --surface-muted: #f2f4f6;
    --surface-raised: #ffffff;
    --text: #191c1e;
    --muted: #5b6472;
    --border: #e2e8f0;
    --primary: #001a41;
    --primary-soft: #dae2ff;
    --gold: #b8860b;
    --green: #0f8a4b;
    --red: #c0263d;
    --blue: #1d4ed8;
    --accent: #1d4ed8;
    --purple: #7c3aed;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] {
    --bg: #0d1118;
    --surface: #141a24;
    --surface-muted: #1b2430;
    --surface-raised: #101722;
    --text: #eff4fb;
    --muted: #a9b4c2;
    --border: #2a3545;
    --primary: #b1c5ff;
    --primary-soft: #13213f;
    --gold: #e9c349;
    --green: #71dc8e;
    --red: #fb7185;
    --blue: #8fb2ff;
    --accent: #8fb2ff;
    --purple: #c4b5fd;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.ui-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.container {
    width: min(1520px, calc(100% - 64px));
    margin-inline: auto;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    width: 100%;
    background: #172a62;
    color: #ffffff;
    box-shadow: 0 14px 40px rgba(0, 26, 65, .14);
}

.site-nav-spacer {
    height: 82px;
}

.nav.is-scrolled {
    box-shadow: 0 18px 50px rgba(0, 18, 46, .24);
}

.nav-inner {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 280px;
}

.brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.brand strong {
    color: #ffffff;
    font-size: clamp(18px, 1.5vw, 26px);
    font-weight: 900;
    letter-spacing: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 1.55vw, 30px);
    color: rgba(255,255,255,.9);
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

.nav-link,
.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.nav-links a:hover,
.dropdown-trigger:hover,
.nav-dropdown:focus-within .dropdown-trigger {
    color: #ffcf1a;
}

.nav-dropdown {
    position: relative;
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    transition: transform 180ms ease;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    display: grid;
    min-width: 240px;
    transform: translateX(-50%) translateY(8px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 28px 70px rgba(0, 18, 46, .24);
    color: var(--text);
    opacity: 0;
    padding: 10px;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.dropdown-panel::before {
    content: "";
    position: absolute;
    inset: -14px 0 auto;
    height: 14px;
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.nav-dropdown:hover .dropdown-icon,
.nav-dropdown:focus-within .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-panel a {
    display: flex;
    align-items: center;
    min-height: 42px;
    border-radius: 12px;
    color: var(--text);
    padding: 0 12px;
    font-size: 14px;
    font-weight: 800;
}

.dropdown-panel a:hover,
.dropdown-panel a:focus {
    background: var(--primary-soft);
    color: var(--primary);
    outline: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 392px;
}

.portal-btn,
.register-btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 18px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.portal-btn {
    border: 1px solid #ffcf1a;
    color: #ffcf1a;
}

.register-btn {
    border: 1px solid #ffcf1a;
    background: #ffcf1a;
    color: #071330;
    box-shadow: 0 14px 34px rgba(255, 207, 26, .22);
}

.portal-btn:hover,
.portal-btn:focus,
.register-btn:hover,
.register-btn:focus {
    transform: translateY(-2px);
    outline: none;
}

.portal-btn:hover,
.portal-btn:focus {
    background: rgba(255, 207, 26, .1);
}

.register-btn:hover,
.register-btn:focus {
    background: #ffe16a;
    box-shadow: 0 18px 42px rgba(255, 207, 26, .3);
}

.mobile-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #ffffff;
    cursor: pointer;
}

.mobile-menu-button svg {
    width: 22px;
    height: 22px;
}

.mobile-panel {
    display: none;
    border-top: 1px solid rgba(255,255,255,.12);
    background: #102358;
    padding: 14px 0 18px;
}

.mobile-panel.is-open {
    display: block;
    animation: panelDrop 180ms ease both;
}

.mobile-links {
    display: grid;
    gap: 8px;
}

.mobile-links a,
.mobile-group-label {
    display: flex;
    align-items: center;
    min-height: 42px;
    border-radius: 12px;
    color: rgba(255,255,255,.92);
    padding: 0 14px;
    font-weight: 850;
}

.mobile-links a:hover,
.mobile-links a:focus {
    background: rgba(255,255,255,.08);
    color: #ffcf1a;
    outline: none;
}

.mobile-links .mobile-register-link {
    justify-content: center;
    background: #ffcf1a;
    color: #071330;
}

.mobile-links .mobile-register-link:hover,
.mobile-links .mobile-register-link:focus {
    background: #ffe16a;
    color: #071330;
}

.mobile-group {
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px;
    padding: 6px;
}

.mobile-group-label {
    color: #ffcf1a;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

@keyframes panelDrop {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-theme="dark"] body {
    background: var(--bg);
    color: var(--text);
}

[data-theme="dark"] body[style] {
    background-color: var(--bg) !important;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-slate-50,
[data-theme="dark"] .bg-gray-50 {
    background-color: var(--bg) !important;
}

[data-theme="dark"] .bg-slate-100,
[data-theme="dark"] .bg-gray-100,
[data-theme="dark"] .bg-blue-50,
[data-theme="dark"] .bg-white\/80,
[data-theme="dark"] .bg-white\/90,
[data-theme="dark"] .bg-white\/95 {
    background-color: var(--surface) !important;
}

[data-theme="dark"] .text-slate-950,
[data-theme="dark"] .text-slate-900,
[data-theme="dark"] .text-slate-800,
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800 {
    color: var(--text) !important;
}

[data-theme="dark"] .text-slate-700,
[data-theme="dark"] .text-slate-600,
[data-theme="dark"] .text-slate-500,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-500 {
    color: var(--muted) !important;
}

[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-slate-200,
[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200 {
    border-color: var(--border) !important;
}

[data-theme="dark"] .shadow-xl,
[data-theme="dark"] .shadow-2xl,
[data-theme="dark"] .shadow-lg,
[data-theme="dark"] .shadow-md {
    box-shadow: var(--shadow) !important;
}

[data-theme="dark"] .bulletin-archive,
[data-theme="dark"] .plk-shell,
[data-theme="dark"] .plk-section,
[data-theme="dark"] .press-font {
    background: var(--bg) !important;
    background-color: var(--bg) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .bulletin-filter-form,
[data-theme="dark"] .bulletin-search-control,
[data-theme="dark"] .bulletin-search-control:focus-within,
[data-theme="dark"] .bulletin-select-trigger,
[data-theme="dark"] .bulletin-select-trigger:hover,
[data-theme="dark"] .bulletin-select-trigger[aria-expanded="true"],
[data-theme="dark"] .bulletin-select-menu,
[data-theme="dark"] .bulletin-card,
[data-theme="dark"] .plk-service-card {
    border-color: var(--border) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .bulletin-section-title,
[data-theme="dark"] .bulletin-search-input,
[data-theme="dark"] .bulletin-select-trigger,
[data-theme="dark"] .bulletin-select-option,
[data-theme="dark"] .bulletin-card-title,
[data-theme="dark"] .plk-section-title,
[data-theme="dark"] .plk-service-card h3 {
    color: var(--text) !important;
}

[data-theme="dark"] .bulletin-select-label span,
[data-theme="dark"] .bulletin-search-input::placeholder,
[data-theme="dark"] .bulletin-card-summary,
[data-theme="dark"] .bulletin-card-footer,
[data-theme="dark"] .bulletin-topic-chip,
[data-theme="dark"] .plk-section-copy,
[data-theme="dark"] .plk-service-card p {
    color: var(--muted) !important;
}

[data-theme="dark"] .bulletin-select-option:hover,
[data-theme="dark"] .bulletin-select-option.is-active,
[data-theme="dark"] .bulletin-topic-chip:hover,
[data-theme="dark"] .bulletin-topic-chip.is-active,
[data-theme="dark"] .bulletin-card:hover .bulletin-card-title {
    color: var(--primary) !important;
}

[data-theme="dark"] .bulletin-select-option:hover,
[data-theme="dark"] .bulletin-select-option.is-active,
[data-theme="dark"] .bulletin-card-media,
[data-theme="dark"] .plk-service-icon {
    background: var(--primary-soft) !important;
}

a,
button,
.metric-card,
.panel,
.workflow-card,
.module-row,
.content-table-row,
.builder-item,
.message-card {
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

a.is-pressing,
button.is-pressing,
.metric-card.is-pressing,
.content-table-row.is-pressing,
.builder-item summary.is-pressing {
    transform: translateY(1px) scale(.99);
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 560ms ease, transform 560ms ease;
    will-change: opacity, transform;
}

.scroll-reveal[data-reveal-variant="soft"] {
    transform: translateY(18px);
}

.scroll-reveal[data-reveal-variant="scale"] {
    transform: translateY(20px) scale(.985);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none !important;
        transition: none !important;
    }
}

.admin-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 280px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #001a41;
    color: #ffffff;
    padding: 28px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(233, 195, 73, .55) rgba(255, 255, 255, .08);
}

.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 69;
    background: rgba(3, 9, 20, .58);
    backdrop-filter: blur(6px);
}

.admin-sidebar-backdrop[hidden] {
    display: none;
}

.admin-sidebar::-webkit-scrollbar {
    width: 8px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .08);
}

.admin-sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(233, 195, 73, .55);
}

.brand-lockup,
.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 12px;
    background: var(--gold);
    color: #001a41;
    font-weight: 800;
}

.brand-lockup small {
    display: block;
    margin-top: 3px;
    color: #b1c5ff;
}

.side-nav {
    display: grid;
    gap: 8px;
    margin-top: 36px;
}

.side-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 44px;
    border-left: 4px solid transparent;
    border-radius: 0 10px 10px 0;
    padding: 0 14px;
    color: #dbe7ff;
}

.side-link svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: #e9c349;
}

.side-link span {
    min-width: 0;
}

.side-link:hover,
.side-link.is-active {
    border-left-color: var(--gold);
    background: #002d72;
    color: #ffffff;
}

.side-link em {
    color: #e9c349;
    font-size: 12px;
    font-style: normal;
}

.side-link.is-muted { opacity: 0.72; }

.admin-main { min-width: 0; }

.admin-menu-toggle {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.admin-menu-toggle svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.3;
    stroke-linecap: round;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    padding: 22px 32px;
    backdrop-filter: blur(10px);
}

.admin-topbar h1,
.panel h2,
.hero-panel h2 {
    margin: 0;
    letter-spacing: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-content {
    display: grid;
    gap: 24px;
    padding: 32px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.metric-grid,
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-card,
.panel,
.workflow-card,
.hero-panel,
.auth-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card {
    display: grid;
    gap: 10px;
    padding: 20px;
}

.metric-card:hover,
.workflow-card:hover,
.content-table-row:hover,
.builder-item:hover,
.message-card:hover {
    border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
    transform: translateY(-2px);
}

.metric-card span,
.metric-card small,
.muted,
.workflow-card p,
.module-row p,
.table-row small {
    color: var(--muted);
}

.metric-card strong {
    color: var(--text);
    font-size: 34px;
    line-height: 1;
}

.tone-blue { border-top: 4px solid var(--blue); }
.tone-green { border-top: 4px solid var(--green); }
.tone-gold { border-top: 4px solid var(--gold); }
.tone-slate { border-top: 4px solid var(--muted); }

.split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 24px;
}

.panel { padding: 22px; }

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
    gap: 24px;
}

.chart-panel {
    min-height: 360px;
}

.bar-chart {
    display: flex;
    align-items: end;
    gap: 8px;
    min-height: 240px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(to top, color-mix(in srgb, var(--border) 46%, transparent) 1px, transparent 1px) 0 0 / 100% 25%,
        var(--surface-muted);
    padding: 18px 14px 34px;
}

.bar-item {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    height: 220px;
    align-items: end;
    justify-content: center;
}

.bar-item.is-wide {
    max-width: none;
}

.bar-fill {
    display: block;
    width: 100%;
    max-width: 18px;
    border-radius: 999px 999px 4px 4px;
    background: linear-gradient(180deg, var(--blue), var(--primary));
    box-shadow: 0 10px 22px color-mix(in srgb, var(--blue) 18%, transparent);
    transition: height 220ms ease, transform 180ms ease;
}

.monthly-chart .bar-fill {
    max-width: 64px;
    background: linear-gradient(180deg, var(--gold), var(--blue));
}

.bar-item:hover .bar-fill {
    transform: translateY(-3px);
}

.bar-item small {
    position: absolute;
    bottom: -24px;
    left: 50%;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    transform: translateX(-50%);
    white-space: nowrap;
}

.bar-value {
    position: absolute;
    top: -2px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.compact-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-metrics .metric-card strong {
    font-size: 28px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.text-link {
    color: var(--primary);
    font-weight: 700;
}

.module-list,
.compact-table {
    display: grid;
    gap: 10px;
}

.module-row,
.table-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 14px;
}

.module-row h3,
.module-row p,
.table-row strong,
.table-row small,
.workflow-card h3,
.workflow-card p {
    margin: 0;
}

.module-row span,
.badge-success,
.badge-muted,
.workflow-card span {
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-success {
    background: color-mix(in srgb, var(--green) 18%, transparent);
    color: var(--green);
}

.badge-muted {
    background: var(--surface);
    color: var(--muted);
}

.accent-blue { border-left: 4px solid var(--blue); }
.accent-green { border-left: 4px solid var(--green); }
.accent-gold { border-left: 4px solid var(--gold); }
.accent-purple { border-left: 4px solid var(--purple); }
.accent-red { border-left: 4px solid var(--red); }
.accent-slate { border-left: 4px solid var(--muted); }

.hero-panel {
    padding: 30px;
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--primary-soft) 74%, transparent), transparent),
        var(--surface);
}

.hero-panel h2 {
    max-width: 820px;
    font-size: 38px;
}

.hero-panel p:not(.eyebrow) {
    max-width: 760px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.workflow-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.workflow-card { padding: 22px; }
.workflow-card h3 { margin-top: 18px; }

.theme-toggle,
.theme-switch,
.ghost-button,
.danger-button,
.primary-button {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 54px;
    min-width: 54px;
    padding: 0 6px;
    border-radius: 999px;
}

.switch-track {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 42px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    padding: 2px;
}

.switch-thumb {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
    transition: transform 180ms ease, background 180ms ease;
}

.theme-icon {
    position: absolute;
    width: 12px;
    height: 12px;
    color: #001a41;
    transition: opacity 150ms ease, transform 150ms ease;
}

.moon-icon {
    opacity: 0;
    transform: scale(.6) rotate(-20deg);
}

[data-theme="dark"] .switch-track {
    background: #001a41;
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

[data-theme="dark"] .switch-thumb {
    transform: translateX(18px);
    background: var(--primary);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: scale(.6) rotate(20deg);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    color: #08111d;
    transform: scale(1) rotate(0);
}

.ghost-button:hover,
.theme-toggle:hover,
.theme-switch:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.ghost-button:hover,
.primary-button:hover,
.danger-button:hover {
    transform: translateY(-1px);
}

.danger-button {
    border-color: color-mix(in srgb, var(--red) 28%, var(--border));
    color: var(--red);
}

.primary-button {
    width: 100%;
    border-color: var(--primary);
    background: var(--primary);
    color: var(--surface);
}

[data-theme="dark"] .primary-button {
    color: #08111d;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--primary-soft) 65%, transparent), transparent 34%),
        var(--bg);
}

.auth-card {
    width: min(100%, 460px);
    padding: 30px;
}

.auth-brand h1 { margin: 0; }

.stack-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.stack-form label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
}

.stack-form input[type="email"],
.stack-form input[type="password"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text);
    padding: 0 12px;
}

.stack-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
    outline: none;
}

.check-row {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
}

.alert-error {
    border: 1px solid color-mix(in srgb, var(--red) 34%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--red) 10%, var(--surface));
    color: var(--red);
    padding: 12px;
}

.theme-toggle.full { width: 100%; margin-top: 18px; }
.theme-switch.full { width: 54px; margin: 18px auto 0; }
.empty-state { color: var(--muted); }

.notice-success {
    border: 1px solid color-mix(in srgb, var(--green) 34%, var(--border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--green) 10%, var(--surface));
    color: var(--green);
    padding: 14px 16px;
    font-weight: 800;
}

.notice-danger {
    border: 1px solid color-mix(in srgb, var(--red) 34%, var(--border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--red) 10%, var(--surface));
    color: var(--red);
    padding: 14px 16px;
    font-weight: 800;
}

.notice-danger ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.admin-editor-grid {
    grid-template-columns: minmax(340px, .52fr) minmax(0, 1fr);
}

.admin-form {
    display: grid;
    gap: 18px;
}

.admin-form.compact {
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 16px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
    grid-column: 1 / -1;
}

.admin-form label,
.slug-field-grid label,
.article-main-fields label,
.article-side-fields label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form input[type="file"],
.admin-form input[type="color"],
.admin-form select,
.admin-form textarea,
.slug-field-grid input[type="text"],
.article-main-fields input[type="text"],
.article-main-fields input[type="email"],
.article-main-fields input[type="password"],
.article-main-fields input[type="number"],
.article-main-fields input[type="file"],
.article-main-fields select,
.article-main-fields textarea,
.article-side-fields input[type="text"],
.article-side-fields input[type="email"],
.article-side-fields input[type="password"],
.article-side-fields input[type="number"],
.article-side-fields input[type="file"],
.article-side-fields select,
.article-side-fields textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text);
    padding: 0 12px;
}

.admin-form textarea,
.article-main-fields textarea,
.article-side-fields textarea {
    min-height: 110px;
    padding-block: 12px;
    resize: vertical;
}

.admin-form input[type="color"] {
    min-height: 48px;
    padding: 6px;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.slug-field-grid input:focus,
.article-main-fields input:focus,
.article-main-fields select:focus,
.article-main-fields textarea:focus,
.article-side-fields input:focus,
.article-side-fields select:focus,
.article-side-fields textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
    outline: none;
}

.check-stack {
    display: grid;
    align-content: center;
    gap: 10px;
}

.nav-builder-list,
.section-editor-list,
.child-list {
    display: grid;
    gap: 14px;
}

.builder-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 14px;
}

.builder-item.child {
    background: var(--surface);
}

.builder-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    list-style: none;
}

.builder-item summary::-webkit-details-marker {
    display: none;
}

.builder-item strong,
.builder-item small {
    display: block;
}

.builder-item small {
    margin-top: 3px;
    color: var(--muted);
}

.builder-item em,
.switch-line {
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 6px 10px;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.child-list {
    margin-top: 14px;
    padding-left: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.section-editor-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.switch-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.section-status-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 7px 11px 7px 8px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
}

.section-status-toggle input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.section-status-toggle span {
    position: relative;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--border);
}

.section-status-toggle input:checked + span {
    background: var(--blue);
    box-shadow: none;
}

.section-status-toggle input:checked + span::after {
    content: "";
    width: 7px;
    height: 12px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translateY(-1px) rotate(45deg);
}

.section-status-toggle:focus-within {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.inline-button {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 160px auto;
    gap: 12px;
    margin-bottom: 18px;
}

.filter-bar input,
.filter-bar select {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text);
    padding: 0 12px;
}

.livewire-table-shell {
    display: grid;
    gap: 18px;
}

.livewire-filter {
    align-items: center;
}

.livewire-loading {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.pagination-wrap {
    margin-top: 14px;
}

.pagination-wrap nav > div:first-child {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.pagination-wrap nav > div:last-child,
.pagination-wrap nav > div:last-child > span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pagination-wrap a,
.pagination-wrap span[aria-current] span,
.pagination-wrap span[aria-disabled] span {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    padding: 0 12px !important;
    font-size: 13px;
    font-weight: 800;
}

.pagination-wrap span[aria-current] span {
    border-color: var(--primary) !important;
    background: var(--primary) !important;
    color: var(--surface) !important;
}

[data-theme="dark"] .pagination-wrap span[aria-current] span {
    color: #08111d !important;
}

.content-table {
    display: grid;
    gap: 8px;
}

.content-table-head,
.content-table-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 160px 120px 190px;
    gap: 14px;
    align-items: center;
}

.content-table-head {
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.content-table-row {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 14px;
}

.content-table-row strong,
.content-table-row small {
    display: block;
}

.content-table-row small {
    margin-top: 4px;
    color: var(--muted);
}

.row-actions {
    display: flex;
    gap: 8px;
}

.article-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.article-main-fields,
.article-side-fields {
    display: grid;
    gap: 16px;
}

.slug-field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .45fr);
    gap: 16px;
}

.article-side-fields {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    padding: 18px;
}

.content-editor {
    min-height: 380px !important;
}

.is-hidden-editor-source {
    display: none;
}

.rich-editor {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
}

.rich-editor.has-error {
    border-color: var(--red);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 14%, transparent);
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    padding: 10px;
}

.rich-editor-button {
    min-height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    cursor: pointer;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
}

.rich-editor-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.rich-editor-canvas {
    min-height: 380px;
    padding: 16px;
    color: var(--text);
    line-height: 1.75;
    outline: none;
}

.rich-editor-canvas:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.rich-editor-canvas h2,
.rich-editor-canvas h3,
.rich-editor-canvas p,
.rich-editor-canvas ul,
.rich-editor-canvas ol,
.rich-editor-canvas blockquote {
    margin-top: 0;
}

.rich-editor-canvas h2 {
    font-size: 28px;
    line-height: 1.25;
}

.rich-editor-canvas h3 {
    font-size: 22px;
    line-height: 1.3;
}

.rich-editor-canvas ul,
.rich-editor-canvas ol {
    padding-left: 24px;
}

.rich-editor-canvas blockquote {
    border-left: 4px solid var(--gold);
    color: var(--muted);
    margin-left: 0;
    padding-left: 14px;
}

.thumbnail-preview {
    width: 100%;
    max-height: 210px;
    border: 1px solid var(--border);
    border-radius: 12px;
    object-fit: cover;
}

.publish-toggle {
    border-radius: 12px;
    background: var(--surface);
    padding: 12px;
}

.tuition-grid {
    display: grid;
    gap: 18px;
}

.user-admin-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--blue) 9%, transparent), transparent 58%),
        var(--surface);
    box-shadow: var(--shadow);
}

.user-admin-hero h2 {
    margin: 4px 0 8px;
    font-size: clamp(28px, 4vw, 42px);
}

.user-admin-hero p:not(.eyebrow) {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.user-admin-grid {
    display: grid;
    grid-template-columns: minmax(340px, .52fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.user-create-panel {
    position: sticky;
    top: 110px;
}

.user-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-form-grid label,
.user-form-grid input,
.user-form-grid select {
    min-width: 0;
}

.custom-select-field {
    position: relative;
}

.custom-select-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    color: var(--text);
    padding: 0 14px 0 16px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.custom-select-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-trigger svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
}

.custom-select-field.is-open .custom-select-trigger,
.custom-select-trigger:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
    outline: none;
}

.custom-select-field.is-open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-menu {
    position: absolute;
    z-index: 80;
    right: 0;
    left: 0;
    top: calc(100% + 8px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 24px 58px rgba(15, 23, 42, .18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(.98);
    transform-origin: top;
    transition: opacity .16s ease, transform .16s ease;
}

.custom-select-field.is-open .custom-select-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.custom-select-scroll {
    display: grid;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
}

.custom-select-option {
    display: grid;
    gap: 3px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.custom-select-option strong,
.custom-select-option small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-option small {
    color: var(--muted);
    font-weight: 700;
}

.custom-select-option:hover,
.custom-select-option.is-selected {
    background: color-mix(in srgb, var(--blue) 11%, var(--surface-muted));
}

.custom-select-option.is-selected strong {
    color: var(--primary);
}

.user-card-list {
    display: grid;
    gap: 12px;
}

.user-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    padding: 14px;
}

.user-card summary {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    list-style: none;
}

.user-card summary::-webkit-details-marker {
    display: none;
}

.user-avatar {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 12px;
    background: var(--primary);
    color: var(--surface);
    font-size: 20px;
    font-weight: 900;
}

[data-theme="dark"] .user-avatar {
    color: #08111d;
}

.user-card-main {
    min-width: 0;
}

.user-card-main strong,
.user-card-main small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-main small {
    margin-top: 2px;
    color: var(--muted);
}

.user-card em {
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 7px 10px;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.tuition-panel .panel-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 18px;
}

.tuition-rows {
    display: grid;
    gap: 12px;
}

.tuition-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(150px, .8fr) minmax(150px, .8fr) minmax(170px, 1fr) auto;
    gap: 12px;
    align-items: end;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 14px;
}

.tuition-remove {
    min-width: 84px;
}

.tuition-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.tuition-empty {
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 18px;
}

.nsc-filter {
    grid-template-columns: minmax(220px, 1fr) 180px auto;
}

.content-table-head.nsc-book-head,
.content-table-row.nsc-book-row {
    grid-template-columns: minmax(300px, 1fr) 150px 150px 110px 220px;
}

.book-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.book-cell img,
.book-cover-placeholder {
    width: 48px;
    height: 64px;
    flex: 0 0 auto;
    border-radius: 8px;
    object-fit: cover;
}

.book-cover-placeholder {
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
}

.book-cover-preview {
    aspect-ratio: 3 / 4;
    max-height: 280px;
    object-fit: cover;
}

.nsc-logo-preview {
    width: 220px;
    height: 90px;
    object-fit: contain;
    background: var(--surface-muted);
    padding: 14px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-check {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 12px;
}

.settings-sections {
    display: grid;
    gap: 22px;
}

.settings-block {
    display: grid;
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 18px;
}

.settings-block h2 {
    margin: 0;
}

.footer-link-list {
    display: grid;
    gap: 12px;
}

.footer-link-row {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 14px;
}

.floating-icon-preview {
    width: 80px;
    height: 80px;
    object-fit: contain;
    padding: 12px;
    background: var(--surface-muted);
}

.message-list {
    display: grid;
    gap: 14px;
}

.message-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 18px;
}

.message-card.is-unread {
    border-left: 4px solid var(--green);
    background: color-mix(in srgb, var(--green) 6%, var(--surface));
}

.message-head {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.message-head h3,
.message-body {
    margin: 0;
}

.message-body {
    margin-block: 12px;
    color: var(--text);
    line-height: 1.65;
}

.message-actions {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

@media (max-width: 1100px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .brand {
        min-width: 0;
    }

    .nav-actions {
        min-width: 0;
    }

    .metric-grid,
    .workflow-grid,
    .analytics-grid,
    .split-grid,
    .section-editor-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .article-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-side-fields {
        position: static;
    }

    .user-admin-grid {
        grid-template-columns: 1fr;
    }

    .user-create-panel {
        position: static;
    }
}

@media (max-width: 980px) {
    .admin-shell {
        display: block;
        min-width: 0;
        overflow-x: hidden;
    }

    .admin-menu-toggle {
        display: grid;
        flex: 0 0 auto;
    }

    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 70;
        width: min(320px, calc(100vw - 44px));
        height: 100dvh;
        transform: translateX(-104%);
        transition: transform 220ms ease;
        box-shadow: 22px 0 60px rgba(0, 0, 0, .24);
    }

    .admin-sidebar.is-open {
        transform: translateX(0);
    }

    .admin-sidebar-open {
        overflow: hidden;
    }

    .admin-topbar {
        align-items: center;
        justify-content: flex-start;
    }

    .admin-topbar > div:first-of-type {
        min-width: 0;
        flex: 1;
    }

    .admin-topbar h1 {
        overflow: hidden;
        font-size: clamp(26px, 5vw, 38px);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 780px) {
    .container {
        width: min(100% - 32px, 1520px);
    }

    .nav-inner {
        min-height: 72px;
        gap: 12px;
    }

    .site-nav-spacer {
        height: 72px;
    }

    .brand img {
        width: 44px;
        height: 44px;
    }

    .brand strong {
        max-width: min(54vw, 320px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 18px;
    }

    .portal-btn {
        display: none;
    }

    .admin-topbar,
    .topbar-actions,
    .module-row,
    .table-row,
    .message-card {
        align-items: stretch;
        flex-direction: column;
    }
    .admin-content,
    .admin-topbar {
        padding: 18px;
    }
    .metric-grid,
    .workflow-grid,
    .analytics-grid,
    .split-grid,
    .filter-bar,
    .slug-field-grid,
    .content-table-head,
    .content-table-row,
    .content-table-head.nsc-book-head,
    .content-table-row.nsc-book-row,
    .article-form-grid,
    .form-grid.two,
    .section-editor-list,
    .permission-grid,
    .footer-link-row,
    .message-card,
    .tuition-row {
        grid-template-columns: 1fr;
    }

    .bar-chart {
        overflow-x: auto;
        padding-inline: 12px;
    }

    .daily-chart .bar-item {
        min-width: 12px;
    }

    .compact-metrics {
        grid-template-columns: 1fr;
    }

    .content-table-head {
        display: none;
    }

    .row-actions {
        flex-wrap: wrap;
    }
    .hero-panel h2 { font-size: 30px; }

    .panel,
    .hero-panel,
    .workflow-card,
    .metric-card {
        padding: 18px;
    }

    .panel-header,
    .message-head,
    .media-manager-hero,
    .user-admin-hero,
    .content-media-head,
    .gallery-picker-head {
        align-items: stretch;
        flex-direction: column;
    }

    .user-form-grid,
    .user-card summary {
        grid-template-columns: 1fr;
    }

    .user-card em {
        width: fit-content;
    }

    .content-media-strip {
        grid-auto-columns: 132px;
    }

    .rich-editor-toolbar {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .rich-editor-button {
        flex: 0 0 auto;
    }
}

@media (max-width: 420px) {
    .brand strong {
        max-width: 44vw;
    }

    .theme-switch {
        width: 48px;
        min-width: 48px;
    }

    .admin-content,
    .admin-topbar {
        padding: 14px;
    }

    .topbar-actions .ghost-button {
        display: none;
    }

    .admin-topbar h1 {
        font-size: 24px;
    }

    .media-modal-backdrop {
        padding: 10px;
    }

    .media-modal-tabs {
        overflow-x: auto;
    }

    .media-modal-tabs button {
        flex: 0 0 auto;
    }
}

.media-manager-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--panel), var(--surface-muted));
    box-shadow: var(--shadow-soft);
}

.media-manager-hero h2 {
    margin: 6px 0 8px;
    font-size: clamp(28px, 4vw, 42px);
}

.media-manager-hero p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.media-summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
    min-width: min(360px, 100%);
}

.media-summary-strip article {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
}

.media-summary-strip span {
    display: block;
    color: var(--muted);
    font-size: .9rem;
}

.media-summary-strip strong {
    display: block;
    margin-top: 6px;
    font-size: 32px;
}

.media-manager-shell {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.media-uploader {
    position: sticky;
    top: 100px;
}

.media-dropzone {
    gap: 10px;
}

.media-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.media-dropzone-box {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 170px;
    padding: 24px;
    border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 8%, var(--panel));
    text-align: center;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.media-dropzone-box:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.media-dropzone-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
}

.media-dropzone-icon svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.media-dropzone-box small {
    color: var(--muted);
}

.media-library-panel {
    min-width: 0;
}

.media-library-panel .filter-bar {
    grid-template-columns: minmax(0, 1fr) auto;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.media-tile {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.media-thumb {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    background: var(--surface-muted);
}

.media-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-thumb span {
    display: none;
    color: var(--muted);
    font-weight: 700;
}

.media-thumb.is-broken img {
    display: none;
}

.media-thumb.is-broken span {
    display: block;
}

.media-tile-body {
    display: grid;
    gap: 10px;
    padding: 15px;
}

.media-tile-body strong {
    color: var(--text);
    line-height: 1.25;
}

.media-tile-body small {
    color: var(--muted);
}

.media-copy-chip {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.media-copy-chip:hover,
.media-copy-chip.is-copied {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--panel));
}

.media-copy-chip svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.media-copy-path {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-copy-chip strong {
    color: var(--accent);
    font-size: .84rem;
}

.media-actions {
    justify-content: space-between;
}

.media-preview-large {
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.editor-field {
    display: grid;
    gap: 10px;
}

.field-caption {
    color: var(--text);
    font-weight: 800;
}

.content-media-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.content-media-head,
.gallery-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.content-media-head span,
.gallery-picker-head strong {
    color: var(--text);
    font-weight: 800;
}

.content-media-head a,
.gallery-picker-head a {
    color: var(--accent);
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
}

.content-media-strip {
    display: grid;
    grid-auto-columns: 116px;
    grid-auto-flow: column;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.content-media-option,
.gallery-picker-item {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.content-media-option:hover,
.gallery-picker-item:hover,
.gallery-picker-item.is-selected {
    transform: translateY(-1px);
    border-color: var(--accent);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
}

.content-media-option img,
.gallery-picker-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: var(--surface-muted);
}

.content-media-option span,
.gallery-picker-item span {
    overflow: hidden;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-picker {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--blue) 7%, var(--surface));
}

.visually-hidden-file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.gallery-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.gallery-picker-empty {
    margin: 0;
    color: var(--muted);
}

.compact-file-field {
    gap: 8px;
    padding-top: 4px;
}

.selected-thumbnail-preview {
    display: grid;
    place-items: center;
    overflow: hidden;
    min-height: 174px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-muted) 80%, var(--surface));
    color: var(--muted);
    font-weight: 800;
}

.selected-thumbnail-preview.is-visible {
    display: grid;
}

.selected-thumbnail-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.media-picker-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    border: 1px solid #0b3fb5;
    border-radius: 8px;
    background: linear-gradient(135deg, #1d4ed8, #0f2d7a);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    box-shadow: 0 16px 32px rgba(29, 78, 216, .32);
    transition: transform .18s ease, box-shadow .18s ease;
}

.media-picker-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 38px rgba(29, 78, 216, .42);
}

.media-picker-trigger svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.has-media-modal {
    overflow: hidden;
}

.media-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 9, 20, .72);
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.media-modal-backdrop[hidden] {
    display: none;
}

.media-modal {
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: min(980px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    margin: auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}

.media-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 26px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.media-modal-head h2 {
    margin: 4px 0 0;
    font-size: 28px;
}

.media-modal-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    cursor: pointer;
}

.media-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.3;
    stroke-linecap: round;
}

.media-modal-tabs {
    position: sticky;
    top: 86px;
    z-index: 2;
    display: flex;
    gap: 8px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--blue) 5%, var(--surface-muted));
}

.media-modal-tabs button {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
}

.media-modal-tabs button.is-active {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #fff;
}

.media-modal-body {
    min-height: 0;
    overflow: auto;
    padding: 22px 24px 24px;
    background: var(--surface);
}

.media-tab-panel {
    display: none;
}

.media-tab-panel.is-active {
    display: block;
}

.modal-upload-box {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-height: 300px;
    padding: 34px;
    border: 2px dashed color-mix(in srgb, var(--blue) 60%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--blue) 8%, var(--surface));
    text-align: center;
    cursor: pointer;
}

.modal-upload-box input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.modal-upload-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #1d4ed8;
    color: #fff;
}

.modal-upload-icon svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal-upload-box small {
    color: var(--muted);
}

.media-picker-search {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text);
    font-weight: 800;
}

.media-picker-search input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    padding: 0 16px;
    font: inherit;
}

.modal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.modal-gallery-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.modal-media-card {
    display: grid;
    gap: 9px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.modal-media-card:hover,
.modal-media-card.is-selected {
    transform: translateY(-1px);
    border-color: var(--accent);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .1);
}

.modal-media-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: var(--surface-muted);
}

.modal-media-card span {
    overflow: hidden;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .media-manager-hero,
    .media-manager-shell {
        grid-template-columns: 1fr;
    }

    .media-manager-hero {
        display: grid;
    }

    .media-uploader {
        position: static;
    }
}

/* Production polish: admin responsive and dense form ergonomics */
.admin-content,
.panel,
.hero-panel,
.metric-card,
.chart-panel,
.user-card,
.media-tile,
.builder-item {
    min-width: 0;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.article-main-fields input,
.article-main-fields select,
.article-main-fields textarea,
.article-side-fields input,
.article-side-fields select,
.article-side-fields textarea {
    max-width: 100%;
}

.compact-table,
.module-list,
.user-card-list,
.media-grid,
.content-media-strip,
.custom-select-scroll {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 35%, var(--border)) transparent;
}

.compact-table::-webkit-scrollbar,
.module-list::-webkit-scrollbar,
.user-card-list::-webkit-scrollbar,
.media-grid::-webkit-scrollbar,
.content-media-strip::-webkit-scrollbar,
.custom-select-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.compact-table::-webkit-scrollbar-thumb,
.module-list::-webkit-scrollbar-thumb,
.user-card-list::-webkit-scrollbar-thumb,
.media-grid::-webkit-scrollbar-thumb,
.content-media-strip::-webkit-scrollbar-thumb,
.custom-select-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 35%, var(--border));
}

@media (max-width: 1180px) {
    .analytics-grid,
    .split-grid,
    .admin-editor-grid,
    .media-manager-grid,
    .user-admin-grid {
        grid-template-columns: 1fr;
    }

    .user-create-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .admin-topbar {
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .topbar-actions .ghost-button,
    .topbar-actions .danger-button {
        min-height: 42px;
        padding-inline: 14px;
    }

    .form-grid.two,
    .user-form-grid,
    .article-form-grid,
    .filter-bar,
    .livewire-filter,
    .media-library-panel .filter-bar {
        grid-template-columns: 1fr;
    }

    .panel-header,
    .user-admin-hero,
    .content-media-head,
    .gallery-picker-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-row,
    .user-card summary {
        grid-template-columns: 1fr;
    }

    .bar-chart {
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .daily-chart .bar-item {
        min-width: 24px;
    }

    .monthly-chart .bar-item {
        min-width: 120px;
    }

    .media-modal {
        width: min(100%, 94vw);
        max-height: 86vh;
    }

    .media-modal-tabs {
        overflow-x: auto;
    }

    .media-dropzone-box {
        min-height: 260px;
    }

    .custom-select-menu {
        position: fixed;
        right: 18px;
        left: 18px;
        top: auto;
        bottom: 18px;
        max-height: 58vh;
    }

    .custom-select-scroll {
        max-height: calc(58vh - 20px);
    }
}

.auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-inline-link,
.auth-link-button {
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.auth-inline-link:hover,
.auth-link-button:hover {
    color: var(--accent);
}

.auth-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
}

.comment-admin-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.comment-admin-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    border: 1px solid var(--border);
    border-left: 5px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    padding: 16px;
}

.comment-admin-card.status-pending { border-left-color: var(--accent); }
.comment-admin-card.status-approved { border-left-color: var(--green); }
.comment-admin-card.status-rejected { border-left-color: var(--red); }

.comment-admin-main {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
}

.comment-admin-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}

.comment-admin-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.comment-admin-meta strong {
    color: var(--text);
}

.comment-admin-meta span,
.comment-admin-main small {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
}

.comment-admin-meta em {
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 9px;
    font-size: .74rem;
    font-style: normal;
    font-weight: 900;
}

.comment-admin-main p {
    margin: 9px 0;
    color: var(--text);
    line-height: 1.65;
}

.comment-admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.comment-admin-actions select {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    padding: 0 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .comment-admin-card,
    .comment-admin-main {
        grid-template-columns: 1fr;
    }

    .comment-admin-actions {
        justify-content: stretch;
    }

    .comment-admin-actions form,
    .comment-admin-actions select,
    .comment-admin-actions button {
        width: 100%;
    }
}

.image-cropper {
    display: grid;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    padding: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

.image-cropper[hidden] {
    display: none;
}

.image-cropper-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.image-cropper-head strong {
    color: var(--text);
    font-weight: 900;
}

.image-cropper-head small {
    color: var(--muted);
    font-weight: 800;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-cropper-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 260px;
    overflow: hidden;
    border: 1px dashed rgba(37, 99, 235, .55);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(15, 23, 42, .04));
    cursor: grab;
}

.image-cropper-stage:active {
    cursor: grabbing;
}

.image-cropper-stage img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    user-select: none;
    transform-origin: center;
    transition: transform .12s ease;
    will-change: transform;
}

.crop-frame {
    position: absolute;
    inset: 10%;
    border: 2px solid rgba(255, 255, 255, .95);
    border-radius: 14px;
    box-shadow: 0 0 0 999px rgba(2, 6, 23, .32), inset 0 0 0 1px rgba(37, 99, 235, .35);
    pointer-events: none;
}

.image-cropper-zoom {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 900;
}

.image-cropper-zoom input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.image-cropper-apply {
    width: 100%;
}

.media-form-cropper {
    margin-top: -8px;
}

@media (max-width: 760px) {
    .image-cropper-stage {
        min-height: 220px;
    }

    .crop-frame {
        inset: 12%;
    }
}


.image-cropper-ratios {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.image-cropper-ratios button {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 8px 12px;
    font-size: .82rem;
    font-weight: 900;
    cursor: pointer;
    transition: .18s ease;
}

.image-cropper-ratios button:hover,
.image-cropper-ratios button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

.crop-frame {
    inset: auto;
}

.crop-frame.is-circle {
    border-radius: 999px;
}

.crop-frame.is-free {
    border-style: dashed;
}

.crop-frame i {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .22);
    pointer-events: auto;
}

.crop-frame i[data-handle="n"] { top: -9px; left: calc(50% - 9px); cursor: ns-resize; }
.crop-frame i[data-handle="s"] { bottom: -9px; left: calc(50% - 9px); cursor: ns-resize; }
.crop-frame i[data-handle="e"] { right: -9px; top: calc(50% - 9px); cursor: ew-resize; }
.crop-frame i[data-handle="w"] { left: -9px; top: calc(50% - 9px); cursor: ew-resize; }
.crop-frame i[data-handle="ne"] { top: -9px; right: -9px; cursor: nesw-resize; }
.crop-frame i[data-handle="nw"] { top: -9px; left: -9px; cursor: nwse-resize; }
.crop-frame i[data-handle="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.crop-frame i[data-handle="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }

.crop-frame.is-circle i[data-handle="n"],
.crop-frame.is-circle i[data-handle="s"],
.crop-frame.is-circle i[data-handle="e"],
.crop-frame.is-circle i[data-handle="w"] {
    display: none;
}

.crop-frame.is-circle i[data-handle="ne"] { top: 9%; right: 9%; }
.crop-frame.is-circle i[data-handle="nw"] { top: 9%; left: 9%; }
.crop-frame.is-circle i[data-handle="se"] { right: 9%; bottom: 9%; }
.crop-frame.is-circle i[data-handle="sw"] { left: 9%; bottom: 9%; }

.image-cropper-stage,
.image-cropper-stage img {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.image-cropper-stage img {
    pointer-events: none;
}

.crop-frame {
    pointer-events: none;
}

.crop-frame i {
    pointer-events: auto;
}

/* Modern admin file inputs and native select enhancers */
.admin-shell .modern-file-native,
.admin-shell .modern-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: .01;
    pointer-events: none;
}

.modern-file-field {
    display: grid;
    gap: 8px;
}

.modern-file-trigger {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 82px;
    border: 1.5px dashed color-mix(in srgb, var(--accent) 48%, var(--border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
    color: var(--text);
    padding: 14px;
    cursor: pointer;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.modern-file-trigger:hover,
.modern-file-trigger:focus {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 11%, var(--surface));
    box-shadow: 0 16px 34px rgba(15, 23, 42, .1);
    outline: none;
}

.modern-file-trigger.has-file {
    border-style: solid;
    background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.modern-file-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--navy));
    color: #fff;
    box-shadow: 0 14px 26px rgba(29, 78, 216, .28);
}

.modern-file-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modern-file-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.modern-file-copy strong,
.modern-file-copy small,
.modern-file-copy em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-file-copy strong {
    color: var(--text);
    font-size: .94rem;
    font-weight: 900;
    text-transform: capitalize;
}

.modern-file-copy small {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 800;
}

.modern-file-copy em {
    color: var(--accent);
    font-size: .76rem;
    font-style: normal;
    font-weight: 900;
}

.modern-file-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--accent);
    padding: 0 14px;
    font-size: .82rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px var(--border);
    white-space: nowrap;
}

.modern-select {
    position: relative;
    min-width: 0;
}

.modern-select-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text);
    padding: 0 13px 0 14px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.modern-select-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-select-trigger svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
}

.modern-select.is-open .modern-select-trigger,
.modern-select-trigger:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
    outline: none;
}

.modern-select.is-open .modern-select-trigger svg {
    transform: rotate(180deg);
}

.modern-select-menu {
    position: absolute;
    z-index: 120;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 24px 54px rgba(15, 23, 42, .18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(.98);
    transform-origin: top;
    transition: opacity .16s ease, transform .16s ease;
}

.modern-select.is-open .modern-select-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.modern-select-scroll {
    display: grid;
    gap: 5px;
    max-height: 230px;
    overflow-y: auto;
    padding: 8px;
}

.modern-select-option {
    display: grid;
    width: 100%;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    padding: 10px 11px;
    cursor: pointer;
    text-align: left;
}

.modern-select-option strong {
    overflow: hidden;
    font-size: .9rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-select-option:hover,
.modern-select-option.is-selected {
    background: color-mix(in srgb, var(--blue) 11%, var(--surface-muted));
}

.modern-select-option.is-selected strong {
    color: var(--primary);
}

.modern-select-option:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.modern-select-scroll::-webkit-scrollbar {
    width: 8px;
}

.modern-select-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.modern-select-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 34%, transparent);
}

[data-theme="dark"] .modern-file-trigger:hover,
[data-theme="dark"] .modern-select-menu {
    box-shadow: 0 24px 58px rgba(0, 0, 0, .35);
}

@media (max-width: 640px) {
    .modern-file-trigger {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .modern-file-icon {
        width: 42px;
        height: 42px;
    }

    .modern-file-action {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Admin button alignment pass */
.admin-shell .ghost-button,
.admin-shell .danger-button,
.admin-shell .primary-button,
.admin-shell .inline-button,
.admin-shell .rich-editor-button,
.admin-shell .media-picker-trigger,
.admin-shell .media-modal-tabs button,
.admin-shell .media-modal-close,
.admin-shell .image-cropper-ratios button,
.admin-shell .image-cropper-apply,
.admin-shell .modern-select-trigger,
.admin-shell .modern-file-trigger,
.admin-shell .media-copy-chip,
.admin-shell .admin-menu-toggle {
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
}

.admin-shell .ghost-button,
.admin-shell .danger-button,
.admin-shell .primary-button,
.admin-shell .inline-button,
.admin-shell .rich-editor-button,
.admin-shell .media-picker-trigger,
.admin-shell .media-modal-tabs button,
.admin-shell .image-cropper-ratios button,
.admin-shell .image-cropper-apply {
    display: inline-grid;
    place-items: center;
    grid-auto-flow: column;
    gap: 8px;
}

.admin-shell .ghost-button,
.admin-shell .danger-button,
.admin-shell .primary-button,
.admin-shell .inline-button {
    min-height: 48px;
    padding: 0 18px;
    white-space: nowrap;
}

.admin-shell .topbar-actions {
    align-items: center;
}

.admin-shell .topbar-actions form {
    display: contents;
}

.admin-shell .topbar-actions .ghost-button,
.admin-shell .topbar-actions .danger-button {
    min-width: 132px;
}

.admin-shell .theme-switch,
.admin-shell .admin-menu-toggle,
.admin-shell .media-modal-close {
    display: inline-grid;
    place-items: center;
    line-height: 1;
    flex: 0 0 auto;
}

.admin-shell .theme-switch {
    width: 64px;
    min-width: 64px;
    height: 48px;
    min-height: 48px;
}

.admin-shell .switch-track {
    margin: 0;
}

.admin-shell .media-actions,
.admin-shell .row-actions,
.admin-shell .form-actions,
.admin-shell .comment-admin-actions,
.admin-shell .quick-actions,
.admin-shell .panel-actions {
    align-items: center;
}

.admin-shell .media-copy-chip {
    text-align: left;
}

.admin-shell .media-copy-chip strong,
.admin-shell .media-copy-path,
.admin-shell .modern-select-trigger span,
.admin-shell .modern-file-copy strong,
.admin-shell .modern-file-copy small,
.admin-shell .modern-file-copy em {
    line-height: 1.25;
}

.admin-shell .modern-file-action {
    display: inline-grid;
    place-items: center;
    line-height: 1;
}

.admin-shell .filter-bar .ghost-button,
.admin-shell .filter-bar .primary-button,
.admin-shell .filter-bar .danger-button,
.admin-shell .media-library-panel .filter-bar .ghost-button {
    height: 52px;
    min-height: 52px;
}

.admin-shell button svg,
.admin-shell a svg {
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .admin-shell .topbar-actions .ghost-button,
    .admin-shell .topbar-actions .danger-button {
        min-width: 0;
    }

    .admin-shell .ghost-button,
    .admin-shell .danger-button,
    .admin-shell .primary-button,
    .admin-shell .inline-button {
        white-space: normal;
    }
}
/* Admin responsive guard: prevent page-wide horizontal drift on every admin screen */
html:has(body.admin-shell),
body.admin-shell {
    max-width: 100%;
    overflow-x: hidden;
}

body.admin-shell,
.admin-main,
.admin-content,
.admin-topbar,
.admin-sidebar,
.admin-form,
.article-form-grid,
.article-main-fields,
.article-side-fields,
.admin-editor-grid,
.media-manager-shell,
.media-library-panel,
.user-admin-grid,
.split-grid,
.analytics-grid,
.filter-bar,
.livewire-filter,
.form-grid,
.user-form-grid,
.panel,
.hero-panel,
.content-table,
.content-table-row,
.content-table-head,
.module-row,
.table-row,
.modern-select,
.custom-select-field,
.gallery-picker,
.content-media-panel,
.rich-editor,
.rich-editor-toolbar,
.content-editor,
.media-copy-chip {
    min-width: 0;
    max-width: 100%;
}

.admin-main {
    width: 100%;
    overflow-x: clip;
}

.admin-content {
    width: 100%;
    overflow-x: clip;
}

.admin-topbar {
    width: 100%;
    min-width: 0;
}

.admin-topbar > div:first-of-type {
    min-width: 0;
}

.admin-topbar h1 {
    overflow-wrap: anywhere;
}

.topbar-actions {
    min-width: 0;
    flex-wrap: wrap;
}

.admin-shell input,
.admin-shell select,
.admin-shell textarea,
.admin-shell button,
.admin-shell a,
.admin-shell label {
    max-width: 100%;
}

.admin-shell input,
.admin-shell select,
.admin-shell textarea {
    min-width: 0;
}

.article-form-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.article-side-fields {
    width: 100%;
}

.rich-editor-toolbar {
    overflow-x: auto;
}

.content-editor {
    overflow-wrap: anywhere;
}

.content-table,
.compact-table,
.module-list,
.user-card-list,
.media-grid {
    overflow-x: auto;
}

.media-copy-chip {
    grid-template-columns: 24px minmax(0, 1fr) auto;
}

@media (max-width: 1280px) {
    .article-form-grid,
    .admin-editor-grid,
    .media-manager-shell,
    .user-admin-grid,
    .split-grid,
    .analytics-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-side-fields,
    .media-uploader,
    .user-create-panel {
        position: static;
    }
}

@media (max-width: 980px) {
    .admin-shell {
        display: block;
        width: 100%;
    }

    .admin-main {
        width: 100%;
    }

    .admin-topbar {
        align-items: flex-start;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .admin-topbar h1 {
        white-space: normal;
    }

    .topbar-actions {
        margin-left: 0;
    }
}

@media (max-width: 780px) {
    .admin-content,
    .admin-topbar {
        padding-inline: 16px;
    }

    .topbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
    }

    .topbar-actions .ghost-button,
    .topbar-actions .danger-button {
        min-width: 0;
        width: 100%;
    }

    .filter-bar,
    .livewire-filter,
    .media-library-panel .filter-bar,
    .slug-field-grid,
    .form-grid.two,
    .user-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .panel,
    .hero-panel {
        padding: 18px;
    }
}

@media (max-width: 520px) {
    .admin-content,
    .admin-topbar {
        padding-inline: 12px;
    }

    .topbar-actions {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .topbar-actions .ghost-button,
    .topbar-actions form,
    .topbar-actions .danger-button {
        grid-column: 1 / -1;
    }

    .media-copy-chip {
        grid-template-columns: 22px minmax(0, 1fr);
    }

    .media-copy-chip .media-copy-button,
    .media-copy-chip button {
        grid-column: 1 / -1;
        width: 100%;
    }
}
/* Desktop admin sidebar stays fixed while the main panel scrolls */
@media (min-width: 981px) {
    body.admin-shell {
        display: block;
        padding-left: 280px;
    }

    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: 280px;
        max-width: 280px;
        height: 100dvh;
        transform: none;
    }

    .admin-main {
        min-height: 100vh;
        width: 100%;
    }
}

@media (max-width: 980px) {
    body.admin-shell {
        padding-left: 0;
    }
}
/* Phase B custom admin foundation */
.admin-shell :focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 44%, transparent);
    outline-offset: 3px;
}

.side-group-label {
    display: block;
    margin: 18px 0 4px;
    color: rgba(233, 195, 73, .78);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.side-nav .side-group-label:first-child {
    margin-top: 0;
}

.admin-title-block {
    min-width: 0;
}

.admin-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 800;
}

.admin-breadcrumbs a {
    color: var(--primary);
}

.admin-breadcrumbs span:not(:last-child)::after,
.admin-breadcrumbs a:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: var(--muted);
}

.admin-page-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(120deg, color-mix(in srgb, var(--primary-soft) 62%, transparent), var(--surface));
    padding: 18px 20px;
}

.admin-page-intro p {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.admin-page-intro-compact {
    background: transparent;
    padding: 0;
    border: 0;
}

.admin-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-notification-stack {
    display: grid;
    gap: 10px;
}

.admin-notification {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) 34px;
    align-items: start;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 14px;
    box-shadow: var(--shadow);
    transition: opacity .16s ease, transform .16s ease;
}

.admin-notification.is-hiding {
    opacity: 0;
    transform: translateY(-4px);
}

.admin-notification-dot {
    width: 12px;
    height: 12px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--accent);
}

.admin-notification.is-success .admin-notification-dot { background: var(--green); }
.admin-notification.is-error .admin-notification-dot { background: var(--red); }
.admin-notification.is-warning .admin-notification-dot { background: var(--gold); }
.admin-notification.is-info .admin-notification-dot { background: var(--blue); }

.admin-notification strong,
.admin-notification p,
.admin-notification ul {
    margin: 0;
}

.admin-notification p,
.admin-notification li {
    color: var(--muted);
    line-height: 1.55;
}

.admin-notification ul {
    padding-left: 18px;
}

.admin-notification button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.admin-user-menu {
    position: relative;
}

.admin-user-menu summary {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 48px;
    min-width: 190px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 4px 12px 4px 4px;
    cursor: pointer;
    list-style: none;
}

.admin-user-menu summary::-webkit-details-marker {
    display: none;
}

.admin-user-avatar {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}

.admin-user-summary {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.admin-user-summary strong,
.admin-user-summary small,
.admin-user-panel strong,
.admin-user-panel span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-summary small,
.admin-user-panel span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.admin-user-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 150;
    display: grid;
    gap: 12px;
    width: min(280px, 80vw);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 24px 58px rgba(15, 23, 42, .18);
    padding: 14px;
}

.admin-user-panel p {
    display: grid;
    gap: 4px;
    margin: 0;
}

.admin-user-panel .danger-button {
    width: 100%;
}

.admin-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    background: rgba(2, 6, 23, .62);
    backdrop-filter: blur(8px);
    padding: 20px;
}

.admin-confirm-backdrop[hidden] {
    display: none;
}

.admin-confirm-dialog {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 16px;
    width: min(520px, 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 34px 90px rgba(2, 6, 23, .32);
    padding: 22px;
}

.admin-confirm-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--red) 14%, var(--surface));
    color: var(--red);
    font-size: 1.5rem;
    font-weight: 900;
}

.admin-confirm-dialog h2,
.admin-confirm-dialog p {
    margin: 0;
}

.admin-confirm-dialog h2 {
    font-size: 1.35rem;
}

.admin-confirm-dialog p:not(.eyebrow) {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.6;
}

.admin-confirm-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-dialog-open {
    overflow: hidden;
}

[data-theme="dark"] .admin-user-panel,
[data-theme="dark"] .admin-confirm-dialog,
[data-theme="dark"] .admin-notification {
    box-shadow: 0 26px 70px rgba(0, 0, 0, .42);
}

@media (max-width: 980px) {
    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 80;
        width: min(320px, 86vw);
        max-width: 86vw;
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    .admin-sidebar.is-open {
        transform: translateX(0);
    }

    .admin-menu-toggle {
        display: inline-grid;
    }

    .admin-content {
        padding: 24px 18px;
    }
}

@media (max-width: 760px) {
    .admin-page-intro,
    .admin-confirm-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-page-actions,
    .admin-page-actions > *,
    .admin-confirm-actions > * {
        width: 100%;
    }

    .admin-user-menu,
    .admin-user-menu summary {
        width: 100%;
        min-width: 0;
    }

    .admin-user-panel {
        right: auto;
        left: 0;
        width: 100%;
    }
}

@media (max-width: 520px) {
    .admin-confirm-dialog {
        grid-template-columns: 1fr;
    }

    .admin-confirm-icon {
        width: 46px;
        height: 46px;
    }
}

/* News Phase D workflow polish */
.field-hint {
    display: block;
    margin-top: 0.45rem;
    color: var(--muted-text);
    font-size: 0.84rem;
    line-height: 1.45;
}

.publishing-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--soft-surface);
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
}

.button-cluster {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.split-actions {
    justify-content: space-between;
    gap: 1rem;
}

.badge-warning,
.badge-info,
.badge-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.82rem;
    line-height: 1;
    white-space: nowrap;
}

.badge-warning {
    background: #fff4d6;
    color: #8a5a00;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-danger {
    background: #fee2e2;
    color: #be123c;
}

[data-theme="dark"] .badge-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

[data-theme="dark"] .badge-info {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

[data-theme="dark"] .badge-danger {
    background: rgba(244, 63, 94, 0.18);
    color: #fda4af;
}

.news-table .content-table-row > div:first-child {
    min-width: 0;
}

.news-table .content-table-row small {
    overflow-wrap: anywhere;
}

@media (max-width: 820px) {
    .split-actions,
    .button-cluster {
        align-items: stretch;
        flex-direction: column;
    }

    .button-cluster > *,
    .split-actions > * {
        width: 100%;
    }
}

.admin-file-picker {
    align-items: center;
    background: var(--surface-muted, #f1f5f9);
    border: 1px dashed var(--border, #cbd5e1);
    border-radius: 16px;
    color: var(--text, #0f172a);
    cursor: pointer;
    display: flex;
    font-weight: 800;
    justify-content: center;
    min-height: 58px;
    overflow: hidden;
    padding: 0 18px;
    position: relative;
    text-align: center;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.admin-file-picker:hover {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 10px 26px rgba(37, 99, 235, .12);
    transform: translateY(-1px);
}

.admin-file-picker input[type="file"] {
    cursor: pointer;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
}

[data-theme="dark"] .admin-file-picker {
    background: rgba(148, 163, 184, .12);
    border-color: rgba(148, 163, 184, .28);
    color: #e5e7eb;
}

/* Phase G media platform */
.metadata-grid,
.usage-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.metadata-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metadata-grid span,
.usage-list span {
    display: grid;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 12px;
}

.metadata-grid strong,
.usage-list strong {
    color: var(--text);
}

.media-thumb.is-document {
    display: grid;
    place-items: center;
    gap: 6px;
    background: color-mix(in srgb, var(--blue) 10%, var(--surface-muted));
    color: var(--primary);
}

.media-thumb.is-document strong {
    font-size: 1.8rem;
    font-weight: 900;
}

.media-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 4px;
}

.media-select-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 10px;
    cursor: pointer;
}

.media-select-card:hover,
.media-select-card:has(input:checked) {
    border-color: var(--blue);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--blue) 13%, transparent);
}

.media-select-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    object-fit: cover;
    background: var(--surface-muted);
}

.media-select-card span {
    overflow: hidden;
    color: var(--text);
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-select-card input[type="number"],
.media-select-card input[type="text"] {
    min-height: 38px;
    font-size: .88rem;
}

.banner-media-grid .media-select-card input[type="radio"],
.media-select-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.hero-copy {
    position: absolute;
    left: 50%;
    top: 46%;
    width: min(780px, calc(100% - 32px));
    color: #fff;
    text-align: center;
    transform: translate(-50%, -50%);
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1.02;
}

.hero-copy p {
    margin: 18px auto 0;
    max-width: 680px;
    color: rgba(255,255,255,.86);
    font-size: clamp(1rem, 1.5vw, 1.24rem);
    line-height: 1.65;
}

@media (max-width: 760px) {
    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .media-select-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        max-height: 420px;
    }
}

.location-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.location-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    padding: 0 18px;
    font-weight: 900;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.location-tab:hover,
.location-tab:focus {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    outline: none;
}

.location-tab.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.form-hint {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

label.is-muted {
    opacity: .72;
}

.dropdown-subgroup {
    display: grid;
    gap: 2px;
    margin: -2px 0 6px 10px;
    border-left: 2px solid var(--border);
    padding-left: 8px;
}

.dropdown-subgroup a {
    min-height: 36px;
    font-size: 13px;
    font-weight: 750;
}

/* Phase J: tuition management */
.tuition-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.tuition-plan-card,
.notice-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--panel);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
}

.tuition-plan-head,
.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.tuition-plan-head h2,
.section-heading-row h2,
.tuition-workflow-panel h2 {
    margin: .45rem 0 .25rem;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    line-height: 1.15;
}

.tuition-plan-head p,
.muted,
.notice-card p {
    color: var(--muted);
    margin: .25rem 0 0;
}

.status-badge,
.badge-muted,
.badge-info,
.badge-success,
.badge-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    border-radius: 999px;
    padding: .35rem .8rem;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.badge-muted,
.is-draft { background: var(--surface-muted); color: var(--muted); }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .badge-info { background: rgba(37,99,235,.22); color: #bfdbfe; }
[data-theme="dark"] .badge-success { background: rgba(22,163,74,.22); color: #bbf7d0; }
[data-theme="dark"] .badge-warning { background: rgba(202,138,4,.22); color: #fde68a; }

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem;
    margin: 1rem 0;
}

.mini-stats div {
    border-radius: 16px;
    background: var(--surface-muted);
    padding: .8rem;
}

.mini-stats dt {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.mini-stats dd {
    margin: .25rem 0 0;
    font-weight: 800;
}

.tuition-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 1rem;
    align-items: start;
}

.tuition-workflow-panel {
    position: sticky;
    top: 1rem;
}

.tuition-items {
    display: grid;
    gap: .9rem;
}

.tuition-item-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, .8fr) minmax(150px, .8fr) minmax(96px, .45fr) auto;
    gap: .75rem;
    align-items: end;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface-muted);
    padding: 1rem;
}

.tuition-item-row .wide {
    grid-column: 1 / -2;
}

.button-row {
    display: flex;
    gap: .6rem;
    align-items: center;
}

.button-row.wrap { flex-wrap: wrap; }
.button-row.vertical { flex-direction: column; align-items: stretch; }
.full-width { width: 100%; }

.icon-only {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 !important;
    font-size: 1.25rem;
    line-height: 1;
}

.notice-card.warning {
    background: color-mix(in srgb, #fef3c7 72%, var(--panel));
    border-color: #facc15;
}

@media (max-width: 1100px) {
    .tuition-editor-grid {
        grid-template-columns: 1fr;
    }

    .tuition-workflow-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .tuition-item-row {
        grid-template-columns: 1fr;
    }

    .tuition-item-row .wide {
        grid-column: auto;
    }

    .mini-stats {
        grid-template-columns: 1fr;
    }
}

/* Shared public footer: works on legacy CSS pages and Vite/Tailwind pages */
.site-footer {
    margin-top: auto;
    border-top: 1px solid #0f172a;
    background: #020817;
    color: #b6c2d3;
    padding: 3.5rem 0 2.4rem;
}

.site-footer__inner,
.site-footer__bottom {
    width: min(1280px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, .55fr) minmax(260px, .9fr);
    gap: clamp(1.75rem, 4vw, 4.5rem);
    align-items: start;
}

.site-footer__brand-link {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: .9rem;
    color: #fff;
    font-size: clamp(1.1rem, 2vw, 1.55rem);
    font-weight: 950;
    line-height: 1.18;
    text-decoration: none;
}

.site-footer__logo {
    width: 3.15rem;
    height: 3.15rem;
    flex: 0 0 auto;
    object-fit: contain;
}

.site-footer__text {
    max-width: 28rem;
    margin: 1.2rem 0 0;
    color: #b6c2d3;
    font-size: .98rem;
    line-height: 1.75;
}

.site-footer__heading {
    margin: .25rem 0 1rem;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 900;
}

.site-footer__links,
.site-footer__contact-list {
    display: grid;
    gap: .7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer__links a,
.site-footer__contact-item {
    color: #b6c2d3;
    text-decoration: none;
    transition: color .16s ease, transform .16s ease;
}

.site-footer__links a:hover,
.site-footer__links a:focus,
.site-footer__contact-item:hover,
.site-footer__contact-item:focus {
    color: #ffcf1a;
    outline: none;
}

.site-footer__contact-item {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: .65rem;
    line-height: 1.55;
}

.site-footer__contact-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.site-footer__icon {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
    margin-top: .15rem;
}

.site-footer__socials {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.35rem;
}

.site-footer__social {
    display: inline-flex;
    width: 2.65rem;
    height: 2.65rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: rgba(255,255,255,.055);
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.site-footer__social:hover,
.site-footer__social:focus {
    border-color: #ffcf1a;
    background: #ffcf1a;
    transform: translateY(-1px);
    outline: none;
}

.site-footer__social img {
    width: 1.18rem;
    height: 1.18rem;
    object-fit: contain;
}

.site-footer__bottom {
    margin-top: 3rem;
    border-top: 1px solid rgba(148, 163, 184, .2);
    padding-top: 1.35rem;
    color: #9fb0c6;
    font-size: .92rem;
    text-align: center;
}

[data-theme="dark"] .site-footer,
.dark .site-footer {
    background: #020817;
    color: #b6c2d3;
}

@media (max-width: 860px) {
    .site-footer {
        padding-block: 3rem 2rem;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 560px) {
    .site-footer__inner,
    .site-footer__bottom {
        width: min(100% - 1.25rem, 1280px);
    }

    .site-footer__brand-link {
        align-items: flex-start;
    }

    .site-footer__logo {
        width: 2.75rem;
        height: 2.75rem;
    }
}

.pmb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    margin-top: 1.75rem;
}

.tuition-summary__head {
    align-items: flex-end;
}

.tuition-summary__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.tuition-summary__card {
    display: grid;
    min-height: 100%;
    gap: 1.25rem;
    border: 1px solid var(--border, #dbe3ee);
    border-radius: 1.35rem;
    background: var(--surface, #fff);
    padding: 1.35rem;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

.tuition-summary__card span {
    color: #155cff;
    font-size: .82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.tuition-summary__card h3 {
    margin: .35rem 0 .35rem;
    color: var(--text, #07122c);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 950;
    line-height: 1.16;
}

.tuition-summary__card p {
    margin: 0;
    color: var(--muted, #51617a);
    font-weight: 700;
}

.tuition-summary__card ul {
    display: grid;
    gap: .65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tuition-summary__card li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: .9rem;
    background: var(--surface-muted, #f4f7fb);
    padding: .85rem .95rem;
}

.tuition-summary__card li strong {
    color: var(--text, #07122c);
}

.tuition-summary__card li span {
    color: #155cff;
    font-size: .9rem;
    text-transform: none;
}

.tuition-summary__card .blue-button {
    width: 100%;
    min-height: 3rem;
}

.prodi-list-hero {
    background: linear-gradient(135deg, #061848 0%, #123a86 100%);
}

.admin-shell input[type="date"],
.admin-shell input[type="datetime-local"],
.admin-shell input[type="time"],
.admin-shell input[type="month"],
.admin-shell input[type="number"] {
    min-height: 3.45rem;
    border: 1px solid #d9e2ef;
    border-radius: .85rem;
    background: #f8fafc;
    color: #111827;
    padding: .85rem 1rem;
    font: inherit;
    font-weight: 750;
}

.admin-shell button,
.admin-shell .button,
.admin-shell .primary-button,
.admin-shell .secondary-button,
.admin-shell .danger-button,
.admin-shell .ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    line-height: 1.1;
    text-align: center;
}

@media (max-width: 980px) {
    .tuition-summary__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .pmb-actions .blue-button,
    .tuition-summary__head .text-link {
        width: 100%;
    }
}

/* Final responsive polish for tuition admin and public homepage */
.admin-shell .tuition-plan-form label,
.admin-shell .tuition-workflow-panel,
.admin-shell .tuition-item-row label {
    min-width: 0;
}

.form-grid.two-columns,
.tuition-scope-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-shell .tuition-plan-form input:not([type="checkbox"]):not([type="radio"]),
.admin-shell .tuition-plan-form textarea,
.admin-shell .tuition-plan-form select,
.admin-shell .tuition-item-row input:not([type="checkbox"]):not([type="radio"]),
.admin-shell .tuition-item-row textarea,
.admin-shell .tuition-item-row select {
    width: 100%;
    min-height: 3.45rem;
    border: 1px solid var(--border);
    border-radius: .85rem;
    background: var(--surface-muted);
    color: var(--text);
    padding: .85rem 1rem;
    font: inherit;
    font-weight: 750;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.admin-shell .tuition-plan-form textarea,
.admin-shell .tuition-item-row textarea {
    min-height: 7rem;
    resize: vertical;
}

.admin-shell .tuition-plan-form input:focus,
.admin-shell .tuition-plan-form textarea:focus,
.admin-shell .tuition-plan-form select:focus,
.admin-shell .tuition-item-row input:focus,
.admin-shell .tuition-item-row textarea:focus,
.admin-shell .tuition-item-row select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
    background: var(--surface);
}

.admin-shell .tuition-plan-form input::placeholder,
.admin-shell .tuition-plan-form textarea::placeholder,
.admin-shell .tuition-item-row input::placeholder,
.admin-shell .tuition-item-row textarea::placeholder {
    color: var(--muted);
    opacity: .78;
}

.tuition-item-row {
    grid-template-columns: minmax(180px, 1.2fr) minmax(150px, .75fr) minmax(160px, .8fr) minmax(110px, .5fr) 3.25rem;
}

.tuition-item-row .wide {
    grid-column: 1 / -2;
}

@media (max-width: 1280px) {
    .tuition-editor-grid {
        grid-template-columns: 1fr;
    }

    .tuition-workflow-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .tuition-item-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tuition-item-row .wide {
        grid-column: 1 / -1;
    }

    .tuition-item-row .icon-only {
        width: 100%;
        min-width: 0;
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .form-grid.two-columns,
    .tuition-scope-grid,
    .tuition-item-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .tuition-item-row .wide,
    .tuition-item-row .icon-only {
        grid-column: auto;
    }

    .section-heading-row,
    .tuition-plan-head {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .nav-inner {
        gap: .65rem;
    }

    .brand {
        min-width: 0;
    }

    .brand strong {
        max-width: min(52vw, 18rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .section {
        padding: 4rem 0;
    }

    .program-grid,
    .news-grid,
    .facility-grid,
    .tuition-summary__grid,
    .pmb-grid,
    .location-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.4rem;
    }

    .pmb-grid,
    .location-grid {
        align-items: start;
    }

    .form-card,
    .map-card,
    .program-card,
    .news-card,
    .facility-card,
    .tuition-summary__card {
        max-width: 100%;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 1.25rem, 1520px);
    }

    .hero {
        min-height: calc(100svh - 4.5rem);
        background-position: center top;
    }

    .hero-cta {
        width: calc(100% - 2rem);
        min-height: 3.4rem;
        padding-inline: 1rem;
        font-size: 1rem;
        white-space: normal;
    }

    .blue-button {
        width: 100%;
        min-height: 3.25rem;
    }

    .lead-title h2,
    .section-head h2,
    .news-toolbar h2 {
        font-size: clamp(2rem, 11vw, 2.75rem);
        line-height: 1.08;
    }
}

/* Final compact polish pass for admin forms and public mobile navbar */
.admin-shell .panel,
.admin-shell .admin-card,
.admin-shell .tuition-plan-form,
.admin-shell .tuition-workflow-panel {
    min-width: 0;
}

.admin-shell .form-grid,
.admin-shell .tuition-scope-grid,
.admin-shell .tuition-item-row {
    gap: 1.25rem;
}

.admin-shell .tuition-plan-form label,
.admin-shell .tuition-item-row label,
.admin-shell .form-grid label,
.admin-shell .admin-form label {
    display: grid;
    min-width: 0;
    gap: .5rem;
    line-height: 1.25;
}

.admin-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.admin-shell textarea,
.admin-shell select {
    width: 100%;
    max-width: 100%;
    min-height: 3.35rem;
    border: 1px solid var(--border);
    border-radius: .85rem;
    background: var(--surface-muted);
    color: var(--text);
    padding: .8rem 1rem;
    font: inherit;
    font-weight: 700;
    outline: none;
    box-shadow: none;
}

.admin-shell textarea {
    min-height: 8.5rem;
    resize: vertical;
    line-height: 1.45;
}

.admin-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.admin-shell textarea:focus,
.admin-shell select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.admin-shell input[type="file"] {
    width: 100%;
    max-width: 100%;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: .9rem;
    background: var(--surface-muted);
    padding: .75rem;
}

.admin-shell input[type="file"]::file-selector-button {
    border: 0;
    border-radius: .7rem;
    background: var(--primary);
    color: var(--primary-contrast);
    padding: .65rem .9rem;
    margin-right: .75rem;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.admin-shell .tuition-plan-form .locked-notice,
.admin-shell .tuition-plan-form .status-note,
.admin-shell .tuition-plan-form [class*="notice"],
.admin-shell .tuition-plan-form [class*="alert"] {
    margin-block: 1rem 1.25rem;
}

.admin-shell .tuition-item-row {
    align-items: end;
    padding: 1.15rem;
}

.admin-shell .tuition-item-row > label {
    margin: 0;
}

.admin-shell .tuition-item-row .icon-button,
.admin-shell .tuition-item-row button[type="button"] {
    min-width: 3.25rem;
    min-height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-shell .toolbar-actions,
.admin-shell .page-actions,
.admin-shell .admin-header-actions {
    align-items: center;
    gap: .8rem;
}

@media (max-width: 1180px) {
    .admin-shell .tuition-editor-grid,
    .admin-shell .article-form-grid,
    .admin-shell .program-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .admin-shell .form-grid,
    .admin-shell .tuition-scope-grid,
    .admin-shell .tuition-item-row {
        grid-template-columns: 1fr !important;
    }

    .admin-shell .admin-card,
    .admin-shell .panel {
        padding: 1rem;
    }

    .admin-shell .toolbar-actions,
    .admin-shell .page-actions,
    .admin-shell .admin-header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    .site .brand strong,
    .site .brand span:not(.brand-logo) {
        display: none;
    }

    .site .brand {
        min-width: auto;
        width: auto;
        flex: 0 0 auto;
    }

    .site .nav-inner {
        gap: .55rem;
    }

    .site .nav-actions .register-btn {
        display: none;
    }

    .site .mobile-panel .mobile-portal-link,
    .site .mobile-panel .mobile-register-link {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 2.75rem;
        border-radius: .9rem;
        font-weight: 900;
        text-align: center;
    }

    .site .mobile-panel .mobile-portal-link {
        margin-top: .7rem;
        border: 1px solid rgba(255, 210, 0, .65);
        background: rgba(255, 210, 0, .12);
        color: #ffd21a;
    }

    .site .mobile-panel .mobile-register-link {
        margin-top: .55rem;
        background: #ffd21a;
        color: #061538;
        box-shadow: 0 14px 28px rgba(255, 210, 0, .18);
    }

    .site .hero,
    .site .hero-slide,
    .site .hero-media,
    .site .hero-media img {
        min-height: calc(100svh - 4.4rem);
    }

    .site .hero-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }
}

@media (max-width: 430px) {
    .site .nav-actions {
        gap: .45rem;
    }

    .site .theme-toggle,
    .site .mobile-toggle {
        width: 2.55rem;
        height: 2.55rem;
        min-width: 2.55rem;
    }
}

/* Targeted cleanup for reported admin spacing and mobile navbar issues */
@media (min-width: 981px) {
    .admin-shell .admin-menu-toggle {
        display: none !important;
    }
}

.admin-shell .admin-page-intro {
    gap: 1rem;
}

.admin-shell .tuition-plan-form .form-grid.two,
.admin-shell .tuition-plan-form .form-grid.two-columns,
.admin-shell .tuition-scope-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem 1.25rem;
}

.admin-shell .tuition-plan-form label > input,
.admin-shell .tuition-plan-form label > textarea,
.admin-shell .tuition-plan-form label > select,
.admin-shell .article-side-fields label > input,
.admin-shell .article-side-fields label > textarea,
.admin-shell .article-side-fields label > select {
    margin-top: .45rem;
}

.admin-shell .tuition-plan-form .locked-notice,
.admin-shell .tuition-plan-form .status-note,
.admin-shell .tuition-plan-form [class*="notice"],
.admin-shell .tuition-plan-form [class*="alert"] {
    display: block;
    margin: 1rem 0 1.4rem;
}

.admin-shell .tuition-item-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(150px, .75fr) minmax(160px, .8fr) minmax(110px, .55fr) 3.25rem;
    gap: 1.1rem;
    align-items: end;
}

.admin-shell .tuition-item-row label {
    gap: .5rem;
}

.admin-shell .article-side-fields {
    min-width: 0;
}

.admin-shell .admin-file-picker {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: .75rem;
    width: 100%;
    min-height: 4.4rem;
    border: 1px dashed color-mix(in srgb, var(--primary) 42%, var(--border));
    border-radius: 1rem;
    background: color-mix(in srgb, var(--primary) 6%, var(--surface-muted));
    padding: .75rem;
    overflow: hidden;
}

.admin-shell .admin-file-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.admin-shell .admin-file-picker::before {
    content: "Unggah gambar";
    min-width: 0;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-shell .admin-file-picker > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    border: 1px solid var(--border);
    border-radius: .85rem;
    background: var(--surface);
    color: var(--primary);
    padding: 0 1rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.admin-shell .admin-file-picker:hover,
.admin-shell .admin-file-picker:focus-within {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.admin-shell .ghost-button,
.admin-shell .danger-button,
.admin-shell .primary-button,
.admin-shell .inline-button,
.admin-shell .admin-page-actions a,
.admin-shell .admin-page-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    line-height: 1.1;
    text-align: center;
}

.site .mobile-panel .mobile-portal-link + .mobile-register-link {
    margin-top: .65rem;
}

@media (max-width: 780px) {
    .site .brand strong {
        display: none !important;
    }

    .site .brand {
        min-width: 0 !important;
        flex: 0 0 auto;
        gap: 0;
    }

    .site .nav-actions .register-btn,
    .site .nav-actions > .register-btn {
        display: none !important;
    }

    .site .nav-actions .portal-btn,
    .site .nav-actions > .portal-btn {
        display: none !important;
    }

    .site .mobile-links .mobile-portal-link {
        justify-content: center;
        border: 1px solid rgba(255, 207, 26, .72);
        background: rgba(255, 207, 26, .1);
        color: #ffcf1a;
    }

    .site .mobile-links .mobile-register-link {
        justify-content: center;
        border: 1px solid #ffcf1a;
        background: #ffcf1a;
        color: #071330;
    }

    .site .hero-media img,
    .site .hero-slide img,
    .site .hero img {
        object-fit: cover;
        object-position: center center;
    }
}

@media (max-width: 760px) {
    .admin-shell .tuition-plan-form .form-grid.two,
    .admin-shell .tuition-plan-form .form-grid.two-columns,
    .admin-shell .tuition-scope-grid,
    .admin-shell .tuition-item-row {
        grid-template-columns: 1fr !important;
    }

    .admin-shell .admin-file-picker {
        grid-template-columns: 1fr;
    }

    .admin-shell .admin-file-picker > span {
        width: 100%;
    }
}
/* Reusable media modal cleanup for legacy upload fields */
.admin-shell .admin-file-picker[data-modern-file-field] {
    display: block;
    width: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    overflow: visible;
}

.admin-shell .admin-file-picker[data-modern-file-field]::before {
    content: none;
}

.admin-shell .admin-file-picker[data-modern-file-field] .modern-file-trigger {
    width: 100%;
}

.admin-shell .reusable-media-modal .modal-upload-box {
    width: 100%;
    cursor: pointer;
}

.admin-shell .reusable-media-modal .modal-media-card.is-loading {
    opacity: .65;
    cursor: wait;
}
/* Article/event form action and side picker layout fix */
.admin-shell .article-form-panel {
    display: grid;
    gap: 1.4rem;
}

.admin-shell .article-form-panel > .article-form-grid {
    min-width: 0;
}

.admin-shell .article-form-panel > .form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.admin-shell .article-form-panel > .form-actions .primary-button,
.admin-shell .article-form-panel > .form-actions .ghost-button,
.admin-shell .article-form-panel > .form-actions .danger-button {
    width: auto;
    flex: 0 0 auto;
}

.admin-shell .article-form-panel > .form-actions .primary-button {
    min-width: min(260px, 100%);
}

.admin-shell .article-side-fields .modern-file-field {
    width: 100%;
}

.admin-shell .article-side-fields .modern-file-trigger {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: .85rem;
    min-height: 6.4rem;
    padding: .9rem;
}

.admin-shell .article-side-fields .modern-file-copy strong,
.admin-shell .article-side-fields .modern-file-copy small,
.admin-shell .article-side-fields .modern-file-copy em {
    max-width: 100%;
}

.admin-shell .article-side-fields .modern-file-action {
    min-width: 4.2rem;
}

.admin-shell .article-side-fields .check-row {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.admin-shell .article-side-fields .check-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    flex: 0 0 auto;
}

@media (max-width: 980px) {
    .admin-shell .article-form-panel > .form-actions {
        align-items: stretch;
    }

    .admin-shell .article-form-panel > .form-actions .primary-button,
    .admin-shell .article-form-panel > .form-actions .ghost-button,
    .admin-shell .article-form-panel > .form-actions .danger-button {
        width: 100%;
        flex: 1 1 100%;
    }
}

@media (max-width: 420px) {
    .admin-shell .article-side-fields .modern-file-trigger {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .admin-shell .article-side-fields .modern-file-action {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Navbar builder layout and dropdown polish */
.admin-shell .admin-editor-grid {
    grid-template-columns: minmax(400px, 0.58fr) minmax(0, 1fr);
    align-items: start;
}

.admin-shell .admin-editor-grid > .panel,
.admin-shell .builder-item,
.admin-shell .builder-item .admin-form.compact {
    min-width: 0;
    overflow: visible;
}

.admin-shell .admin-editor-grid > .panel:first-child {
    position: relative;
    z-index: 20;
}

.admin-shell .navigation-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    justify-content: stretch;
    margin: 1rem 0 1.15rem;
}

.admin-shell .navigation-quick-actions form,
.admin-shell .navigation-quick-actions button {
    width: 100%;
}

.admin-shell .admin-editor-grid .admin-form,
.admin-shell .admin-editor-grid .form-grid {
    min-width: 0;
}

.admin-shell .admin-editor-grid .form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-shell .admin-editor-grid .admin-form > .primary-button {
    width: 100%;
    margin-top: 0.25rem;
}

.admin-shell .admin-editor-grid .modern-select {
    position: relative;
    width: 100%;
    min-width: 0;
    z-index: 1;
}

.admin-shell .admin-editor-grid .modern-select.is-open {
    z-index: 700;
}

.admin-shell .admin-editor-grid .modern-select-menu {
    left: 0;
    right: auto;
    width: 100%;
    min-width: min(280px, calc(100vw - 48px));
    max-width: min(380px, calc(100vw - 48px));
    z-index: 800;
}

.admin-shell .admin-editor-grid .modern-select-toggle,
.admin-shell .admin-editor-grid .modern-select-option {
    gap: 0.65rem;
    text-align: left;
}

.admin-shell .admin-editor-grid .builder-item .form-actions {
    flex-wrap: wrap;
    gap: 0.65rem;
}

.admin-shell .admin-editor-grid .builder-item .form-actions .primary-button,
.admin-shell .admin-editor-grid .builder-item .form-actions .ghost-button,
.admin-shell .admin-editor-grid .builder-item .form-actions .danger-button {
    width: auto;
    min-width: 120px;
}

@media (max-width: 1180px) {
    .admin-shell .admin-editor-grid {
        grid-template-columns: 1fr;
    }

    .admin-shell .navigation-quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .admin-shell .navigation-quick-actions,
    .admin-shell .admin-editor-grid .form-grid.two {
        grid-template-columns: 1fr !important;
    }

    .admin-shell .admin-editor-grid .modern-select-menu {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .admin-shell .admin-editor-grid .builder-item .form-actions .primary-button,
    .admin-shell .admin-editor-grid .builder-item .form-actions .ghost-button,
    .admin-shell .admin-editor-grid .builder-item .form-actions .danger-button {
        width: 100%;
    }
}
/* Hero banner desktop and mobile media selection */
.admin-shell .banner-device-panel {
    display: grid;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
    padding: 1rem;
}

.admin-shell .banner-device-panel + .banner-device-panel {
    margin-top: 1.25rem;
}

.admin-shell .panel-header.compact {
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0;
}

.admin-shell .panel-header.compact h3 {
    margin: .15rem 0 0;
    font-size: 1.15rem;
}

.admin-shell .muted-text {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 800;
}

.admin-shell .media-select-empty {
    min-height: 9rem;
    place-items: center;
    text-align: center;
}

.admin-shell .media-select-empty span {
    padding: .75rem;
}
.admin-shell .hero-fit-options {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.admin-shell .hero-fit-option {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding: .65rem .9rem;
    border: 1px solid var(--border);
    border-radius: .9rem;
    background: var(--surface-soft);
    color: var(--text);
    font-size: .92rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}

.admin-shell .hero-fit-option:hover,
.admin-shell .hero-fit-option:has(input:focus-visible) {
    border-color: var(--blue);
    box-shadow: 0 12px 26px color-mix(in srgb, var(--blue) 14%, transparent);
}

.admin-shell .hero-fit-option:has(input:checked) {
    border-color: var(--blue);
    background: color-mix(in srgb, var(--blue) 12%, var(--surface));
    color: var(--blue);
}

.admin-shell .hero-fit-option input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--blue);
}

.admin-shell .banner-inline-upload {
    display: grid;
    gap: .55rem;
    font-size: .95rem;
    font-weight: 900;
    color: var(--text);
}

.admin-shell .banner-inline-upload small {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 750;
    line-height: 1.45;
}

.admin-shell .banner-device-panel .admin-file-picker {
    min-height: 4rem;
}




/* Upload picker feedback fixes */
.modal-upload-box.is-drag-over {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, var(--surface));
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

.admin-shell .modern-file-preview {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: .9rem;
    background: var(--surface-muted);
}

.admin-shell .modern-file-preview[hidden] {
    display: none;
}

.admin-shell .modern-file-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
}
/* Scoped upload previews inside admin side panels */
.admin-shell .admin-upload-field {
    display: grid;
    gap: .75rem;
    min-width: 0;
}

.admin-shell .admin-upload-field > label {
    margin: 0;
}

.admin-shell .admin-upload-field .thumbnail-preview,
.admin-shell .admin-upload-field .modern-file-preview {
    width: 100%;
    max-width: 100%;
}

.admin-shell .admin-upload-field .thumbnail-preview {
    display: block;
    aspect-ratio: 16 / 10;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    border-radius: .9rem;
    border: 1px solid var(--border);
    background: var(--surface);
}

.admin-shell .admin-editor-grid > .admin-form .article-form-grid {
    grid-template-columns: minmax(0, 1fr);
}

.admin-shell .admin-editor-grid > .admin-form .article-side-fields {
    position: static;
}
/* Facility admin layout refinements */
.admin-shell .facility-edit-form {
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.admin-shell .facility-edit-form .article-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.25rem;
}

.admin-shell .facility-edit-form .article-side-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    position: static !important;
    width: 100%;
    max-width: 100%;
    z-index: auto;
}

.admin-shell .facility-edit-form .article-main-fields,
.admin-shell .facility-edit-form .article-side-fields,
.admin-shell .facility-edit-form .admin-upload-field,
.admin-shell .facility-edit-form .modern-file-field,
.admin-shell .facility-edit-form .modern-file-trigger {
    min-width: 0;
    max-width: 100%;
}

.admin-shell .facility-edit-form .content-editor,
.admin-shell .facility-edit-form .rich-editor {
    clear: both;
    position: relative;
    z-index: 0;
}

.admin-shell .facility-admin-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.1rem;
    overflow: visible;
}

.admin-shell .facility-admin-tile {
    min-width: 0;
    overflow: hidden;
}

.admin-shell .facility-admin-tile .media-thumb {
    aspect-ratio: 16 / 10;
}

.admin-shell .facility-admin-tile .media-tile-body {
    display: grid;
    gap: .75rem;
    min-width: 0;
}

.admin-shell .facility-admin-tile .media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    width: 100%;
    overflow: visible;
}

.admin-shell .facility-admin-tile .media-actions > a,
.admin-shell .facility-admin-tile .media-actions > form,
.admin-shell .facility-admin-tile .media-actions button {
    flex: 1 1 92px;
    min-width: 0;
}

.admin-shell .facility-admin-tile .media-actions button,
.admin-shell .facility-admin-tile .media-actions a {
    width: 100%;
}
/* Facility form vertical layout */
.admin-shell .facility-form-stack {
    display: grid;
    gap: 1.15rem;
    min-width: 0;
}

.admin-shell .facility-publish-panel {
    display: grid;
    gap: 1rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface-muted);
}

.admin-shell .facility-publish-panel .check-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    margin: 0;
}

.admin-shell .facility-publish-panel .check-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    flex: 0 0 auto;
}

.admin-shell .facility-side-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

.admin-shell .facility-side-actions > a {
    flex: 1 1 140px;
}

/* Keep the media picker tidy when image crop tools are visible. */
.admin-shell .media-modal {
    max-height: min(760px, calc(100dvh - 40px));
}

.admin-shell .media-modal-body {
    padding: 18px 22px 22px;
}

.admin-shell .media-tab-panel.is-active {
    display: grid;
    gap: 1rem;
}

.admin-shell .modal-upload-box {
    min-height: 180px;
    padding: 1.25rem;
}

.admin-shell .modal-upload-box strong,
.admin-shell .modal-upload-box small {
    max-width: 100%;
}

.admin-shell .media-tab-panel:has(.image-cropper:not([hidden])) .modal-upload-box {
    min-height: 88px;
    grid-template-columns: 52px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    text-align: left;
}

.admin-shell .media-tab-panel:has(.image-cropper:not([hidden])) .modal-upload-box .modal-upload-icon {
    grid-row: span 2;
    width: 52px;
    height: 52px;
}

.admin-shell .media-tab-panel:has(.image-cropper:not([hidden])) .modal-upload-box small {
    justify-self: start;
}

.admin-shell .media-tab-panel:has(.image-cropper:not([hidden])) .image-cropper {
    margin-top: 0;
}

.admin-shell .media-tab-panel:has(.image-cropper:not([hidden])) .image-cropper-stage {
    min-height: clamp(240px, 44vh, 360px);
}

@media (max-width: 760px) {
    .admin-shell .media-modal {
        max-height: calc(100dvh - 20px);
    }

    .admin-shell .media-modal-body {
        padding: 14px;
    }

    .admin-shell .media-modal-tabs {
        overflow-x: auto;
    }

    .admin-shell .modal-upload-box {
        min-height: 140px;
    }

    .admin-shell .media-tab-panel:has(.image-cropper:not([hidden])) .modal-upload-box {
        grid-template-columns: 44px minmax(0, 1fr);
        min-height: 76px;
        padding: .9rem;
    }

    .admin-shell .media-tab-panel:has(.image-cropper:not([hidden])) .modal-upload-box .modal-upload-icon {
        width: 44px;
        height: 44px;
    }

    .admin-shell .media-tab-panel:has(.image-cropper:not([hidden])) .image-cropper-stage {
        min-height: 260px;
    }
}

/* Unified image upload trigger: match Berita/Publikasi media picker. */
.admin-shell .modern-file-field.is-image-picker {
    display: grid;
    gap: .8rem;
    width: 100%;
    min-width: 0;
}

.admin-shell .modern-file-field.is-image-picker .modern-file-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    min-height: 58px;
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--accent) 72%, var(--border));
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--navy));
    color: #fff;
    padding: .95rem 1rem;
    text-align: center;
    box-shadow: 0 18px 34px rgba(29, 78, 216, .24);
}

.admin-shell .modern-file-field.is-image-picker .modern-file-trigger:hover,
.admin-shell .modern-file-field.is-image-picker .modern-file-trigger:focus {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 82%, white);
    background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 92%, white), var(--navy));
    box-shadow: 0 22px 40px rgba(29, 78, 216, .3);
}

.admin-shell .modern-file-field.is-image-picker .modern-file-icon {
    width: 24px;
    height: 24px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.admin-shell .modern-file-field.is-image-picker .modern-file-icon svg {
    width: 22px;
    height: 22px;
}

.admin-shell .modern-file-field.is-image-picker .modern-file-copy {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.admin-shell .modern-file-field.is-image-picker .modern-file-copy strong {
    color: inherit;
    font-size: 1rem;
    text-transform: none;
}

.admin-shell .modern-file-field.is-image-picker .modern-file-copy small,
.admin-shell .modern-file-field.is-image-picker .modern-file-copy em,
.admin-shell .modern-file-field.is-image-picker .modern-file-action {
    display: none;
}

.admin-shell .modern-file-field.is-image-picker + .modern-file-preview,
.admin-shell .modern-file-field.is-image-picker .modern-file-preview {
    margin-top: 0;
}

.admin-shell .modern-file-field.is-image-picker + .modern-file-preview img,
.admin-shell .modern-file-field.is-image-picker .modern-file-preview img {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 220px;
    object-fit: cover;
    border-radius: .9rem;
    border: 1px solid var(--border);
}

.admin-shell .reusable-media-modal .image-cropper {
    margin-top: 0;
}

@media (max-width: 760px) {
    .admin-shell .modern-file-field.is-image-picker .modern-file-trigger {
        min-height: 54px;
    }
}

.tracer-options-field {
    display: grid;
    gap: 12px;
}

.tracer-options-field[hidden] {
    display: none !important;
}

.tracer-options-header,
.tracer-option-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tracer-options-header {
    justify-content: space-between;
}

.tracer-options-header > span {
    font-weight: 800;
}

.tracer-options-list {
    display: grid;
    gap: 10px;
}

.tracer-option-row input {
    flex: 1;
    min-width: 0;
}

@media (max-width: 760px) {
    .tracer-options-header,
    .tracer-option-row {
        align-items: stretch;
        flex-direction: column;
    }
}

.tracer-question-builder {
    display: grid;
    gap: 18px;
}

.tracer-question-builder .panel-header {
    align-items: center;
}

.tracer-reorder-form {
    display: flex;
    justify-content: flex-end;
}

.tracer-question-list {
    display: grid;
    gap: 18px;
}

.tracer-question-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(15, 23, 42, .42);
    box-shadow: 0 18px 38px rgba(0, 0, 0, .16);
}

.tracer-question-card.is-dragging {
    opacity: .72;
    outline: 2px solid rgba(166, 190, 255, .9);
}

.tracer-question-drag {
    justify-self: center;
    width: 92px;
    min-height: 32px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(148, 163, 184, .12);
    cursor: grab;
    font-weight: 800;
}

.tracer-question-drag:active {
    cursor: grabbing;
}

.tracer-question-new-label {
    color: var(--accent);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.tracer-question-actions,
.tracer-question-delete-form {
    display: flex;
    justify-content: flex-end;
}

.tracer-question-actions {
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

@media (max-width: 760px) {
    .tracer-question-builder .panel-header,
    .tracer-reorder-form,
    .tracer-question-actions,
    .tracer-question-delete-form {
        align-items: stretch;
        flex-direction: column;
    }

    .tracer-question-builder .panel-header .primary-button,
    .tracer-reorder-form .ghost-button,
    .tracer-question-actions .primary-button,
    .tracer-question-actions .ghost-button,
    .tracer-question-delete-form .danger-button {
        width: 100%;
    }
}

.rich-editor-canvas blockquote {
    border-left: 4px solid var(--gold);
    color: var(--muted);
    margin-left: 0;
    padding-left: 14px;
}

.rich-editor-canvas figure,
.rich-editor-canvas .content-image {
    margin: 18px 0;
}

.rich-editor-canvas img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.rich-editor-canvas figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.rich-editor-canvas table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    overflow-wrap: anywhere;
}

.rich-editor-canvas th,
.rich-editor-canvas td {
    border: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.rich-editor-canvas th {
    background: var(--surface);
    font-weight: 900;
}

.prose figure,
.prose .content-image {
    margin: 2rem 0;
}

.prose figcaption {
    margin-top: .65rem;
    color: #64748b;
    font-size: .95rem;
    text-align: center;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    overflow-wrap: anywhere;
}

.prose th,
.prose td {
    border: 1px solid #cbd5e1;
    padding: .8rem;
    text-align: left;
    vertical-align: top;
}

.prose th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
}
.rich-editor-select {
    min-height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    cursor: pointer;
    padding: 0 28px 0 10px;
    font-size: 12px;
    font-weight: 900;
}

.rich-editor-canvas figure.is-selected {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.rich-editor-canvas .content-image--small,
.prose .content-image--small {
    max-width: min(100%, 520px);
}

.rich-editor-canvas .content-image--medium,
.prose .content-image--medium {
    max-width: min(100%, 760px);
}

.rich-editor-canvas .content-image--full,
.prose .content-image--full {
    max-width: 100%;
}

.rich-editor-canvas .content-image--left,
.prose .content-image--left {
    margin-left: 0;
    margin-right: auto;
}

.rich-editor-canvas .content-image--center,
.prose .content-image--center {
    margin-left: auto;
    margin-right: auto;
}

.rich-editor-canvas .content-image--right,
.prose .content-image--right {
    margin-left: auto;
    margin-right: 0;
}

.rich-editor-canvas .rich-text-lead,
.prose .rich-text-lead {
    font-size: 1.18em;
    line-height: 1.75;
    font-weight: 600;
}

.rich-editor-canvas .rich-text-small,
.prose .rich-text-small {
    font-size: .88em;
}

.rich-editor-canvas .rich-text-highlight,
.prose .rich-text-highlight {
    border-radius: .35em;
    background: #fef3c7;
    color: #78350f;
    padding: .08em .28em;
}

.rich-editor-canvas .rich-font-sans,
.prose .rich-font-sans {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rich-editor-canvas .rich-font-serif,
.prose .rich-font-serif {
    font-family: Georgia, "Times New Roman", serif;
}

.rich-editor-canvas .rich-font-mono,
.prose .rich-font-mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.rich-editor-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    gap: 4px;
}

.rich-editor-button svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rich-editor-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.rich-editor-symbol--underline {
    text-decoration: underline;
}
.rich-editor {
    overflow: visible;
}

.rich-editor-toolbar {
    align-items: center;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    flex-wrap: wrap !important;
    max-height: none !important;
}

.rich-editor-button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
}

.rich-editor-button .rich-editor-symbol {
    min-width: auto;
}

.rich-editor-select {
    width: auto;
    max-width: 150px;
    flex: 0 0 auto;
}

.rich-editor-canvas {
    overflow-wrap: anywhere;
}
/* Mobile public navbar scroll containment */
@media (max-width: 1100px) {
    body.mobile-menu-open {
        overflow: hidden;
    }

    .site .mobile-panel,
    .mobile-panel {
        max-height: calc(100svh - 72px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        scrollbar-gutter: stable;
    }

    .site .mobile-links,
    .mobile-links {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}
/* Stronger mobile menu scroll fix: keep the page locked, but let the menu itself scroll. */
@media (max-width: 1100px) {
    body.mobile-menu-open {
        overflow: hidden !important;
        touch-action: auto !important;
    }

    .site .mobile-panel.is-open,
    .mobile-panel.is-open {
        position: fixed;
        top: 72px;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 59;
        display: block;
        max-height: none !important;
        height: calc(100dvh - 72px);
        overflow-y: auto !important;
        overflow-x: hidden;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y !important;
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}
/* Password visibility toggle */
.password-toggle-field {
    position: relative;
    width: 100%;
}

.password-toggle-field input[type="password"],
.password-toggle-field input[type="text"] {
    padding-right: 3rem;
}

.password-toggle-button {
    position: absolute;
    top: 50%;
    right: .55rem;
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: .7rem;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-toggle-button:hover,
.password-toggle-button:focus {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
    outline: none;
}

.password-eye-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.password-toggle-button.is-visible .password-eye-icon {
    opacity: .72;
}
/* Stable public mobile navbar and floating contact button */
.floating-contact-button {
    position: fixed;
    right: 1rem;
    bottom: 1.5rem;
    z-index: 80;
    display: inline-flex;
    max-width: calc(100vw - 2rem);
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: 999px;
    background: #ffcf1a;
    color: #071330;
    padding: .85rem 1.1rem;
    font-weight: 900;
    font-size: .95rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 18px 40px rgba(7, 19, 48, .18);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.floating-contact-button:hover,
.floating-contact-button:focus {
    transform: translateY(-2px);
    background: #ffe16a;
    color: #071330;
    outline: none;
    box-shadow: 0 22px 46px rgba(7, 19, 48, .24);
}

.floating-contact-button__icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 auto;
}

.floating-contact-button span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.mobile-menu-open .floating-contact-button {
    display: none;
}

@media (max-width: 780px) {
    .nav .brand,
    .brand {
        min-width: 0 !important;
        flex: 0 0 auto;
        gap: 0;
    }

    .nav .brand strong,
    .brand strong {
        display: none !important;
    }

    .nav .nav-actions,
    .nav-actions {
        gap: .45rem;
        min-width: 0;
    }

    .nav .portal-btn,
    .nav .register-btn,
    .portal-btn,
    .register-btn {
        display: none !important;
    }

    .nav .theme-switch,
    .nav .mobile-menu-button,
    .theme-switch,
    .mobile-menu-button {
        width: 2.55rem;
        height: 2.55rem;
        min-width: 2.55rem;
    }

    .nav .nav-inner,
    .nav-inner {
        min-height: 72px;
        gap: .55rem;
    }

    .floating-contact-button {
        right: .85rem;
        bottom: .85rem;
        max-width: calc(100vw - 1.7rem);
        min-height: 2.9rem;
        padding: .8rem 1rem;
        font-size: .9rem;
    }
}
/* Dosen editor inside Prodi form */
.dosen-editor-panel {
    margin-top: 1.25rem;
}


.dosen-editor-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.dosen-remove-button {
    width: fit-content;
}
.dosen-editor-list {
    display: grid;
    gap: 1rem;
}

.dosen-editor-item {
    display: grid;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
    padding: 1rem;
}

.dosen-editor-photo {
    width: 96px;
    height: 96px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--surface);
}

.danger-check {
    color: var(--red);
    font-weight: 800;
}

/* Tracer Study redesign: scoped admin builder, monitoring, and alumni portal */
.tracer-period-panel .panel-header p,
.tracer-dashboard-hero p,
.tracer-question-builder .panel-header p {
    max-width: 58rem;
    color: var(--muted);
}

.tracer-period-summary,
.tracer-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .85rem;
    margin-bottom: 1.1rem;
}

.tracer-period-summary article {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    padding: 1rem;
}

.tracer-period-summary span,
.tracer-period-summary strong {
    display: block;
}

.tracer-period-summary span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tracer-period-summary strong {
    margin-top: .35rem;
    color: var(--text);
    font-size: 1.15rem;
}

.tracer-status-pill,
.tracer-type-chip,
.tracer-required-chip,
.tracer-logic-chip {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: .35rem .7rem;
    font-size: .75rem;
    font-weight: 850;
    line-height: 1;
}

.tracer-status-pill.is-active,
.tracer-status-pill.is-submitted {
    border: 1px solid rgba(16, 185, 129, .28);
    background: rgba(16, 185, 129, .12);
    color: #059669;
}

.tracer-status-pill.is-draft,
.tracer-status-pill.is-not_started {
    border: 1px solid rgba(148, 163, 184, .35);
    background: rgba(148, 163, 184, .12);
    color: var(--muted);
}

.tracer-status-pill.is-closed,
.tracer-status-pill.is-in_progress {
    border: 1px solid rgba(245, 158, 11, .32);
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}

.tracer-studio-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.tracer-outline-panel {
    position: sticky;
    top: 96px;
    display: grid;
    gap: .75rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
    padding: 1rem;
}

.tracer-outline-panel > strong {
    font-size: 1rem;
    color: var(--text);
}

.tracer-outline-panel > span,
.tracer-outline-panel p {
    color: var(--muted);
    font-size: .85rem;
}

.tracer-outline-list {
    display: grid;
    gap: .55rem;
    max-height: 55vh;
    overflow: auto;
    padding-right: .2rem;
}

.tracer-outline-list a {
    display: grid;
    gap: .25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    padding: .75rem;
    text-decoration: none;
}

.tracer-outline-list small {
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
}

.tracer-outline-list b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tracer-builder-main {
    min-width: 0;
}

.tracer-question-topline {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: .8rem;
}

.tracer-type-chip {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
}

.tracer-required-chip {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
}

.tracer-logic-chip {
    background: rgba(16, 185, 129, .12);
    color: #059669;
}

.tracer-logic-field {
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 5%, var(--surface-muted));
    padding: 1rem;
}

.tracer-logic-field p {
    margin: .35rem 0 .8rem;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.55;
}

.tracer-logic-list {
    display: grid;
    gap: .6rem;
}

.tracer-logic-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto minmax(180px, 1.2fr) auto;
    gap: .55rem;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    padding: .65rem;
}

.tracer-logic-row span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
    text-align: center;
}

.tracer-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}

.tracer-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--panel)), var(--panel));
}

.tracer-mini-progress {
    height: .45rem;
    margin-top: .7rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted);
}

.tracer-mini-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #6366f1);
}

.tracer-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.tracer-aggregate-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-muted);
    padding: 1rem;
}

.tracer-aggregate-card > span {
    color: var(--accent);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tracer-aggregate-card h3 {
    margin: .35rem 0 .75rem;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.35;
}

.tracer-aggregate-card strong {
    color: var(--accent);
    font-size: 2rem;
}

.tracer-aggregate-card p {
    color: var(--muted);
}

.tracer-aggregate-card ul {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tracer-aggregate-card li {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    border-radius: 10px;
    background: var(--panel);
    padding: .65rem .75rem;
}

.tracer-response-shell {
    margin: 0;
    min-height: 100vh;
    background: #0b0f17;
    color: #e5e7eb;
    font-family: Inter, system-ui, sans-serif;
}

.tracer-response-main {
    width: min(100% - 2rem, 980px);
    margin-inline: auto;
    padding: clamp(1rem, 4vw, 2rem) 0 2.5rem;
}

.tracer-response-hero,
.tracer-response-progress,
.tracer-response-question,
.tracer-response-actions,
.tracer-response-alert {
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    background: #111827;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .25);
}

.tracer-response-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    overflow: hidden;
}

.tracer-response-hero h1 {
    margin: .35rem 0;
    color: #f8fafc;
    font-size: clamp(1.7rem, 5vw, 2.65rem);
    line-height: 1.1;
}

.tracer-response-hero p:not(.eyebrow) {
    color: #cbd5e1;
    line-height: 1.6;
}

.tracer-response-timer {
    height: fit-content;
    white-space: nowrap;
    border-radius: 999px;
    background: rgba(59, 130, 246, .15);
    color: #93c5fd;
    padding: .6rem .85rem;
    font-weight: 800;
}

.tracer-response-alert {
    margin-top: 1rem;
    padding: 1rem;
    color: #bfdbfe;
}

.tracer-response-alert.is-error {
    color: #fecaca;
}

.tracer-response-progress {
    margin: 1rem 0;
    padding: 1rem;
}

.tracer-response-progress > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .7rem;
    color: #cbd5e1;
    font-weight: 800;
}

.tracer-progress-track {
    height: .55rem;
    overflow: hidden;
    border-radius: 999px;
    background: #1e293b;
}

.tracer-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6, #818cf8);
    transition: width .25s ease;
}

.tracer-response-form {
    display: grid;
    gap: 1rem;
}

.tracer-response-question {
    display: grid;
    gap: .9rem;
    padding: clamp(1.15rem, 4vw, 1.7rem);
}

.tracer-response-question[hidden] {
    display: none;
}

.tracer-response-question-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    color: #a5b4fc;
    font-size: .8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.tracer-response-question-head b {
    border-radius: 999px;
    background: rgba(248, 113, 113, .16);
    color: #fca5a5;
    padding: .3rem .6rem;
    text-transform: none;
}

.tracer-response-question h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    line-height: 1.35;
}

.tracer-response-question p {
    margin: 0;
    color: #94a3b8;
    line-height: 1.65;
}

.tracer-response-question input:not([type="radio"]):not([type="checkbox"]),
.tracer-response-question select,
.tracer-response-question textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: #1e293b;
    color: #f8fafc;
    padding: .85rem 1rem;
    font: inherit;
}

.tracer-response-question input:focus,
.tracer-response-question select:focus,
.tracer-response-question textarea:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .22);
    outline: none;
}

.tracer-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.tracer-choice-card,
.tracer-scale-grid label {
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: #1e293b;
    color: #e2e8f0;
    padding: .9rem;
    font-weight: 750;
    cursor: pointer;
}

.tracer-choice-card:has(input:checked),
.tracer-scale-grid label:has(input:checked) {
    border-color: #818cf8;
    background: rgba(99, 102, 241, .16);
}

.tracer-scale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: .65rem;
}

.tracer-scale-grid label {
    justify-content: center;
}

.tracer-response-actions {
    position: sticky;
    bottom: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: .85rem;
    backdrop-filter: blur(12px);
}

@media (max-width: 920px) {
    .tracer-studio-grid {
        grid-template-columns: 1fr;
    }

    .tracer-outline-panel {
        position: static;
    }

    .tracer-logic-row {
        grid-template-columns: 1fr;
    }

    .tracer-response-hero,
    .tracer-response-progress > div:first-child,
    .tracer-response-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Stitch-like tracer skin override */
body.admin-shell:has(.tracer-saas-page) {
    background: #0b0f17;
}

body.admin-shell:has(.tracer-saas-page) .admin-main,
body.admin-shell:has(.tracer-saas-page) .admin-content {
    background: #0b0f17;
}

body.admin-shell:has(.tracer-saas-page) .admin-topbar {
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(15, 19, 28, .88);
    color: #e5e7eb;
    backdrop-filter: blur(16px);
}

body.admin-shell:has(.tracer-saas-page) .admin-title-block h1,
body.admin-shell:has(.tracer-saas-page) .admin-page-intro p,
body.admin-shell:has(.tracer-saas-page) .topbar-actions,
body.admin-shell:has(.tracer-saas-page) .admin-user-summary strong {
    color: #e5e7eb;
}

.tracer-saas-page {
    --tracer-bg: #0b0f17;
    --tracer-panel: #111827;
    --tracer-card: #1e293b;
    --tracer-card-2: #172033;
    --tracer-line: rgba(255,255,255,.09);
    --tracer-muted: #94a3b8;
    --tracer-text: #f8fafc;
    --tracer-indigo: #818cf8;
    --tracer-blue: #3b82f6;
    --tracer-green: #34d399;
    display: grid;
    gap: 1.25rem;
    color: var(--tracer-text);
}

.tracer-saas-page .panel,
.tracer-saas-page .stat-card,
.tracer-saas-page .content-table {
    border: 1px solid var(--tracer-line);
    background: linear-gradient(180deg, rgba(17, 24, 39, .98), rgba(15, 23, 42, .98));
    color: var(--tracer-text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

.tracer-saas-page .panel-header h2,
.tracer-saas-page h2,
.tracer-saas-page h3,
.tracer-saas-page .stat-card strong,
.tracer-saas-page .content-table td,
.tracer-saas-page .content-table strong {
    color: var(--tracer-text);
}

.tracer-saas-page .eyebrow,
.tracer-saas-page .panel-header .eyebrow {
    color: var(--tracer-indigo);
}

.tracer-saas-page .panel p,
.tracer-saas-page small,
.tracer-saas-page .content-table small,
.tracer-saas-page .stat-card span {
    color: var(--tracer-muted);
}

.tracer-saas-page .admin-form input,
.tracer-saas-page .admin-form select,
.tracer-saas-page .admin-form textarea,
.tracer-saas-page .filter-bar input,
.tracer-saas-page .filter-bar select,
.tracer-saas-page .tracer-logic-row select,
.tracer-saas-page .tracer-option-row input {
    border-color: rgba(255,255,255,.12);
    background: #1e293b;
    color: var(--tracer-text);
}

.tracer-saas-page .admin-form label span,
.tracer-saas-page .filter-bar label {
    color: #dbeafe;
}

.tracer-saas-page .primary-button {
    border: 0;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    box-shadow: 0 12px 32px rgba(59, 130, 246, .28);
}

.tracer-saas-page .ghost-button,
.tracer-saas-page .inline-button {
    border-color: rgba(255,255,255,.12);
    background: #1e293b;
    color: #e2e8f0;
}

.tracer-saas-page .danger-button {
    border: 1px solid rgba(248,113,113,.28);
    background: rgba(239,68,68,.12);
    color: #fca5a5;
}

.tracer-dashboard-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, .24), transparent 34%),
        linear-gradient(135deg, #111827, #172554) !important;
}

.tracer-dashboard-hero::after {
    content: '';
    position: absolute;
    right: -4rem;
    bottom: -4rem;
    width: 15rem;
    height: 15rem;
    border-radius: 999px;
    background: rgba(52, 211, 153, .09);
    filter: blur(18px);
}

.tracer-studio-grid {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(240px, 300px);
}

.tracer-outline-panel,
.tracer-simulator-panel {
    border: 1px solid var(--tracer-line);
    border-radius: 18px;
    background: #111827;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
}

.tracer-outline-list a,
.tracer-question-card,
.tracer-aggregate-card,
.tracer-period-summary article,
.tracer-logic-row,
.tracer-option-row {
    border-color: var(--tracer-line);
    background: #1e293b;
    color: var(--tracer-text);
}

.tracer-question-card {
    padding: 1rem;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.tracer-question-card:hover {
    border-color: rgba(129, 140, 248, .38);
    box-shadow: 0 16px 42px rgba(0,0,0,.28), 0 0 0 1px rgba(99,102,241,.18);
    transform: translateY(-1px);
}

.tracer-question-drag {
    border: 1px solid rgba(129, 140, 248, .28);
    background: rgba(129, 140, 248, .14);
    color: #c7d2fe;
}

.tracer-options-field,
.tracer-logic-field {
    border-color: rgba(129,140,248,.25);
    background: rgba(15, 23, 42, .72);
}

.tracer-type-chip,
.tracer-logic-chip {
    border: 1px solid rgba(129,140,248,.25);
    background: rgba(99,102,241,.15);
    color: #c7d2fe;
}

.tracer-required-chip {
    border: 1px solid rgba(248,113,113,.3);
    background: rgba(239,68,68,.14);
    color: #fca5a5;
}

.tracer-simulator-panel {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.tracer-simulator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.tracer-simulator-header div {
    display: grid;
    gap: .25rem;
}

.tracer-simulator-header span,
.tracer-phone-preview small {
    color: var(--tracer-indigo);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tracer-simulator-header strong {
    color: var(--tracer-text);
    line-height: 1.25;
}

.tracer-simulator-header b {
    border-radius: 999px;
    background: rgba(52,211,153,.14);
    color: var(--tracer-green);
    padding: .35rem .6rem;
}

.tracer-phone-preview {
    display: grid;
    gap: .8rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    background: #0b0f17;
    padding: .9rem;
}

.tracer-phone-top {
    display: flex;
    justify-content: space-between;
    color: var(--tracer-muted);
    font-size: .75rem;
    font-weight: 800;
}

.tracer-phone-progress {
    height: .45rem;
    overflow: hidden;
    border-radius: 999px;
    background: #1e293b;
}

.tracer-phone-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6, #818cf8);
}

.tracer-phone-preview h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1rem;
    line-height: 1.35;
}

.tracer-phone-options {
    display: grid;
    gap: .5rem;
}

.tracer-phone-options span {
    border-radius: 12px;
    background: #1e293b;
    color: #cbd5e1;
    padding: .65rem .75rem;
    font-size: .84rem;
    font-weight: 750;
}

.tracer-phone-options span:first-child {
    box-shadow: 0 0 0 2px rgba(129,140,248,.55);
    color: #f8fafc;
}

.tracer-simulator-note {
    border-radius: 14px;
    background: rgba(59,130,246,.12);
    color: #bfdbfe;
    padding: .85rem;
    font-size: .86rem;
    line-height: 1.5;
}

.tracer-analytics-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.tracer-aggregate-card li {
    background: #111827;
    color: #e2e8f0;
}

.tracer-response-shell {
    background:
        radial-gradient(circle at top left, rgba(99,102,241,.2), transparent 34%),
        radial-gradient(circle at top right, rgba(59,130,246,.16), transparent 32%),
        #0b0f17;
}

.tracer-response-hero,
.tracer-response-progress,
.tracer-response-question,
.tracer-response-actions,
.tracer-response-alert {
    border-color: rgba(255,255,255,.09);
    background: rgba(17,24,39,.92);
    backdrop-filter: blur(12px);
}

.tracer-response-hero {
    background:
        radial-gradient(circle at top right, rgba(129,140,248,.22), transparent 38%),
        linear-gradient(135deg, rgba(17,24,39,.98), rgba(15,23,42,.98));
}

.tracer-choice-card,
.tracer-scale-grid label {
    min-height: 64px;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.tracer-choice-card:hover,
.tracer-scale-grid label:hover {
    transform: translateY(-1px);
    border-color: rgba(129,140,248,.45);
}

@media (max-width: 1180px) {
    .tracer-studio-grid {
        grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    }

    .tracer-simulator-panel {
        position: static;
        grid-column: 1 / -1;
    }
}

@media (max-width: 920px) {
    .tracer-studio-grid {
        grid-template-columns: 1fr;
    }
}

/* Tracer builder polish: make it closer to the Stitch studio, not a dark-tinted default form. */
.tracer-saas-page [hidden],
.tracer-saas-page .tracer-question-card[hidden],
.tracer-saas-page .tracer-question-card-new[hidden] {
    display: none !important;
}

.tracer-saas-page .admin-page-intro,
body.admin-shell:has(.tracer-saas-page) .admin-page-intro {
    border: 1px solid rgba(255,255,255,.1);
    background: linear-gradient(135deg, rgba(129,140,248,.22), rgba(255,255,255,.08));
    color: #f8fafc;
}

.tracer-saas-page .tracer-period-panel {
    padding: 1.4rem;
}

.tracer-saas-page .tracer-period-panel .form-grid {
    gap: .85rem 1rem;
}

.tracer-saas-page .tracer-period-panel .admin-form label span,
.tracer-saas-page .tracer-period-panel label > span {
    color: #dbeafe;
    font-size: .82rem;
    letter-spacing: .01em;
}

.tracer-saas-page .admin-form input:not([type="checkbox"]):not([type="radio"]),
.tracer-saas-page .admin-form select,
.tracer-saas-page .admin-form textarea,
.tracer-saas-page .filter-bar input,
.tracer-saas-page .filter-bar select,
.tracer-saas-page .tracer-logic-row select,
.tracer-saas-page .tracer-option-row input {
    min-height: 44px !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    background: #1e293b !important;
    color: #f8fafc !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

.tracer-saas-page .admin-form textarea {
    min-height: 92px !important;
}

.tracer-saas-page .admin-form input::placeholder,
.tracer-saas-page .admin-form textarea::placeholder {
    color: #64748b !important;
}

.tracer-saas-page .admin-form input:focus,
.tracer-saas-page .admin-form select:focus,
.tracer-saas-page .admin-form textarea:focus {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.25), inset 0 1px 0 rgba(255,255,255,.05) !important;
}

.tracer-saas-page .tracer-period-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tracer-saas-page .tracer-period-summary article {
    padding: .85rem 1rem;
    background: rgba(30,41,59,.82);
}

.tracer-saas-page .tracer-period-summary strong {
    color: #f8fafc;
    font-size: 1rem;
}

.tracer-saas-page .tracer-question-builder {
    padding: 1.55rem;
    background:
        radial-gradient(circle at 78% 0%, rgba(99,102,241,.18), transparent 28%),
        linear-gradient(180deg, rgba(17,24,39,.98), rgba(15,23,42,.98));
}

.tracer-saas-page .tracer-question-builder > .panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    align-items: start;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.tracer-saas-page .tracer-question-builder > .panel-header .primary-button {
    height: 48px;
    justify-content: center;
    border-radius: 14px;
    font-weight: 900;
}

.tracer-saas-page .tracer-studio-grid {
    gap: 1.1rem;
}

.tracer-saas-page .tracer-outline-panel,
.tracer-saas-page .tracer-simulator-panel {
    background: rgba(17,24,39,.86);
}

.tracer-saas-page .tracer-builder-main {
    display: grid;
    gap: .85rem;
}

.tracer-saas-page .tracer-reorder-form {
    justify-content: flex-end;
    margin-bottom: .15rem;
}

.tracer-saas-page .empty-state[data-tracer-empty-state] {
    display: grid;
    min-height: 260px;
    place-items: center;
    border: 1px dashed rgba(129,140,248,.38);
    border-radius: 20px;
    background:
        radial-gradient(circle at center, rgba(99,102,241,.14), transparent 52%),
        rgba(15,23,42,.72);
    color: #cbd5e1;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

.tracer-saas-page .empty-state[data-tracer-empty-state]::before {
    content: 'Sisipkan elemen pertanyaan baru';
    display: block;
    margin-bottom: .45rem;
    color: #f8fafc;
    font-size: 1.35rem;
    font-weight: 900;
}

.tracer-saas-page .tracer-question-list {
    gap: 1rem;
}

.tracer-saas-page .tracer-question-card {
    position: relative;
    border-radius: 20px;
    background: rgba(30,41,59,.88);
    padding: 1.15rem;
}

.tracer-saas-page .tracer-question-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 999px 0 0 999px;
    background: linear-gradient(180deg, #3b82f6, #818cf8);
    opacity: .75;
}

.tracer-saas-page .tracer-question-form {
    gap: .9rem;
}

.tracer-saas-page .tracer-options-field,
.tracer-saas-page .tracer-logic-field {
    border-radius: 18px;
    padding: .9rem;
}

.tracer-saas-page .tracer-options-header {
    color: #f8fafc;
    font-weight: 900;
}

.tracer-saas-page .tracer-option-row,
.tracer-saas-page .tracer-logic-row {
    background: rgba(15,23,42,.72);
}

.tracer-saas-page .tracer-question-actions {
    justify-content: flex-end;
    margin-top: .4rem;
}

.tracer-saas-page .tracer-question-delete-form {
    display: flex;
    justify-content: flex-end;
    margin-top: .7rem;
}

.tracer-saas-page .tracer-simulator-panel {
    padding: 1.1rem;
}

.tracer-saas-page .tracer-phone-preview {
    min-height: 260px;
    align-content: start;
}

@media (max-width: 920px) {
    .tracer-saas-page .tracer-question-builder > .panel-header,
    .tracer-saas-page .tracer-period-summary {
        grid-template-columns: 1fr;
    }
}

/* Stitch-style tracer controls: compact switches, component palette, and icon-led cards. */
.tracer-saas-page .tracer-card-title {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: #f8fafc;
    font-size: .86rem;
    font-weight: 900;
}

.tracer-saas-page .tracer-mini-icon {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    background: rgba(59,130,246,.2);
    color: #93c5fd;
    box-shadow: inset 0 0 0 1px rgba(147,197,253,.22);
}

.tracer-saas-page .tracer-question-topline {
    align-items: center;
    gap: .55rem;
}

.tracer-saas-page .tracer-question-drag {
    justify-self: start;
    width: auto;
    min-width: 54px;
    height: 32px;
    padding: 0 .7rem;
    border-radius: 10px;
    border-color: rgba(129,140,248,.25);
    background: rgba(15,23,42,.85);
    color: #93c5fd;
}

.tracer-saas-page .tracer-question-drag::before {
    content: '⋮⋮';
    margin-right: .4rem;
    color: #64748b;
    letter-spacing: -.22em;
}

.tracer-saas-page .tracer-type-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.tracer-saas-page .tracer-type-chip::before {
    content: '◦';
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 6px;
    background: rgba(59,130,246,.22);
    color: #60a5fa;
    font-size: .85rem;
}

.tracer-saas-page .tracer-type-chip[data-question-type="multiple_choice"]::before,
.tracer-saas-page .tracer-type-chip[data-question-type="yes_no"]::before {
    content: '✓';
}

.tracer-saas-page .tracer-type-chip[data-question-type="long_text"]::before {
    content: '¶';
}

.tracer-saas-page .tracer-type-chip[data-question-type="short_text"]::before {
    content: 'T';
    font-size: .68rem;
    font-weight: 900;
}

.tracer-saas-page .tracer-type-chip[data-question-type="scale"]::before {
    content: '↕';
}

.tracer-saas-page .tracer-switch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 68px;
    padding: .8rem .9rem;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: rgba(15,23,42,.64);
    cursor: pointer;
}

.tracer-saas-page .tracer-switch-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tracer-saas-page .tracer-switch-copy {
    display: grid;
    gap: .18rem;
}

.tracer-saas-page .tracer-switch-copy b {
    color: #f8fafc;
    font-size: .92rem;
}

.tracer-saas-page .tracer-switch-copy small {
    color: #94a3b8;
    font-size: .76rem;
}

.tracer-saas-page .tracer-switch-ui {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #334155;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.11);
    transition: background .2s ease, box-shadow .2s ease;
}

.tracer-saas-page .tracer-switch-ui::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,.28);
    transition: transform .2s ease, background .2s ease;
}

.tracer-saas-page .tracer-switch-card input:checked + .tracer-switch-ui {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    box-shadow: 0 0 0 3px rgba(99,102,241,.16), inset 0 0 0 1px rgba(255,255,255,.15);
}

.tracer-saas-page .tracer-switch-card input:checked + .tracer-switch-ui::after {
    transform: translateX(20px);
    background: #fff;
}

.tracer-saas-page .tracer-switch-card:has(input:focus-visible) {
    outline: 2px solid rgba(129,140,248,.65);
    outline-offset: 2px;
}


@media (max-width: 760px) {
    .tracer-saas-page .tracer-switch-card {
        min-height: 58px;
    }

    .tracer-saas-page .tracer-question-topline {
        flex-wrap: wrap;
    }
}

/* Tracer builder type picker: replace redundant palette/select with in-card component buttons. */
.tracer-saas-page .tracer-type-picker {
    display: grid;
    gap: .65rem;
    padding: .8rem;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: rgba(15,23,42,.62);
}

.tracer-saas-page .tracer-field-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.tracer-saas-page .tracer-field-heading span {
    color: #f8fafc;
    font-size: .9rem;
    font-weight: 900;
}

.tracer-saas-page .tracer-field-heading small {
    color: #94a3b8;
    font-size: .74rem;
    font-weight: 700;
}

.tracer-saas-page .tracer-type-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: .55rem;
}

.tracer-saas-page .tracer-type-choice {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 42px;
    padding: .55rem .65rem;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    background: rgba(30,41,59,.72);
    color: #cbd5e1;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 900;
    text-align: left;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.tracer-saas-page .tracer-type-choice span {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 8px;
    background: rgba(59,130,246,.16);
    color: #93c5fd;
    font-size: .82rem;
    font-weight: 950;
}

.tracer-saas-page .tracer-type-choice:hover,
.tracer-saas-page .tracer-type-choice:focus-visible {
    border-color: rgba(96,165,250,.52);
    background: rgba(59,130,246,.18);
    color: #fff;
    transform: translateY(-1px);
}

.tracer-saas-page .tracer-type-choice.is-active {
    border-color: rgba(129,140,248,.72);
    background: linear-gradient(135deg, rgba(59,130,246,.28), rgba(99,102,241,.26));
    color: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.tracer-saas-page .tracer-type-choice.is-active span {
    background: #2563eb;
    color: #fff;
}

.tracer-saas-page .tracer-question-card-new .tracer-type-picker {
    grid-column: 1 / -1;
}

.tracer-saas-page .tracer-question-card-new .tracer-switch-card,
.tracer-saas-page .tracer-question-card .tracer-switch-card {
    align-self: stretch;
}

.tracer-saas-page .tracer-question-card-new .tracer-options-field,
.tracer-saas-page .tracer-question-card .tracer-options-field {
    background: rgba(15,23,42,.74);
}

@media (max-width: 760px) {
    .tracer-saas-page .tracer-type-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tracer-saas-page .tracer-type-choice {
        min-height: 40px;
        padding: .5rem;
        font-size: .78rem;
    }
}

/* Tracer builder single-question focus mode. */
.tracer-saas-page .tracer-outline-list a {
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease, color .18s ease;
}

.tracer-saas-page .tracer-outline-list a:hover,
.tracer-saas-page .tracer-outline-list a.is-active {
    border-color: rgba(96,165,250,.48);
    background: rgba(59,130,246,.16);
    transform: translateX(2px);
}

.tracer-saas-page .tracer-outline-list a.is-active {
    box-shadow: inset 3px 0 0 #3b82f6, 0 0 0 1px rgba(99,102,241,.2);
}

.tracer-saas-page .tracer-question-card.is-active {
    box-shadow: 0 0 0 1px rgba(96,165,250,.35), 0 24px 70px rgba(15,23,42,.42);
}

.tracer-saas-page .tracer-question-list {
    min-height: 520px;
    align-content: start;
}

@media (max-width: 920px) {
    .tracer-saas-page .tracer-question-list {
        min-height: 0;
    }
}

/* Tracer builder light theme parity. The tracer studio has a strong custom dark skin,
   so light mode needs explicit overrides after that skin is loaded. */
[data-theme="light"] body.admin-shell:has(.tracer-saas-page) {
    background: #f3f6fb;
}

[data-theme="light"] body.admin-shell:has(.tracer-saas-page) .admin-main,
[data-theme="light"] body.admin-shell:has(.tracer-saas-page) .admin-content {
    background: #f3f6fb;
}

[data-theme="light"] body.admin-shell:has(.tracer-saas-page) .admin-topbar {
    border-bottom: 1px solid #dbe4f0;
    background: rgba(255,255,255,.92);
    color: #0f172a;
    box-shadow: 0 12px 38px rgba(15,23,42,.08);
    backdrop-filter: blur(16px);
}

[data-theme="light"] body.admin-shell:has(.tracer-saas-page) .admin-title-block h1,
[data-theme="light"] body.admin-shell:has(.tracer-saas-page) .admin-page-intro p,
[data-theme="light"] body.admin-shell:has(.tracer-saas-page) .topbar-actions,
[data-theme="light"] body.admin-shell:has(.tracer-saas-page) .admin-user-summary strong {
    color: #0f172a;
}

[data-theme="light"] .tracer-saas-page {
    --tracer-bg: #f3f6fb;
    --tracer-panel: #ffffff;
    --tracer-card: #f8fafc;
    --tracer-card-2: #eef4ff;
    --tracer-line: #d8e2f0;
    --tracer-muted: #64748b;
    --tracer-text: #0f172a;
    --tracer-indigo: #4f46e5;
    --tracer-blue: #2563eb;
    --tracer-green: #059669;
    color: var(--tracer-text);
}

[data-theme="light"] .tracer-saas-page .panel,
[data-theme="light"] .tracer-saas-page .stat-card,
[data-theme="light"] .tracer-saas-page .content-table,
[data-theme="light"] .tracer-saas-page .tracer-outline-panel,
[data-theme="light"] .tracer-saas-page .tracer-simulator-panel,
[data-theme="light"] .tracer-saas-page .tracer-question-card,
[data-theme="light"] .tracer-saas-page .tracer-aggregate-card,
[data-theme="light"] .tracer-saas-page .tracer-period-summary article {
    border-color: var(--tracer-line);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    color: var(--tracer-text);
    box-shadow: 0 20px 55px rgba(15,23,42,.08);
}

[data-theme="light"] .tracer-saas-page .panel-header h2,
[data-theme="light"] .tracer-saas-page h2,
[data-theme="light"] .tracer-saas-page h3,
[data-theme="light"] .tracer-saas-page .stat-card strong,
[data-theme="light"] .tracer-saas-page .content-table td,
[data-theme="light"] .tracer-saas-page .content-table strong,
[data-theme="light"] .tracer-saas-page .tracer-card-title,
[data-theme="light"] .tracer-saas-page .tracer-field-heading span,
[data-theme="light"] .tracer-saas-page .tracer-switch-copy b,
[data-theme="light"] .tracer-saas-page .tracer-simulator-header strong {
    color: var(--tracer-text);
}

[data-theme="light"] .tracer-saas-page .panel p,
[data-theme="light"] .tracer-saas-page small,
[data-theme="light"] .tracer-saas-page .content-table small,
[data-theme="light"] .tracer-saas-page .stat-card span,
[data-theme="light"] .tracer-saas-page .tracer-field-heading small,
[data-theme="light"] .tracer-saas-page .tracer-switch-copy small,
[data-theme="light"] .tracer-saas-page .tracer-phone-options span {
    color: var(--tracer-muted);
}

[data-theme="light"] .tracer-saas-page .eyebrow,
[data-theme="light"] .tracer-saas-page .panel-header .eyebrow,
[data-theme="light"] .tracer-saas-page .tracer-simulator-header span,
[data-theme="light"] .tracer-saas-page .tracer-phone-preview small {
    color: var(--tracer-indigo);
}

[data-theme="light"] .tracer-saas-page .admin-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
[data-theme="light"] .tracer-saas-page .admin-form select,
[data-theme="light"] .tracer-saas-page .admin-form textarea,
[data-theme="light"] .tracer-saas-page .filter-bar input,
[data-theme="light"] .tracer-saas-page .filter-bar select,
[data-theme="light"] .tracer-saas-page .tracer-logic-row select,
[data-theme="light"] .tracer-saas-page .tracer-option-row input {
    border-color: #d8e2f0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 10px 24px rgba(15,23,42,.04);
}

[data-theme="light"] .tracer-saas-page .admin-form input::placeholder,
[data-theme="light"] .tracer-saas-page .admin-form textarea::placeholder,
[data-theme="light"] .tracer-saas-page .filter-bar input::placeholder,
[data-theme="light"] .tracer-saas-page .tracer-option-row input::placeholder {
    color: #94a3b8;
}

[data-theme="light"] .tracer-saas-page .admin-form label span,
[data-theme="light"] .tracer-saas-page .filter-bar label {
    color: #1e3a8a;
}

[data-theme="light"] .tracer-saas-page .ghost-button,
[data-theme="light"] .tracer-saas-page .inline-button,
[data-theme="light"] .tracer-saas-page .tracer-reorder-form,
[data-theme="light"] .tracer-saas-page .tracer-options-field,
[data-theme="light"] .tracer-saas-page .tracer-logic-field,
[data-theme="light"] .tracer-saas-page .tracer-type-picker,
[data-theme="light"] .tracer-saas-page .tracer-switch-card,
[data-theme="light"] .tracer-saas-page .tracer-option-row,
[data-theme="light"] .tracer-saas-page .tracer-logic-row,
[data-theme="light"] .tracer-saas-page .tracer-outline-list a {
    border-color: var(--tracer-line);
    background: #f8fafc;
    color: #0f172a;
}

[data-theme="light"] .tracer-saas-page .tracer-question-card:hover,
[data-theme="light"] .tracer-saas-page .tracer-question-card.is-active {
    border-color: rgba(37,99,235,.38);
    box-shadow: 0 22px 60px rgba(37,99,235,.14);
}

[data-theme="light"] .tracer-saas-page .tracer-outline-list a:hover,
[data-theme="light"] .tracer-saas-page .tracer-outline-list a.is-active {
    border-color: rgba(37,99,235,.35);
    background: #eef4ff;
    color: #0f172a;
}

[data-theme="light"] .tracer-saas-page .tracer-question-drag,
[data-theme="light"] .tracer-saas-page .tracer-mini-icon,
[data-theme="light"] .tracer-saas-page .tracer-type-chip,
[data-theme="light"] .tracer-saas-page .tracer-logic-chip {
    border-color: rgba(37,99,235,.18);
    background: #dbeafe;
    color: #1d4ed8;
}

[data-theme="light"] .tracer-saas-page .tracer-required-chip {
    border-color: rgba(220,38,38,.2);
    background: #fee2e2;
    color: #b91c1c;
}

[data-theme="light"] .tracer-saas-page .tracer-type-choice {
    border-color: #d8e2f0;
    background: #ffffff;
    color: #334155;
    box-shadow: 0 8px 18px rgba(15,23,42,.04);
}

[data-theme="light"] .tracer-saas-page .tracer-type-choice span,
[data-theme="light"] .tracer-saas-page .tracer-type-chip::before {
    background: #dbeafe;
    color: #2563eb;
}

[data-theme="light"] .tracer-saas-page .tracer-type-choice:hover,
[data-theme="light"] .tracer-saas-page .tracer-type-choice:focus-visible,
[data-theme="light"] .tracer-saas-page .tracer-type-choice.is-active {
    border-color: rgba(37,99,235,.5);
    background: linear-gradient(135deg, #eaf2ff, #eef2ff);
    color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

[data-theme="light"] .tracer-saas-page .tracer-type-choice.is-active span {
    background: #2563eb;
    color: #ffffff;
}

[data-theme="light"] .tracer-saas-page .tracer-switch-ui {
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(15,23,42,.12);
}

[data-theme="light"] .tracer-saas-page .tracer-switch-ui::after {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15,23,42,.18);
}

[data-theme="light"] .tracer-saas-page .tracer-phone-preview {
    border-color: #d8e2f0;
    background: #ffffff;
    color: #0f172a;
}

[data-theme="light"] .tracer-saas-page .tracer-phone-options span {
    border-color: #d8e2f0;
    background: #f8fafc;
}

[data-theme="light"] .tracer-saas-page .tracer-simulator-panel .tracer-note,
[data-theme="light"] .tracer-saas-page .empty-state[data-tracer-empty-state] {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

[data-theme="light"] .tracer-dashboard-hero {
    background: linear-gradient(135deg, #eef4ff, #ffffff) !important;
}

[data-theme="light"] .tracer-dashboard-hero::after {
    background: rgba(37,99,235,.08);
}

/* Stitch-style tracer monitoring dashboard. */
.tracer-monitoring-page {
    gap: 1rem;
}

.tracer-monitoring-head {
    display: grid;
    gap: .85rem;
}

.tracer-monitoring-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    color: var(--tracer-muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tracer-monitoring-crumbs strong {
    color: var(--tracer-indigo);
}

.tracer-monitoring-titlebar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.tracer-monitoring-titlebar h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.18;
}

.tracer-monitoring-titlebar p {
    max-width: 720px;
    margin: .45rem 0 .65rem;
    color: var(--tracer-muted);
}

.tracer-live-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    width: fit-content;
    border: 1px solid rgba(52,211,153,.22);
    border-radius: 999px;
    background: rgba(16,185,129,.12);
    color: var(--tracer-green);
    padding: .36rem .7rem;
    font-size: .76rem;
    font-weight: 900;
}

.tracer-live-pill i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(16,185,129,.12);
}

.tracer-monitoring-actions,
.tracer-table-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
}

.tracer-monitoring-actions form {
    margin: 0;
}

.tracer-monitoring-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .75rem;
}

.tracer-monitoring-kpi {
    display: grid;
    align-content: space-between;
    min-height: 148px;
    gap: .65rem;
    border: 1px solid var(--tracer-line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(17,24,39,.98), rgba(15,23,42,.98));
    padding: 1rem;
    box-shadow: 0 20px 55px rgba(0,0,0,.24);
}

.tracer-monitoring-kpi div:first-child {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .7rem;
}

.tracer-monitoring-kpi span {
    color: var(--tracer-muted);
    font-size: .7rem;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tracer-monitoring-kpi strong {
    display: flex;
    align-items: baseline;
    gap: .45rem;
    color: var(--tracer-text);
    font-size: clamp(1.55rem, 2.4vw, 2.25rem);
    line-height: 1;
}

.tracer-monitoring-kpi em {
    color: var(--tracer-muted);
    font-size: .75rem;
    font-style: normal;
    font-weight: 900;
}

.tracer-monitoring-kpi small {
    color: var(--tracer-muted);
    font-size: .78rem;
}

.tracer-monitoring-kpi.is-success span,
.tracer-monitoring-kpi.is-success strong,
.tracer-monitoring-kpi.is-success em {
    color: var(--tracer-green);
}

.tracer-monitoring-kpi.is-alert em {
    color: #fca5a5;
}

.tracer-kpi-icon {
    display: inline-grid;
    min-width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    background: rgba(59,130,246,.14);
    color: #93c5fd;
    font-size: .68rem;
    font-weight: 950;
}

.tracer-meter {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148,163,184,.18);
}

.tracer-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--tracer-green);
}

.tracer-meter.is-indigo i {
    background: var(--tracer-indigo);
}

.tracer-meter.is-red i {
    background: #f87171;
}

.tracer-monitoring-filter form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
}

.tracer-monitoring-filter label {
    display: grid;
    gap: .38rem;
}

.tracer-monitoring-filter label span {
    color: var(--tracer-muted);
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tracer-monitoring-filter .tracer-monitoring-search {
    grid-column: span 3;
}

.tracer-monitoring-filter-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: .5rem;
}

.tracer-monitoring-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 1rem;
}

.tracer-progress-list,
.tracer-log-list {
    display: grid;
    gap: .75rem;
}

.tracer-progress-list article {
    display: grid;
    gap: .48rem;
    border-radius: 12px;
    background: rgba(15,23,42,.42);
    padding: .75rem;
}

.tracer-progress-list article > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
}

.tracer-progress-list strong {
    color: var(--tracer-text);
}

.tracer-progress-list span {
    color: var(--tracer-muted);
    font-size: .8rem;
}

.tracer-progress-list b {
    color: var(--tracer-green);
}

.tracer-log-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .15rem .75rem;
    border-radius: 12px;
    background: rgba(15,23,42,.5);
    padding: .75rem;
}

.tracer-log-list b {
    color: var(--tracer-text);
}

.tracer-log-list span {
    color: var(--tracer-muted);
    font-size: .78rem;
}

.tracer-log-list em {
    grid-row: span 2;
    align-self: center;
    color: var(--tracer-green);
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.tracer-monitoring-table {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--tracer-line);
    border-radius: 14px;
}

.tracer-monitoring-table table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.tracer-monitoring-table th,
.tracer-monitoring-table td {
    border-bottom: 1px solid var(--tracer-line);
    padding: .9rem .8rem;
    text-align: left;
    vertical-align: middle;
}

.tracer-monitoring-table th {
    background: rgba(15,23,42,.7);
    color: var(--tracer-muted);
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tracer-monitoring-table td {
    color: var(--tracer-text);
    font-size: .85rem;
}

.tracer-monitoring-table tbody tr:hover {
    background: rgba(99,102,241,.08);
}

.tracer-monitoring-table tr:last-child td {
    border-bottom: 0;
}

.tracer-monitoring-table td > strong,
.tracer-monitoring-table td > span,
.tracer-monitoring-table td > small {
    display: block;
}

.tracer-alumni-cell {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 220px;
}

.tracer-alumni-cell > span {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #3b82f6, #818cf8);
    color: #fff;
    font-size: .72rem;
    font-weight: 950;
}

.tracer-alumni-cell strong {
    color: var(--tracer-text);
}

.tracer-alumni-cell small,
.tracer-monitoring-table td > small {
    color: var(--tracer-muted);
    font-size: .75rem;
}

[data-theme="light"] .tracer-monitoring-kpi {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 18px 48px rgba(15,23,42,.08);
}

[data-theme="light"] .tracer-progress-list article,
[data-theme="light"] .tracer-log-list article,
[data-theme="light"] .tracer-monitoring-table th {
    background: #f1f5f9;
}

[data-theme="light"] .tracer-monitoring-table tbody tr:hover {
    background: #eef4ff;
}

[data-theme="light"] .tracer-kpi-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 1180px) {
    .tracer-monitoring-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tracer-monitoring-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .tracer-monitoring-titlebar {
        display: grid;
    }

    .tracer-monitoring-actions,
    .tracer-monitoring-actions .ghost-button,
    .tracer-monitoring-actions .primary-button,
    .tracer-monitoring-actions form {
        width: 100%;
    }

    .tracer-monitoring-filter form {
        grid-template-columns: 1fr;
    }

    .tracer-monitoring-filter .tracer-monitoring-search {
        grid-column: auto;
    }

    .tracer-monitoring-filter-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .tracer-monitoring-filter-actions .ghost-button,
    .tracer-monitoring-filter-actions .primary-button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .tracer-monitoring-kpis {
        grid-template-columns: 1fr;
    }

    .tracer-monitoring-kpi {
        min-height: 120px;
    }
}

/* Tracer branching map controls. */
.tracer-saas-page .tracer-branch-card {
    display: grid;
    gap: .9rem;
    padding: .9rem;
    border-radius: 16px;
    background: rgba(15,23,42,.74);
}

.tracer-saas-page .tracer-branch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.tracer-saas-page .tracer-branch-head strong {
    color: var(--tracer-text);
    font-size: .9rem;
}

.tracer-saas-page .tracer-branch-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    align-items: stretch;
    gap: .75rem;
}

.tracer-saas-page .tracer-branch-node {
    display: grid;
    align-content: start;
    gap: .65rem;
    min-height: 124px;
    border: 1px solid rgba(129,140,248,.22);
    border-radius: 14px;
    background: rgba(30,41,59,.64);
    padding: .8rem;
}

.tracer-saas-page .tracer-branch-node > span {
    color: var(--tracer-muted);
    font-size: .7rem;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tracer-saas-page .tracer-branch-choice-list {
    display: grid;
    gap: .5rem;
}

.tracer-saas-page .tracer-branch-choice {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 40px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    background: rgba(15,23,42,.64);
    color: #cbd5e1;
    padding: .5rem .65rem;
    font: inherit;
    font-size: .82rem;
    font-weight: 850;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.tracer-saas-page .tracer-branch-choice::before {
    content: '';
    display: inline-grid;
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 2px solid rgba(148,163,184,.8);
    box-shadow: 0 0 0 3px rgba(148,163,184,.08);
}

.tracer-saas-page .tracer-branch-choice:hover,
.tracer-saas-page .tracer-branch-choice:focus-visible {
    border-color: rgba(96,165,250,.5);
    background: rgba(59,130,246,.16);
    color: #fff;
    transform: translateY(-1px);
}

.tracer-saas-page .tracer-branch-choice.is-active {
    border-color: rgba(16,185,129,.48);
    background: rgba(16,185,129,.14);
    color: #d1fae5;
    box-shadow: 0 0 0 3px rgba(16,185,129,.1);
}

.tracer-saas-page .tracer-branch-choice.is-active::before {
    border-color: var(--tracer-green);
    background: var(--tracer-green);
    box-shadow: 0 0 0 4px rgba(16,185,129,.16);
}

.tracer-saas-page .tracer-branch-arrow {
    display: grid;
    place-items: center;
    align-self: center;
    min-height: 44px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(59,130,246,.3), rgba(99,102,241,.26));
    color: #bfdbfe;
    font-weight: 950;
}

[data-theme="light"] .tracer-saas-page .tracer-branch-card,
[data-theme="light"] .tracer-saas-page .tracer-branch-node {
    border-color: #d8e2f0;
    background: #ffffff;
}

[data-theme="light"] .tracer-saas-page .tracer-branch-choice {
    border-color: #d8e2f0;
    background: #f8fafc;
    color: #334155;
}

[data-theme="light"] .tracer-saas-page .tracer-branch-choice:hover,
[data-theme="light"] .tracer-saas-page .tracer-branch-choice:focus-visible {
    border-color: rgba(37,99,235,.4);
    background: #eef4ff;
    color: #1e3a8a;
}

[data-theme="light"] .tracer-saas-page .tracer-branch-choice.is-active {
    border-color: rgba(5,150,105,.36);
    background: #ecfdf5;
    color: #065f46;
}

[data-theme="light"] .tracer-saas-page .tracer-branch-arrow {
    background: linear-gradient(135deg, #dbeafe, #eef2ff);
    color: #1d4ed8;
}

@media (max-width: 760px) {
    .tracer-saas-page .tracer-branch-flow {
        grid-template-columns: 1fr;
    }

    .tracer-saas-page .tracer-branch-arrow {
        width: 44px;
        justify-self: center;
        transform: rotate(90deg);
    }
}

/* Fix branching map layout so it stays tidy inside the active question card. */
.tracer-saas-page .tracer-question-form .full-span,
.tracer-saas-page .tracer-question-form > .form-grid > .full-span {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}

.tracer-saas-page .tracer-logic-field {
    display: grid;
    gap: .85rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.tracer-saas-page .tracer-logic-field .tracer-options-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.tracer-saas-page .tracer-logic-field .tracer-options-header span {
    max-width: none;
    color: var(--tracer-text);
    line-height: 1.15;
}

.tracer-saas-page .tracer-logic-field p {
    max-width: 760px;
    margin: 0;
}

.tracer-saas-page .tracer-branch-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.tracer-saas-page .tracer-branch-flow {
    width: 100%;
    min-width: 0;
}

.tracer-saas-page .tracer-branch-node,
.tracer-saas-page .tracer-branch-choice-list,
.tracer-saas-page .tracer-branch-choice {
    min-width: 0;
}

.tracer-saas-page .tracer-branch-choice {
    overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
    .tracer-saas-page .tracer-branch-flow {
        grid-template-columns: 1fr;
    }

    .tracer-saas-page .tracer-branch-arrow {
        width: 44px;
        justify-self: center;
        transform: rotate(90deg);
    }
}

@media (max-width: 640px) {
    .tracer-saas-page .tracer-logic-field .tracer-options-header {
        align-items: stretch;
        flex-direction: column;
    }

    .tracer-saas-page .tracer-logic-field .tracer-options-header .inline-button {
        width: 100%;
    }
}
/* Tracer alumni management, adapted from the Stitch workspace while keeping CMS data fields intact. */
.tracer-alumni-page {
    display: grid;
    gap: 1rem;
}

.tracer-alumni-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel));
}

.tracer-alumni-hero h2,
.tracer-alumni-hero h3 {
    margin: .2rem 0 .55rem;
    color: var(--text);
}

.tracer-alumni-hero p {
    max-width: 62rem;
    color: var(--muted);
}

.tracer-alumni-actions,
.tracer-alumni-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    justify-content: flex-end;
}

.tracer-alumni-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
}

.tracer-alumni-kpi {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.tracer-alumni-kpi small,
.tracer-alumni-kpi em {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-style: normal;
    font-weight: 800;
}

.tracer-alumni-kpi small {
    margin-top: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.tracer-alumni-kpi strong {
    display: block;
    margin-top: .35rem;
    color: var(--text);
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    line-height: 1;
}

.tracer-alumni-kpi em {
    margin-top: .55rem;
}

.tracer-alumni-kpi i {
    display: block;
    height: .35rem;
    max-width: 100%;
    margin-top: .75rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #2563eb);
}

.tracer-alumni-icon {
    display: inline-grid;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    border-radius: .75rem;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    font-weight: 900;
}

.tracer-alumni-icon.is-green { background: rgba(16, 185, 129, .14); color: #10b981; }
.tracer-alumni-icon.is-blue { background: rgba(37, 99, 235, .14); color: #3b82f6; }
.tracer-alumni-icon.is-purple { background: rgba(99, 102, 241, .14); color: #818cf8; }

.tracer-alumni-import {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 1rem;
    align-items: end;
}

.tracer-alumni-import code {
    color: var(--accent);
    font-weight: 800;
}

.tracer-alumni-import-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: end;
}

.tracer-alumni-toolbar {
    display: grid;
    gap: 1rem;
}

.tracer-alumni-search {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(130px, .65fr) minmax(150px, .7fr) auto auto;
    gap: .75rem;
    align-items: end;
}

.tracer-alumni-search label,
.tracer-alumni-field-grid label {
    display: grid;
    gap: .4rem;
}

.tracer-alumni-search label span,
.tracer-alumni-field-grid label span,
.tracer-alumni-status-grid > label > span {
    color: var(--text);
    font-size: .85rem;
    font-weight: 850;
}

.tracer-alumni-search input,
.tracer-alumni-search select,
.tracer-alumni-field-grid input,
.tracer-alumni-field-grid select {
    width: 100%;
    min-height: 3rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    color: var(--text);
    padding: .75rem .9rem;
    font: inherit;
    font-weight: 750;
}

.tracer-alumni-search input:focus,
.tracer-alumni-search select:focus,
.tracer-alumni-field-grid input:focus,
.tracer-alumni-field-grid select:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.tracer-alumni-table-wrap {
    margin-top: 1rem;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
}

.tracer-alumni-table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
}

.tracer-alumni-table th,
.tracer-alumni-table td {
    padding: .95rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.tracer-alumni-table th {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.tracer-alumni-table td strong,
.tracer-alumni-person strong {
    display: block;
    color: var(--text);
    font-size: .95rem;
}

.tracer-alumni-table td small,
.tracer-alumni-person small {
    display: block;
    margin-top: .2rem;
    color: var(--muted);
    font-size: .8rem;
}

.tracer-alumni-person {
    display: flex;
    gap: .75rem;
    align-items: center;
}

.tracer-alumni-person > span {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: #fff;
    font-size: .82rem;
    font-weight: 900;
}

.tracer-alumni-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    color: var(--muted);
    font-weight: 750;
}

.tracer-alumni-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 1rem;
    align-items: start;
}

.tracer-alumni-form-main,
.tracer-alumni-helper {
    display: grid;
    gap: 1rem;
}

.tracer-alumni-helper {
    position: sticky;
    top: 96px;
}

.tracer-alumni-section-head {
    display: flex;
    gap: .8rem;
    align-items: center;
    margin: -1rem -1rem 1rem;
    border-bottom: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    background: color-mix(in srgb, var(--accent) 7%, var(--surface-muted));
    padding: 1rem;
}

.tracer-alumni-section-head > span {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: .8rem;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    font-weight: 900;
}

.tracer-alumni-section-head.is-green > span { background: rgba(16, 185, 129, .14); color: #10b981; }
.tracer-alumni-section-head.is-blue > span { background: rgba(37, 99, 235, .14); color: #3b82f6; }

.tracer-alumni-section-head h3 {
    margin: 0;
    color: var(--text);
}

.tracer-alumni-section-head p {
    margin: .2rem 0 0;
    color: var(--muted);
}

.tracer-alumni-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.tracer-alumni-field-grid .is-wide {
    grid-column: 1 / -1;
}

.tracer-alumni-field-grid small {
    color: var(--muted);
    font-size: .78rem;
}

.tracer-alumni-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.tracer-alumni-radio-card {
    position: relative;
    display: grid;
    gap: .35rem;
    min-height: 6.25rem;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-muted);
    padding: 1rem 1rem 1rem 3.1rem;
}

.tracer-alumni-radio-card input {
    position: absolute;
    top: 1.1rem;
    left: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #2563eb;
}

.tracer-alumni-radio-card:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    background: color-mix(in srgb, var(--accent) 10%, var(--surface-muted));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.tracer-alumni-radio-card small,
.tracer-alumni-checklist p,
.tracer-alumni-checklist li {
    color: var(--muted);
    line-height: 1.55;
}

.tracer-alumni-form-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    padding: 1rem;
}

.tracer-alumni-checklist ul {
    display: grid;
    gap: .65rem;
    margin: .9rem 0 0;
    padding: 0;
    list-style: none;
}

.tracer-alumni-checklist li {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    font-weight: 700;
}

.tracer-alumni-checklist li span {
    color: #10b981;
    font-weight: 900;
}

[data-theme="light"] .tracer-alumni-page .tracer-alumni-table-wrap,
[data-theme="light"] .tracer-alumni-page .tracer-alumni-kpi,
[data-theme="light"] .tracer-alumni-page .tracer-alumni-form-actions {
    background: #ffffff;
}

[data-theme="light"] .tracer-alumni-page .tracer-alumni-search input,
[data-theme="light"] .tracer-alumni-page .tracer-alumni-search select,
[data-theme="light"] .tracer-alumni-page .tracer-alumni-field-grid input,
[data-theme="light"] .tracer-alumni-page .tracer-alumni-field-grid select,
[data-theme="light"] .tracer-alumni-page .tracer-alumni-radio-card {
    background: #f8fafc;
}

@media (max-width: 1180px) {
    .tracer-alumni-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tracer-alumni-import,
    .tracer-alumni-form-layout {
        grid-template-columns: 1fr;
    }

    .tracer-alumni-helper {
        position: static;
    }

    .tracer-alumni-search {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .tracer-alumni-hero,
    .tracer-alumni-import-form,
    .tracer-alumni-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tracer-alumni-actions,
    .tracer-alumni-row-actions,
    .tracer-alumni-form-actions {
        justify-content: stretch;
    }

    .tracer-alumni-actions > *,
    .tracer-alumni-row-actions > *,
    .tracer-alumni-form-actions > * {
        justify-content: center;
        width: 100%;
    }

    .tracer-alumni-kpis,
    .tracer-alumni-search,
    .tracer-alumni-field-grid,
    .tracer-alumni-status-grid {
        grid-template-columns: 1fr;
    }

    .tracer-alumni-section-head {
        align-items: flex-start;
    }
}

.rich-editor-dialog-open {
    overflow: hidden;
}

.rich-editor-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, .68);
    backdrop-filter: blur(12px);
}

.rich-editor-dialog-backdrop[hidden] {
    display: none;
}

.rich-editor-dialog {
    width: min(520px, 100%);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 18px;
    background: var(--surface, #fff);
    box-shadow: 0 28px 80px rgba(2, 6, 23, .34);
    color: var(--text, #0f172a);
    overflow: hidden;
}

.rich-editor-dialog-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--border, #dbe4f0);
}

.rich-editor-dialog-kicker {
    margin: 0 0 6px;
    color: var(--primary, #2563eb);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.rich-editor-dialog h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
}

.rich-editor-dialog [data-rich-dialog-copy] {
    margin: 8px 0 0;
    color: var(--muted, #64748b);
    line-height: 1.55;
}

.rich-editor-dialog-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border, #dbe4f0);
    border-radius: 10px;
    background: var(--surface-muted, #f8fafc);
    color: var(--text, #0f172a);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.rich-editor-dialog-form {
    display: grid;
    gap: 16px;
    padding: 20px 24px 24px;
}

.rich-editor-dialog-field {
    display: grid;
    gap: 8px;
    color: var(--text, #0f172a);
    font-weight: 900;
}

.rich-editor-dialog-field input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border, #dbe4f0);
    border-radius: 12px;
    background: var(--surface-muted, #f8fafc);
    color: var(--text, #0f172a);
    padding: 0 14px;
    font: inherit;
    font-weight: 800;
    outline: none;
}

.rich-editor-dialog-field input:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}

.rich-editor-dialog-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border, #dbe4f0);
    border-radius: 14px;
    background: var(--surface-muted, #f8fafc);
    padding: 14px;
    cursor: pointer;
}

.rich-editor-dialog-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rich-editor-dialog-switch-ui {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background .18s ease;
}

.rich-editor-dialog-switch-ui::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .22);
    transition: transform .18s ease;
}

.rich-editor-dialog-switch input:checked + .rich-editor-dialog-switch-ui {
    background: var(--primary, #2563eb);
}

.rich-editor-dialog-switch input:checked + .rich-editor-dialog-switch-ui::after {
    transform: translateX(22px);
}

.rich-editor-dialog-switch strong,
.rich-editor-dialog-switch small {
    display: block;
}

.rich-editor-dialog-switch small {
    margin-top: 3px;
    color: var(--muted, #64748b);
    font-size: 12px;
    font-weight: 800;
}

.rich-editor-dialog-error {
    margin: 0;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 12px;
    font-weight: 900;
}

.rich-editor-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.rich-editor-dialog-secondary,
.rich-editor-dialog-primary {
    min-height: 46px;
    border-radius: 12px;
    padding: 0 18px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.rich-editor-dialog-secondary {
    border: 1px solid var(--border, #dbe4f0);
    background: var(--surface-muted, #f8fafc);
    color: var(--text, #0f172a);
}

.rich-editor-dialog-primary {
    border: 0;
    background: linear-gradient(135deg, #2563eb, #5b5ff4);
    color: #fff;
}

.rich-editor-canvas .content-button,
.prose .content-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff !important;
    padding: .7rem 1.05rem;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 16px 34px rgba(37, 99, 235, .24);
    overflow-wrap: anywhere;
}

.rich-editor-canvas .content-embed,
.prose .content-embed,
.prose .youtube-embed {
    width: min(100%, 860px);
    aspect-ratio: 16 / 9;
    margin: 1.6rem auto;
    border-radius: 16px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .14);
}

.rich-editor-canvas .content-embed iframe,
.prose .content-embed iframe,
.prose .youtube-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 640px) {
    .rich-editor-dialog-backdrop {
        align-items: end;
        padding: 12px;
    }

    .rich-editor-dialog {
        border-radius: 16px;
    }

    .rich-editor-dialog-header,
    .rich-editor-dialog-form {
        padding-left: 16px;
        padding-right: 16px;
    }

    .rich-editor-dialog-actions {
        flex-direction: column-reverse;
    }

    .rich-editor-dialog-secondary,
    .rich-editor-dialog-primary {
        width: 100%;
    }
}

.cms-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    color: #475569;
    font-size: .92rem;
    font-weight: 700;
}

.cms-pagination__summary {
    color: inherit;
}

.cms-pagination__links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
}

.cms-pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    border: 1px solid #cbd5e1;
    border-radius: .75rem;
    background: #fff;
    color: #0f172a;
    padding: .45rem .75rem;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.cms-pagination__item:hover {
    border-color: #2563eb;
    color: #1d4ed8;
}

.cms-pagination__item.is-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.cms-pagination__item.is-disabled {
    cursor: default;
    opacity: .48;
    box-shadow: none;
}

.admin-shell .cms-pagination {
    color: var(--muted, #64748b);
}

.admin-shell .cms-pagination__item {
    border-color: var(--border, #dbe4f0);
    background: var(--surface, #fff);
    color: var(--text, #0f172a);
}

.admin-shell .cms-pagination__item.is-active {
    border-color: var(--primary, #2563eb);
    background: var(--primary, #2563eb);
    color: #fff;
}

@media (max-width: 640px) {
    .cms-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .cms-pagination__links {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: .15rem;
    }
}

.image-cropper-original {
    width: 100%;
    margin-top: 0.75rem;
    justify-content: center;
}

.image-cropper-original + .image-cropper-apply {
    margin-top: 0.5rem;
}

.image-cropper-output-preview {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.image-cropper-output-preview[hidden] {
    display: none;
}

.image-cropper-output-preview img {
    width: 96px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    background: var(--surface-muted);
}

.image-cropper-output-preview strong,
.image-cropper-output-preview span {
    display: block;
    min-width: 0;
}

.image-cropper-output-preview strong {
    color: var(--text);
    font-weight: 900;
}

.image-cropper-output-preview span {
    color: var(--muted);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tracer-saas-page .tracer-branch-manual-input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.68);
    color: #e5edff;
    padding: 0.85rem 1rem;
    font-weight: 700;
}

.tracer-saas-page .tracer-branch-manual-input::placeholder {
    color: rgba(191, 207, 235, 0.68);
}

.tracer-inline-form {
    margin: 0;
}

.tracer-muted-action {
    color: #94a3b8;
    font-weight: 800;
}

[data-theme="light"] .tracer-saas-page .tracer-branch-manual-input {
    background: #ffffff;
    border-color: #d7e3f4;
    color: #0f172a;
}

[data-theme="light"] .tracer-saas-page .tracer-branch-manual-input::placeholder {
    color: #7b8da8;
}
