:root {
    --navy: #0b0e14;
    --navy-soft: #151a24;
    --lime: #d4ff00;
    --lime-ink: #3d4a10;
    --accent: #1aad72;
    --forest: #0b0e14;
    --forest-deep: #06080c;
    --green: #1aad72;
    --green-bright: #19b87a;
    --green-dark: #128a5c;
    --mint: #f3f5f8;
    --mint-soft: #eef7f2;
    --surface: #f7f8fb;
    --ink: #5c6570;
    --line: #e4e7ec;
    --white: #ffffff;
    --sand: #f3e7d4;
    --sand-ink: #8a6a3a;
    --danger: #b42318;
    --danger-bg: #fdecec;
    --heading: "Poppins", sans-serif;
    --body: "Poppins", sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --sidebar: 256px;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 1px 2px rgba(11, 14, 20, 0.04);
    --shadow-lg: 0 12px 32px rgba(11, 14, 20, 0.08);
    --space: 1rem;
    --fw: 500;
    --fw-strong: 600;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.console {
    margin: 0;
    color: var(--navy);
    background:
        radial-gradient(900px 420px at 88% -8%, rgba(26, 173, 114, 0.07), transparent 55%),
        radial-gradient(700px 360px at 0% 0%, rgba(212, 255, 0, 0.05), transparent 50%),
        var(--mint);
    font-family: var(--body);
    font-size: 0.915rem;
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    min-height: 1.2rem;
    padding: 0 0.3rem;
    border-radius: 6px;
    border: 1px solid rgba(11, 14, 20, 0.12);
    background: rgba(255, 255, 255, 0.75);
    color: var(--ink);
    font: 500 0.68rem/1 var(--body);
    letter-spacing: 0.02em;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 {
    font-family: var(--heading);
    line-height: 1.2;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
    font-weight: 600;
}
p { margin: 0; }
button, .btn, input, select, textarea { font: inherit; }

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: var(--navy);
    color: var(--white);
    padding: 0.5rem 0.8rem;
    z-index: 40;
    border-radius: 8px;
}
.skip:focus { top: 1rem; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: var(--fw-strong);
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    background: var(--navy);
    color: var(--white);
    transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--navy); color: var(--white); box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset; }
.btn-primary:hover { background: var(--navy-soft); }
.btn-accent {
    background: var(--green);
    color: var(--white);
}
.btn-accent:hover { background: var(--green-dark); }
.btn-secondary {
    background: var(--white);
    color: var(--navy);
    border-color: var(--line);
    box-shadow: var(--shadow);
}
.btn-secondary:hover { background: #f8fafb; border-color: #d5dae3; }
.btn.is-loading,
.btn-auth.is-loading,
button[type="submit"].is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    opacity: 0.92;
}
.btn.is-loading::after,
.btn-auth.is-loading::after,
button[type="submit"].is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}
.btn-secondary.is-loading::after,
.profile-menu-item.is-loading::after {
    border-color: rgba(16, 22, 35, 0.18);
    border-top-color: var(--navy);
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.lede { color: var(--ink); max-width: 56ch; }
.muted { color: var(--ink); font-size: 0.92rem; }

.dash-stack { display: grid; gap: 1.35rem; }
.dash-block { display: grid; gap: 0.7rem; }
.dash-block-head { display: grid; gap: 0.2rem; }
.dash-block-head-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
}
.section-title {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: var(--fw-strong);
    color: var(--ink);
}
.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}
.shortcut-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #e6e8eb;
    background: #fff;
    color: #0b0e14;
    text-decoration: none;
    box-shadow: none;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.shortcut-card:hover,
.shortcut-card.is-priority:hover {
    background: #f6f8fa;
    border-color: #d5d8de;
    transform: none;
    box-shadow: none;
}
.shortcut-card.is-priority {
    background: #fff;
    border-color: #e6e8eb;
    color: #0b0e14;
}
.shortcut-card.is-priority .shortcut-arrow { color: #697386; }
.shortcut-label { font-weight: 500; font-size: 0.875rem; letter-spacing: 0; }
.shortcut-arrow { color: #8b93a0; font-size: 0.95rem; }
.section-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.28rem;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(11, 14, 20, 0.04), rgba(11, 14, 20, 0.02)),
        #e8ebf0;
    border: 1px solid #d8dde6;
    width: fit-content;
    max-width: 100%;
}
.section-switch-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 34px;
    padding: 0.35rem 0.85rem;
    border-radius: 9px;
    text-decoration: none;
    font-weight: var(--fw-strong);
    font-size: 0.84rem;
    color: var(--ink);
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.section-switch-item:hover {
    color: var(--navy);
    background: rgba(255, 255, 255, 0.55);
}
.section-switch-item.is-active {
    background: var(--navy);
    color: var(--white);
}

