:root {
  --bg: #f7f4ff;
  --panel: #ffffff;
  --panel-2: #f0eaff;
  --text: #23173a;
  --muted: #706580;
  --line: #ddd2f1;
  --primary: #7651e6;
  --primary-2: #4e2b9c;
  --success: #119b6c;
  --warning: #cb7b15;
  --danger: #cc3d61;
  --shadow: 0 14px 36px rgba(67, 38, 127, .11);
  --login-bg: radial-gradient(circle at 12% 18%, rgba(122, 82, 226, .16), transparent 34%), var(--bg);
  --login-card: var(--panel);
  --login-text: var(--text);
  --login-muted: var(--muted);
  --login-line: var(--line);
  --login-shadow: 0 24px 60px rgba(20, 32, 54, .16);
  --login-intro: linear-gradient(145deg, #160d38 0%, #251151 60%, #42227d 100%);
}

html[data-theme="dark"] {
  --bg: #0e0a1b;
  --panel: #181128;
  --panel-2: #241a38;
  --text: #f5f0ff;
  --muted: #b7accb;
  --line: #3c2d57;
  --primary: #b292ff;
  --primary-2: #dccbff;
  --shadow: 0 14px 36px rgba(0, 0, 0, .36);
  --login-bg: radial-gradient(circle at 12% 18%, rgba(173, 131, 255, .12), transparent 34%), var(--bg);
  --login-card: var(--panel);
  --login-text: var(--text);
  --login-muted: var(--muted);
  --login-line: var(--line);
  --login-shadow: 0 28px 68px rgba(0, 0, 0, .46);
  --login-intro: linear-gradient(145deg, #100724 0%, #21103f 60%, #39176a 100%);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--line); color: var(--text); background: var(--panel); border-radius: 9px; padding: 9px 13px; cursor: pointer; }
button:hover { border-color: var(--primary); }
button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { width: 100%; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 11.7px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 20.7px; margin-bottom: 4px; }
h2 { font-size: 14.4px; }
.app-shell { display: grid; grid-template-columns: 235px 1fr; min-height: 100vh; font-size: 12.6px; }
aside { background: linear-gradient(180deg, #160d2b 0%, #110a21 100%); color: #f5efff; padding: 24px 15px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid rgba(194, 159, 255, .14); }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 10px 24px; font-size: 16.2px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #8156ed, #bd63f1); color: white; font-weight: 800; }
.brand-mark.small { width: 30px; height: 30px; border-radius: 9px; }
nav { display: grid; gap: 5px; }
.nav-item { border: 1px solid transparent; color: #c9bedf; background: transparent; text-align: left; padding: 12px 13px; }
.nav-item.active, .nav-item:hover { color: #fff; border-color: rgba(191, 153, 255, .22); background: linear-gradient(100deg, rgba(123, 79, 225, .47), rgba(113, 70, 191, .16)); }
.sidebar-footer { margin-top: 14px; padding: 12px; color: #c9bedf; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); margin-right: 7px; }
.dot.ready { background: #32d296; }
main { min-width: 0; }
header { padding: 20px 28px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
header p { color: var(--muted); margin-bottom: 0; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.icon-button { width: 40px; height: 40px; padding: 0; font-size: 17.1px; }
.account { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 190px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); display: grid; z-index: 20; }
.menu button { border: 0; text-align: left; }
.menu-label { padding: 8px; color: var(--muted); }
.hidden { display: none !important; }
.page { display: none; padding: 25px 28px 40px; }
.page.active { display: block; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.card { padding: 17px; }
.card .label { color: var(--muted); font-size: 10.8px; text-transform: uppercase; letter-spacing: .04em; }
.card .value { font-size: 21.6px; font-weight: 700; margin-top: 6px; }
.card .sub { color: var(--muted); margin-top: 5px; }

/* Overview: purple network command center */
.page-home { position: relative; isolation: isolate; overflow: hidden; }
.page-home::before, .page-home::after { content: ""; position: absolute; pointer-events: none; z-index: -1; filter: blur(2px); }
.page-home::before { width: 460px; height: 460px; top: 128px; right: -245px; border-radius: 50%; background: radial-gradient(circle, rgba(140, 81, 255, .13), transparent 67%); }
.page-home::after { width: 360px; height: 360px; bottom: 55px; left: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(217, 70, 239, .08), transparent 70%); }
.overview-hero { position: relative; min-height: 292px; display: flex; align-items: stretch; justify-content: space-between; gap: 30px; overflow: hidden; margin-bottom: 25px; padding: 29px 31px; border: 1px solid rgba(154, 99, 255, .42); border-radius: 19px; color: #fbfaff; background-color: #160d38; background-image: linear-gradient(90deg, rgba(14, 8, 42, .97) 0%, rgba(20, 10, 55, .9) 42%, rgba(28, 12, 68, .26) 100%), url("/assets/overview-command-center-purple-v1.png"); background-size: cover; background-position: center; box-shadow: 0 20px 44px rgba(55, 16, 121, .23), inset 0 1px 0 rgba(255,255,255,.1); }
.overview-hero::before { content: ""; position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(rgba(231, 216, 255, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(231, 216, 255, .08) 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(90deg, black, transparent 78%); }
.overview-hero::after { content: ""; position: absolute; width: 150%; height: 2px; left: -35%; top: 0; opacity: .7; background: linear-gradient(90deg, transparent, rgba(248, 235, 255, .95), transparent); box-shadow: 0 0 24px rgba(206, 140, 255, .9); animation: overview-scan 8s linear infinite; }
.overview-hero-copy { position: relative; z-index: 1; display: flex; flex: 1 1 0; flex-direction: column; max-width: 645px; }
.overview-eyebrow, .overview-section-kicker { margin: 0; color: #caadff; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.overview-hero h2 { max-width: 520px; margin: 11px 0 8px; color: #fff; font-size: clamp(28px, 3vw, 41px); letter-spacing: -.045em; line-height: 1.07; }
.overview-lede { max-width: 530px; margin: 0; color: #ded4ff; font-size: 14px; line-height: 1.62; }
.overview-hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.overview-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 29px; padding: 5px 9px; border: 1px solid rgba(220, 199, 255, .25); border-radius: 999px; color: #eee8ff; background: rgba(15, 7, 45, .47); font-size: 10.6px; backdrop-filter: blur(9px); }
.overview-pill b { color: #fff; font-weight: 800; }
.overview-pill.ready { border-color: rgba(89, 238, 172, .46); color: #a0ffd0; }
.overview-pill.down { border-color: rgba(255, 140, 168, .48); color: #ffc0d2; }
.overview-pill.violet { border-color: rgba(205, 147, 255, .55); color: #f0d7ff; }
.overview-hero-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 20px; color: #c9bce8; font-size: 11.2px; }
.overview-live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #7dffbf; box-shadow: 0 0 0 4px rgba(125, 255, 191, .12); }
.overview-live-dot::after { content: ""; position: absolute; inset: -5px; border: 1px solid rgba(125, 255, 191, .72); border-radius: 50%; animation: overview-ping 2s ease-out infinite; }
.overview-version-card { position: relative; z-index: 1; align-self: center; width: 190px; min-height: 164px; display: flex; flex-direction: column; justify-content: center; padding: 20px; overflow: hidden; border: 1px solid rgba(234, 221, 255, .22); border-radius: 16px; color: #cfc5eb; background: rgba(17, 8, 48, .55); box-shadow: inset 0 1px 0 rgba(255,255,255,.09); backdrop-filter: blur(12px); }
.overview-version-card strong { position: relative; z-index: 1; margin: 8px 0 3px; color: #fff; font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.overview-version-card > span:last-of-type { position: relative; z-index: 1; font-size: 10.6px; }
.overview-version-label { position: relative; z-index: 1; color: #cba4ff; font-size: 9.4px; font-weight: 800; letter-spacing: .09em; }
.overview-orbit { position: absolute; width: 168px; height: 168px; right: -86px; bottom: -83px; border: 1px solid rgba(232, 202, 255, .42); border-radius: 50%; }
.overview-orbit::before, .overview-orbit::after, .overview-orbit i { content: ""; position: absolute; display: block; border-radius: 50%; }
.overview-orbit::before { width: 98px; height: 98px; inset: 34px; border: 1px solid rgba(232, 202, 255, .3); }
.overview-orbit::after { width: 8px; height: 8px; top: 13px; left: 43px; background: #fae7ff; box-shadow: 0 0 18px 4px #d174ff; }
.overview-orbit i:nth-child(1) { width: 5px; height: 5px; right: 15px; top: 54px; background: #bfffea; box-shadow: 0 0 14px 3px #71e1b4; }
.overview-orbit i:nth-child(2) { width: 6px; height: 6px; left: 22px; bottom: 37px; background: #e6beff; box-shadow: 0 0 12px 3px #c064ff; }
.overview-orbit i:nth-child(3) { width: 119px; height: 1px; top: 81px; left: 21px; border-radius: 0; background: linear-gradient(90deg, transparent, rgba(240, 212, 255, .65), transparent); transform: rotate(-34deg); }
.overview-section-heading, .overview-panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.overview-section-heading { margin: 0 0 12px; }
.overview-section-heading h2, .overview-panel-title h2, .overview-shortcuts h2 { margin: 4px 0 0; font-size: 17px; line-height: 1.2; }
.overview-updated { flex: 0 0 auto; margin-top: 5px; padding: 6px 9px; border: 1px solid rgba(142, 98, 255, .2); border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--panel) 75%, #8b5cf6 25%); font-size: 10px; }
.overview-metrics { grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 15px; margin-bottom: 22px; }
.overview-metrics .card { position: relative; overflow: hidden; min-height: 123px; padding: 18px; border-color: color-mix(in srgb, var(--line) 72%, #9b74ff 28%); transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease; }
.overview-metrics .card::before { content: ""; position: absolute; width: 105px; height: 105px; right: -47px; bottom: -57px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, .22), transparent 69%); transition: transform .3s ease; }
.overview-metrics .card:nth-child(2)::before { background: radial-gradient(circle, rgba(206, 94, 255, .21), transparent 69%); }
.overview-metrics .card:nth-child(3)::before { background: radial-gradient(circle, rgba(61, 215, 176, .18), transparent 69%); }
.overview-metrics .card:nth-child(4)::before { background: radial-gradient(circle, rgba(126, 95, 255, .2), transparent 69%); }
.overview-metrics .card:hover { border-color: rgba(161, 117, 255, .73); box-shadow: 0 17px 30px rgba(81, 44, 159, .18); transform: translateY(-4px); }
.overview-metrics .card:hover::before { transform: scale(1.4); }
.overview-metrics .card .label { font-size: 12.4px; }
.overview-metrics .card .value { position: relative; margin-top: 8px; font-size: 24.8px; }
.overview-metrics .card .sub { position: relative; font-size: 14.5px; line-height: 1.35; }
.overview-command-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); gap: 16px; margin-bottom: 18px; }
.overview-command-grid .panel, .overview-shortcuts { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--line) 74%, #8b5cf6 26%); }
.overview-command-grid .panel::before { content: ""; position: absolute; width: 180px; height: 180px; top: -135px; right: -50px; border-radius: 50%; background: radial-gradient(circle, rgba(147, 93, 255, .14), transparent 69%); pointer-events: none; }
.overview-flow-panel, .overview-health-panel { min-height: 212px; }
.overview-flow-indicator, .overview-health-pulse { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: #a976ff; box-shadow: 0 0 0 5px rgba(169, 118, 255, .12), 0 0 20px rgba(169, 118, 255, .7); }
.overview-health-pulse { background: #63e7b4; box-shadow: 0 0 0 5px rgba(99, 231, 180, .12), 0 0 20px rgba(99, 231, 180, .64); }
.overview-flow { position: relative; display: grid; grid-template-columns: 1fr 32px 1fr 32px 1fr 32px 1fr; align-items: center; min-height: 125px; margin-top: 20px; }
.overview-flow-node { position: relative; z-index: 1; display: grid; justify-items: center; gap: 4px; min-height: 103px; padding: 13px 8px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel-2) 86%, #8b5cf6 14%); text-align: center; transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease; }
.overview-flow-node:hover { border-color: #a879ff; box-shadow: 0 11px 22px rgba(97, 55, 183, .16); transform: translateY(-4px); }
.flow-node-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #7046d9, #b04ee8); box-shadow: 0 7px 13px rgba(100, 53, 191, .3); font-size: 15px; font-weight: 800; }
.overview-flow-node.source .flow-node-icon { background: linear-gradient(135deg, #3a62db, #6d49d4); }
.overview-flow-node.core .flow-node-icon { background: linear-gradient(135deg, #ad5ae4, #6d49d4); }
.overview-flow-node.egress .flow-node-icon { background: linear-gradient(135deg, #3eae9b, #4e63d7); }
.overview-flow-node strong { font-size: 11.5px; }
.overview-flow-node small { color: var(--muted); font-size: 9.5px; }
.overview-flow-link { position: relative; display: block; height: 2px; overflow: hidden; background: color-mix(in srgb, var(--line) 50%, #9972ef 50%); }
.overview-flow-link::after { content: ""; position: absolute; width: 40%; height: 100%; left: -48%; background: #c6abff; box-shadow: 0 0 9px #a66bff; animation: overview-flow 2.8s linear infinite; }
.overview-health-list { display: grid; gap: 4px; margin-top: 16px; }
.overview-health-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 34px; padding: 6px 0; border-bottom: 1px dashed color-mix(in srgb, var(--line) 78%, transparent); color: var(--muted); font-size: 11.6px; }
.overview-health-item:last-child { border-bottom: 0; }
.overview-health-item strong { color: var(--text); font-size: 11.6px; }
.overview-health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.overview-health-dot.ready { background: #39d99d; box-shadow: 0 0 0 4px rgba(57, 217, 157, .11); }
.overview-health-dot.warning { background: #eead43; box-shadow: 0 0 0 4px rgba(238, 173, 67, .11); }
.overview-health-dot.down { background: #f06987; box-shadow: 0 0 0 4px rgba(240, 105, 135, .11); }
.overview-shortcuts { margin-bottom: 18px; padding: 18px; border: 1px solid color-mix(in srgb, var(--line) 74%, #8b5cf6 26%); border-radius: 13px; background: var(--panel); box-shadow: var(--shadow); }
.overview-shortcuts-title { margin-bottom: 14px; }
.overview-shortcut-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.overview-shortcut { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border-color: color-mix(in srgb, var(--line) 72%, #956cff 28%); background: color-mix(in srgb, var(--panel-2) 78%, #8b5cf6 22%); text-align: left; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease; }
.overview-shortcut:hover { border-color: #a878ff; background: color-mix(in srgb, var(--panel-2) 65%, #8b5cf6 35%); box-shadow: 0 13px 24px rgba(92, 51, 173, .15); transform: translateY(-3px); }
.overview-shortcut-icon { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #7448dd, #b050ea); font-size: 15px; font-weight: 800; }
.overview-shortcut:nth-child(2) .overview-shortcut-icon { background: linear-gradient(135deg, #4f5fd5, #9a55e7); }
.overview-shortcut:nth-child(3) .overview-shortcut-icon { background: linear-gradient(135deg, #9758e4, #d857af); }
.overview-shortcut:nth-child(4) .overview-shortcut-icon { background: linear-gradient(135deg, #3a9aad, #6055d7); }
.overview-shortcut span:last-child { display: grid; min-width: 0; gap: 2px; }
.overview-shortcut strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.2px; }
.overview-shortcut small { overflow: hidden; color: var(--muted); font-size: 9.9px; line-height: 1.35; }
.overview-details .panel { transition: transform .22s ease, border-color .22s ease; }
.overview-details .panel:hover { border-color: rgba(157, 111, 255, .65); transform: translateY(-2px); }
@keyframes overview-scan { from { transform: translateY(-10px); } to { transform: translateY(310px); } }
@keyframes overview-ping { 0% { opacity: .9; transform: scale(.58); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes overview-flow { to { left: 115%; } }
@media (prefers-reduced-motion: reduce) {
  .overview-hero::after, .overview-live-dot::after, .overview-flow-link::after { animation: none; }
  .overview-metrics .card, .overview-flow-node, .overview-shortcut, .overview-details .panel { transition: none; }
}
.panel { padding: 18px; margin-bottom: 18px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.toolbar, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.toolbar > div { display: flex; gap: 8px; }
.proxy-family-tabs { display: flex; align-items: end; gap: 8px; margin: -8px 0 22px; border-bottom: 1px solid var(--line); }
.proxy-family-tab { position: relative; border: 0; border-radius: 10px 10px 0 0; padding: 11px 16px; color: var(--muted); background: transparent; font-weight: 700; }
.proxy-family-tab:hover { color: var(--text); background: var(--panel-2); }
.proxy-family-tab.active { color: var(--primary); background: var(--panel); }
.proxy-family-tab.active::after { content: ""; position: absolute; right: 14px; bottom: -1px; left: 14px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.proxy-family-panel[hidden] { display: none; }
.ipv6-readiness-panel { border-left: 3px solid var(--primary); }
.ipv6-readiness-panel .panel-title-row { margin-bottom: 0; }
.ipv6-uplink-heading { align-items: flex-start; }
.ipv6-uplink-actions { align-items: center; flex-wrap: wrap; }
.ipv6-uplink-summary { margin: 12px 0 0; font-size: 11.3px; }
.ipv6-uplink-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); grid-auto-rows: 1fr; gap: 10px; margin-top: 14px; }
.ipv6-uplink-item { min-width: 0; height: 100%; display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.ipv6-uplink-item .panel-title-row { gap: 8px; margin-bottom: 4px; }
.ipv6-uplink-item h3 { margin: 0 0 5px; font-size: 13px; }
.ipv6-uplink-item p { margin: 4px 0; font-size: 11px; }
.ipv6-uplink-item .error { margin-top: auto; overflow-wrap: anywhere; }
.proxy-region + .proxy-region { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.proxy-region-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.proxy-region-heading h2 { margin-bottom: 3px; }
.proxy-region-heading p { margin: 0; color: var(--muted); }
.ipv6-proxy-toolbar { align-items: flex-start; }
.ipv6-proxy-toolbar .toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; }
.ipv6-proxy-toolbar .toolbar-actions button { font-size: 11.4px; }
.toolbar-meta { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-height: 38px; white-space: nowrap; }
.proxy-runtime-controls { align-items: center; flex-wrap: wrap; }
.proxy-runtime-controls label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.proxy-runtime-controls select { width: auto; padding: 8px; }
.proxy-runtime-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.actions select { width: auto; min-width: 86px; padding: 7px; }
.vpn-list-panel { margin-top: 14px; }
.error-text { color: var(--danger); }
.grow { flex-grow: 1; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.table-panel { overflow-x: auto; }
.ipv6-table-panel { padding: 0; overflow-x: auto; background: var(--panel); }
.ipv6-proxy-table { min-width: 1360px; table-layout: fixed; background: var(--panel); }
.ipv6-col-select { width: 42px; }
.ipv6-col-credential { width: 140px; }
.ipv6-col-endpoints { width: 245px; }
.ipv6-col-egress { width: 175px; }
.ipv6-col-fingerprint { width: 100px; }
.ipv6-col-route { width: 270px; }
.ipv6-col-status { width: 86px; }
.ipv6-col-actions { width: 260px; }
.ipv6-proxy-table th { background: var(--panel-2); }
.ipv6-proxy-table th, .ipv6-proxy-table td { vertical-align: middle; }
.ipv6-proxy-table th { white-space: normal; line-height: 1.35; }
.ipv6-proxy-table td { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.ipv6-proxy-table tbody tr { background: var(--panel); }
.ipv6-proxy-table tbody tr:hover { background: var(--panel-2); }
.ipv6-proxy-table .select-column, .ipv6-proxy-table .select-cell { width: 42px; min-width: 42px; text-align: center; }
.ipv6-proxy-table input[type="checkbox"] { width: 16px; height: 16px; padding: 0; vertical-align: middle; accent-color: var(--primary); }
.ipv6-proxy-table td .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 6px; align-items: stretch; }
.ipv6-proxy-table td .actions button { width: 100%; min-height: 35px; padding: 7px 8px; font-size: 11px; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 10.8px; text-transform: uppercase; }
td .actions { display: flex; gap: 6px; }
.status { padding: 4px 8px; border-radius: 999px; background: var(--panel-2); }
.status.active, .status.ready, .status.success, .status.verified { color: var(--success); }
.status.degraded, .status.failed, .status.down { color: var(--danger); }
.detail-list { display: grid; gap: 8px; margin-bottom: 12px; }
.detail { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.detail span:first-child { color: var(--muted); }
.panel-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-title-row h2 { margin-bottom: 3px; }
.panel-title-row p { margin: 0; color: var(--muted); }
.router-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(285px, .37fr); gap: 16px; align-items: start; }
.router-primary, .router-secondary { min-width: 0; }
.router-openwrt-grid { display: grid; grid-template-columns: minmax(260px, .95fr) minmax(340px, 1.05fr); gap: 16px; }
.router-secondary { display: grid; gap: 16px; position: sticky; top: 96px; }
.router-secondary .panel, .router-primary > .panel { margin-bottom: 0; }
.router-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.router-detail-grid .detail { min-width: 0; }
.router-detail-grid .detail strong { overflow-wrap: anywhere; text-align: right; }
.router-status-panel, .router-wan-panel { min-height: 330px; display: flex; flex-direction: column; }
.router-status-panel .actions { margin-top: auto; }
.router-wan-panel .router-form { margin-top: auto; }
.router-debian-panel, .dashboard-domain-panel { margin-top: 16px; }
.debian-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.router-coming-panel { min-height: 190px; }
.router-coming-panel .muted { margin: 0; }
.router-ddns-panel, .router-ddns-target-panel { min-height: 345px; }
.form-note { margin: 0; color: var(--muted); font-size: 10.8px; line-height: 1.5; }
.domain-plan { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; line-height: 1.55; word-break: break-word; }
.domain-plan.ready { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); color: var(--text); }
.domain-plan.degraded { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--text); }
.domain-plan code { color: var(--primary); font-size: .95em; }
.router-operation-result { margin-top: 16px; margin-bottom: 0; }
.muted { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compact-form { margin-top: 14px; }
.ddns-details { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ddns-details summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.wide { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.output { background: var(--panel-2); border: 1px solid var(--line); padding: 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; max-height: 55vh; overflow: auto; }
.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.login-page { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 5vh 5vw; background: var(--login-bg); }
.login-card { width: 90vw; height: 90vh; display: grid; grid-template-columns: minmax(320px, .82fr) minmax(420px, 1.18fr); overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--login-card); box-shadow: var(--login-shadow); }
.login-intro { position: relative; display: flex; flex-direction: column; padding: clamp(28px, 4vw, 62px) clamp(34px, 5vw, 82px) clamp(22px, 3vw, 46px); overflow: hidden; color: #fff; background: var(--login-intro); border-right: 1px solid rgba(255,255,255,.12); }
.login-intro::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 78%); }
.login-intro > * { position: relative; z-index: 1; }
.login-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; font-weight: 600; letter-spacing: .01em; color: rgba(255,255,255,.88); }
.login-preferences { display: flex; align-items: center; gap: 8px; }
.language-picker { display: inline-flex; align-items: center; }
.language-picker select { width: auto; min-width: 72px; padding: 7px 26px 7px 9px; font-size: 12px; cursor: pointer; }
.login-language select { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }
.login-language select option { color: #172033; background: #fff; }
.login-theme-button { width: 33px; height: 33px; padding: 0; color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); font-size: 16px; }
.login-theme-button:hover { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.16); }
.login-branding { margin: auto 0 0; text-align: center; }
.login-logo { display: grid; place-items: center; width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 24px; filter: drop-shadow(0 12px 22px rgba(0,0,0,.25)); }
.login-logo-image { display: block; width: 100%; height: 100%; }
.login-branding h1 { margin: 0; font-size: clamp(30px, 2.2vw, 38px); font-weight: 750; line-height: 1.1; letter-spacing: -.035em; }
.login-branding p { margin: 12px auto 0; max-width: 330px; color: rgba(255,255,255,.78); font-size: 15px; line-height: 1.55; }
.login-intro-copy { width: min(100%, 390px); margin: 34px auto auto; padding: 24px 0 0; border-top: 1px solid rgba(255,255,255,.17); }
.login-intro-copy strong { display: block; font-size: 19px; line-height: 1.25; }
.login-intro-copy p { margin: 10px 0 0; color: rgba(255,255,255,.8); font-size: 14px; line-height: 1.65; }
.login-footer { display: flex; gap: 10px; align-items: center; font-size: 10px; font-weight: 600; letter-spacing: .1em; color: rgba(255,255,255,.62); }
.login-form-panel { display: grid; align-content: center; gap: clamp(18px, 2.2vh, 28px); padding: clamp(42px, 7vw, 116px); color: var(--login-text); background: var(--login-card); }
.login-form-head { margin-bottom: 7px; }
.login-form-head .eyebrow { color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.login-form-head h2 { margin: 7px 0 6px; font-size: 27px; letter-spacing: -.03em; }
.login-form-head p { margin: 0; color: var(--login-muted); }
.login-form-panel label { display: grid; gap: 7px; color: var(--login-text); font-size: 12px; font-weight: 650; }
.login-form-panel input { padding: 11px 2px; color: var(--login-text); border: 0; border-bottom: 1.5px solid var(--login-line); border-radius: 0; background: transparent; box-shadow: none; }
.login-form-panel input:focus { outline: 0; border-bottom-color: var(--primary); }
.login-submit { display: flex; justify-content: center; align-items: center; gap: 13px; margin-top: 6px; border: 0; border-radius: 9px; padding: 12px 18px; background: var(--primary); box-shadow: 0 9px 19px rgba(36, 87, 214, .2); }
.dashboard-language select { min-width: 58px; padding: 8px 24px 8px 8px; font-size: 10.8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.error { min-height: 20px; color: var(--danger); }
dialog { width: min(520px, calc(100vw - 30px)); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(4, 8, 14, .72); }
dialog form { display: grid; gap: 12px; }
.dialog-head, .dialog-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 12px 16px; border-radius: 9px; background: #24143f; color: white; z-index: 200; box-shadow: var(--shadow); }

/* Purple system shell and dashboard typography (+20%). */
body { background: radial-gradient(circle at 82% 2%, rgba(139, 92, 246, .11), transparent 27%), radial-gradient(circle at 8% 88%, rgba(192, 92, 232, .07), transparent 26%), var(--bg); font-size: 16.8px; }
button, input, select, textarea { transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease; }
button:hover:not(:disabled) { box-shadow: 0 7px 18px rgba(99, 54, 183, .12); }
button.primary { background: linear-gradient(135deg, #7651e6, #9d65ed); border-color: #8d61e9; box-shadow: 0 9px 20px rgba(104, 61, 204, .21); }
button.danger { background: linear-gradient(135deg, #c83961, #d74b70); }
h1 { font-size: 24.8px; }
h2 { font-size: 17.3px; }
label { font-size: 14px; }
.app-shell { grid-template-columns: 270px minmax(0, 1fr); font-size: 15.1px; }
.brand { gap: 12px; padding: 0 11px 28px; font-size: 19.5px; letter-spacing: -.02em; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; }
.brand-router-icon { display: block; object-fit: cover; border: 1px solid rgba(211, 181, 255, .38); box-shadow: 0 8px 19px rgba(113, 61, 215, .32); }
.primary-nav { gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 49px; font-size: 18.2px; font-weight: 650; line-height: 1.2; white-space: normal; }
.nav-icon { display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #e9dcff; background: rgba(180, 143, 255, .13); font-size: 17px; line-height: 1; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { color: #fff; background: linear-gradient(135deg, #8d5df0, #b969ef); box-shadow: 0 5px 12px rgba(158, 96, 235, .34); }
.sidebar-lower { display: grid; gap: 8px; margin-top: auto; padding-top: 17px; border-top: 1px solid rgba(216, 190, 255, .13); }
.nav-item-router { border-color: rgba(180, 137, 255, .28); background: linear-gradient(100deg, rgba(106, 60, 195, .46), rgba(82, 45, 143, .14)); }
.sidebar-footer { display: grid; gap: 9px; margin-top: 12px; padding: 14px 12px 3px; border-top: 1px solid rgba(216, 190, 255, .13); }
.sidebar-api { display: flex; align-items: center; gap: 4px; color: #cfc3e6; font-size: 13px; font-weight: 700; letter-spacing: .05em; }
.sidebar-api .dot { margin-right: 4px; }
.sidebar-version { color: #968aac; font-size: 12.2px; line-height: 1.25; }
.sidebar-version small { color: #c3afd8; font-size: inherit; }
.sidebar-logout { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; padding: 9px 10px; border-color: rgba(216, 190, 255, .16); color: #e4d9f5; background: rgba(255,255,255,.045); font-size: 14.4px; }
.sidebar-logout:hover { border-color: rgba(213, 170, 255, .5); background: rgba(159, 96, 231, .17); }
header { padding: 23px 31px; background: color-mix(in srgb, var(--panel) 92%, #8b5cf6 8%); }
header p { font-size: 14.4px; }
.icon-button { width: 48px; height: 48px; font-size: 20.5px; }
.dashboard-language select { min-width: 70px; padding: 9px 28px 9px 10px; font-size: 13px; }
.page { padding: 29px 32px 46px; }
.panel, .card { border-color: color-mix(in srgb, var(--line) 78%, #9b73f1 22%); }
.panel:hover { border-color: color-mix(in srgb, var(--line) 55%, #9b73f1 45%); }
.card { padding: 20px; }
.card .label { font-size: 13px; }
.card .value { font-size: 25.9px; }
.card .sub { font-size: 14.5px; }
.toolbar, .pagination, .actions, .inline-form, .proxy-runtime-controls { flex-wrap: wrap; }
.proxy-family-tab { padding: 13px 18px; font-size: 15.1px; }
.ipv6-uplink-summary { font-size: 13.6px; }
.ipv6-uplink-item { padding: 15px; }
.ipv6-uplink-item h3 { font-size: 15.6px; }
.ipv6-uplink-item p, .ipv6-proxy-toolbar .toolbar-actions button { font-size: 13.2px; }
.toolbar-meta { min-height: 44px; font-size: 13.7px; }
.ipv6-proxy-table td .actions button { min-height: 42px; padding: 8px 9px; font-size: 13.2px; }
th { font-size: 13px; }
th, td { padding: 14px 12px; }
.status, .badge { padding: 6px 10px; font-size: 13.2px; }
.detail-list { gap: 10px; }
.detail { padding-bottom: 9px; }
.form-note { font-size: 13px; }
.output { padding: 14px; }
.overview-eyebrow, .overview-section-kicker { font-size: 12px; }
.overview-hero h2 { font-size: clamp(34px, 3.6vw, 49px); }
.overview-lede { font-size: 16.8px; }
.overview-pill { min-height: 35px; padding: 6px 11px; font-size: 12.7px; }
.overview-hero-footer { font-size: 13.4px; }
.overview-version-card { width: 215px; min-height: 182px; }
.overview-version-card strong { font-size: 33.6px; }
.overview-version-card > span:last-of-type { font-size: 12.7px; }
.overview-version-label { font-size: 11.3px; }
.overview-section-heading h2, .overview-panel-title h2, .overview-shortcuts h2 { font-size: 20.4px; }
.overview-updated { font-size: 12px; }
.overview-metrics .card { min-height: 137px; padding: 21px; }
.overview-metrics .card .label { font-size: 14.9px; }
.overview-metrics .card .value { font-size: 29.8px; }
.overview-metrics .card .sub { font-size: 17.4px; }
.flow-node-icon { width: 35px; height: 35px; font-size: 18px; }
.overview-flow-node strong { font-size: 13.8px; }
.overview-flow-node small { font-size: 11.4px; }
.overview-health-item, .overview-health-item strong { font-size: 13.9px; }
.overview-shortcut-icon { width: 36px; height: 36px; font-size: 18px; }
.overview-shortcut strong { font-size: 13.5px; }
.overview-shortcut small { font-size: 11.9px; }
.router-system-settings { padding-top: 0; padding-bottom: 48px; }
.router-settings-heading { margin: 6px 0 17px; padding: 22px 24px; border: 1px solid color-mix(in srgb, var(--line) 68%, #9d6df0 32%); border-radius: 14px; background: linear-gradient(110deg, color-mix(in srgb, var(--panel) 86%, #8b5cf6 14%), var(--panel)); box-shadow: var(--shadow); }
.router-settings-heading h2 { margin: 5px 0 6px; font-size: 20.4px; }
.router-settings-heading p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.login-submit { background: linear-gradient(135deg, #7651e6, #a465ef); box-shadow: 0 9px 19px rgba(103, 60, 202, .25); }
.login-language select option { color: #23173a; background: #fff; }

@media (max-width: 1180px) {
  .overview-hero { min-height: 278px; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-flow { grid-template-columns: 1fr 20px 1fr 20px 1fr 20px 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 92px minmax(0, 1fr); }
  .brand { padding-left: 0; padding-right: 0; justify-content: center; }
  .brand span:last-child { display: none; }
  .nav-item { font-size: 9.9px; text-align: center; padding: 10px 5px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-command-grid { grid-template-columns: 1fr; }
  .overview-health-panel { min-height: 0; }
  .overview-flow { max-width: 680px; }
  .split { grid-template-columns: 1fr; }
  .router-workspace { grid-template-columns: 1fr; }
  .router-secondary { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .router-secondary .panel { min-height: 0; }
  .router-ddns-panel, .router-ddns-target-panel { grid-column: span 1; }
  .debian-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ipv6-uplink-list { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  td .actions { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .login-page { padding: 18px; overflow: auto; }
  .login-card { width: min(100%, 620px); height: auto; min-height: calc(100dvh - 36px); grid-template-columns: 1fr; margin: auto; }
  .login-intro { min-height: 250px; padding: 22px 28px; }
  .login-intro::after { inset: 0; width: auto; height: auto; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 28px 28px; }
  .login-branding { margin: 24px 0 0; }
  .login-intro-copy { margin: 22px auto auto; padding-top: 18px; }
  .login-intro-copy { display: none; }
  .login-form-panel { padding: 38px clamp(24px, 8vw, 58px) 44px; }
}

@media (max-width: 600px) {
  .login-page { padding: 0; place-items: stretch; }
  .login-card { width: 100%; min-height: 100dvh; margin: 0; border-radius: 0; }
  .login-intro { min-height: 242px; padding: 20px 24px; }
  .login-branding { margin: 22px 0 0; }
  .login-logo { width: 72px; height: 72px; margin-bottom: 12px; border-radius: 18px; }
  .login-branding h1 { font-size: 28px; }
  .login-intro-copy { display: none; }
  .login-form-panel { padding: 34px 26px 38px; }
  .login-form-head h2 { font-size: 24px; }
  .app-shell { display: block; }
  aside { position: static; width: 100%; height: auto; padding: 10px 8px; }
  .brand { display: none; }
  nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .nav-item { flex: 0 0 auto; font-size: 10.8px; padding: 9px 10px; white-space: nowrap; }
  .sidebar-footer { display: none; }
  header { position: static; padding: 15px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .page { padding: 16px 12px 30px; }
  .page-home { padding-top: 14px; }
  .overview-hero { display: block; min-height: 0; margin-bottom: 19px; padding: 23px 20px 18px; border-radius: 15px; background-image: linear-gradient(145deg, rgba(14, 8, 42, .98), rgba(32, 15, 74, .73)), url("/assets/overview-command-center-purple-v1.png"); background-position: 69% center; }
  .overview-hero::before { background-size: 28px 28px; opacity: .17; }
  .overview-hero::after { display: none; }
  .overview-hero h2 { max-width: 330px; margin-top: 8px; font-size: 29px; }
  .overview-lede { max-width: 310px; font-size: 12.1px; line-height: 1.55; }
  .overview-hero-pills { margin-top: 17px; }
  .overview-hero-footer { margin-top: 17px; padding-top: 0; }
  .overview-version-card { width: 100%; min-height: 78px; margin-top: 21px; padding: 14px 16px; }
  .overview-version-card strong { margin: 5px 0 2px; font-size: 23px; }
  .overview-orbit { right: -22px; bottom: -95px; }
  .overview-section-heading { align-items: flex-end; margin-bottom: 10px; }
  .overview-section-heading h2, .overview-panel-title h2, .overview-shortcuts h2 { font-size: 15px; }
  .overview-updated { max-width: 125px; margin-top: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .overview-metrics { grid-template-columns: 1fr; gap: 10px; margin-bottom: 17px; }
  .overview-metrics .card { min-height: 105px; padding: 15px; }
  .overview-metrics .card .label { font-size: 12px; }
  .overview-metrics .card .value { font-size: 24.8px; }
  .overview-metrics .card .sub { font-size: 13.4px; }
  .overview-command-grid { gap: 12px; margin-bottom: 13px; }
  .overview-command-grid .panel, .overview-shortcuts { padding: 15px; border-radius: 12px; }
  .overview-flow { grid-template-columns: 1fr 18px 1fr; grid-template-rows: auto 18px auto 18px auto; gap: 0; min-height: 270px; margin-top: 15px; }
  .overview-flow-node { min-height: 88px; padding: 10px 6px; }
  .overview-flow-node.source { grid-column: 1; grid-row: 1; }
  .overview-flow > .overview-flow-link:nth-of-type(1) { grid-column: 2; grid-row: 1; }
  .overview-flow-node.router { grid-column: 3; grid-row: 1; }
  .overview-flow > .overview-flow-link:nth-of-type(2) { grid-column: 2; grid-row: 2; width: 2px; height: 18px; justify-self: center; }
  .overview-flow-node.core { grid-column: 2; grid-row: 3; }
  .overview-flow > .overview-flow-link:nth-of-type(3) { grid-column: 2; grid-row: 4; width: 2px; height: 18px; justify-self: center; }
  .overview-flow-node.egress { grid-column: 2; grid-row: 5; }
  .overview-flow-link::after { width: 2px; height: 40%; left: 0; top: -45%; animation-name: overview-flow-vertical; }
  .overview-flow > .overview-flow-link:nth-of-type(1)::after { width: 40%; height: 100%; top: 0; left: -48%; animation-name: overview-flow; }
  .overview-shortcut-grid { grid-template-columns: 1fr; }
  .overview-shortcut { min-height: 58px; }
  .card-grid, .form-grid { grid-template-columns: 1fr; }
  .router-openwrt-grid, .router-secondary, .router-detail-grid, .debian-detail-grid { grid-template-columns: 1fr; }
  .router-secondary .router-ddns-panel, .router-secondary .router-ddns-target-panel { grid-column: auto; }
  .router-status-panel, .router-wan-panel { min-height: 0; }
  .panel-title-row { align-items: flex-start; }
  .panel-title-row .status, .panel-title-row .badge { white-space: nowrap; }
  .toolbar, .pagination { align-items: flex-start; flex-wrap: wrap; }
  .ipv6-uplink-heading { flex-direction: column; }
  .ipv6-uplink-actions { width: 100%; justify-content: flex-start; }
  .ipv6-uplink-actions .status { flex: 0 0 auto; }
  .ipv6-uplink-summary { font-size: 10.9px; line-height: 1.5; }
  .ipv6-uplink-list { grid-template-columns: 1fr; }
  .ipv6-uplink-item { min-height: 112px; }
  .proxy-family-tabs { overflow-x: auto; margin: -4px 0 18px; }
  .proxy-family-tab { flex: 0 0 auto; padding: 10px 12px; }
  .toolbar > div, .proxy-runtime-controls { width: 100%; flex-wrap: wrap; }
  .ipv6-proxy-toolbar .toolbar-actions { gap: 7px; }
  .ipv6-proxy-toolbar .toolbar-actions button { flex: 1 1 136px; min-height: 38px; }
  .toolbar-meta { width: 100%; justify-content: space-between; }
  .proxy-runtime-controls label { white-space: normal; }
  .table-panel { margin-left: -1px; margin-right: -1px; border-radius: 10px; }
  table { min-width: 780px; }
  .ipv6-proxy-table { min-width: 1360px; }
  .ipv6-table-panel { -webkit-overflow-scrolling: touch; }
  .vpn-list-table { min-width: 680px; }
  th, td { padding: 10px 8px; }
  .actions { justify-content: flex-start; flex-wrap: wrap; }
  .actions button, .actions select { min-height: 38px; }
  dialog { width: calc(100vw - 18px); padding: 16px; max-height: calc(100vh - 18px); overflow: auto; }
  .toast { right: 12px; left: 12px; bottom: 12px; text-align: center; }
  .wide { grid-column: auto; }
}
@keyframes overview-flow-vertical { to { top: 115%; } }

/* Responsive corrections for the larger purple interface. */
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .nav-item { font-size: 16.5px; }
  .overview-command-grid { grid-template-columns: 1fr; }
  .router-workspace { grid-template-columns: 1fr; }
  .router-secondary { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
  .brand { display: flex; justify-content: flex-start; padding: 0 8px 20px; font-size: 17.2px; }
  .brand span:last-child { display: inline; }
  .nav-item { padding: 10px; font-size: 15.1px; text-align: left; }
  .nav-icon { width: 24px; height: 24px; font-size: 15px; }
  .sidebar-footer { padding-right: 8px; padding-left: 8px; }
  .router-secondary { grid-template-columns: 1fr; }
  .debian-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .router-openwrt-grid { grid-template-columns: 1fr; }
  .router-status-panel, .router-wan-panel { min-height: 0; }
  .overview-shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .app-shell { display: block; }
  aside { display: block; position: static; width: 100%; height: auto; padding: 12px 10px 10px; border-right: 0; }
  .brand { display: flex; padding: 1px 6px 11px; font-size: 17px; }
  .brand-mark.small { width: 32px; height: 32px; }
  .primary-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; overflow: visible; margin: 0; padding: 0 0 7px; border: 0; }
  .primary-nav .nav-item:last-child { grid-column: 1 / -1; }
  .sidebar-lower { display: grid; gap: 7px; margin: 0; padding: 2px 0 6px; border: 0; }
  .nav-item { width: 100%; min-height: 43px; padding: 8px 10px; font-size: 14px; white-space: normal; }
  .nav-icon { width: 22px; height: 22px; border-radius: 7px; font-size: 14px; }
  .sidebar-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 11px; margin-top: 4px; padding: 8px 6px 0; border-top: 1px solid rgba(216, 190, 255, .13); }
  .sidebar-api { font-size: 11.5px; }
  .sidebar-version { font-size: 11.3px; }
  .sidebar-logout { width: auto; padding: 7px 9px; font-size: 12.6px; }
  header { padding: 17px 16px; }
  h1 { font-size: 23px; }
  header p { font-size: 13px; }
  .page { padding: 18px 14px 34px; }
  .toolbar, .pagination { gap: 8px; }
  .toolbar > div, .actions, .inline-form { width: 100%; }
  .toolbar > div > button, .actions > button { flex: 1 1 144px; }
  .proxy-family-tab { padding: 11px 13px; font-size: 13.6px; }
  .panel { padding: 16px; }
  .card { padding: 16px; }
  .card .label { font-size: 12.3px; }
  .card .value { font-size: 24px; }
  .card .sub { font-size: 13.4px; }
  .overview-hero { padding: 24px 21px 19px; }
  .overview-hero h2 { font-size: 35px; }
  .overview-lede { font-size: 14.2px; }
  .overview-pill { font-size: 11.8px; }
  .overview-version-card { min-height: 86px; }
  .overview-version-card strong { font-size: 27px; }
  .overview-metrics .card .label { font-size: 13.2px; }
  .overview-metrics .card .value { font-size: 27px; }
  .overview-metrics .card .sub { font-size: 14.8px; }
  .overview-section-heading h2, .overview-panel-title h2, .overview-shortcuts h2, .router-settings-heading h2 { font-size: 17px; }
  .overview-shortcut-grid { grid-template-columns: 1fr; }
  .overview-shortcut { padding: 13px; }
  .router-settings-heading { padding: 18px; }
  .router-settings-heading p:last-child { font-size: 13px; }
  .detail { align-items: flex-start; flex-direction: column; gap: 3px; }
  .detail strong { text-align: left !important; }
  label, .form-note { font-size: 12.6px; }
  th { font-size: 11.5px; }
  th, td { padding: 11px 9px; }
  .status, .badge { font-size: 12px; }
  .router-system-settings { padding-top: 0; }
}

/* Monitoring & Backup workspace */
html, body { max-width: 100%; overflow-x: hidden; }
.page-operations { position: relative; isolation: isolate; }
.page-operations::before { content: ""; position: absolute; z-index: -1; width: 440px; height: 440px; top: 50px; right: -230px; border-radius: 50%; background: radial-gradient(circle, rgba(161, 102, 255, .13), transparent 68%); pointer-events: none; }
.realtime-monitor-panel { position: relative; overflow: hidden; padding: 22px; border-color: color-mix(in srgb, var(--line) 62%, #a678ff 38%); background: linear-gradient(125deg, color-mix(in srgb, var(--panel) 93%, #7c3aed 7%), var(--panel)); }
.realtime-monitor-panel::after { content: ""; position: absolute; width: 220px; height: 220px; top: -135px; right: 24%; border: 1px solid rgba(190, 145, 255, .23); border-radius: 50%; box-shadow: 0 0 0 38px rgba(139, 92, 246, .035), 0 0 0 76px rgba(139, 92, 246, .022); pointer-events: none; }
.operations-panel-head { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.operations-panel-head.compact { margin-bottom: 15px; }
.operations-panel-head h2 { margin: 4px 0 5px; font-size: 21px; line-height: 1.2; }
.operations-panel-head p:last-child { max-width: 670px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.operations-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.monitor-live-state { display: inline-flex; align-items: center; gap: 8px; min-height: 39px; padding: 0 12px; border: 1px solid rgba(88, 227, 173, .24); border-radius: 999px; color: #75efbc; background: rgba(70, 218, 157, .08); font-size: 12px; font-weight: 750; letter-spacing: .04em; }
.monitor-live-state i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px rgba(94, 240, 193, .12), 0 0 16px currentColor; }
.monitor-live-state i::after { content: ""; position: absolute; inset: -5px; border: 1px solid currentColor; border-radius: 50%; animation: monitor-live-ping 1.9s ease-out infinite; }
.monitor-live-state.degraded { border-color: rgba(253, 189, 74, .32); color: #f5bd55; background: rgba(239, 173, 67, .08); }
.realtime-monitor-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(270px, .72fr); gap: 16px; align-items: stretch; }
.health-wave-card { min-height: 254px; padding: 16px 17px 12px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 65%, #a369ff 35%); border-radius: 14px; background: linear-gradient(145deg, color-mix(in srgb, var(--panel-2) 85%, #5628ad 15%), color-mix(in srgb, var(--panel) 93%, #5d37aa 7%)); }
.health-wave-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.health-wave-meta div { display: grid; gap: 2px; }
.health-wave-meta span { color: var(--muted); font-size: 12px; }
.health-wave-meta strong { color: var(--text); font-size: 28px; line-height: 1; letter-spacing: -.035em; }
.health-wave-stage { position: relative; height: 155px; margin-top: 11px; overflow: hidden; border-radius: 10px; background-image: linear-gradient(rgba(205, 174, 255, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(205, 174, 255, .06) 1px, transparent 1px), radial-gradient(circle at 85% 20%, rgba(194, 90, 255, .17), transparent 32%); background-size: 100% 31px, 56px 100%, auto; }
.health-wave-stage svg { display: block; width: 100%; height: 100%; overflow: visible; }
.health-wave-stage #healthWaveLine { filter: drop-shadow(0 0 7px rgba(190, 116, 255, .78)); stroke-dasharray: 4 0; animation: monitor-wave-glow 3.8s linear infinite; }
.health-wave-stage #healthWaveHead { filter: drop-shadow(0 0 9px #d3b6ff); animation: monitor-head-pulse 1.7s ease-in-out infinite; }
.health-wave-scan { position: absolute; top: 0; bottom: 0; width: 76px; left: -96px; background: linear-gradient(90deg, transparent, rgba(223, 196, 255, .13), transparent); transform: skewX(-18deg); animation: monitor-scan 4.8s ease-in-out infinite; pointer-events: none; }
.health-wave-axis { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 11px; }
.health-component-grid { display: grid; grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 9px; }
.health-component { display: grid; grid-template-columns: 11px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 51px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--panel-2) 80%, #7a47dc 20%); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.health-component:hover { border-color: rgba(177, 126, 255, .7); background: color-mix(in srgb, var(--panel-2) 66%, #8b5cf6 34%); transform: translateX(-3px); }
.health-component-dot { width: 8px; height: 8px; border-radius: 50%; background: #fb617f; box-shadow: 0 0 0 4px rgba(240, 105, 135, .11); }
.health-component.ready .health-component-dot { background: #55e6ac; box-shadow: 0 0 0 4px rgba(85, 230, 172, .11), 0 0 14px rgba(85, 230, 172, .5); }
.health-component.degraded .health-component-dot { background: #f0ba58; box-shadow: 0 0 0 4px rgba(240, 186, 88, .11); }
.health-component div { display: grid; min-width: 0; gap: 2px; }
.health-component strong { overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; white-space: nowrap; font-size: 13px; }
.health-component small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.health-component-score { color: #cdb3ff; font-size: 12.5px; font-weight: 800; }
.operations-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; gap: 16px; align-items: start; }
.operations-data-panel { min-width: 0; contain: inline-size; padding: 20px 0 0; overflow: hidden; border-color: color-mix(in srgb, var(--line) 70%, #9f6bf1 30%); }
.operations-data-panel > .operations-panel-head, .operations-data-panel > .operations-toolbar, .operations-data-panel > .operations-footnote { margin-right: 20px; margin-left: 20px; }
.operations-data-panel .operations-panel-head { align-items: center; }
.operations-data-panel .operations-panel-head h2 { font-size: 19px; }
.operations-data-panel .operations-panel-head p:last-child { font-size: 12px; }
.operations-toolbar { display: flex; align-items: end; gap: 9px; min-height: 43px; margin-bottom: 14px; }
.operations-toolbar label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.operations-toolbar select { min-width: 146px; padding: 8px 30px 8px 9px; font-size: 12px; }
.backup-toolbar { justify-content: flex-start; flex-wrap: wrap; }
.operations-toolbar .danger { background: linear-gradient(135deg, #b63258, #d84265); border-color: rgba(255, 145, 174, .35); color: #fff; }
.operations-toolbar .danger:hover { box-shadow: 0 10px 19px rgba(188, 44, 87, .23); transform: translateY(-1px); }
.operations-table-scroll { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.operations-table { min-width: 650px; margin: 0; background: transparent; }
.operations-table th { padding-top: 12px; padding-bottom: 12px; background: color-mix(in srgb, var(--panel-2) 82%, #7446d3 18%); font-size: 10.4px; }
.operations-table td { padding-top: 12px; padding-bottom: 12px; font-size: 12px; }
.operations-table tbody tr { transition: background .18s ease; }
.operations-table tbody tr:hover { background: color-mix(in srgb, var(--panel-2) 74%, #7b4bc7 26%); }
.operations-table code { color: #d6b6ff; font-size: 11px; }
.operations-table input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--primary); }
.operations-pagination { justify-content: flex-start; min-height: 54px; margin: 0; padding: 10px 20px; }
.operations-pagination button { min-width: 39px; padding: 8px 10px; }
.operations-pagination button:disabled { opacity: .42; cursor: not-allowed; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.backup-actions button { padding: 7px 9px; font-size: 11.5px; }
.operations-footnote { margin-top: 12px; margin-bottom: 16px; color: var(--muted); font-size: 11.4px; line-height: 1.5; }
@keyframes monitor-live-ping { 0% { opacity: .8; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.65); } }
@keyframes monitor-scan { 0%, 15% { left: -100px; opacity: 0; } 28%, 72% { opacity: 1; } 88%, 100% { left: calc(100% + 100px); opacity: 0; } }
@keyframes monitor-wave-glow { 50% { filter: drop-shadow(0 0 12px rgba(210, 145, 255, 1)); } }
@keyframes monitor-head-pulse { 50% { r: 6.5; opacity: .74; } }
@media (prefers-reduced-motion: reduce) {
  .monitor-live-state i::after, .health-wave-stage #healthWaveLine, .health-wave-stage #healthWaveHead, .health-wave-scan { animation: none; }
  .health-component { transition: none; }
}
@media (max-width: 1040px) {
  .realtime-monitor-grid, .operations-data-grid { grid-template-columns: 1fr; }
  .health-component-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .realtime-monitor-panel { padding: 16px; }
  .operations-panel-head { align-items: flex-start; flex-direction: column; gap: 11px; }
  .operations-panel-head h2 { font-size: 18px; }
  .operations-panel-head p:last-child { font-size: 12px; }
  .operations-head-actions { width: 100%; justify-content: space-between; }
  .health-wave-card { min-height: 240px; padding: 14px 13px 11px; }
  .health-component-grid { grid-template-columns: 1fr; }
  .health-component { min-height: 48px; }
  .operations-data-grid { gap: 13px; }
  .operations-data-panel { padding-top: 16px; }
  .operations-data-panel > .operations-panel-head, .operations-data-panel > .operations-toolbar, .operations-data-panel > .operations-footnote { margin-right: 16px; margin-left: 16px; }
  .operations-toolbar { align-items: stretch; flex-wrap: wrap; }
  .operations-toolbar label { width: 100%; }
  .operations-toolbar select, .operations-toolbar button { width: 100%; min-height: 39px; }
  .operations-pagination { padding: 9px 16px; }
  .operations-table { min-width: 630px; }
}

/* Stable navigation and compact bulk controls. */
@media (min-width: 601px) {
  .app-shell { display: block; }
  aside { position: fixed; z-index: 30; top: 0; left: 0; width: 270px; height: 100vh; box-sizing: border-box; overflow-y: auto; }
  main { margin-left: 270px; }
}
@media (min-width: 601px) and (max-width: 900px) {
  aside { width: 218px; }
  main { margin-left: 218px; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  aside { width: 240px; }
  main { margin-left: 240px; }
}
.mobile-sidebar-toggle, .sidebar-backdrop { display: none; }
.proxy-toolbar-actions { align-items: center; flex-wrap: wrap; }
.bulk-action-box { display: inline-flex; align-items: stretch; overflow: hidden; min-height: 42px; border: 1px solid rgba(177, 126, 255, .42); border-radius: 10px; background: color-mix(in srgb, var(--panel-2) 84%, #6030b5 16%); }
.bulk-action-box > span { display: inline-flex; align-items: center; padding: 0 10px; color: #d8c6ff; font-weight: 750; font-size: 12px; border-right: 1px solid rgba(177, 126, 255, .28); }
.bulk-action-box button { min-height: 40px; padding: 7px 10px; border: 0; border-left: 1px solid rgba(177, 126, 255, .2); border-radius: 0; color: var(--text); background: transparent; box-shadow: none; font-size: 12px; }
.bulk-action-box button:hover:not(:disabled) { color: #fff; background: rgba(148, 87, 239, .36); box-shadow: none; transform: none; }
#pppoeProxyRegion .table-panel table th:last-child, #vpnProxyRegion .table-panel table th:last-child { text-align: right; }
#pppoeProxyRegion .table-panel table td:last-child, #vpnProxyRegion .table-panel table td:last-child { text-align: right; }
.proxy-row-actions { min-width: 218px; }
.proxy-row-actions .actions { justify-content: flex-end; width: 100%; }
.proxy-row-actions .actions button { min-width: 100px; }
.backup-table td { height: 37px; padding-top: 4px; padding-bottom: 4px; }
.backup-actions button { min-height: 29px; padding: 4px 7px; font-size: 10.8px; }
.backup-empty-row td { color: transparent; }
@media (min-width: 1041px) {
  .operations-data-panel { display: flex; flex-direction: column; height: 560px; min-height: 0; }
  .operations-data-panel .operations-table-scroll { flex: 0 0 auto; }
  .audit-panel .operations-pagination, .backup-panel .operations-footnote { margin-top: auto; }
  .backup-panel .operations-footnote { display: flex; align-items: center; min-height: 54px; box-sizing: border-box; }
}

@media (max-width: 600px) {
  body.mobile-sidebar-open { overflow: hidden; }
  .app-shell { display: block; }
  main { margin-left: 0; }
  aside { display: flex; position: fixed; z-index: 80; top: 0; bottom: 0; left: 0; width: min(86vw, 340px); height: 100dvh; padding: 18px 15px 15px; overflow-y: auto; border-right: 1px solid rgba(194, 159, 255, .3); box-shadow: 22px 0 45px rgba(5, 1, 18, .4); transform: translateX(calc(-100% - 16px)); transition: transform .25s ease; }
  .app-shell.mobile-sidebar-open aside { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; z-index: 70; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: rgba(5, 2, 14, .58); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
  .app-shell.mobile-sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
  .brand { display: flex; padding: 1px 6px 16px; font-size: 18px; }
  .brand-mark.small { width: 34px; height: 34px; }
  .primary-nav { display: grid; grid-template-columns: 1fr; gap: 8px; overflow: visible; margin: 0; padding: 0; border: 0; }
  .primary-nav .nav-item:last-child { grid-column: auto; }
  .sidebar-lower { display: grid; gap: 8px; margin-top: auto; padding: 16px 0 0; border-top: 1px solid rgba(216, 190, 255, .13); }
  .nav-item { width: 100%; min-height: 45px; padding: 9px 11px; font-size: 15px; white-space: normal; }
  .sidebar-footer { display: grid; align-items: start; gap: 9px; margin-top: 12px; padding: 14px 6px 2px; border-top: 1px solid rgba(216, 190, 255, .13); }
  header { position: sticky; z-index: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 16px 76px 16px 16px; }
  .mobile-sidebar-toggle { position: fixed; z-index: 90; top: 16px; right: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 48px; height: 44px; padding: 0; border-color: rgba(190, 146, 255, .45); background: linear-gradient(145deg, rgba(111, 59, 203, .52), rgba(59, 23, 105, .7)); box-shadow: 0 8px 18px rgba(36, 10, 79, .28); }
  .mobile-sidebar-toggle img { width: 21px; height: 21px; border-radius: 6px; object-fit: cover; }
  .mobile-menu-lines { display: grid; gap: 3px; width: 14px; }
  .mobile-menu-lines i { display: block; width: 14px; height: 2px; border-radius: 999px; background: #f3eaff; }
  .header-actions { grid-column: 1 / -1; width: 100%; justify-content: space-between; }
  .proxy-toolbar-actions { width: 100%; }
  .bulk-action-box { flex: 1 1 220px; }
  .bulk-action-box > span { flex: 1 1 auto; }
  .bulk-action-box button { flex: 1 1 0; }
  .proxy-row-actions .actions { min-width: 214px; }
}

/* Account layer, desktop toolbar sizing, and data-panel alignment. */
header .header-actions { position: relative; z-index: 120; }
header .account { z-index: 140; }
header #accountMenu { z-index: 180; }
.header-actions > .icon-button, .header-actions .dashboard-language select, #accountButton { height: 48px; min-height: 48px; }
.header-actions .dashboard-language select { min-width: 78px; border-radius: 10px; }
#accountButton { display: inline-flex; align-items: center; justify-content: center; min-width: 120px; padding: 0 13px; border-radius: 10px; white-space: nowrap; }

.operations-data-panel .operations-toolbar { min-height: 58px; align-items: end; }
.operations-table { table-layout: fixed; }
.operations-table th { height: 42px; padding-top: 9px; padding-bottom: 9px; vertical-align: middle; }
.operations-table td, .backup-table td { height: 44px; padding-top: 7px; padding-bottom: 7px; vertical-align: middle; }
.audit-panel .operations-table th:nth-child(1) { width: 23%; }
.audit-panel .operations-table th:nth-child(2) { width: 13%; }
.audit-panel .operations-table th:nth-child(3) { width: 30%; }
.audit-panel .operations-table th:nth-child(4) { width: 17%; }
.audit-panel .operations-table th:nth-child(5) { width: 17%; }
.backup-panel .operations-table th:nth-child(1) { width: 7%; }
.backup-panel .operations-table th:nth-child(2) { width: 24%; }
.backup-panel .operations-table th:nth-child(3) { width: 17%; }
.backup-panel .operations-table th:nth-child(4) { width: 19%; }
.backup-panel .operations-table th:nth-child(5) { width: 17%; }
.backup-panel .operations-table th:nth-child(6) { width: 16%; }
.backup-actions { align-items: center; flex-wrap: nowrap; }
.backup-actions button { min-height: 30px; padding: 4px 7px; font-size: 10.8px; white-space: nowrap; }

/* Login: 2/3 visual banner, 1/3 focused sign-in form. */
.login-page { background: linear-gradient(135deg, rgba(7, 2, 24, .78), rgba(23, 7, 53, .7)), url("/assets/login-purple-network-v1.png") center / cover no-repeat; }
.login-card { grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); background: rgba(20, 10, 43, .88); border-color: rgba(195, 151, 255, .35); }
.login-intro { background: linear-gradient(95deg, rgba(15, 6, 39, .93) 0%, rgba(31, 12, 73, .84) 55%, rgba(73, 27, 131, .56) 100%), url("/assets/login-purple-network-v1.png") 75% center / cover no-repeat; }
.login-intro::after { background-image: linear-gradient(rgba(226, 203, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(226, 203, 255, .06) 1px, transparent 1px); }
.login-form-panel { padding: clamp(34px, 4vw, 72px); background: linear-gradient(160deg, color-mix(in srgb, var(--login-card) 92%, #2c135b 8%), color-mix(in srgb, var(--login-card) 96%, #5a2497 4%)); border-left: 1px solid rgba(213, 181, 255, .18); }
.login-form-head h2 { font-size: clamp(25px, 2vw, 31px); }
.login-submit { min-height: 48px; }
html[data-theme="light"] .login-form-panel { background: linear-gradient(160deg, rgba(255,255,255,.93), rgba(245,238,255,.91)); }

@media (max-width: 760px) {
  .login-card { grid-template-columns: 1fr; }
  .login-intro { background-position: 68% center; }
  .login-form-panel { border-left: 0; border-top: 1px solid rgba(213, 181, 255, .18); }
}
@media (max-width: 600px) {
  .header-actions { gap: 7px; }
  .header-actions > .icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex: 0 0 44px; }
  .header-actions .dashboard-language select, #accountButton { height: 44px; min-height: 44px; flex: 0 0 auto; }
  .header-actions .dashboard-language select { min-width: 72px; }
  #accountButton { min-width: 106px; padding: 0 10px; }
  header:has(#accountMenu:not(.hidden)) { z-index: 300; }
  #accountMenu:not(.hidden) { position: fixed; z-index: 260; top: 154px; right: 16px; }
  .login-page { background-position: 68% center; }
}

/* Unified Proxy Manager controls: PPPoE/VPN and IPv4/IPv6 share one rhythm. */
.proxy-region-heading { gap: 16px; }
.proxy-region-heading > div:first-child { min-width: 0; }
.proxy-region-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.proxy-region-heading-actions button { min-height: 42px; padding: 8px 13px; font-size: 12.8px; white-space: nowrap; }
#pppoeProxyRegion > .toolbar,
#vpnProxyRegion > .toolbar,
#ipv6PppoeProxyRegion > .toolbar,
#ipv6VpnProxyRegion > .toolbar { align-items: center; gap: 12px; flex-wrap: nowrap; }
#pppoeProxyRegion .proxy-toolbar-actions,
#vpnProxyRegion .proxy-toolbar-actions,
#ipv6PppoeProxyRegion .toolbar-actions,
#ipv6VpnProxyRegion .toolbar-actions { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; flex-wrap: nowrap; }
#pppoeProxyRegion .proxy-toolbar-meta,
#vpnProxyRegion .proxy-toolbar-meta,
#ipv6PppoeProxyRegion .toolbar-meta,
#ipv6VpnProxyRegion .toolbar-meta { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 9px; min-height: 42px; margin-left: auto; white-space: nowrap; }
#pppoeProxyRegion .proxy-toolbar-actions > button,
#vpnProxyRegion .proxy-toolbar-actions > button,
#ipv6PppoeProxyRegion .toolbar-actions > button,
#ipv6VpnProxyRegion .toolbar-actions > button,
.proxy-action-choice > summary,
.proxy-runtime-controls button,
.proxy-runtime-controls select { min-height: 42px; height: 42px; font-size: 12.8px; }
.proxy-runtime-controls { display: inline-flex; width: auto; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: nowrap; }
.proxy-runtime-controls label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.proxy-runtime-controls select { width: auto; min-width: 106px; padding: 7px 27px 7px 9px; }
.proxy-action-choice { position: relative; flex: 0 0 auto; margin: 0; }
.proxy-action-choice > summary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--panel); cursor: pointer; font-weight: 700; list-style: none; white-space: nowrap; }
.proxy-action-choice > summary::-webkit-details-marker { display: none; }
.proxy-action-choice > summary::after { content: "⌄"; color: var(--muted); font-size: 14px; line-height: 1; }
.proxy-action-choice[open] > summary { border-color: rgba(178, 126, 255, .78); background: color-mix(in srgb, var(--panel-2) 72%, #7c3aed 28%); }
.proxy-action-menu { position: absolute; top: calc(100% + 7px); left: 0; z-index: 90; display: grid; min-width: 126px; padding: 6px; gap: 5px; border: 1px solid rgba(181, 135, 255, .48); border-radius: 10px; background: color-mix(in srgb, var(--panel) 90%, #492287 10%); box-shadow: 0 16px 32px rgba(8, 3, 24, .36); }
.proxy-action-menu button { min-height: 34px; padding: 6px 10px; font-size: 12px; text-align: left; white-space: nowrap; }
#pppoeProxyRegion .proxy-row-actions,
#vpnProxyRegion .proxy-row-actions { min-width: 226px; }
#pppoeProxyRegion .proxy-row-actions .actions,
#vpnProxyRegion .proxy-row-actions .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 6px; justify-content: stretch; }
#pppoeProxyRegion .proxy-row-actions .actions button,
#vpnProxyRegion .proxy-row-actions .actions button { width: 100%; min-width: 0; min-height: 36px; padding: 7px 8px; font-size: 11.8px; white-space: nowrap; }

/* Header controls are deliberately measured against the icon buttons. */
.header-actions > .icon-button { width: 48px; min-width: 48px; }
.dashboard-language { position: relative; display: inline-flex; align-items: center; }
.dashboard-language .language-icon { position: absolute; left: 11px; z-index: 1; color: #d9c7ff; font-size: 16px; font-weight: 800; line-height: 1; pointer-events: none; }
.header-actions .dashboard-language select { appearance: none; width: 96px; min-width: 96px; padding: 8px 10px 8px 36px; text-align: left; }
#accountButton { min-width: 140px; gap: 10px; font-size: 17px; font-weight: 800; }
#accountButton .account-settings-icon { color: #caa9ff; font-size: 16px; line-height: 1; }

@media (min-width: 761px) and (max-width: 1400px) {
  #pppoeProxyRegion > .toolbar,
  #vpnProxyRegion > .toolbar,
  #ipv6PppoeProxyRegion > .toolbar,
  #ipv6VpnProxyRegion > .toolbar { align-items: flex-start; flex-wrap: wrap; }
  #pppoeProxyRegion .proxy-toolbar-actions,
  #vpnProxyRegion .proxy-toolbar-actions,
  #ipv6PppoeProxyRegion .toolbar-actions,
  #ipv6VpnProxyRegion .toolbar-actions { flex-wrap: wrap; }
  #pppoeProxyRegion .proxy-toolbar-meta,
  #vpnProxyRegion .proxy-toolbar-meta,
  #ipv6PppoeProxyRegion .toolbar-meta,
  #ipv6VpnProxyRegion .toolbar-meta { width: 100%; margin-left: 0; }
}

@media (max-width: 760px) {
  .proxy-region-heading { display: block; margin-bottom: 12px; }
  .proxy-region-heading-actions { display: grid; grid-template-columns: 1fr 1fr 1.7fr; width: 100%; margin-top: 11px; gap: 7px; }
  .proxy-region-heading-actions button { min-width: 0; min-height: 42px; padding: 7px 8px; font-size: 11.5px; white-space: normal; }
  #pppoeProxyRegion > .toolbar,
  #vpnProxyRegion > .toolbar,
  #ipv6PppoeProxyRegion > .toolbar,
  #ipv6VpnProxyRegion > .toolbar { align-items: stretch; flex-wrap: wrap; gap: 8px; }
  #pppoeProxyRegion .proxy-toolbar-actions,
  #vpnProxyRegion .proxy-toolbar-actions,
  #ipv6PppoeProxyRegion .toolbar-actions,
  #ipv6VpnProxyRegion .toolbar-actions { width: 100%; flex-wrap: wrap; gap: 7px; }
  #pppoeProxyRegion .proxy-toolbar-actions > button,
  #vpnProxyRegion .proxy-toolbar-actions > button,
  #ipv6PppoeProxyRegion .toolbar-actions > button,
  #ipv6VpnProxyRegion .toolbar-actions > button { flex: 1 1 118px; }
  .proxy-action-choice { flex: 1 1 118px; }
  .proxy-action-choice > summary { width: 100%; min-height: 42px; }
  .proxy-action-menu { width: 100%; min-width: 0; }
  .proxy-runtime-controls { flex: 1 1 100%; width: 100%; flex-wrap: wrap; }
  .proxy-runtime-controls label { flex: 1 1 152px; }
  .proxy-runtime-controls select { flex: 1 1 auto; min-width: 0; }
  .proxy-runtime-controls button { flex: 1 1 116px; }
  #pppoeProxyRegion .proxy-toolbar-meta,
  #vpnProxyRegion .proxy-toolbar-meta,
  #ipv6PppoeProxyRegion .toolbar-meta,
  #ipv6VpnProxyRegion .toolbar-meta { width: 100%; justify-content: space-between; margin-left: 0; }
  .header-actions .dashboard-language select { width: 88px; min-width: 88px; padding-left: 34px; }
  .dashboard-language .language-icon { left: 10px; }
  #accountButton { min-width: 120px; padding: 0 9px; font-size: 16px; gap: 7px; }
}

/* Login branding and copy are intentionally 150% of the original presentation scale. */
.login-topbar { font-size: 18px; }
.login-theme-button { width: 44px; height: 44px; font-size: 20px; }
.login-language select { min-width: 108px; font-size: 15px; }
.login-logo { width: 144px; height: 144px; margin-bottom: 27px; border-radius: 32px; }
.login-branding h1 { font-size: clamp(45px, 3.3vw, 57px); }
.login-branding p { max-width: 495px; margin-top: 18px; font-size: 22.5px; }
.login-intro-copy { width: min(100%, 585px); margin-top: 51px; padding-top: 36px; }
.login-intro-copy strong { font-size: 28.5px; }
.login-intro-copy p { margin-top: 15px; font-size: 21px; }
.login-footer { font-size: 15px; }
.login-form-panel { font-size: 21px; }
.login-form-head .eyebrow { font-size: 16.5px; }
.login-form-head h2 { font-size: clamp(37.5px, 3vw, 46.5px); }
.login-form-head p { font-size: 21px; }
.login-form-panel label { font-size: 18px; }
.login-form-panel input { font-size: 18px; }
.login-submit { min-height: 60px; font-size: 18px; }

@media (max-width: 760px) {
  .login-intro { min-height: 390px; }
  .login-logo { width: 108px; height: 108px; margin-bottom: 18px; border-radius: 27px; }
  .login-branding h1 { font-size: 42px; }
  .login-branding p { margin-top: 12px; font-size: 18px; }
  .login-topbar { font-size: 15px; }
  .login-theme-button { width: 40px; height: 40px; font-size: 18px; }
  .login-language select { min-width: 96px; font-size: 14px; }
  .login-form-panel { font-size: 18px; }
  .login-form-head .eyebrow { font-size: 14px; }
  .login-form-head h2 { font-size: 34px; }
  .login-form-head p { font-size: 18px; }
  .login-form-panel label, .login-form-panel input { font-size: 16px; }
  .login-submit { min-height: 54px; font-size: 17px; }
}

@media (max-width: 600px) {
  .login-intro { min-height: 390px; }
  .login-branding { margin-top: 28px; }
  .login-logo { width: 108px; height: 108px; margin-bottom: 18px; }
  .login-branding h1 { font-size: 42px; }
  .login-branding p { font-size: 18px; line-height: 1.45; }
  .login-form-panel { padding: 34px 26px 42px; }
}

/* Mobile overview: one explicit vertical route avoids compressed implicit grid tracks. */
@media (max-width: 760px) {
  .overview-flow { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 26px auto 26px auto 26px auto; align-items: stretch; min-height: 0; margin-top: 15px; gap: 0; }
  .overview-flow-node,
  .overview-flow-node.source,
  .overview-flow-node.router,
  .overview-flow-node.core,
  .overview-flow-node.egress { grid-column: 1; width: 100%; min-height: 94px; padding: 12px 14px; }
  .overview-flow-node.source { grid-row: 1; }
  .overview-flow-node.router { grid-row: 3; }
  .overview-flow-node.core { grid-row: 5; }
  .overview-flow-node.egress { grid-row: 7; }
  .overview-flow > .overview-flow-link,
  .overview-flow > .overview-flow-link:nth-of-type(1),
  .overview-flow > .overview-flow-link:nth-of-type(2),
  .overview-flow > .overview-flow-link:nth-of-type(3) { grid-column: 1; width: 2px; height: 26px; justify-self: center; align-self: stretch; }
  .overview-flow > .overview-flow-link:nth-of-type(1) { grid-row: 2; }
  .overview-flow > .overview-flow-link:nth-of-type(2) { grid-row: 4; }
  .overview-flow > .overview-flow-link:nth-of-type(3) { grid-row: 6; }
  .overview-flow-link::after,
  .overview-flow > .overview-flow-link:nth-of-type(1)::after { width: 2px; height: 40%; top: -45%; left: 0; animation-name: overview-flow-vertical; }
  .overview-flow-node strong { font-size: 15px; }
  .overview-flow-node small { font-size: 12px; }
}

/* Login mobile must keep the sign-in fields reachable below the visual banner. */
@media (max-width: 760px) {
  .login-page {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }
  .login-card {
    height: auto;
    min-height: 0;
    margin: 0 auto;
    overflow: visible;
  }
  .login-form-panel { min-height: 0; }
}

@media (max-width: 600px) {
  .login-page { padding: 0; }
  .login-card { width: 100%; height: auto; min-height: 0; margin: 0; }
}

/* Dashboard language: the selected language is centered, followed by its icon. */
.dashboard-language {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 48px;
}
.dashboard-language .language-icon {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translateY(-50%);
}
.header-actions .dashboard-language select {
  width: 100%;
  min-width: 100%;
  height: 48px;
  padding: 0 20px 0 0;
  text-align: center;
  text-align-last: center;
}

@media (max-width: 760px) {
  .dashboard-language { width: 88px; height: 44px; }
  .header-actions .dashboard-language select { width: 100%; min-width: 100%; height: 44px; padding-right: 20px; }
}

@media (max-width: 600px) {
  .header-actions {
    display: flex;
    width: calc(100% + 60px);
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
  }
  .dashboard-language { flex: 0 0 88px; min-width: 88px; }
  .header-actions .account { flex: 0 0 120px; width: 120px; }
  .header-actions #accountButton { width: 100%; min-width: 0; }
}

@media (max-width: 360px) {
  .header-actions { width: calc(100% + 60px); gap: 5px; }
  .dashboard-language { flex-basis: 76px; min-width: 76px; }
  .header-actions .dashboard-language select { padding-right: 18px; }
  .header-actions .account { flex-basis: 100px; width: 100px; }
  #accountButton { gap: 4px; padding: 0 6px; font-size: 14px; }
}
