:root {
    color-scheme: light;
    --dpi-font-scale: 1;
    --bg: #edf3f9;
    --bg-overlay: radial-gradient(circle at 12% 18%, #f7fbff 0%, #edf3f9 42%, #e8eef6 100%);
    --ink: #112338;
    --muted: #5f7389;
    --brand: #1d8f7e;
    --brand-strong: #147564;
    --brand-soft: rgba(29, 143, 126, 0.14);
    --accent: #2d88d8;
    --warn: #c88524;
    --danger: #cc4352;
    --line: #d7e2ec;
    --line-strong: #c3d0db;
    --card: #ffffff;
    --card-soft: linear-gradient(150deg, #ffffff 0%, #f8fbff 100%);
    --shadow: 0 16px 38px rgba(20, 43, 66, 0.08);
    --sidebar: linear-gradient(180deg, #0f243a 0%, #0b1a2b 70%, #071320 100%);
    --sidebar-soft: rgba(132, 178, 213, 0.16);
    --sidebar-ink: #d7e7f7;
}

.inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

[data-theme='dark'] {
    color-scheme: dark;
    --bg: #070f19;
    --bg-overlay: radial-gradient(circle at 10% 15%, #12253b 0%, #0b1724 45%, #070f19 100%);
    --ink: #deebf8;
    --muted: #8ea5bc;
    --brand: #32b7a2;
    --brand-strong: #1f9581;
    --brand-soft: rgba(50, 183, 162, 0.2);
    --accent: #64adff;
    --warn: #e0a33f;
    --danger: #e86674;
    --line: #1f2c3a;
    --line-strong: #2b3b4b;
    --card: #0d1a27;
    --card-soft: linear-gradient(145deg, #0d1a27 0%, #122234 100%);
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
    --sidebar: linear-gradient(180deg, #06101b 0%, #050d16 100%);
    --sidebar-soft: rgba(90, 132, 167, 0.22);
    --sidebar-ink: #cde0f4;
}

* { box-sizing: border-box; }

[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    min-height: 100%;
}

html {
    font-size: calc(16px * var(--dpi-font-scale));
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.45;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url('/storage/bg/dark-background-variant-2-2600x1200.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 0.92;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(
        180deg,
        rgba(8, 18, 30, 0.42) 0%,
        rgba(7, 15, 25, 0.48) 48%,
        rgba(6, 14, 24, 0.54) 100%
    );
}

[data-theme='light'] body::before,
:root:not([data-theme]) body::before {
    opacity: 0.98;
}

[data-theme='light'] body::after,
:root:not([data-theme]) body::after {
   opacity: 0.0;
}

#portal-bg-canvas {
    display: none;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    position: relative;
    z-index: 1;
}

.sidebar {
    position: sticky;
    top: 0;
    background: var(--sidebar);
    color: var(--sidebar-ink);
    padding: 22px 16px;
    border-right: 1px solid rgba(112, 152, 185, 0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100vh;
    overflow-y: auto;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 12% 10%, rgba(58, 162, 253, 0.16) 0%, transparent 52%);
}

.logo {
    position: relative;
    font-weight: 800;
    letter-spacing: 0.01em;
    font-size: 1.05rem;
    margin-bottom: 18px;
}

.logo-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.logo small {
    display: block;
    font-size: 0.76rem;
    color: #91b2ce;
    margin-top: 4px;
    text-align: center;
    width: 100%;
    letter-spacing: 0.02em;
}

.sidebar-main {
    flex: 1;
}

.sidebar-footer {
    margin-top: auto;
}

.nav-group {
    margin-top: 18px;
}

.nav-item {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--sidebar-ink);
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: var(--sidebar-soft);
    border-color: rgba(142, 180, 211, 0.3);
    text-decoration: none;
}

.user-block {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(142, 180, 211, 0.28);
    background: rgba(23, 51, 79, 0.46);
    border-radius: 12px;
    padding: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.82rem;
    color: #fff;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-large {
    width: 72px;
    height: 72px;
    font-size: 1.1rem;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-crop-wrap {
    width: 320px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    overflow: hidden;
    background: color-mix(in srgb, var(--card) 86%, black 14%);
}

#avatar-crop-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}

#avatar-crop-canvas:active {
    cursor: grabbing;
}

.user-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #f0f7ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-name-link {
    font-size: 0.84rem;
    font-weight: 700;
    color: #f0f7ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-name-link:hover {
    color: #cfe8ff;
    text-decoration: underline;
}

.user-email {
    font-size: 0.74rem;
    color: #95b7d2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-logout {
    margin: 0;
    flex-shrink: 0;
}

.user-logout .btn {
    padding: 8px 10px;
}

.main {
    padding: 24px 28px 42px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-nav-toggle,
.mobile-nav-close,
.mobile-nav-backdrop {
    display: none;
}

/* Keep mobile nav controls hidden by default on desktop. */
.btn.mobile-nav-toggle,
.btn.mobile-nav-close {
    display: none;
}

.mobile-nav-header {
    display: none;
}

.title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.subtitle {
    color: var(--muted);
    font-size: 0.9rem;
}

.panel {
    background: var(--card-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(4, 14, 25, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    width: min(880px, 96vw);
    max-height: 92vh;
    overflow: auto;
    background: var(--card-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 14px;
}

.panel-hero {
    padding: 18px;
    border-color: rgba(42, 136, 216, 0.22);
}

.hero-grid {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.pack-panel {
    border-color: rgba(39, 134, 196, 0.24);
}

.pack-edit-card {
    border-color: rgba(39, 134, 196, 0.28);
}

.pack-edit-card[hidden] {
    display: none !important;
}

.pack-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sub-panel {
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    padding: 12px;
    background: color-mix(in srgb, var(--card) 88%, transparent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.two-up {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.stat {
    background: linear-gradient(160deg, color-mix(in srgb, var(--card) 94%, white) 0%, color-mix(in srgb, var(--card) 86%, var(--brand-soft)) 100%);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

.stat .k {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 4px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 9px 8px;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 700;
}

/* Clickable list rows (tr[data-href], see CLAUDE.md convention) had cursor:pointer
   but no other affordance — easy to miss that a row is clickable at all. */
tr[data-href]:hover {
    background: var(--brand-soft);
}
tr[data-href]:hover td:first-child {
    text-decoration: underline;
}

code {
    font-family: "JetBrains Mono", "Cascadia Code", monospace;
    font-size: 0.8rem;
    color: var(--accent);
}

form.inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}

label {
    display: block;
    font-weight: 700;
    font-size: 0.83rem;
    margin-bottom: 5px;
    color: var(--muted);
    letter-spacing: 0.01em;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    color: var(--ink);
    background: color-mix(in srgb, var(--card) 92%, transparent);
}

input[type='checkbox'],
input[type='radio'] {
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: inline-block;
    vertical-align: middle;
    accent-color: var(--brand);
}

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 14px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
}

.remember-row input[type='checkbox'] {
    margin: 0;
}

.checkbox-field {
    display: grid;
    gap: 6px;
    align-content: start;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    color: var(--ink);
    font-weight: 600;
    font-size: calc(0.83rem - 2px);
    cursor: pointer;
}

.checkbox-label input[type='checkbox'] {
    margin: 0;
}

select {
    appearance: none;
    background-image:
        linear-gradient(180deg, color-mix(in srgb, var(--card) 94%, transparent) 0%, color-mix(in srgb, var(--card) 88%, var(--brand-soft)) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%237e96ae' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 12px center;
    padding-right: 34px;
    border-color: color-mix(in srgb, var(--line-strong) 78%, var(--brand-soft));
}

[data-theme='dark'] select {
    background-image:
        linear-gradient(180deg, color-mix(in srgb, var(--card) 90%, transparent) 0%, color-mix(in srgb, var(--card) 80%, var(--brand-soft)) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23a9c3dc' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
}

select option {
    color: var(--ink);
    background: var(--card);
}

select[multiple] {
    appearance: auto;
    background-image: none;
    padding-right: 10px;
}

select[multiple] option {
    padding: 4px 6px;
}

select:disabled,
input:disabled,
textarea:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.network-select-blocked {
    border-color: color-mix(in srgb, var(--danger) 45%, var(--line-strong));
    background: color-mix(in srgb, var(--card) 82%, var(--danger) 18%);
}

.network-picker {
    display: grid;
    gap: 8px;
}

.network-mode-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.network-mode {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--ink);
    font-weight: 700;
}

.network-mode input[type='radio'] {
    width: auto;
    margin: 0;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--brand) 55%, var(--line-strong));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

.tag-multi {
    position: relative;
}

.tag-multi-control {
    min-height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

.tag-multi.open .tag-multi-control {
    border-color: color-mix(in srgb, var(--brand) 55%, var(--line-strong));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

.tag-multi-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 22px;
}

.tag-multi-caret {
    color: var(--muted);
    font-size: 0.82rem;
}

.tag-multi-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    display: none;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-height: 210px;
    overflow: auto;
    padding: 6px;
}

.tag-multi.open .tag-multi-menu {
    display: block;
}

.tag-menu-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    border-radius: 8px;
    padding: 8px 9px;
    font-size: 0.86rem;
}

.tag-menu-item:hover {
    background: color-mix(in srgb, var(--brand-soft) 72%, transparent);
}

.tag-menu-item.active {
    background: color-mix(in srgb, var(--brand-soft) 95%, transparent);
    border-color: color-mix(in srgb, var(--brand) 25%, transparent);
}

.hv-picker-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.hv-picker-row select {
    flex: 1 1 auto;
    min-width: 0;
}

.hv-picker-row .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 94px;
}

.hv-row-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hv-card {
    border: 1px solid color-mix(in srgb, var(--line-strong) 86%, var(--accent));
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 84%, var(--accent) 16%);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.hv-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--line-strong) 82%, var(--accent));
    background: color-mix(in srgb, var(--card) 76%, var(--accent) 24%);
    cursor: pointer;
}

.hv-card-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hv-card-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.hv-toggle-btn,
.hv-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
}

.hv-toggle-btn span {
    font-size: 1rem;
    line-height: 1;
}

.hv-card-body {
    padding: 10px;
    display: grid;
    gap: 8px;
}

.hv-card-body[hidden] {
    display: none !important;
}

.hv-card-summary {
    font-size: 0.8rem;
    color: color-mix(in srgb, var(--brand) 66%, var(--ink));
}

.hv-card-summary.empty {
    color: var(--muted);
}

.hv-map-picker-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.hv-map-picker-row select {
    flex: 1 1 auto;
    min-width: 0;
}

.hv-add-mapping {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 84px;
}

.hv-mapping-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hv-mapping-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
    background: color-mix(in srgb, var(--accent) 28%, var(--card));
    border-radius: 9px;
    padding: 3px 6px 3px 8px;
    font-size: 0.82rem;
    color: var(--ink);
}

.hv-chip-remove {
    width: 24px;
    min-width: 24px;
    height: 24px;
    padding: 0;
    font-size: 0.72rem;
}

textarea {
    min-height: 82px;
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.vm-list-filters {
    margin-bottom: 10px;
    align-items: end;
}

.vm-list-filter-actions {
    align-self: end;
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
}

.vm-list-status-row {
    margin-top: 8px;
    margin-bottom: 10px;
}

.ip-management-create-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

.ip-management-description-field,
.ip-management-form-actions {
    grid-column: 1 / -1;
}

.ip-management-description-field textarea {
    min-height: 88px;
}

.ip-management-form-actions {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* save/apply on the right (2026-10-23) */
}

.ip-management-attach-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.ip-management-attach-actions {
    align-self: end;
    display: flex;
    align-items: stretch;
}

.access-blocks-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: start;
}

.access-blocks-wide-field {
    grid-column: span 4;
}

.access-blocks-form-actions {
    align-self: end;
    display: flex;
    align-items: stretch;
}

.pack-pricing-grid {
    align-items: start;
}

.pack-pricing-grid > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pack-pricing-grid > div > label:first-child {
    min-height: 2.5em;
    display: flex;
    align-items: flex-end;
    font-size: calc(0.83rem - 2px);
    line-height: 1.12;
}

.pack-toggle-field {
    justify-content: flex-end;
}

.pack-toggle-option {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 40px;
    font-weight: 600;
}


/* OS image create form (2026-10-22): 7 fields on row 1, logo/URLs/options on
   row 2 instead of one 1980px row with a horizontal scrollbar. */
.os-image-create-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
}
.os-image-create-grid > .os-image-row-break {
    grid-column-start: 1;
}
.os-image-create-grid > .os-image-wide {
    grid-column: span 2;
}
.os-image-create-grid > .os-image-create-action {
    grid-column: -2 / -1; /* last column: button on the right */
}
@media (max-width: 1200px) {
    .os-image-create-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }
    .os-image-create-grid > .os-image-wide,
    .os-image-create-grid > .os-image-create-action {
        grid-column: auto;
    }
}

.os-image-create-grid > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.os-image-create-grid > div > label {
    min-height: 2.25em;
    display: flex;
    align-items: flex-end;
}

.os-image-create-grid input[type='file'] {
    min-height: 40px;
}

.os-image-create-action {
    align-self: end;
}

.os-image-create-action > .btn {
    width: 100%;
}

@media (max-width: 1180px) {
    .os-image-create-grid > div > label {
        min-height: 0;
    }

    .ip-management-create-grid,
    .ip-management-attach-grid,
    .access-blocks-grid {
        grid-template-columns: 1fr;
    }

    .access-blocks-wide-field {
        grid-column: auto;
    }
}

button,
.btn {
    border: 0;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #fff;
    border-radius: 10px;
    padding: 9px 13px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    min-height: 40px;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn.secondary {
    background: linear-gradient(180deg, #2f86ce 0%, #2368a4 100%);
}

.btn.btn-sm {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 0.82rem;
}

.btn.warn {
    background: linear-gradient(180deg, #d49a40 0%, #b57419 100%);
}

.btn.danger {
    background: linear-gradient(180deg, #e0606d 0%, #bf3948 100%);
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink);
}

.icon-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    vertical-align: middle;
    text-decoration: none;
}

.action-cell {
    align-self: end;
    display: flex;
}

.action-cell > button,
.action-cell > .btn {
    width: 100%;
}

.form-actions-right {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.vm-iso-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    margin-top: 10px;
}

.vm-iso-map-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.vm-iso-map-input {
    flex: 1 1 auto;
    min-width: 0;
}

.vm-iso-map-submit,
.vm-iso-detach-form {
    flex: 0 0 auto;
}

@media (max-width: 980px) {
    .vm-iso-row {
        grid-template-columns: 1fr;
    }

    .vm-iso-map-form {
        flex-wrap: wrap;
    }
}

.icon-svg {
    width: 17px;
    height: 17px;
    display: block;
    flex: 0 0 auto;
}

.btn-loading {
    cursor: wait;
    opacity: 0.95;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 999px;
    animation: btn-spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.1;
    background: var(--brand-soft);
    color: color-mix(in srgb, var(--brand) 72%, var(--ink));
    border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
}

.badge-ok {
    background: color-mix(in srgb, var(--brand) 14%, transparent);
    color: color-mix(in srgb, var(--brand) 72%, var(--ink));
    border-color: color-mix(in srgb, var(--brand) 45%, transparent);
}

.badge-neutral {
    background: color-mix(in srgb, var(--line) 58%, transparent);
    color: color-mix(in srgb, var(--muted) 80%, var(--ink));
    border-color: color-mix(in srgb, var(--line-strong) 70%, transparent);
}

.badge-danger {
    background: color-mix(in srgb, var(--danger) 16%, transparent);
    color: color-mix(in srgb, var(--danger) 74%, var(--ink));
    border-color: color-mix(in srgb, var(--danger) 52%, transparent);
}

.wizard-form {
    display: grid;
    gap: 12px;
}

.wizard-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.wizard-pill {
    opacity: 0.72;
}

.wizard-pill-active {
    opacity: 1;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    color: color-mix(in srgb, var(--accent) 72%, var(--ink));
}

.choice-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.choice-grid-large {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.choice-grid-medium {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Deploy wizard step-1 pack/host pickers: keep a clean 4-up card layout on wide screens. */
#pack-card-grid,
#host-card-grid,
#template-card-grid,
#os-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1320px) {
    #pack-card-grid,
    #host-card-grid,
    #template-card-grid,
    #os-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1120px) {
    #pack-card-grid,
    #host-card-grid,
    #template-card-grid,
    #os-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    #pack-card-grid,
    #host-card-grid,
    #template-card-grid,
    #os-card-grid {
        grid-template-columns: 1fr;
    }
}

.choice-empty {
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    padding: 12px;
    color: var(--muted);
    background: color-mix(in srgb, var(--card) 88%, transparent);
}

.choice-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice-btn-large {
    min-height: 42px;
    padding: 10px 16px;
}

.choice-btn.choice-active {
    background: linear-gradient(180deg, #3aa0ef 0%, #276ea9 100%);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 34%, transparent);
}

.choice-btn.choice-disabled,
.choice-btn:disabled {
    opacity: 1;
    color: color-mix(in srgb, var(--muted) 88%, var(--ink));
    background: linear-gradient(180deg, color-mix(in srgb, var(--card) 90%, #6e7d8d 10%) 0%, color-mix(in srgb, var(--card) 82%, #5d6e80 18%) 100%) !important;
    border: 1px dashed color-mix(in srgb, var(--line-strong) 78%, #6e7d8d 22%);
    box-shadow: none !important;
    filter: saturate(0.2);
    cursor: not-allowed;
}

.choice-card {
    border: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
    border-radius: 12px;
    background: linear-gradient(150deg, color-mix(in srgb, var(--card) 94%, transparent) 0%, color-mix(in srgb, var(--card) 82%, var(--brand-soft)) 100%);
    color: var(--ink);
    text-align: left;
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
    min-height: 128px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.choice-card:disabled {
    cursor: not-allowed;
}

.choice-card:hover {
    border-color: color-mix(in srgb, var(--accent) 44%, var(--line-strong));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 18%, transparent);
    transform: translateY(-1px);
}

.choice-card.choice-card-unavailable {
    opacity: 1;
    border-style: dashed;
    border-color: color-mix(in srgb, var(--line-strong) 72%, #6e7d8d 28%);
    background: linear-gradient(150deg, color-mix(in srgb, var(--card) 95%, #6e7d8d 5%) 0%, color-mix(in srgb, var(--card) 84%, #5d6e80 16%) 100%);
    filter: saturate(0.15);
}

.choice-card.choice-card-unavailable:hover {
    border-color: color-mix(in srgb, var(--line-strong) 72%, #6e7d8d 28%);
    box-shadow: none;
    transform: none;
}

.choice-card.choice-card-unavailable .choice-title,
.choice-card.choice-card-unavailable .choice-meta,
.choice-card.choice-card-unavailable .small,
.choice-card.choice-card-unavailable .choice-progress span {
    color: color-mix(in srgb, var(--muted) 88%, var(--ink)) !important;
}

.choice-card-active {
    border-color: color-mix(in srgb, var(--accent) 60%, var(--brand) 40%);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--accent) 32%, transparent),
        inset 0 0 0 1px color-mix(in srgb, var(--brand) 26%, transparent),
        0 10px 22px color-mix(in srgb, var(--accent) 18%, transparent);
    background: linear-gradient(150deg, color-mix(in srgb, var(--card) 88%, var(--accent) 12%) 0%, color-mix(in srgb, var(--card) 78%, var(--brand-soft) 22%) 100%);
}

.pack-unavailable-note {
    color: color-mix(in srgb, var(--muted) 88%, var(--ink));
    font-weight: 700;
}

.badge-unavailable {
    background: linear-gradient(180deg, #7d8998 0%, #667484 100%);
    color: #f5f9ff;
}

.choice-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--ink);
}

.choice-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

.pack-country-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.pack-card-layout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.pack-card-main {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.pack-side-flag {
    width: 58px;
    min-height: 82px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--line-strong) 78%, transparent);
    background: color-mix(in srgb, var(--card) 88%, transparent);
    display: grid;
    place-items: center;
    align-content: center;
    color: var(--muted);
}

.pack-side-flag-emoji {
    font-size: 1.9rem;
    line-height: 1;
}

.pack-side-flag-empty {
    opacity: 0;
    pointer-events: none;
}

.pack-country-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--muted);
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--line-strong) 75%, transparent);
    background: color-mix(in srgb, var(--card) 88%, transparent);
}

.pack-country-dot {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--line-strong) 75%, transparent);
    background: color-mix(in srgb, var(--card) 88%, transparent);
    display: inline-grid;
    place-items: center;
}

.pack-country-dot .flag-emoji {
    font-size: 0.95rem;
}

.flag-emoji {
    font-size: 0.95rem;
    line-height: 1;
}

.host-flag {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    min-width: 0;
}

.host-flag-text {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .pack-card-layout {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .pack-side-flag {
        width: 64px;
        min-height: 64px;
    }
}

.host-card .choice-title {
    line-height: 1.24;
    min-height: 2.45em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.os-card {
    min-height: 154px;
    align-content: start;
    justify-items: center;
    text-align: center;
}

.os-card-logo-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--line-strong) 72%, transparent);
    background: color-mix(in srgb, var(--card) 82%, #f6fbff 18%);
    display: grid;
    place-items: center;
}

.os-card-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 6px;
}