.filter-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    padding: 0.15rem 0 0.05rem;
    border-bottom: 1px solid var(--line);
}
.filter-rail-item {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: var(--fw-strong);
    font-size: 0.82rem;
    color: var(--ink);
    border: 1px solid transparent;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.filter-rail-item:hover {
    color: var(--navy);
    background: rgba(26, 173, 114, 0.08);
}
.filter-rail-item.is-active {
    color: var(--green-dark);
    background: #e8f7ef;
    border-color: #bfe4cd;
}
.filter-rail-item strong {
    font-variant-numeric: tabular-nums;
}
.queue-rail {
    border-bottom: 0;
    gap: 0.45rem;
}
.queue-rail .filter-rail-item {
    gap: 0.4rem;
    min-height: 32px;
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    background: #fff;
    border-color: #e6e8eb;
    font-weight: 400;
    color: #3c4257;
}
.queue-rail .filter-rail-item:hover {
    background: #f6f8fa;
    color: #0b0e14;
}
.queue-rail .filter-rail-item strong {
    font-weight: 500;
    color: #0b0e14;
}
.queue-rail .filter-rail-item.is-active {
    background: #f6f8fa;
    border-color: #d5d8de;
    color: #0b0e14;
}
.queue-rail .filter-rail-item.is-active strong {
    color: #0b0e14;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.chart-panel {
    border-radius: 8px;
    border-color: #e6e8eb;
    box-shadow: none;
    background: #fff;
}
.chart-panel-wide { grid-column: 1 / -1; }
.chart-frame {
    position: relative;
    height: 280px;
}
.chart-frame-square { height: 260px; }
.profile-panel { display: grid; gap: 1rem; }
.dash-block .section-title {
    font-size: 0.8rem;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 500;
    color: #697386;
}
.dash-block-head-row .section-switch {
    margin-left: auto;
    padding: 2px;
    gap: 0;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e6e8eb;
}
.dash-block .section-switch .section-switch-item {
    min-height: 28px;
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}
.dash-block .section-switch .section-switch-item.is-active {
    background: #f2f4f7;
    color: #0b0e14;
}
.section-switch .section-switch-item {
    font-size: 0.84rem;
    min-height: 34px;
    padding: 0.35rem 0.85rem;
}
.field-error { color: #b42318; font-size: 0.84rem; }

.console-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
.console-sidebar {
    background:
        radial-gradient(520px 280px at 12% -8%, rgba(212, 255, 0, 0.1), transparent 55%),
        radial-gradient(480px 260px at 80% 0%, rgba(26, 173, 114, 0.18), transparent 58%),
        linear-gradient(180deg, #121722 0%, var(--forest-deep) 100%);
    color: rgba(255, 255, 255, 0.86);
    padding: 1.15rem 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.nav-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.35rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.55);
}
.nav-search:focus-within {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
    color: #fff;
}
.nav-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.84rem;
    outline: none;
}
.nav-search input::placeholder { color: rgba(255, 255, 255, 0.4); }
.nav-empty {
    margin: 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.82rem;
}
.nav-hint {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.7rem 0.35rem;
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.75rem;
}
.nav-hint kbd {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    box-shadow: none;
}
.console-sidebar::-webkit-scrollbar {
    width: 8px;
}
.console-sidebar::-webkit-scrollbar-track {
    background: transparent;
    border: none;
    box-shadow: none;
}
.console-sidebar::-webkit-scrollbar-corner {
    background: transparent;
}
.console-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.console-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.34);
    background-clip: padding-box;
    border: 2px solid transparent;
}
.console-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: #fff;
    padding: 0.15rem 0.55rem 0.35rem;
    border-radius: 8px;
}
.console-brand:hover { background: rgba(255, 255, 255, 0.06); }
.console-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #e6e8eb;
}
.console-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.console-brand-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}
.console-brand-copy strong {
    font-family: var(--heading);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.console-brand-copy small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.console-nav { display: grid; gap: 1.15rem; padding: 0.35rem 0.15rem 0; }
.nav-group { display: grid; gap: 1px; }
.nav-group-label {
    margin: 0 0.55rem 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.72);
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    font-weight: 400;
    font-size: 0.875rem;
    letter-spacing: 0;
    position: relative;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.nav-link.is-current {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 500;
    box-shadow: none;
}
.nav-link.is-current .nav-icon {
    opacity: 1;
    color: #fff;
    background: transparent;
}
.nav-icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    padding: 0;
    box-sizing: content-box;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    opacity: 1;
}

.console-logout { margin-top: auto; padding: 0.35rem; }
.console-logout button {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    font-weight: 600;
}
.console-logout button:hover { background: rgba(255, 255, 255, 0.08); }

.console-main { min-width: 0; }
.console-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.65rem;
    background: rgba(255, 255, 255, 0.78);
    border-bottom: 1px solid rgba(226, 229, 235, 0.85);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    position: sticky;
    top: 0;
    z-index: 10;
}
.top-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 40px;
    padding: 0.35rem 0.7rem 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    box-shadow: var(--shadow);
    transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}
.top-search-btn:hover {
    border-color: #c5e0d2;
    background: #f5faf7;
    color: var(--navy);
}
.top-search-btn kbd {
    margin-left: 0.35rem;
    background: var(--surface);
}
.console-top-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.console-crumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ink);
    font-weight: 600;
    min-width: 0;
    flex-wrap: wrap;
}
.crumb-section { color: var(--ink); font-weight: 600; }
.crumb-sep { color: #b7bec8; font-weight: 500; }
.crumb-page {
    color: var(--navy);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.env-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--sand);
    color: var(--sand-ink);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.console-top-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.top-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--navy);
    display: inline-grid;
    place-items: center;
    text-decoration: none;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.top-icon-btn:hover,
.top-icon-btn.is-active {
    background: #e8f3ee;
    border-color: #c5e0d2;
    color: var(--green-dark);
}
.console-profile {
    position: relative;
    display: flex;
    align-items: center;
}
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.2rem 0.35rem 0.2rem 0.2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: inherit;
    cursor: pointer;
    font: inherit;
}
.profile-trigger:hover,
.console-profile.is-open .profile-trigger {
    border-color: #c5e0d2;
    background: #f5faf7;
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #151a24 0%, #0b0e14 55%, #163528 100%);
    color: var(--lime);
    display: grid;
    place-items: center;
    font-family: var(--heading);
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    line-height: 1;
    flex: 0 0 auto;
    overflow: hidden;
    text-transform: uppercase;
    user-select: none;
}
.avatar-sm { width: 34px; height: 34px; font-size: 0.72rem; }
.avatar-img { padding: 0; background: var(--line); }
.avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-photo-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.profile-photo-preview,
.profile-photo-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.profile-photo-fallback { font-size: 1.1rem; }
.avatar-picker {
    border: 0;
    margin: 0.75rem 0 0;
    padding: 0;
}
.avatar-picker legend {
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 0.55rem;
}
.avatar-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.avatar-option {
    position: relative;
    cursor: pointer;
    margin: 0;
}
.avatar-option input {
    position: absolute;
    opacity: 0;
    inset: 0;
}
.avatar-option img {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid transparent;
    object-fit: cover;
}
.avatar-option input:focus-visible + img,
.avatar-option input:checked + img {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(26, 173, 114, 0.25);
}
.field-error { color: #b42318; font-size: 0.86rem; margin: 0.35rem 0 0; }
.form-error {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: var(--danger-bg, #fdeceb);
    color: var(--danger, #9b1c1c);
    font-weight: 600;
}
.field-hint { color: var(--ink); font-size: 0.86rem; margin: 0.35rem 0 0; opacity: 0.85; }
.is-invalid input,
.is-invalid select { border-color: #f04438; }
.profile-meta { display: grid; gap: 0.05rem; text-align: left; }
.profile-meta strong { font-size: 0.88rem; }
.profile-meta small { color: var(--ink); font-size: 0.74rem; }
.profile-caret { color: var(--ink); flex: 0 0 auto; }
.console-profile.is-open .profile-caret { transform: rotate(180deg); }
.profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    width: min(260px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(16, 22, 35, 0.12);
    padding: 0.55rem;
    z-index: 20;
    display: grid;
    gap: 0.2rem;
    overflow: hidden;
    min-width: 0;
}
.profile-menu[hidden] { display: none; }
.profile-menu-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.55rem 0.7rem;
    min-width: 0;
}
.profile-menu-head > div {
    min-width: 0;
    flex: 1 1 auto;
}
.profile-menu-head strong,
.profile-menu-head small {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.profile-menu-head small { color: var(--ink); font-size: 0.78rem; margin-top: 0.1rem; }
.profile-menu-meta {
    justify-self: start;
    max-width: 100%;
    margin: 0 0.55rem 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    background: #e8f3ee;
    color: var(--green-dark);
    font-size: 0.75rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.profile-menu-item {
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--navy);
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 0.7rem;
    border-radius: 10px;
    cursor: pointer;
    min-width: 0;
}
.profile-menu-item:hover { background: #f3f6f4; }
.profile-menu-item.is-danger { color: #b42318; }
.profile-menu form { margin: 0; min-width: 0; max-width: 100%; }

.console-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}
.console-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--navy);
    border-radius: 2px;
}

.console-content {
    padding: 1rem 1.65rem 2.5rem;
    display: grid;
    gap: 1rem;
    max-width: 1220px;
}
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid transparent;
    background:
        linear-gradient(90deg, rgba(26, 173, 114, 0.08), transparent 42%);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin: 0 -0.25rem;
}
.page-head-copy { display: grid; gap: 0.2rem; min-width: 0; }
.page-back {
    width: fit-content;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
}
.page-back:hover { color: var(--green-dark); }
.page-head h1 {
    font-family: var(--heading);
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.03em;
}
.page-lede {
    color: var(--ink);
    font-size: 0.9rem;
    max-width: 58ch;
    line-height: 1.45;
    font-weight: 400;
}
.page-actions { display: flex; gap: 0.55rem; flex-wrap: wrap; align-items: center; }
.page-actions form { display: inline-flex; }
.lp-live-count {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 0.75rem;
    border-radius: 999px;
    background: #eef2f5;
    color: var(--navy);
    font-size: 0.8rem;
    font-weight: 700;
}
.page-body { display: grid; gap: 1rem; min-width: 0; }
.detail-sub {
    margin: 0 0 1rem;
    color: var(--ink);
    font-size: 0.94rem;
}
.detail-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.detail-toolbar .detail-sub { margin: 0; }
.detail-form-block {
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
}
.rules-stack { display: grid; gap: 1rem; }
.chart-title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}
.stat-card,
.panel,
.table-wrap {
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 8px;
    box-shadow: none;
}
.stat-card {
    padding: 0.9rem 1rem;
    display: grid;
    gap: 0.25rem;
    min-height: 0;
}
.stat-card:hover { background: #fafbfc; }
.stat-card.is-featured {
    background: #fff;
    border-color: #e6e8eb;
    color: #0b0e14;
}
.stat-label {
    color: #697386;
    font-size: 0.8rem;
    font-weight: 500;
}
.stat-card.is-featured .stat-label,
.stat-card.is-featured .stat-note { color: #697386; }
.stat-value {
    font-family: var(--heading);
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #0b0e14;
}
.stat-note { color: #8b93a0; font-size: 0.78rem; }

.panel { padding: 0.95rem 1rem; }
.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.panel h2 { font-size: 1.15rem; }
.panel > .muted { margin-top: -0.35rem; margin-bottom: 0.85rem; }

.toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.table-toolbar {
    margin: 0;
    gap: 0.75rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.table-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    flex: 1 1 240px;
}
.table-search input {
    min-width: min(100%, 240px);
    width: 260px;
    min-height: 40px;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    font: inherit;
    color: var(--navy);
}
.table-search input:focus {
    outline: 2px solid rgba(26, 173, 114, 0.35);
    border-color: var(--green);
}
.toolbar-end {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: flex-end;
}
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.4rem 0.9rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.btn-ghost:hover { background: var(--mint-soft); color: var(--navy); }
.btn-ghost.is-disabled,
.btn-ghost[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.table-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
}
.table-pager-meta {
    margin: 0;
    color: var(--ink);
    font-size: 0.9rem;
}
.table-pager-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
.table-per-page {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--ink);
}
.table-per-page select {
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--white);
    padding: 0.25rem 0.5rem;
    font: inherit;
}
.table-pager-links {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.table-pager-page {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--navy);
    padding: 0 0.35rem;
}
.filters,
.action-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--line);
    text-decoration: none;
    font-weight: 600;
    color: var(--ink);
    font-size: 0.82rem;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.chip:hover {
    color: var(--navy);
    background: rgba(26, 173, 114, 0.08);
}
.chip.is-active {
    color: var(--green-dark);
    background: #e8f7ef;
    border-color: #bfe4cd;
}

.table-wrap {
    overflow-x: auto;
    overflow-y: visible;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}
.data-table th,
.data-table td {
    padding: 0.8rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid #eef0f4;
    vertical-align: middle;
}
.data-table td {
    font-size: 0.84rem;
    line-height: 1.4;
    font-weight: 400;
}
.data-table th {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7a8491;
    background: linear-gradient(180deg, #fbfcfd, #f5f7fa);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: inset 0 -1px 0 var(--line);
}
.data-table tbody tr {
    transition: background 0.15s var(--ease);
}
.data-table.is-striped tbody tr:nth-child(even) td {
    background: #f8fafb;
}
.data-table tbody tr:hover td,
.data-table.is-striped tbody tr:hover td {
    background: #eef7f2;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong { display: block; }
.data-table td .muted {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.78rem;
}
.data-table .badge {
    font-size: 0.72rem;
    min-height: 24px;
}
.data-table a {
    color: var(--navy);
    font-weight: 600;
    text-decoration: none;
}
.data-table a:hover { color: #2a3344; }
.col-sn {
    width: 1%;
    white-space: nowrap;
    color: var(--muted, #6b7280);
    font-variant-numeric: tabular-nums;
}
.col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}
.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}
.table-actions form { margin: 0; }
.table-action {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--navy);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}
.table-action:hover {
    background: #e8f3ee;
    border-color: #c5e0d2;
    color: var(--green-dark);
}
.table-action.is-success { color: var(--green-dark); }
.table-action.is-success:hover {
    background: #e8f7ef;
    border-color: #bfe4cd;
    color: var(--green-dark);
}
.table-action.is-warning { color: #8a5b00; }
.table-action.is-warning:hover {
    background: #fff4df;
    border-color: #f0d9a8;
    color: #8a5b00;
}
.table-action.is-danger {
    color: #b42318;
}
.table-action.is-danger:hover {
    background: #fdecec;
    border-color: #f3c4c0;
    color: #8a1f18;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: #eef0f4;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}
.badge.is-pending { background: #fff4df; color: #8a5b00; }
.badge.is-active,
.badge.is-published { background: #e8f7ef; color: var(--green-dark); }
.badge.is-rejected,
.badge.is-suspended { background: var(--danger-bg); color: var(--danger); }
.badge.is-available { background: #e8f7ef; color: var(--green-dark); }
.badge.is-reserved { background: #eef2ff; color: #3b4cca; }
.badge.is-dispatched { background: #f3e7d4; color: #8a6a3a; }
.badge.is-returned { background: #f1f1f4; color: #4b5563; }
.badge.is-activated { background: #e8f3ee; color: var(--green-dark); }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1.25rem;
    margin: 0 0 1.25rem;
}
.detail-grid dt { color: var(--ink); font-size: 0.86rem; margin-bottom: 0.15rem; }
.detail-grid dd { margin: 0; font-weight: 600; }
.action-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

.empty-state {
    border: 1px dashed #d5d9e2;
    background:
        radial-gradient(420px 180px at 50% 0%, rgba(26, 173, 114, 0.06), transparent 70%),
        #fafbfc;
    border-radius: var(--radius);
    padding: 2.6rem 1.4rem;
    text-align: center;
    color: var(--ink);
    display: grid;
    gap: 0.4rem;
    justify-items: center;
}
.empty-state strong {
    display: block;
    color: var(--navy);
    font-family: var(--heading);
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.1rem;
}
.empty-state .btn { margin-top: 0.85rem; }

.console-flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 0.95rem 0.9rem 1.05rem;
    border-radius: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    box-shadow: var(--shadow);
    animation: flash-in 0.28s var(--ease);
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.console-flash.is-leaving {
    opacity: 0;
    transform: translateY(-4px);
}
@keyframes flash-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
.console-flash.is-success {
    background: #e8f7ef;
    color: var(--green-dark);
    border-color: #cfe9dc;
}
.console-flash.is-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #f3c4c0;
}
.flash-dismiss {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 0.2rem;
}
.flash-dismiss:hover { opacity: 1; }

.console-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 14, 20, 0.45);
    z-index: 25;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
}
.console-backdrop:not([hidden]) {
    display: block;
}
.console-shell.is-open .console-backdrop {
    display: block;
}

.settings-shell {
    display: grid;
    gap: 1.15rem;
    min-width: 0;
}
.settings-switch {
    max-width: 100%;
    flex-wrap: wrap;
}
.settings-switch .section-switch-item {
    font-size: 0.88rem;
    min-height: 36px;
    padding: 0.4rem 0.9rem;
}
.settings-stage {
    display: grid;
    gap: 0.9rem;
    min-width: 0;
}
.settings-stage-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}
.settings-stage-head h2 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.45rem);
}
.settings-form { display: grid; gap: 0.9rem; }
.settings-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(228, 231, 236, 0.95);
    border-radius: var(--radius);
    padding: 1.05rem 1.1rem;
    display: grid;
    gap: 0.9rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.settings-card.is-hidden { display: none; }
.settings-card h3 {
    margin: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.95rem;
    min-width: 0;
}
/* Only short, paired fields (names, IMEIs, amounts) — never long titles. */
.settings-grid.is-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}
.settings-grid .switch-field { grid-column: 1 / -1; }
.settings-savebar {
    position: sticky;
    bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.65rem 0.75rem 0.65rem 1.1rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    z-index: 5;
}
.switch-field {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}
.switch-field input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.switch-ui {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d7e0db;
    position: relative;
    flex: 0 0 auto;
    margin-top: 0.1rem;
    transition: background 0.2s var(--ease);
}
.switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s var(--ease);
}
.switch-field input:checked + .switch-ui { background: var(--navy); }
.switch-field input:checked + .switch-ui::after { transform: translateX(18px); }
.switch-copy { display: grid; gap: 0.15rem; }
.switch-copy strong { font-size: 0.94rem; }
.switch-copy small { color: var(--ink); font-size: 0.82rem; }

.crumb-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}
.crumb-row a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}
.crumb-row a:hover { color: var(--navy); }
.section-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}
.section-card {
    display: grid;
    gap: 1rem;
    align-content: space-between;
}
.section-card-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}
.section-card h3 { margin: 0.2rem 0 0; font-size: 1.05rem; }
.editor-form { gap: 0.9rem; }
.page-summary .panel-head { margin-bottom: 0.35rem; }