.os-card-logo-fallback {
    font-weight: 900;
    font-size: 1rem;
    color: color-mix(in srgb, var(--accent) 64%, var(--ink));
}

.os-image-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: color-mix(in srgb, var(--card) 88%, white 12%);
    vertical-align: middle;
}

.os-image-logo-lg {
    width: 32px;
    height: 32px;
}

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

.choice-progress span {
    color: var(--muted);
    font-size: 0.79rem;
}

.slider-grid {
    display: grid;
    gap: 10px;
}

.slider-row {
    display: grid;
    grid-template-columns: minmax(110px, 140px) 1fr minmax(130px, 180px);
    align-items: center;
    gap: 10px;
}

.slider-row label {
    margin: 0;
}

.slider-row input[type='range'] {
    width: 100%;
    accent-color: var(--accent);
}

.usage-line {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
}

.usage-label {
    font-size: 0.8rem;
    color: var(--muted);
}

.usage-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 82%, transparent);
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
}

.badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notice {
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.notice.ok {
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 42%, transparent);
    color: color-mix(in srgb, var(--brand) 68%, var(--ink));
}

.notice.err {
    background: color-mix(in srgb, var(--danger) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
    color: color-mix(in srgb, var(--danger) 72%, var(--ink));
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.login-card {
    width: min(460px, 92vw);
    background: var(--card-soft);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 18px;
    padding: 24px;
}

.error-page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.error-page-card {
    width: min(620px, 96vw);
    background: var(--card-soft);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.error-status {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: 8px;
}

.error-title {
    margin: 0 0 10px;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
}

.error-message {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.error-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.login-brand {
    text-align: center;
    margin-bottom: 18px;
}

.login-brand .logo-row {
    justify-content: center;
    margin-bottom: 8px;
}

.login-tagline {
    margin: 0;
}

.login-card .remember-row {
    display: flex;
    width: 100%;
    margin: 10px 0 0;
}

.login-submit {
    margin-top: 12px;
    width: 100%;
}

.small {
    color: var(--muted);
    font-size: 0.84rem;
}

/* Fallback styling for Laravel's default Tailwind pagination markup. */
nav[aria-label="Pagination Navigation"] {
    margin-top: 10px;
}

nav[aria-label="Pagination Navigation"] .inline-flex {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

nav[aria-label="Pagination Navigation"] a.inline-flex,
nav[aria-label="Pagination Navigation"] span.inline-flex {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: color-mix(in srgb, var(--card) 90%, transparent);
    color: var(--ink);
    font-size: 0.86rem;
    line-height: 1.1;
    text-decoration: none;
}

nav[aria-label="Pagination Navigation"] a.inline-flex:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
    background: color-mix(in srgb, var(--card) 82%, var(--brand-soft));
}

nav[aria-label="Pagination Navigation"] [aria-current="page"] > span.inline-flex {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: color-mix(in srgb, var(--accent) 78%, var(--ink));
    font-weight: 800;
}

nav[aria-label="Pagination Navigation"] svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

@media (max-width: 639px) {
    nav[aria-label="Pagination Navigation"] .sm\:flex-1,
    nav[aria-label="Pagination Navigation"] .sm\:flex {
        display: none !important;
    }

    nav[aria-label="Pagination Navigation"] .sm\:hidden {
        display: flex !important;
        gap: 8px;
        align-items: center;
        justify-content: space-between;
    }
}

@media (min-width: 640px) {
    nav[aria-label="Pagination Navigation"] .sm\:hidden {
        display: none !important;
    }

    nav[aria-label="Pagination Navigation"] .sm\:flex {
        display: flex !important;
    }

    nav[aria-label="Pagination Navigation"] .sm\:flex-1 {
        flex: 1 1 auto;
        gap: 10px;
        align-items: center;
        justify-content: space-between;
    }
}

@media (max-width: 1080px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    body.mobile-nav-ready {
        width: 100%;
        overflow-x: hidden;
    }

    body.mobile-nav-ready .layout {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body.mobile-nav-ready .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1300;
        width: min(320px, 86vw);
        height: 100vh;
        padding-top: 0;
        overflow: hidden;
        overscroll-behavior: contain;
        transform: translateX(calc(-100% - 16px));
        transition: transform 0.24s ease;
        box-shadow: 0 16px 44px rgba(3, 8, 13, 0.52);
    }

    body.mobile-nav-ready.mobile-nav-open .sidebar {
        transform: translateX(0);
    }

    body.mobile-nav-ready.mobile-nav-open {
        overflow: hidden;
    }

    body.mobile-nav-ready .mobile-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1200;
        border: 0;
        background: rgba(5, 16, 27, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.mobile-nav-ready.mobile-nav-open .mobile-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-nav-ready .mobile-nav-toggle,
    body.mobile-nav-ready .mobile-nav-close {
        display: inline-flex;
    }

    body.mobile-nav-ready .mobile-nav-header {
        display: flex;
        justify-content: flex-end;
        position: sticky;
        top: 0;
        z-index: 2;
        margin: 0 0 10px;
        padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
        background: color-mix(in srgb, var(--sidebar) 86%, #05111b 14%);
        border-bottom: 1px solid rgba(145, 178, 206, 0.2);
    }

    body.mobile-nav-ready .mobile-nav-close {
        min-width: 118px;
        border-color: rgba(145, 178, 206, 0.45);
        color: var(--sidebar-ink);
        background: rgba(15, 36, 58, 0.6);
    }

    body.mobile-nav-ready .main {
        padding: 16px;
        min-width: 0;
        overflow-x: hidden;
    }

    body.mobile-nav-ready .topbar {
        flex-wrap: wrap;
        min-width: 0;
    }

    body.mobile-nav-ready .top-actions {
        width: 100%;
        justify-content: flex-end;
        min-width: 0;
    }

    body.mobile-nav-ready .mobile-nav-toggle {
        min-width: 92px;
    }

    body.mobile-nav-ready .panel,
    body.mobile-nav-ready .table-wrap,
    body.mobile-nav-ready form,
    body.mobile-nav-ready .notice {
        min-width: 0;
        max-width: 100%;
    }

    body.mobile-nav-ready .main table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-nav-ready .sidebar-main {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding-right: 4px;
    }

    body.mobile-nav-ready .sidebar-footer {
        margin-top: 10px;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    }

    .user-email {
        display: none;
    }

    .two-up {
        grid-template-columns: 1fr;
    }

    .slider-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* ============================================================
   TNGNET theme (per-user, opt-in via Profile > Appearance).
   Tokens pulled from tngnet.com's real production stylesheet, not
   guessed: --bg:#0b0f14, --green:#2A8C4A, --blue:#0F4C81, border
   rgba(255,255,255,.08). The real site has no
   light mode (dark is the brand's default), so dark uses those values
   verbatim; light is an extrapolated secondary built to the same
   two-hue rule. Menu structure (utility bar + top mast nav, no
   sidebar) is lifted from TNGNET's own product-page markup.
   ============================================================ */
:root[data-brand="tngnet"] {
    --bg: #eef2f2;
    --bg-overlay: none;
    --ink: #0a1210;
    --muted: #566360;
    --brand: #227a41;
    --brand-strong: #185c30;
    --brand-soft: rgba(34, 122, 65, 0.12);
    --accent: #0f4c81;
    --warn: #a8631c;
    --danger: #b3392f;
    --line: #dbe3e0;
    --line-strong: #c7d1cd;
    --card: #ffffff;
    --card-soft: #ffffff;
    --shadow: 0 10px 24px rgba(10, 18, 16, 0.06);
    --sidebar: #0b0f14;
    --sidebar-soft: rgba(255, 255, 255, 0.08);
    --sidebar-ink: #f2fbff;
    --btn-fg: #001114;
}
:root[data-brand="tngnet"][data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b0f14;
    --bg-overlay: none;
    --ink: #f2fbff;
    --muted: #9fb0bf;
    --brand: #2A8C4A;
    --brand-strong: #3aa85c;
    --brand-soft: rgba(42, 140, 74, 0.2);
    --accent: #3b7ec7;
    --warn: #d69a52;
    --danger: #de766a;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --card: #0f1520;
    --card-soft: #0f1520;
    --shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    --sidebar: #060a0d;
    --sidebar-soft: rgba(255, 255, 255, 0.08);
    --sidebar-ink: #f2fbff;
    --btn-fg: #001114;
}
@media (prefers-color-scheme: dark) {
    :root[data-brand="tngnet"]:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0b0f14;
        --bg-overlay: none;
        --ink: #f2fbff;
        --muted: #9fb0bf;
        --brand: #2A8C4A;
        --brand-strong: #3aa85c;
        --brand-soft: rgba(42, 140, 74, 0.2);
        --accent: #3b7ec7;
        --warn: #d69a52;
        --danger: #de766a;
        --line: rgba(255, 255, 255, 0.08);
        --line-strong: rgba(255, 255, 255, 0.14);
        --card: #0f1520;
        --card-soft: #0f1520;
        --shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
        --sidebar: #060a0d;
        --sidebar-soft: rgba(255, 255, 255, 0.08);
        --sidebar-ink: #f2fbff;
        --btn-fg: #001114;
    }
}

/* Sharp corners: TNGNET's real site uses square/minimal radii throughout,
   a deliberate contrast to Classic's rounded 10-14px. Zeroing radius is
   always visually safe (never causes clipping/overflow), so this is a
   blanket override across the shared components every page already uses. */
[data-brand="tngnet"] .panel,
[data-brand="tngnet"] .sub-panel,
[data-brand="tngnet"] .btn,
[data-brand="tngnet"] .stat,
[data-brand="tngnet"] .notice,
[data-brand="tngnet"] .modal-card,
[data-brand="tngnet"] input,
[data-brand="tngnet"] select,
[data-brand="tngnet"] textarea {
    border-radius: 0;
}
[data-brand="tngnet"] .btn {
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    color: var(--btn-fg);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent);
}
[data-brand="tngnet"] .btn.secondary,
[data-brand="tngnet"] .btn.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}
[data-brand="tngnet"] .btn.warn {
    background: var(--warn);
    color: #fff;
    box-shadow: none;
}
[data-brand="tngnet"] .btn.danger {
    background: var(--danger);
    color: #fff;
    box-shadow: none;
}

/* Classic's decorative fixed background image/tint doesn't exist in
   TNGNET's real design language (flat --bg only) — suppress it. */
[data-brand="tngnet"] body::before,
[data-brand="tngnet"] body::after {
    display: none;
}

/* -- top-nav shell: replaces the sidebar entirely for this theme -- */
.tng-utility {
    background: var(--sidebar);
    color: var(--sidebar-ink);
    opacity: 0.72;
    font-size: 0.72rem;
    padding: 6px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.tng-utility a {
    color: inherit;
    text-decoration: none;
}
.tng-utility a:hover {
    opacity: 0.8;
}
.tng-utility nav {
    display: flex;
    gap: 18px;
}
.tng-mast {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 40;
}
.tng-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    color: var(--ink);
    flex-shrink: 0;
}
.tng-brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2A8C4A, #0F4C81);
    flex: 0 0 auto;
}
.tng-primary-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.tng-primary-nav a {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 600;
    border-radius: 0;
}
.tng-primary-nav a:hover {
    color: var(--ink);
}
.tng-primary-nav a.active {
    color: var(--ink);
    background: var(--brand-soft);
}
.tng-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.tng-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    color: #fff;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
    overflow: hidden;
    flex-shrink: 0;
    text-decoration: none;
}
.tng-identity-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 28px;
    background: color-mix(in srgb, var(--card) 60%, var(--bg));
    border-bottom: 1px solid var(--line);
}
.tng-identity-strip .title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.tng-identity-strip .subtitle {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}
.tng-main {
    padding: 24px 28px 42px;
}

/* -- Profile > Appearance theme picker -- */
.theme-picker {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    width: 140px;
}
.theme-option.is-selected {
    border-color: var(--brand);
}
.theme-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.theme-option-swatch {
    width: 100%;
    height: 64px;
    border-radius: 8px;
    display: flex;
    overflow: hidden;
    border: 1px solid var(--line);
}
.theme-option-swatch span:first-child {
    width: 30%;
    height: 100%;
}
.theme-option-swatch span:nth-child(2) {
    flex: 1;
    height: 40%;
}
.theme-option-swatch span:nth-child(3) {
    flex: 1;
    height: 60%;
    align-self: flex-end;
}
.theme-swatch-classic {
    background: #edf3f9;
}
.theme-swatch-classic span:first-child { background: #0f243a; }
.theme-swatch-classic span:nth-child(2) { background: #ffffff; border: 1px solid #d7e2ec; }
.theme-swatch-classic span:nth-child(3) { background: #1d8f7e; }
.theme-swatch-tngnet {
    background: #0b0f14;
    border-radius: 0;
}
.theme-swatch-tngnet span:first-child { background: #060a0d; }
.theme-swatch-tngnet span:nth-child(2) { background: #0f1520; }
.theme-swatch-tngnet span:nth-child(3) { background: linear-gradient(135deg, #2A8C4A, #0F4C81); }
.theme-option-label {
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 1080px) {
    .tng-utility { display: none; }
    .tng-primary-nav { order: 3; width: 100%; }
}

/* ============================================================
   Stacked settings list (admin Settings page) — subsections with every
   option on its own full-width row, instead of card panels containing a
   multi-column field grid. Theme-agnostic: no box/shadow/border, just
   dividers, so it reads the same in Classic and TNGNET.
   ============================================================ */
.settings-section {
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
}
.settings-section:first-child {
    padding-top: 0;
}
.settings-section:last-child {
    border-bottom: 0;
}
.settings-section > h3 {
    margin: 0 0 4px;
}
.settings-section > p.small {
    margin: 0 0 18px;
}
.settings-field {
    padding: 16px 0;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.settings-section > .settings-field:first-of-type {
    border-top: 0;
    padding-top: 0;
}
.settings-field > label {
    font-weight: 700;
    color: var(--ink);
}
.settings-field > input,
.settings-field > select {
    max-width: 480px;
}
.settings-field-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.settings-field-actions input {
    flex: 1;
    max-width: 420px;
}
.settings-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.settings-checkbox-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
    color: var(--ink);
}
.settings-checkbox-row input {
    width: auto;
}

/* --- B1 (2026-10-14) ----------------------------------------------------
   Class-based replacements for inline styles the CSP drops (D9), plus the
   Clean Block theme fixes from R1-31/R1-32. Append-only block. */

/* Checkbox-label convention as classes (CLAUDE.md "Checkbox labels"): the
   inline style="" version is ignored under the CSP, so new markup uses these. */
.form-check-cell {
    align-self: end;
}
.form-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--ink);
    font-weight: 600;
}
.form-check-label input[type="checkbox"] {
    width: auto;
}

/* Usage bars whose width is applied from data-pct via CSSOM start empty
   instead of rendering 100% full when the script hasn't run (R1-05b). */
.usage-fill[data-pct] {
    width: 0;
}

/* noVNC console iframe (R1-05c): was style="width:100%;height:70vh;..." and
   fell back to the browser's 300x150 default. */
.console-title {
    margin-top: 0;
}
.console-frame {
    display: block;
    width: 100%;
    height: 70vh;
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #000;
}

/* Deploy wizard card spacing (R1-06): were style="margin..." inside innerHTML. */
.pack-card-network {
    margin: 2px 0 6px;
}
.pack-card-usage-label {
    margin: 2px 0 8px;
}
.host-card-flags {
    margin-top: 8px;
}

/* Admin users: "Delete is disabled" note (was inline style). */
.user-delete-note {
    margin-top: 6px;
    color: var(--warn);
}

/* Admin infrastructure server stats with <x-icon> instead of emoji (R1-29). */
.resource-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}
.resource-stat .icon-svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--muted);
}

/* R1-31: in Clean Block, `[data-brand="tngnet"] .btn.secondary` (0,3,0) beat
   `.choice-btn.choice-active` (0,2,0), so the selected wizard/timeframe
   choice looked identical to the unselected ones. */
[data-brand="tngnet"] .btn.choice-btn.choice-active,
[data-brand="tngnet"] .choice-btn.choice-active {
    background: var(--brand-soft);
    color: var(--ink);
    border-color: var(--brand);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 45%, transparent);
}

/* R1-32: Classic-only hard-coded colours, re-tinted for Clean Block. */
[data-brand="tngnet"] .modal-backdrop {
    background: rgba(10, 18, 16, 0.55);
}
[data-brand="tngnet"] .panel-hero,
[data-brand="tngnet"] .pack-panel,
[data-brand="tngnet"] .pack-edit-card {
    border-color: var(--line-strong);
}
[data-brand="tngnet"] .badge-unavailable {
    background: color-mix(in srgb, var(--muted) 22%, var(--card));
    color: var(--ink);
}

/* --- F7: admin organizations page, org billing panel, VAT forms --- */
.f7-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.f7-heading-row > h3,
.f7-heading-row > h4,
.f7-panel-title {
    margin-top: 0;
}
.f7-sub-title {
    margin: 0 0 10px;
}
.f7-filter-bar {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.f7-filter-bar > div {
    min-width: 160px;
}
.f7-stat-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin: 6px 0 0;
}
.f7-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
}
.f7-amount-negative {
    color: var(--danger);
}
.f7-uppercase {
    text-transform: uppercase;
}
.f7-note {
    margin-top: 8px;
}
.f7-spaced {
    margin-top: 12px;
}
.f7-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.f7-pager-links {
    display: flex;
    align-items: center;
    gap: 12px;
}
.f7-action-cell {
    align-self: end;
}
/* F7: cursor for clickable rows via CSS, since style="" attributes are CSP-blocked (D9). */
tr[data-href] {
    cursor: pointer;
}

/* --- F6: org selector, org invitations, org page helpers (CSP-safe: no inline styles) --- */
.org-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.org-switcher-label {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
}
.org-switcher-select {
    width: auto;
    min-width: 160px;
    max-width: 240px;
}
.org-switcher-submit--js {
    display: none;
}
.context-note {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--muted);
}
.context-note strong {
    color: var(--ink);
}
.panel-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.panel-heading-row h3,
.panel-heading-row h4 {
    margin: 0;
}
.inline-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.inline-actions form {
    margin: 0;
}
.form-grid .checkbox-cell {
    align-self: end;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.checkbox-label input[type="checkbox"] {
    width: auto;
}
.role-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.badge-chip-button {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.badge-chip-button svg {
    width: 12px;
    height: 12px;
}
.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 6px 6px 0;
}
.form-help {
    margin-top: 8px;
}
.subheading {
    margin: 16px 0 8px;
}
@media (max-width: 720px) {
    .org-switcher-label {
        display: none;
    }
    .org-switcher-select {
        min-width: 120px;
        max-width: 160px;
    }
}
.panel-title {
    margin-top: 0;
}
.member-role-editor {
    margin-top: 6px;
}
.member-role-editor summary {
    cursor: pointer;
}
.member-role-editor form {
    margin-top: 8px;
}
/* The inline style="cursor:pointer" on data-href rows is dropped by the CSP (D9). */
tr[data-href] {
    cursor: pointer;
}

/* --- F1: two-factor authentication (recovery codes, QR setup, challenge) --- */
.panel-heading-flush {
    margin-top: 0;
}
.sub-panel-heading {
    margin: 0 0 10px;
}
.notice.warn {
    background: color-mix(in srgb, var(--warn) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
    color: color-mix(in srgb, var(--warn) 72%, var(--ink));
}
.recovery-codes-panel {
    margin-bottom: 12px;
    border-color: var(--warn);
}
.recovery-code-list {
    list-style: none;
    margin: 10px 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px 16px;
}
.recovery-code-list code,
.two-factor-secret {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    letter-spacing: 0.04em;
}
.two-factor-secret {
    word-break: break-all;
    margin: 6px 0;
}
.recovery-code-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.recovery-code-actions .btn {
    font-size: 13px;
    text-decoration: none;
}
.two-factor-setup-grid {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.two-factor-setup-manual {
    flex: 1;
    min-width: 220px;
}
.two-factor-uri {
    word-break: break-all;
    margin-top: 6px;
}
.qr-code-wrap {
    background: #ffffff;
    border-radius: 8px;
    padding: 4px;
    line-height: 0;
    flex: none;
}
.qr-code-wrap svg {
    width: 196px;
    height: 196px;
    max-width: 100%;
}
.two-factor-challenge-field {
    margin-bottom: 10px;
}
.btn.btn-block {
    width: 100%;
}
.two-factor-recovery {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}
.two-factor-recovery summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 8px;
}
.two-factor-cancel-form {
    margin-top: 10px;
}
.admin-two-factor-reset {
    margin-top: 10px;
}
/* --- end F1 --- */

/* ============================================================
   B2 utilities (D9, 2026-10-15)
   The CSP (style-src 'self' 'nonce-…', no 'unsafe-inline') makes browsers
   ignore every style="…" attribute, so views use these classes instead.
   Guide: docs/agents/B2-guide.md.

   - Utilities are prefixed `u-`, are single-purpose, and use !important
     on purpose: they replace inline styles, which used to beat every
     selector, so they must still win over rules like `.panel h3` or
     `input { width:100% }`.
   - Order matters for shorthand composition: `u-m-0` comes before the
     side-specific margins, so `class="u-m-0 u-mb-8"` == `margin:0 0 8px`.
   - Colours only use theme variables, so Classic and Clean Block (light and
     dark) all work.
   - Per-area one-offs go in their own blocks below with `adm-` (admin) or
     `usr-` (user/auth/profile) prefixes, not here.
   ============================================================ */

/* -- margin: all sides first, then individual sides -- */
.u-m-0 { margin: 0 !important; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-4 { margin-top: 4px !important; }
.u-mt-6 { margin-top: 6px !important; }
.u-mt-8 { margin-top: 8px !important; }
.u-mt-10 { margin-top: 10px !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-mt-14 { margin-top: 14px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-mt-auto { margin-top: auto !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-4 { margin-bottom: 4px !important; }
.u-mb-6 { margin-bottom: 6px !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-mb-10 { margin-bottom: 10px !important; }
.u-mb-12 { margin-bottom: 12px !important; }
.u-mb-14 { margin-bottom: 14px !important; }
.u-mb-18 { margin-bottom: 18px !important; }
.u-mr-8 { margin-right: 8px !important; }

/* -- padding -- */
.u-p-0 { padding: 0 !important; }
.u-p-14 { padding: 14px !important; }
.u-py-6 { padding-top: 6px !important; padding-bottom: 6px !important; }
.u-py-8 { padding-top: 8px !important; padding-bottom: 8px !important; }
.u-pt-8 { padding-top: 8px !important; }
.u-pt-10 { padding-top: 10px !important; }

/* -- display / flex / grid -- */
.u-block { display: block !important; }
.u-inline-block { display: inline-block !important; }
.u-flex { display: flex !important; }
.u-inline-flex { display: inline-flex !important; }
.u-hidden { display: none !important; }
.u-flex-col { flex-direction: column !important; }
.u-flex-wrap { flex-wrap: wrap !important; }
.u-flex-1 { flex: 1 !important; }
.u-items-center { align-items: center !important; }
.u-items-start { align-items: flex-start !important; }
.u-items-end { align-items: flex-end !important; }
.u-justify-between { justify-content: space-between !important; }
.u-justify-end { justify-content: flex-end !important; }
.u-justify-center { justify-content: center !important; }
.u-self-end { align-self: end !important; }
.u-self-center { align-self: center !important; }
.u-gap-4 { gap: 4px !important; }
.u-gap-6 { gap: 6px !important; }
.u-gap-8 { gap: 8px !important; }
.u-gap-10 { gap: 10px !important; }
.u-gap-12 { gap: 12px !important; }
.u-gap-16 { gap: 16px !important; }
.u-grid-full { grid-column: 1 / -1 !important; }

/* -- widths -- */
.u-w-auto { width: auto !important; }
.u-w-full { width: 100% !important; }
.u-w-90 { width: 90px !important; }
.u-w-180 { width: 180px !important; }
.u-minw-0 { min-width: 0 !important; }
.u-minw-220 { min-width: 220px !important; }
.u-minw-320 { min-width: 320px !important; }
.u-maxw-90 { max-width: 90px !important; }
.u-maxw-110 { max-width: 110px !important; }
.u-maxw-120 { max-width: 120px !important; }
.u-maxw-140 { max-width: 140px !important; }
.u-maxw-160 { max-width: 160px !important; }
.u-maxw-320 { max-width: 320px !important; }
.u-maxw-420 { max-width: 420px !important; }
.u-maxw-760 { max-width: 760px !important; }

/* -- text -- */
.u-text-left { text-align: left !important; }
.u-text-center { text-align: center !important; }
.u-text-right { text-align: right !important; }
.u-nowrap { white-space: nowrap !important; }
.u-pre-wrap { white-space: pre-wrap !important; }
.u-break-all { word-break: break-all !important; }
.u-fw-400 { font-weight: 400 !important; }
.u-fw-600 { font-weight: 600 !important; }
.u-fw-700 { font-weight: 700 !important; }
.u-fw-800 { font-weight: 800 !important; }
.u-fs-sm { font-size: 0.84rem !important; }
.u-fs-1 { font-size: 1rem !important; }
.u-fs-11 { font-size: 1.1rem !important; }
.u-uppercase { text-transform: uppercase !important; }
.u-mono { font-family: "JetBrains Mono", "Cascadia Code", monospace !important; }
.u-text-ink { color: var(--ink) !important; }
.u-text-muted { color: var(--muted) !important; }
.u-text-brand { color: var(--brand) !important; }
.u-text-accent { color: var(--accent) !important; }
.u-text-warn { color: var(--warn) !important; }
.u-text-danger { color: var(--danger) !important; }
/* muted + small in one go (same look as the existing .small) */
.u-muted-sm { color: var(--muted) !important; font-size: 0.84rem !important; }

/* -- borders / misc -- */
.u-border-top { border-top: 1px solid var(--line) !important; }
.u-border-top-dashed { border-top: 1px dashed var(--line-strong) !important; }
.u-border-bottom-dashed { border-bottom: 1px dashed var(--line-strong) !important; }
.u-border-line { border-color: var(--line) !important; }
.u-rounded-8 { border-radius: 8px !important; }
.u-rounded-12 { border-radius: 12px !important; }
.u-cursor-pointer { cursor: pointer !important; }

/* -- B2 components: repeated multi-declaration patterns --
   No !important here, so a u- utility can still adjust them
   (e.g. `row-cluster u-gap-12`). */

/* display:flex; align-items:center; gap:8px; flex-wrap:wrap
   (button groups, chip lists, inline filter bars) */
.row-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.row-cluster > form {
    margin: 0;
}

/* display:flex; justify-content:space-between; align-items:center; gap:12px;
   flex-wrap:wrap (panel header: title left, actions right) */
.row-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* display:flex; align-items:center; gap:8px; justify-content:flex-end;
   margin-bottom:10px (right-aligned action bar above a table) */
.row-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

/* display:flex; align-items:center; justify-content:space-between; gap:8px;
   padding:6px 0; border-bottom:1px dashed var(--line-strong) (key/value list rows) */
.row-dashed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--line-strong);
}

/* Fixed-height chart placeholder/box (VM usage graphs):
   width:100%; height:160px; background:color-mix(...); border-radius:8px */
.chart-box {
    display: block;
    width: 100%;
    height: 160px;
    background: color-mix(in srgb, var(--line) 30%, transparent);
    border-radius: 8px;
}

/* Card whose footer sticks to the bottom (flex column, min-height:150px). */
.stack-card {
    display: flex;
    flex-direction: column;
    min-height: 150px;
}
.stack-card-foot {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

/* Elements sized by panel.js from data-width-pct start at 0, not full width,
   if the script hasn't run (mirrors .usage-fill[data-pct] from B1). */
[data-width-pct] {
    width: 0;
}

/* Sidebar "Return To Admin" block in layouts/app (was inline styles). */
.sidebar-help-group,
.sidebar-impersonation-form {
    margin-bottom: 10px;
}
.sidebar-impersonation-form .btn {
    width: 100%;
}

/* --- end B2 utilities ---
   Per-area blocks for one-off styles (append below, keep the prefixes):
   - `adm-*`  admin views (resources/views/admin/**)
   - `usr-*`  user/auth/profile views
   ------------------------------------------------------------ */

/* === B2 area: admin-1 (adm-<page>-*) ===================================
   Converter for admin group 1 appends ONLY between these two markers. */

/* === end B2 area: admin-1 === */


/* === B2 area: admin-2 (adm-<page>-*) ===================================
   Converter for admin group 2 appends ONLY between these two markers. */

/* admin/deployment-errors: the search field spans the first three filter
   columns (was an inline grid-column:1/4). */
.adm-deperr-span-3 {
    grid-column: 1 / 4 !important;
}

/* === end B2 area: admin-2 === */


/* === B2 area: user/auth/profile (usr-<page>-*) =========================
   Converter for the user/auth/profile group appends ONLY between these two
   markers. */

/* user/vms/create: #wizard-custom-limit-warning starts hidden (was an inline
   display:none). Deliberately NOT !important and NOT the `hidden` attribute
   ([hidden] is display:none !important): the wizard script toggles it with
   CSSOM `style.display = 'block' | 'none'`, which must be able to win. */
.usr-create-limit-warning {
    display: none;
}

/* user/vms/show usage-history SVG charts. Same declarations as the old
   inline style; not `.chart-box`, which adds display:block and so drops the
   inline-SVG baseline gap the original layout had (about 6px under the legend). */
.usr-vmshow-chart {
    width: 100%;
    height: 160px;
    background: color-mix(in srgb, var(--line) 30%, transparent);
    border-radius: 8px;
}

/* user/vms/create "Current Pack Usage" bars (#wizard-usage-*-fill): start at
   0 width (was an inline width:0%), then the wizard script sets style.width via
   CSSOM. Deliberately not data-pct="0": panel.js's MutationObserver applies
   data-pct to parser-inserted nodes and would reset a width the wizard set
   synchronously in applyInitialState() (e.g. a pack preselected via ?pack_id=)
   back to 0%. Not !important, so the wizard's CSSOM style.width still wins. */
.usage-fill.usr-create-usage-fill {
    width: 0;
}

/* === end B2 area: user/auth/profile === */

/* === Clean Block: square corners everywhere (2026-10-16) =================
   The Clean Block theme is square. Earlier tngnet rules only zeroed a fixed
   list (.panel, .btn, inputs...), so cards, chips, badges, bars, the login
   card and the u-rounded-* utilities kept their radius. !important is needed
   to beat the u-rounded-* utilities. Exceptions stay round on purpose:
   circles (avatars, spinner, status dot) and the brand logo marks.
   tests/Feature/UiCleanBlockSquareCornersTest.php fails if a new rounded rule
   isn't covered here. */
[data-brand="tngnet"] .nav-item,
[data-brand="tngnet"] .user-block,
[data-brand="tngnet"] .avatar-crop-wrap,
[data-brand="tngnet"] .panel,
[data-brand="tngnet"] .modal-card,
[data-brand="tngnet"] .sub-panel,
[data-brand="tngnet"] .stat,
[data-brand="tngnet"] input,
[data-brand="tngnet"] select,
[data-brand="tngnet"] textarea,
[data-brand="tngnet"] .tag-multi-control,
[data-brand="tngnet"] .tag-multi-menu,
[data-brand="tngnet"] .tag-menu-item,
[data-brand="tngnet"] .hv-card,
[data-brand="tngnet"] .hv-mapping-chip,
[data-brand="tngnet"] button,
[data-brand="tngnet"] .btn,
[data-brand="tngnet"] .badge,
[data-brand="tngnet"] .choice-empty,
[data-brand="tngnet"] .choice-card,
[data-brand="tngnet"] .pack-side-flag,
[data-brand="tngnet"] .pack-country-chip,
[data-brand="tngnet"] .os-card-logo-wrap,
[data-brand="tngnet"] .os-card-logo,
[data-brand="tngnet"] .os-image-logo,
[data-brand="tngnet"] .usage-track,
[data-brand="tngnet"] .usage-fill,
[data-brand="tngnet"] .notice,
[data-brand="tngnet"] .login-card,
[data-brand="tngnet"] .error-page-card,
[data-brand="tngnet"] nav[aria-label="Pagination Navigation"] a.inline-flex,
[data-brand="tngnet"] nav[aria-label="Pagination Navigation"] span.inline-flex,
[data-brand="tngnet"] .theme-option,
[data-brand="tngnet"] .theme-option-swatch,
[data-brand="tngnet"] .console-frame,
[data-brand="tngnet"] .qr-code-wrap,
[data-brand="tngnet"] .u-rounded-8,
[data-brand="tngnet"] .u-rounded-12,
[data-brand="tngnet"] .chart-box,
[data-brand="tngnet"] .usr-vmshow-chart,
[data-brand="tngnet"] table,
[data-brand="tngnet"] th,
[data-brand="tngnet"] td {
    border-radius: 0 !important;
}

/* === Content width cap on wide screens (2026-10-16) =======================
   On wide monitors the content stops at a centred 1600px column instead of
   stretching edge to edge (best viewed on 1920x1080). Bar backgrounds stay
   full width; only their side padding grows so their contents line up with
   the page content. Below the breakpoints nothing changes. */
@media (min-width: 1657px) { /* 1600px + 2 x 28px padding */
    .tng-utility,
    .tng-mast,
    .tng-identity-strip,
    .tng-main {
        padding-left: calc((100% - 1600px) / 2);
        padding-right: calc((100% - 1600px) / 2);
    }
}
@media (min-width: 1937px) { /* Classic: 280px sidebar + 1600px + 2 x 28px */
    .main {
        padding-left: max(28px, calc((100% - 1600px) / 2));
        padding-right: max(28px, calc((100% - 1600px) / 2));
    }
}

/* === Clean Block masthead: org selector on its own row (2026-10-16) =======
   The "Viewing" org selector used to sit inside .tng-tools, which made the
   tools group too wide and wrapped it onto a second line. It is now a direct
   child of .tng-mast on its own full-width row; the nav is pushed right so it
   sits next to the tools (Return To Admin, Dark Mode, avatar, Logout). */
.tng-primary-nav {
    margin-left: auto;
}
.tng-mast > .org-switcher {
    order: 10;
    flex-basis: 100%;
}

/* === PAY1: credit top-up, mock provider, credit packs (pay1-*) (2026-10-16) ==
   No rounded corners here on purpose (Clean Block is square, and Classic
   reuses .panel/.badge for its rounding). Theme variables only. */
.pay1-mock-banner {
    font-weight: 700;
}
.pay1-test-badge {
    letter-spacing: 0.06em;
    margin-left: 6px;
}
.pay1-pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.pay1-pack-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line-strong);
    background: var(--card);
}
.pay1-pack-card .pay1-pack-name {
    font-size: 1.05rem;
    font-weight: 800;
}
.pay1-pack-card form {
    margin-top: auto;
}
.pay1-breakdown {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.pay1-breakdown th,
.pay1-breakdown td {
    padding: 4px 0;
    border-bottom: 1px dashed var(--line-strong);
    text-align: left;
}
.pay1-breakdown td {
    text-align: right;
    font-weight: 700;
}
.pay1-breakdown tr.pay1-total th,
.pay1-breakdown tr.pay1-total td {
    border-bottom: 0;
    font-size: 1rem;
    color: var(--brand);
}
.pay1-test-label {
    padding: 14px;
    border: 2px dashed var(--warn);
    color: var(--warn);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
}
.pay1-checkout {
    max-width: 560px;
}
.pay1-checkout-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
/* === end PAY1 === */

/* === Admin nav groups (2026-10-16) ========================================
   "Products" and "System" dropdowns in the Clean Block top nav (native
   <details>, closed by panel.js initNavDropdowns), and section labels in the
   Classic sidebar. Square corners (Clean Block). */
.tng-nav-dropdown {
    position: relative;
}
.tng-nav-dropdown > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: 0.87rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.tng-nav-dropdown > summary::-webkit-details-marker {
    display: none;
}
.tng-nav-dropdown > summary::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.15s ease;
}
.tng-nav-dropdown[open] > summary::after {
    transform: rotate(180deg);
}
.tng-nav-dropdown > summary:hover,
.tng-nav-dropdown[open] > summary {
    color: var(--ink);
}
.tng-nav-dropdown > summary.active {
    color: var(--ink);
    background: var(--brand-soft);
}
.tng-nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 60;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}
.tng-primary-nav .tng-nav-menu a {
    padding: 9px 16px;
    white-space: nowrap;
}
.tng-primary-nav .tng-nav-menu a:hover {
    background: var(--brand-soft);
}
.nav-section-label {
    margin: 14px 12px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* === D-DNS (2026-10-19): reverse DNS admin page + VM panel === */
.ddns-wide { grid-column: 1 / -1; }
#reverse-dns form input[type="text"] { min-width: 0; flex: 1; }

/* === UI-TABS (2026-10-20): VM detail page server-side tab bar ============
   resources/views/user/vms/show.blade.php. Tabs are plain ?tab=<key> links;
   the active one carries aria-current="page". Square on purpose (no
   border-radius), so Clean Block needs no override. Wraps on narrow screens. */
.vm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 14px;
    border-bottom: 2px solid var(--line-strong);
}
.vm-tab {
    display: inline-block;
    padding: 9px 14px;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.vm-tab:hover,
.vm-tab:focus-visible {
    color: var(--ink);
    background: var(--brand-soft);
}
.vm-tab.is-active {
    color: var(--brand-strong);
    border-bottom-color: var(--brand);
}
.vm-danger-zone {
    border-color: var(--danger);
}
.vm-danger-zone h4 {
    color: var(--danger);
}
@media (max-width: 640px) {
    .vm-tab { flex: 1 1 45%; text-align: center; white-space: normal; }
}

/* === VM summary: facts + live console preview (2026-10-20) ================
   Two columns on the VM Summary tab (stacks on narrow screens). The preview
   iframe is view-only: pointer-events none + tabindex -1, so it can't take
   clicks or keyboard focus even if noVNC ignores view_only. Square corners. */
.vm-summary-grid {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) minmax(320px, 3fr);
    gap: 16px;
    align-items: start;
}
@media (max-width: 980px) {
    .vm-summary-grid {
        grid-template-columns: 1fr;
    }
}
.vm-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: baseline;
    gap: 8px 16px;
    margin: 0;
}
.vm-facts dt {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}
.vm-facts dd {
    margin: 0;
    color: var(--ink);
    word-break: break-word;
}
.vm-console-preview-frame-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #000;
    border: 1px solid var(--line);
    overflow: hidden;
}
.vm-console-preview-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}
.vm-console-preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    padding: 16px;
    text-align: center;
    color: var(--muted);
    background: color-mix(in srgb, var(--card) 60%, var(--bg));
    border: 1px dashed var(--line);
}