.lp-studio {
    display: grid;
    gap: 1.1rem;
    min-width: 0;
}
.lp-mast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem 1.25rem;
    padding: 1.25rem 1.35rem;
    border-radius: 18px;
    color: var(--white);
    background:
        radial-gradient(420px 180px at 100% 0%, rgba(212, 255, 0, 0.2), transparent 62%),
        linear-gradient(115deg, #0b0e14 0%, #143026 64%, #1aad72 145%);
}
.lp-mast h2 {
    margin: 0;
    color: var(--white);
    font-size: 1.55rem;
    letter-spacing: -0.03em;
}
.lp-mast-kicker,
.lp-flow-kicker {
    margin: 0 0 0.35rem;
    color: var(--lime);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.72rem;
}
.lp-flow-kicker { color: var(--green-dark); }
.lp-mast-copy p {
    margin: 0.35rem 0 0;
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.78);
}
.lp-mast-meta,
.lp-mast-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}
.lp-mast-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-content: flex-end;
    align-items: flex-start;
}
.lp-mast-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.78rem;
    font-weight: 700;
}
.lp-mast .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.22);
}
.lp-mast .btn-secondary:hover { background: rgba(255, 255, 255, 0.16); }
.lp-mast .btn-primary {
    background: var(--lime);
    color: var(--navy);
    border-color: var(--lime);
}
.lp-story {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}
.lp-story > li { margin: 0; }
.lp-story-card {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    border: 1px solid #e6e8eb;
    background: #fff;
    color: #0b0e14;
    text-decoration: none;
    box-shadow: none;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.lp-story-card:hover {
    background: #f6f8fa;
    border-color: #d5d8de;
}
.lp-story-card:focus-visible {
    outline: 2px solid #0b0e14;
    outline-offset: 2px;
}
.lp-story-card.is-hidden { background: #fff; }
.lp-story-card.is-hidden .lp-story-preview { color: #697386; }
.lp-story-num {
    color: #8b93a0;
    font-size: 0.75rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.lp-story-card.is-hidden .lp-story-num { color: #8b93a0; background: transparent; }
.lp-story-body { display: grid; gap: 0.1rem; min-width: 0; }
.lp-story-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
}
.lp-story-top strong {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0;
}
.lp-story-state {
    color: #697386;
    font-size: 0.75rem;
    font-weight: 400;
}
.lp-story-card.is-hidden .lp-story-state { color: #8b93a0; background: transparent; }
.lp-story-preview {
    font-size: 0.84rem;
    font-weight: 400;
    color: #3c4257;
    letter-spacing: 0;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.lp-story-note {
    color: #8b93a0;
    font-size: 0.78rem;
    line-height: 1.35;
}
.lp-story-go {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #8b93a0;
    background: transparent;
    border-radius: 6px;
}
.lp-story-card:hover .lp-story-go,
.lp-story-card.is-hidden .lp-story-go {
    background: transparent;
    color: #0b0e14;
}
@media (max-width: 720px) {
    .lp-story-card { grid-template-columns: 2rem minmax(0, 1fr); }
    .lp-story-go { grid-column: 2; }
}
.lp-stage {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.lp-flow {
    position: sticky;
    top: 0.75rem;
    padding: 0.85rem;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--line);
}
.lp-flow nav { display: grid; gap: 0.2rem; }
.lp-flow-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.55rem 0.6rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--navy);
}
.lp-flow-item:hover { background: #f4f7f5; }
.lp-flow-item.is-active { background: var(--navy); color: var(--white); }
.lp-flow-item.is-active small,
.lp-flow-item.is-active .lp-flow-copy small { color: rgba(255, 255, 255, 0.7); }
.lp-flow-index {
    font-family: var(--heading);
    font-size: 0.75rem;
    color: var(--green);
}
.lp-flow-item.is-active .lp-flow-index { color: var(--lime); }
.lp-flow-copy { display: grid; min-width: 0; }
.lp-flow-copy strong { font-size: 0.88rem; }
.lp-flow-copy small { color: var(--ink); font-size: 0.72rem; }
.lp-canvas { min-width: 0; display: grid; gap: 0.75rem; }
.lp-canvas-head h3 { margin: 0; font-size: 1.35rem; letter-spacing: -0.03em; }
.lp-brand-preview {
    color: #8fb800;
    font-family: var(--heading);
    font-weight: 800;
}
.lp-form .tiptap { margin-top: 0.15rem; }
@media (max-width: 960px) {
    .lp-stage { grid-template-columns: 1fr; }
    .lp-flow { position: static; }
    .lp-mast { grid-template-columns: 1fr; }
    .lp-mast-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
}
.lp-hero-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem 1rem;
    align-items: start;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--white);
}
.lp-hero-copy { grid-column: 1; display: grid; gap: 0.25rem; }
.lp-hero-title {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    font-weight: 600;
}
.lp-hero-meta {
    grid-column: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}
.lp-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: #eef2f5;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 700;
}
.lp-hero-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
    align-items: flex-start;
}
.lp-section-switch {
    width: 100%;
}
.lp-tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c5cbd4;
    flex: 0 0 auto;
}
.lp-tab-dot.is-on {
    background: var(--green-bright);
}
.section-switch-item.is-active .lp-tab-dot {
    background: rgba(255, 255, 255, 0.55);
}
.section-switch-item.is-active .lp-tab-dot.is-on {
    background: #e8f7ef;
}
.lp-editor-shell {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
}
.lp-editor-title {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}
.lp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--white);
    box-shadow: var(--shadow);
}
.lp-toolbar-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    flex: 1 1 14rem;
}
.lp-toolbar-copy .muted {
    margin: 0;
    font-size: 0.86rem;
}
.lp-visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0;
    padding: 0.45rem 0.7rem 0.45rem 0.55rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f7f9fa;
    cursor: pointer;
    flex: 0 1 auto;
    max-width: 100%;
}
.lp-visibility-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.lp-visibility-toggle .switch-ui {
    margin-top: 0;
    flex: 0 0 auto;
}
.lp-visibility-toggle input:checked + .switch-ui { background: var(--navy); }
.lp-visibility-toggle input:checked + .switch-ui::after { transform: translateX(18px); }
.lp-visibility-toggle:focus-within {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26, 173, 114, 0.18);
}
.lp-visibility-copy {
    display: grid;
    gap: 0.05rem;
    min-width: 0;
}
.lp-visibility-copy strong {
    font-size: 0.88rem;
    color: var(--navy);
    line-height: 1.2;
}
.lp-visibility-copy small {
    color: var(--ink);
    font-size: 0.75rem;
    line-height: 1.25;
}
.lp-field-hint {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
}
.lp-form {
    gap: 0.85rem;
}
.lp-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 34px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: #eef2f5;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
}
.lp-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c5cbd4;
}
.lp-live-dot.is-on { background: var(--green-bright); box-shadow: 0 0 0 3px rgba(26, 173, 114, 0.18); }
.lp-card {
    padding: 0.95rem 1rem;
}
.lp-card .lp-card-head {
    display: grid;
    gap: 0.15rem;
    margin-bottom: 0.75rem;
}
.lp-card .lp-card-head h3 {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 0.98rem;
}
.lp-card .lp-card-head p {
    margin: 0;
    color: var(--ink);
    font-size: 0.8rem;
}
.lp-card-head-row {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
}
.btn-sm {
    min-height: 34px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    border-radius: 10px;
}
.lp-pair-list {
    display: grid;
    gap: 0.65rem;
}
.lp-pair-row {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem 0.8rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fbfcfd;
    min-width: 0;
}
.lp-pair-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.lp-pair-index {
    display: inline-grid;
    place-items: center;
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #e8f7ef;
    color: var(--green-dark);
    font-size: 0.75rem;
    font-weight: 700;
}
.lp-row-remove {
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: 8px;
}
.lp-row-remove:hover {
    color: var(--danger);
    background: var(--danger-bg);
}
.lp-media-upload {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.lp-media-preview {
    width: 140px;
    height: 90px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f4f6f8;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.lp-media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lp-media-controls {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}
.lp-media-controls input[type="file"] {
    min-height: 44px;
    padding: 0.45rem;
}
.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
    color: var(--muted, #5b6573);
}
.lp-media-row .settings-grid {
    margin-bottom: 0.85rem;
}
@media (max-width: 720px) {
    .lp-media-upload {
        grid-template-columns: 1fr;
    }
    .lp-media-preview {
        width: 100%;
        height: 140px;
    }
}
.lp-pair-row textarea {
    min-height: 4.5rem;
    resize: vertical;
}
.lp-savebar {
    gap: 1rem;
}
.lp-save-meta {
    display: grid;
    gap: 0.1rem;
}
.lp-save-status {
    font-weight: 600;
    color: var(--navy);
    font-size: 0.9rem;
}
.lp-form.is-saving .lp-save-status { color: var(--green-dark); }
.lp-toast-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 90;
    display: grid;
    gap: 0.55rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}
.lp-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.8rem 0.85rem 1rem;
    border-radius: 14px;
    background: var(--navy);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: lp-toast-in 0.22s var(--ease);
}
.lp-toast-copy {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}
.lp-toast-close {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    margin: -0.1rem -0.1rem 0 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    font: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}
.lp-toast-close:hover { background: rgba(255, 255, 255, 0.22); }
.lp-toast.is-success { background: #0f6b45; }
.lp-toast.is-error { background: #8f221a; }
.lp-toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
@keyframes lp-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
    .lp-hero-bar {
        grid-template-columns: 1fr;
    }
    .lp-hero-actions {
        grid-column: 1;
        grid-row: auto;
        justify-content: flex-start;
    }
    .lp-toolbar {
        align-items: stretch;
    }
    .lp-visibility-toggle {
        width: 100%;
        justify-content: flex-start;
    }
}

.brand-upload-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.brand-preview {
    width: 120px;
    height: 72px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f8fbf9;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
}
.brand-preview.is-favicon {
    width: 56px;
    height: 56px;
}
.brand-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.brand-upload-controls {
    display: grid;
    gap: 0.35rem;
    min-width: min(100%, 280px);
}
.brand-upload-controls input[type="file"] {
    min-height: 44px;
    padding: 0.45rem;
}
.field {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}
.field label { font-weight: 600; font-size: 0.84rem; color: var(--navy); }
.field label span { color: #d64545; }
.field-wide { grid-column: 1 / -1; }
.field input,
.field select,
.field textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
    background: #fbfcfd;
    font: inherit;
    color: var(--navy);
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: #cfd4dd;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--navy);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26, 173, 114, 0.22);
}
.field textarea { min-height: 140px; resize: vertical; }
.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6570' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.4rem;
}
.check-field {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    font-weight: 600;
}
.check-field input { margin-top: 0.2rem; }
.check-field span {
    display: grid;
    gap: 0.15rem;
}
.check-field small {
    color: var(--ink);
    font-weight: 500;
}
.permission-groups { display: grid; gap: 1rem; }
.permission-group h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);
}
.permission-list {
    display: grid;
    gap: 0.65rem;
}
.permission-list .check-field {
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfd;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.permission-list .check-field:hover {
    border-color: #cfd4dd;
    background: #fff;
}
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82em;
    background: #eef0f4;
    padding: 0.12rem 0.35rem;
    border-radius: 6px;
}

.plain-list { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; gap: 0.55rem; }
.plain-list a { color: var(--navy); font-weight: 700; text-decoration: none; }

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

body.has-modal { overflow: hidden; }
.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}
.modal[hidden] { display: none !important; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 14, 20, 0.52);
    backdrop-filter: blur(2px);
}
.modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    max-height: min(90vh, 720px);
    overflow: auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    display: grid;
}
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem 1.2rem 0.85rem;
    border-bottom: 1px solid var(--line);
}
.modal-head h2 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
}
.modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    color: var(--navy);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}
.modal-close:hover { background: var(--mint-soft); }
.modal-body {
    padding: 1.1rem 1.2rem 1.2rem;
    gap: 1rem;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.25rem;
}
.panel-form {
    display: grid;
    gap: 1.15rem;
}

/* Auth (login) */
.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 3vw, 2rem);
    background: #eceff3;
    font-family: var(--body);
    color: var(--navy);
    margin: 0;
}
.auth-stage {
    width: min(100%, 1120px);
    min-height: min(720px, calc(100vh - 2rem));
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: var(--white);
    border-radius: 1.75rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(16, 22, 35, 0.12);
}
.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    color: var(--white);
    background:
        linear-gradient(160deg, rgba(16, 22, 35, 0.28) 0%, rgba(16, 22, 35, 0.82) 58%, rgba(16, 22, 35, 0.94) 100%),
        linear-gradient(135deg, #1aad72 0%, #0b3d2e 48%, #101623 100%);
    overflow: hidden;
}
.auth-visual::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto auto;
    width: 70%;
    height: 55%;
    background: radial-gradient(circle, rgba(26, 173, 114, 0.35), transparent 68%);
    pointer-events: none;
}
.auth-visual-brand { position: relative; z-index: 1; width: fit-content; }
.auth-visual-brand img {
    height: 44px;
    width: auto;
    background: var(--white);
    border-radius: 10px;
    padding: 0.2rem 0.4rem;
}
.auth-visual-media {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    place-items: center;
    padding: 1.5rem 0.5rem;
}
.auth-visual-media img {
    width: min(100%, 420px);
    max-height: 360px;
    object-fit: cover;
    border-radius: 1.25rem;
    box-shadow: 0 28px 50px rgba(0, 0, 0, 0.28);
    animation: auth-float 5.5s var(--ease) infinite alternate;
}
.auth-visual-copy {
    position: relative;
    z-index: 1;
    font-family: var(--heading);
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    max-width: 11ch;
    margin: 0;
}
.auth-visual-copy span { color: #9ae6c4; }
.auth-panel {
    display: grid;
    place-items: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: var(--white);
}
.auth-panel-inner {
    width: min(100%, 390px);
    display: grid;
    gap: 1rem;
}
.auth-panel h1 {
    font-size: clamp(1.7rem, 2.6vw, 2.15rem);
    margin: 0;
}
.auth-lede { color: var(--ink); margin: 0; font-size: 0.95rem; }
.auth-form { display: grid; gap: 1rem; margin-top: 0.35rem; }
.password-field { position: relative; display: grid; }
.password-field input {
    padding-right: 3.1rem;
    width: 100%;
}
.password-field input::-ms-reveal,
.password-field input::-ms-clear {
    display: none;
}
.password-toggle {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: #4d5968;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
}
.password-toggle:hover {
    background: #eef2f5;
    color: var(--navy);
}
.password-toggle svg {
    display: block;
    grid-area: 1 / 1;
}
.password-toggle svg[hidden] {
    display: none !important;
}
.field-meta { display: flex; justify-content: flex-end; margin-top: 0.45rem; }
.field-meta a,
.auth-footer a {
    color: var(--green);
    font-weight: 700;
    text-decoration: none;
}
.btn-auth {
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    border: 0;
    background: var(--navy);
    color: var(--white);
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.25rem;
}
.btn-auth:hover { background: #1a2230; }
.form-alert {
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f3c4c0;
    font-weight: 600;
}
.form-success {
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: #e8f7ef;
    color: var(--green-dark);
    border: 1px solid #b9e4cb;
    font-weight: 600;
}
.password-field {
    position: relative;
}
.password-field .password-toggle {
    top: 50%;
}
.auth-footer {
    text-align: center;
    color: var(--ink);
    font-size: 0.94rem;
    margin-top: 0.35rem;
}
.auth-stage-solo { grid-template-columns: 1fr; min-height: auto; }
.auth-panel-solo { padding-block: 3rem; }
.auth-mini-brand img {
    height: 44px;
    width: auto;
    background: var(--white);
    border-radius: 10px;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--line);
}

/* Centered OTP / gate card (full-bleed backdrop) */
.auth.is-auth-gate {
    place-items: center;
    align-content: center;
    gap: 1.25rem;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    background:
        radial-gradient(900px 520px at 12% 18%, rgba(212, 255, 0, 0.16), transparent 55%),
        radial-gradient(700px 480px at 88% 12%, rgba(26, 173, 114, 0.28), transparent 50%),
        radial-gradient(640px 420px at 70% 90%, rgba(212, 255, 0, 0.08), transparent 55%),
        linear-gradient(155deg, #0b0e14 0%, #121821 42%, #0a3d2c 100%);
    position: relative;
    overflow: hidden;
}
.auth.is-auth-gate::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, #000 35%, transparent 78%);
    pointer-events: none;
}
.auth-gate {
    position: relative;
    z-index: 1;
    width: min(100%, 440px);
    display: grid;
    gap: 1.15rem;
    justify-items: stretch;
}
.auth-gate-card {
    width: 100%;
    background: var(--white);
    border-radius: 1.35rem;
    padding: clamp(1.5rem, 4vw, 2.15rem);
    display: grid;
    gap: 1.05rem;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    animation: auth-card-in 0.45s var(--ease) both;
}
.auth-gate-brand {
    width: fit-content;
    display: inline-flex;
}
.auth-gate-brand img {
    height: 40px;
    width: auto;
}
.auth-gate-head {
    display: grid;
    gap: 0.4rem;
}
.auth-gate-head h1 {
    margin: 0;
    font-family: var(--heading);
    font-size: clamp(1.65rem, 3.5vw, 2rem);
    letter-spacing: -0.03em;
}
.auth-gate-email {
    margin: 0.15rem 0 0;
    font-weight: 700;
    color: var(--navy);
    word-break: break-word;
}
.auth-gate .auth-form {
    margin-top: 0.15rem;
}
.auth-gate .field input {
    min-height: 50px;
    height: 50px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f4f6f9;
    padding: 0.7rem 0.95rem;
    font: inherit;
}
.auth-gate .field input[name="code"],
.auth-gate .field input[autocomplete="one-time-code"] {
    letter-spacing: 0.18em;
    font-weight: 700;
    text-align: center;
}
.auth-gate .field input:focus {
    outline: none;
    border-color: var(--navy);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26, 173, 114, 0.2);
}
.auth-gate .password-field {
    position: relative;
}
.auth-gate .password-field input {
    width: 100%;
    padding-right: 2.85rem;
}
.auth-gate .password-toggle {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    cursor: pointer;
}
.auth-gate .password-toggle:hover,
.auth-gate .password-toggle:focus-visible {
    color: var(--navy);
    background: rgba(11, 14, 20, 0.06);
}
.auth-gate .field-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.45rem;
}
.auth-gate .field-meta a {
    color: var(--green);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
}
.auth-gate .field-meta a:hover {
    text-decoration: underline;
}
.auth-gate .form-alert,
.auth-gate .form-success {
    margin: 0;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
}
.auth-gate .form-alert {
    background: #fff1f1;
    color: #9b1c1c;
    border: 1px solid #f5c2c2;
}
.auth-gate .form-success {
    background: #eefbf4;
    color: #0f6b45;
    border: 1px solid #b7e6cf;
}
.auth-gate .btn-auth {
    min-height: 52px;
    border-radius: 12px;
    background: linear-gradient(100deg, var(--navy) 0%, #163528 55%, #1aad72 140%);
    color: var(--white);
    font-family: var(--heading);
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}
.auth-gate .btn-auth:hover {
    background: linear-gradient(100deg, #151a24 0%, #1a4333 55%, #19b87a 140%);
    filter: brightness(1.05);
}
.auth-gate-resend {
    margin: 0;
    text-align: center;
}
.auth-gate-linkbtn {
    border: 0;
    background: none;
    color: var(--green);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0.25rem;
}
.auth-gate-linkbtn:hover { text-decoration: underline; }
.auth-gate .auth-footer {
    margin: 0;
}
.auth-gate-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem 1.25rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
}
.auth-gate-meta a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-weight: 600;
}
.auth-gate-meta a:hover {
    color: var(--lime);
}