/* === Form grid alignment (2026-10-22) =====================================
   A label that wraps to two lines pushed its input below the neighbours'.
   Each grid cell is a column with its content at the bottom, so inputs in a
   row always line up. Full-width cells and checkbox cells keep their layout. */
.form-grid > div:not(.u-grid-full):not(.form-check-cell):not(.checkbox-cell):not(.action-cell):not([class*="-actions"]) {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.form-grid input[type="file"] {
    padding-top: 6px;
    padding-bottom: 6px;
}
.form-grid input[type="file"]::file-selector-button {
    padding: 4px 10px;
    margin-right: 8px;
}

/* === Admin users: inactive accounts stand out (2026-10-22) ================
   Muted row with a warning-tinted left edge; the status badge is red. */
tr.user-row-inactive > td {
    background: color-mix(in srgb, var(--warn) 7%, transparent);
    color: var(--muted);
}
tr.user-row-inactive > td:first-child {
    box-shadow: inset 3px 0 0 var(--warn);
}

/* --- LIVE (2026-10-22): live VM status (panel.js initLiveVmStatus) --- */
.vm-live-pending {
    display: inline-block;
    margin-left: 6px;
    color: var(--muted);
    font-style: italic;
    white-space: nowrap;
}
.vm-live-pending[hidden] {
    display: none;
}
[data-vm-action]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
/* --- end LIVE --- */

/* === Help tip (2026-10-23): circled "?" with a hover/focus tooltip ========
   <x-help-tip text="..."/>. CSS only (content: attr(data-tip)), CSP-safe.
   Square, like Clean Block. */
.help-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 4px;
    color: var(--muted);
    cursor: help;
}
.help-tip .icon-svg {
    width: 15px;
    height: 15px;
}
.help-tip:hover,
.help-tip:focus-visible {
    color: var(--ink);
    outline: none;
}
.help-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: -8px;
    z-index: 70;
    width: max-content;
    max-width: 280px;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    text-transform: none;
    white-space: normal;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease;
}
.help-tip:hover::after,
.help-tip:focus::after {
    opacity: 1;
    visibility: visible;
}