@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .auth-gate-card { border-radius: 1.1rem; }
    .auth-gate .field input[name="code"],
    .auth-gate .field input[autocomplete="one-time-code"] {
        letter-spacing: 0.12em;
    }
}

@keyframes auth-float {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chart-grid { grid-template-columns: 1fr; }
    .chart-panel-wide { grid-column: auto; }
    .shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
    .console-shell { grid-template-columns: minmax(0, 1fr); }
    .console-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, var(--sidebar));
        transform: translateX(-105%);
        transition: transform 0.3s var(--ease);
        z-index: 30;
    }
    .console-shell.is-open .console-sidebar { transform: none; }
    .console-shell.is-open { overflow: hidden; }
    .console-toggle { display: inline-flex; }
    .detail-grid { grid-template-columns: 1fr; }
    .settings-grid.is-split { grid-template-columns: 1fr; }
    .settings-savebar { border-radius: 16px; }
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-end {
        justify-content: flex-start;
        width: 100%;
    }
    .table-search input { width: 100%; min-width: 0; }
}

@media (max-width: 900px) {
    .auth-stage { grid-template-columns: 1fr; min-height: auto; }
    .auth-visual { min-height: 280px; gap: 1rem; }
    .auth-visual-media { padding: 0.5rem 0; }
    .auth-visual-media img { max-height: 180px; width: min(100%, 260px); }
    .auth-visual-copy { max-width: 16ch; font-size: 1.65rem; }
}