/* === Save/apply buttons on the right (2026-10-23) =========================
   The final submit button of a block form sits on the right. Inline action
   forms (power buttons, row actions) and forms inside table cells keep their
   position. */
form:not(.inline) > button[type="submit"]:last-child {
    display: block;
    width: fit-content;
    margin-left: auto;
}
/* Button-only forms (row actions like Delete/Impersonate) keep their spot. */
form:not(:has(input:not([type="hidden"]), select, textarea)) > button[type="submit"]:last-child,
.inline-actions form > button[type="submit"]:last-child {
    display: inline-flex;
    margin-left: 0;
}
/* Grid forms whose last cell holds the submit button: put it in the last
   column, right-aligned. */
.form-grid > .action-cell:last-child {
    grid-column: -2 / -1;
    justify-self: end;
    align-self: end;
}

/* === FUNDS: admin credit transfer typeahead (2026-10-23) ==================
   Org/user search dropdown under the From/To fields of the transfer form.
   Square corners (Clean Block). */
.funds-target {
    position: relative;
}
.funds-target-list {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: 100%;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
    max-height: 260px;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: 0;
}
.funds-target-list [role="option"],
.funds-target-list .funds-target-empty {
    padding: 6px 10px;
    cursor: pointer;
}
.funds-target-list .funds-target-empty {
    cursor: default;
}
.funds-target-list [role="option"]:hover,
.funds-target-list [role="option"].is-active {
    background: color-mix(in srgb, var(--card) 80%, var(--accent) 20%);
}