@media (max-width: 640px) {
    .console-content,
    .console-top { padding-left: 1rem; padding-right: 1rem; }
    .profile-meta { display: none; }
    .profile-caret { display: none; }
    .profile-trigger { padding: 0.2rem; }
    .stat-grid { grid-template-columns: 1fr; }
    .shortcut-grid { grid-template-columns: 1fr; }
    .action-row .btn { width: 100%; }
    .page-head { align-items: flex-start; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; }
    .console-crumb .env-badge { display: none; }
    .top-search-btn span,
    .top-search-btn kbd { display: none; }
    .top-search-btn { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
    .nav-hint { display: none; }
}

/* Command palette */
.command-palette {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: start center;
    padding: 12vh 1rem 2rem;
}
.command-palette[hidden] { display: none; }
.command-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(11, 14, 20, 0.48);
    backdrop-filter: blur(6px);
    cursor: pointer;
}
.command-panel {
    position: relative;
    width: min(560px, 100%);
    background: var(--white);
    border: 1px solid rgba(228, 231, 236, 0.95);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(11, 14, 20, 0.22);
    overflow: hidden;
    animation: command-in 0.22s var(--ease);
}
@keyframes command-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.command-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.command-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    font: inherit;
    font-size: 1rem;
    color: var(--navy);
    background: transparent;
}
.command-results {
    max-height: min(48vh, 360px);
    overflow: auto;
    padding: 0.45rem;
}
.command-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.command-item:hover,
.command-item.is-active {
    background: #eef7f2;
}
.command-item-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}
.command-item-copy strong {
    font-weight: 600;
    letter-spacing: -0.01em;
}
.command-item-copy small {
    color: var(--ink);
    font-size: 0.78rem;
}
.command-item-go {
    color: var(--green-dark);
    font-size: 0.78rem;
    font-weight: 600;
}
.command-empty {
    margin: 0;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--ink);
}
.command-foot {
    margin: 0;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.75rem;
    background: #fafbfc;
}
body.has-command { overflow: hidden; }

.site-toast-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 100;
    display: grid;
    gap: 0.55rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}
.site-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 0.85rem 0.9rem 1rem;
    border-radius: 14px;
    background: var(--navy);
    color: var(--white);
    font-weight: 600;
    font-size: 0.92rem;
    box-shadow: var(--shadow-lg);
    animation: site-toast-in 0.22s var(--ease);
}
.site-toast-copy {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}
.site-toast-close {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    margin: -0.1rem -0.15rem 0 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    font: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}
.site-toast-close:hover { background: rgba(255, 255, 255, 0.22); }
.site-toast.is-success { background: #0f6b45; }
.site-toast.is-error { background: #8f221a; }
.site-toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
@keyframes site-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