/* === Buttons use the page font (2026-10-26, sweep D2) =====================
   <button class="btn"> fell back to the browser's ~13px system font while
   <a class="btn"> used the page font, so mixed button rows looked uneven. */
button.btn,
input[type="submit"].btn {
    font-family: inherit;
    font-size: inherit;
}

/* === SWEEPFIX: browser sweep D1/D3/D4/D5/D6 (2026-10-26) ====================
   D1: Classic light mode puts the top bar (page title, subtitle, org
       selector label, Dark Mode toggle) and the "Showing <org>" context
       note straight on the dark background image, where --ink (#112338)
       was nearly invisible. Light ink there, as Classic dark mode has.
   D3: Clean Block primary .btn is flat (brand fill, no gradient, no glow)
       with a white label in both modes. Dark mode uses the light-mode brand
       green, since white on the brighter dark-mode --brand is under 4.5:1.
       .secondary/.ghost/.warn/.danger and .choice-active keep their own
       (more specific) rules. Classic is untouched.
   D4: Classic's 1fr main column grew to the table's min-content (13px page
       overflow on Audit at 1440). minmax(0, 1fr) lets .table-wrap scroll.
   D5: the admin Users table squeezed into 500px stacked its actions and
       pack columns into very tall cells; give it a real minimum width so
       it scrolls inside .table-wrap like the other wide tables.
   D6: the org selector may take the free width at narrow sizes. */
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .topbar .title {
    color: #f2f7fc;
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .topbar .subtitle,
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .topbar .org-switcher-label,
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .context-note {
    color: #c9d9e8;
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .context-note strong,
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .context-note a {
    color: #f2f7fc;
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .topbar .btn.ghost {
    color: #f2f7fc;
    border-color: rgba(242, 247, 252, 0.55);
}

:root[data-brand="tngnet"] {
    --btn-primary-bg: var(--brand);
}
:root[data-brand="tngnet"][data-theme="dark"] {
    --btn-primary-bg: #227a41;
}
@media (prefers-color-scheme: dark) {
    :root[data-brand="tngnet"]:not([data-theme="light"]) {
        --btn-primary-bg: #227a41;
    }
}
[data-brand="tngnet"] .btn {
    background: var(--btn-primary-bg);
    color: #fff;
    box-shadow: none;
}

@media (min-width: 1081px) { /* below this the layout is one column already */
    .layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }
}
.main {
    min-width: 0;
}

.adm-users-table {
    min-width: 820px;
}
.adm-users-table th.adm-users-actions {
    min-width: 210px; /* four 40px icon buttons on one line */
}

@media (max-width: 720px) {
    .org-switcher {
        flex: 1 1 auto;
        min-width: 0;
    }
    .org-switcher-select {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }
}

/* === SMALLFIX: Classic light-mode contrast sweep (2026-10-26) ===============
   Follow-up to SWEEPFIX D1. In Classic light mode, content that sits directly
   on the dark background image (outside .panel/cards) used light-mode ink:
   - flash/notices (.notice ok/err/warn, incl. the PAY1 mock-payment banner
     and the VM page's Proxmox error) had translucent tints over the image,
     so their dark text was close to invisible. Give them an opaque card-tinted
     background, so the existing light-mode ink reads as on a card.
   - the server-side tab strips (.vm-tabs on the VM page and admin Settings)
     used --muted / --brand-strong text on the image. Light ink, as D1.
   Scoped to direct children of .main, so notices/tabs inside panels, Classic
   dark mode and Clean Block are unchanged. */
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .notice.ok {
    background: color-mix(in srgb, var(--brand) 12%, var(--card));
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .notice.err {
    background: color-mix(in srgb, var(--danger) 12%, var(--card));
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .notice.warn {
    background: color-mix(in srgb, var(--warn) 14%, var(--card));
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .notice:not(.ok):not(.err):not(.warn) {
    background: var(--card);
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .vm-tabs {
    border-bottom-color: rgba(242, 247, 252, 0.35);
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .vm-tabs .vm-tab {
    color: #c9d9e8;
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .vm-tabs .vm-tab:hover,
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .vm-tabs .vm-tab:focus-visible,
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .vm-tabs .vm-tab.is-active {
    color: #f2f7fc;
}
:root[data-brand="classic"]:not([data-theme="dark"]) .main > .vm-tabs .vm-tab.is-active {
    border-bottom-color: #5fd3bf;
}

/* ===== FRONT (2026-10-26): front page, self-signup and approval =====
   Login/register links, verification re-send, signup honeypot, pending badge. */
.front-auth-links {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.front-resend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.front-hp {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.badge-warn {
    background: color-mix(in srgb, var(--warn) 16%, transparent);
    color: color-mix(in srgb, var(--warn) 78%, var(--ink));
    border-color: color-mix(in srgb, var(--warn) 52%, transparent);
}
/* ===== end FRONT ===== */

/* ===== STATUS (2026-10-26): front-page hero parallax/video, locations,
   status notice banner and the public /status page. Clean Block: square
   corners throughout (no border-radius here). ===== */

/* -- hero: layered parallax background + optional video -- */
.front-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: none;
}
.front-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.front-hero-layer {
    position: absolute;
    left: 0;
    right: 0;
    top: -12%;
    height: 124%;
    will-change: transform;
}
.front-hero-layer svg {
    display: block;
    width: 100%;
    height: 100%;
}
.front-hero-layer--glow {
    background:
        radial-gradient(circle at 18% 10%, color-mix(in srgb, var(--brand) 22%, transparent) 0%, transparent 55%),
        radial-gradient(circle at 82% 20%, color-mix(in srgb, var(--accent) 20%, transparent) 0%, transparent 50%),
        linear-gradient(180deg, transparent 60%, var(--bg) 100%);
}
.front-hero-layer--network {
    color: var(--brand);
    opacity: 0.26;
}
.front-hero-layer--racks {
    color: var(--accent);
    opacity: 0.3;
}
.front-hero-layer--racks .rack-led {
    fill: var(--brand);
}
.front-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.front-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 9, 12, 0.72) 0%, rgba(5, 9, 12, 0.6) 55%, var(--bg) 100%);
    opacity: 0;
    transition: opacity 0.8s ease;
}
.front-hero.is-video-playing .front-hero-video,
.front-hero.is-video-playing .front-hero-overlay {
    opacity: 1;
}
.front-hero.is-video-playing h1,
.front-hero.is-video-playing p {
    color: #f2f7f5;
}
.front-hero-content {
    position: relative;
    z-index: 1;
}
@media (max-width: 719px) {
    .front-hero-video,
    .front-hero-overlay { display: none; }
    .front-hero.is-video-playing h1,
    .front-hero.is-video-playing p { color: inherit; }
}
@media (prefers-reduced-motion: reduce) {
    .front-hero-layer { transform: none !important; will-change: auto; }
    .front-hero-video,
    .front-hero-overlay { display: none; }
    .front-hero.is-video-playing h1,
    .front-hero.is-video-playing p { color: inherit; }
}

/* -- header/footer status link and the notice banner -- */
.pub-status-link {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 6px 4px;
    text-decoration: none;
}
.pub-status-link:hover {
    color: var(--ink);
}
.pub-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 28px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent) 12%, var(--card));
    color: var(--ink);
    font-size: 0.9rem;
}
.pub-notice--maintenance {
    background: color-mix(in srgb, var(--warn) 16%, var(--card));
}
.pub-notice--incident {
    background: color-mix(in srgb, var(--danger) 16%, var(--card));
}
.pub-notice svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}
.pub-notice-body {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}
.pub-notice-level {
    font-weight: 800;
    margin-right: 6px;
}
.pub-notice a {
    color: inherit;
    font-weight: 700;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .pub-notice { padding: 10px 16px; }
}

/* -- locations -- */
.pub-locations {
    margin: 40px 0 36px;
}
.pub-locations h2 {
    margin: 0 0 6px;
    font-size: 1.4rem;
    font-weight: 800;
}
.pub-locations > p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.9rem;
}
.pub-location-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pub-location {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border: 1px solid var(--line-strong);
    background: var(--card);
    font-weight: 700;
}
.pub-loc-code {
    display: inline-block;
    min-width: 2.4em;
    padding: 2px 6px;
    text-align: center;
    font-family: "JetBrains Mono", "Cascadia Code", monospace;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: var(--brand);
    color: var(--btn-fg);
}

/* -- /status page -- */
.pub-status-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 36px 28px 60px;
}
.pub-status-main h1 {
    margin: 0 0 18px;
    font-size: 1.9rem;
    font-weight: 800;
}
.pub-status-overall {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--line-strong);
    border-left-width: 6px;
    background: var(--card);
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 18px;
}
.pub-status-overall svg {
    width: 22px;
    height: 22px;
}
.pub-status-overall--operational { border-left-color: var(--brand); }
.pub-status-overall--degraded { border-left-color: var(--warn); }
.pub-status-overall--outage { border-left-color: var(--danger); }
.pub-status-overall--unknown { border-left-color: var(--muted); }
.pub-status-overall-sub {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}
.pub-status-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--line-strong);
    background: var(--card);
}
.pub-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}
.pub-status-row > div {
    min-width: 0;
}
.pub-status-row > .pub-state {
    flex: 0 0 auto;
}
.pub-status-row:first-child {
    border-top: 0;
}
.pub-status-name {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.pub-status-checked {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
}
.pub-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 0.86rem;
}
.pub-state::before {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--muted);
}
.pub-state--operational { color: var(--brand); }
.pub-state--operational::before { background: var(--brand); }
.pub-state--degraded { color: var(--warn); }
.pub-state--degraded::before { background: var(--warn); }
.pub-state--outage { color: var(--danger); }
.pub-state--outage::before { background: var(--danger); }
.pub-state--unknown { color: var(--muted); }
.pub-status-notice {
    margin-bottom: 18px;
    border: 1px solid var(--line-strong);
}
.pub-status-foot {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.82rem;
}
.pub-footer {
    border-top: 1px solid var(--line);
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.84rem;
    max-width: 1180px;
    margin: 0 auto;
}
.pub-footer nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.pub-footer a {
    color: var(--muted);
}
@media (max-width: 640px) {
    .pub-status-main { padding: 24px 16px 40px; }
    .pub-status-main h1 { font-size: 1.5rem; }
    .pub-status-row { padding: 12px 14px; }
    .pub-footer { padding: 18px 16px; }
}

/* -- admin Settings > Public site -- */
.adm-public-site-video {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
/* ===== end STATUS ===== */

/* --- PACKBADGE (2026-11-05): deploy wizard pack card — Standard / Special offer
   badge on the bottom row, right-aligned on the same line as the country flags. --- */
.pack-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}
.pack-card-foot .pack-country-row { margin-top: 0; }
.pack-card-foot .pack-source-badge { margin-left: auto; white-space: nowrap; }
