:root {
  color-scheme: dark;
  --bg: #080d14;
  --surface: #111a27;
  --surface-raised: #182536;
  --line: #26364a;
  --line-strong: #38516f;
  --text: #f3f6fa;
  --muted: #93a2b7;
  --blue: #79aef8;
  --blue-strong: #377fdf;
  --green: #61c99b;
  --amber: #e9b965;
  --red: #f47e88;
  --radius: 17px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-feature-settings: "kern" 1, "tnum" 1;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 280px; min-height: 100vh; overflow-x: hidden; background: var(--bg); }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .44; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #b9d5ff; outline-offset: 3px; }
[hidden] { display: none !important; }
.ambient { position: fixed; inset: 0 0 auto; height: 210px; pointer-events: none; background: radial-gradient(ellipse at 72% -28%, rgba(69,122,194,.18), transparent 62%); }
.shell { position: relative; width: min(100%, 600px); margin: 0 auto; padding: calc(15px + env(safe-area-inset-top)) 16px calc(34px + env(safe-area-inset-bottom)); }
.topbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.brand { display: flex; gap: 11px; align-items: center; }
.brand h1 { margin: 0; font-size: 26px; font-weight: 760; line-height: 1; letter-spacing: -.9px; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.2; }
.brand-mark, .gate-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #365678; border-radius: 12px 12px 12px 5px; background: #122138; color: var(--blue); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.brand-mark svg, .gate-mark svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(17,26,39,.82); color: #c7d3e2; transition: border-color .16s ease, background .16s ease, color .16s ease; }
.icon-button:active { border-color: var(--line-strong); background: var(--surface-raised); color: var(--text); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.loading svg { animation: spin .8s linear infinite; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: #0c131d; }
.segmented button { min-width: 0; min-height: 39px; padding: 6px 4px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: -.1px; }
.segmented button[aria-pressed="true"] { color: var(--text); background: var(--surface-raised); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 5px 16px rgba(0,0,0,.12); }
.host-dot { display: inline-block; width: 6px; height: 6px; margin: 0 0 1px 3px; border-radius: 50%; background: var(--muted); }
.host-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(98,213,162,.1); }
.host-dot.offline { background: var(--red); }
.host-notices { margin-top: 10px; }
.host-notice { margin: 0 0 6px; padding: 9px 11px; border-left: 3px solid var(--red); border-radius: 4px 10px 10px 4px; color: #ffd8db; background: rgba(255,125,134,.08); font-size: 12px; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.status-card { position: relative; min-width: 0; min-height: 94px; display: grid; grid-template: auto auto / 1fr auto; align-items: center; overflow: hidden; padding: 12px 11px 11px; border: 1px solid var(--line); border-radius: 15px; text-align: left; background: linear-gradient(145deg, rgba(24,37,54,.84), rgba(15,23,34,.96)); transition: border-color .16s ease, transform .16s ease; }
.status-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: currentColor; opacity: .9; }
.status-card:active { transform: translateY(1px); border-color: var(--line-strong); }
.status-card strong { grid-row: 1; align-self: center; font-size: 27px; font-weight: 740; line-height: 1; letter-spacing: -1px; color: var(--text); font-variant-numeric: tabular-nums; }
.status-card > span:last-child { grid-column: 1 / -1; margin-top: 10px; overflow: hidden; color: #aab7c8; font-size: 11px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.status-icon { grid-column: 2; justify-self: end; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: rgba(147,162,183,.1); }
.status-card.working .status-icon { background: rgba(121,174,248,.11); }
.status-card.question .status-icon { background: rgba(233,185,101,.11); }
.status-card.idle .status-icon { background: rgba(97,201,155,.11); }
.status-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.working { color: var(--blue); }.question { color: var(--amber); }.idle { color: var(--green); }.error { color: var(--red); }.unknown { color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #142133, #0f1722 74%); box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.vpn-panel { padding: 15px; }
.panel-heading, .section-heading, .dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vpn-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.section-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #345274; border-radius: 11px; background: rgba(44,92,150,.16); color: var(--blue); }
.section-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.section-kicker { margin: 0 0 3px; color: var(--muted); font-size: 10px; line-height: 1.2; }
h2 { margin: 0; font-size: 19px; font-weight: 730; letter-spacing: -.45px; }
.state-pill, .session-state { display: inline-flex; align-items: center; gap: 6px; border: 1px solid currentColor; border-radius: 999px; padding: 5px 9px; font-size: 11px; white-space: nowrap; background: rgba(11,16,24,.42); }
.state-pill::before, .session-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vpn-metrics { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0 14px; }
.vpn-metrics > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.vpn-metrics span, .vpn-metrics strong { display: block; }
.vpn-metrics span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.vpn-metrics strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.panel-message { margin: 0 0 12px; color: #c7d2e2; font-size: 12px; line-height: 1.45; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.button-row button { flex: 1; }
.primary, .secondary, .danger, .danger-quiet { min-height: 44px; padding: 9px 13px; border-radius: 12px; font-weight: 700; font-size: 13px; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.primary:active, .secondary:active, .danger:active, .danger-quiet:active { transform: translateY(1px); }
.primary { border: 1px solid #5795e7; background: var(--blue-strong); color: white; box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 7px 18px rgba(35,93,170,.18); }
.secondary { border: 1px solid var(--line); background: #162131; color: #dce5f0; }
.danger { border: 1px solid #fb737d; background: #d84450; color: white; }
.danger-quiet { border: 1px solid rgba(255,125,134,.4); background: transparent; color: #ff9da4; }
.small { min-height: 38px; padding: 7px 10px; font-size: 12px; }
.button-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.new-session, .action-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.otp-form { margin: 10px 0 14px; }
.otp-form label { margin-bottom: 6px; }
.otp-form > div { display: flex; gap: 8px; }
.otp-form input { flex: 1; min-width: 0; letter-spacing: 4px; text-align: center; }
.sessions { margin-top: 25px; }
.section-heading { margin-bottom: 13px; }
.section-heading h2 span { color: var(--muted); font-weight: 500; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.new-session { min-height: 41px; padding-inline: 14px; }
.search-box { position: relative; display: block; }
.search-box svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.search-box input { width: 100%; padding-left: 40px; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #0c141f; padding: 11px 12px; font-size: 14px; transition: border-color .16s ease, background .16s ease; }
input:focus, select:focus, textarea:focus { border-color: #547ca9; background: #0e1825; }
textarea { resize: vertical; line-height: 1.45; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
label { display: block; color: #c5d0df; font-size: 12px; }
label > input, label > select, label > textarea { margin-top: 7px; }
.form-help { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; font-weight: 450; line-height: 1.35; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin: 11px -16px 15px; padding: 0 16px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row button { min-height: 34px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 580; }
.filter-row button[aria-pressed="true"] { border-color: #5277a5; background: #17263a; color: #dceaff; }
.project-group { margin-top: 15px; }
.group-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; color: #b8c5d6; font-size: 12px; }
.group-title span:last-child { color: var(--muted); }
.session-row { width: 100%; min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 13px 12px 12px 15px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: var(--surface); }
.session-row:first-of-type { border-radius: 14px 14px 0 0; }
.session-row:last-child { border-bottom: 0; border-radius: 0 0 14px 14px; }
.session-row:only-of-type { border-radius: 14px; }
.session-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.session-row small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.session-state { align-self: center; padding: 4px 7px; font-size: 10px; }
.empty-state { padding: 28px 20px; border: 1px dashed #314158; border-radius: 15px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--text); font-size: 14px; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.45; }
.gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.gate-mark { width: 56px; height: 56px; margin-bottom: 20px; border-radius: 18px 18px 18px 7px; }
.gate-mark svg { width: 32px; height: 32px; }
.gate h1 { margin: 0; font-size: 22px; }
.gate p { max-width: 340px; margin: 10px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
dialog { color: var(--text); }
dialog::backdrop { background: rgba(3,7,12,.76); backdrop-filter: blur(5px); }
.sheet { width: min(100% - 18px, 560px); max-height: calc(100dvh - env(safe-area-inset-top) - 10px); margin: auto auto 0; padding: 0; border: 1px solid var(--line); border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: 0 -20px 60px rgba(0,0,0,.3); }
.sheet[open] { animation: sheet-in .2s ease-out; }
.sheet form { margin: 0; }
.dialog-header { position: sticky; top: 0; z-index: 2; padding: 17px 16px 13px; border-bottom: 1px solid var(--line); background: rgba(18,26,38,.96); backdrop-filter: blur(10px); }
.dialog-header .icon-button { width: 38px; height: 38px; flex: 0 0 auto; }
.dialog-body { display: grid; gap: 16px; overflow-y: auto; max-height: calc(100dvh - 153px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 16px; }
.dialog-footer { position: sticky; bottom: 0; display: flex; gap: 9px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(18,26,38,.97); }
.dialog-footer button { flex: 1; }
.form-grid { display: grid; gap: 12px; }.form-grid.two { grid-template-columns: 1fr 1fr; }
fieldset { margin: 0; padding: 0; border: 0; } legend { margin-bottom: 8px; color: #c5d0df; font-size: 12px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; min-height: 66px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: #0f1722; }
.choice input:checked + span { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; background: #14233a; }
.choice input:focus-visible + span { outline: 2px solid #b9d5ff; outline-offset: 3px; }
.choice strong, .choice small { display: block; }.choice strong { color: var(--text); font-size: 12px; }.choice small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.defaults-card { overflow: hidden; border: 1px solid #35577f; border-radius: 14px; background: #111e30; }
.settings-retry { justify-self: end; margin-top: -6px; }
.defaults-summary { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 13px; border: 0; text-align: left; background: transparent; }
.defaults-summary strong, .defaults-summary small { display: block; }.defaults-summary small { margin-top: 4px; color: #9bb0ca; }
.chevron { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; color: var(--muted); transition: transform .18s ease; }.chevron svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.defaults-summary[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.defaults-details { padding: 0 13px 13px; }
.defaults-details dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; margin: 0 0 12px; padding-top: 12px; border-top: 1px solid #2b4565; }
.defaults-details dt { color: var(--muted); font-size: 10px; }.defaults-details dd { margin: 3px 0 0; font-size: 12px; }
.custom-settings { display: grid; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #0f1722; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.switch-row strong, .switch-row small { display: block; }.switch-row strong { font-size: 12px; }.switch-row small { max-width: 260px; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.3; }
input[role="switch"] { width: 43px; height: 25px; flex: 0 0 auto; appearance: none; padding: 2px; border-radius: 99px; background: #2b3748; transition: background .15s; }
input[role="switch"]::before { content: ""; display: block; width: 19px; height: 19px; border-radius: 50%; background: white; transition: transform .15s; }
input[role="switch"]:checked { background: var(--blue-strong); } input[role="switch"]:checked::before { transform: translateX(17px); }
.optional { color: var(--muted); font-size: 10px; }
.form-error { margin: 0; padding: 10px; border-left: 3px solid var(--red); border-radius: 4px 10px 10px 4px; background: rgba(255,125,134,.08); color: #ffd5d8; font-size: 12px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }.detail-meta span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; }
.answer-block { min-height: 150px; padding: 14px; border-left: 3px solid var(--blue); border-radius: 4px 14px 14px 4px; background: #0c141f; }
.answer-block h3 { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 500; }
.answer-block pre { margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-word; color: #e4ebf5; font: 13px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif; }
.confirm-dialog { width: min(100% - 36px, 380px); padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); text-align: center; }
.confirm-dialog form { margin: 0; }.confirm-symbol { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 14px; border: 1px solid rgba(244,126,136,.55); border-radius: 14px; background: rgba(244,126,136,.08); color: var(--red); }.confirm-symbol svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.confirm-dialog h2 { margin-bottom: 8px; }.confirm-dialog p { margin: 0 0 19px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 460px); transform: translateX(-50%); padding: 12px 14px; border: 1px solid #385478; border-radius: 12px; background: #18263a; box-shadow: 0 10px 35px rgba(0,0,0,.32); color: white; font-size: 12px; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheet-in { from { transform: translateY(20px); opacity: .5; } }
@media (max-width: 370px) { .shell { padding-left: 12px; padding-right: 12px; }.status-grid { gap: 6px; }.status-card { min-height: 90px; padding: 10px 9px; }.status-card strong { font-size: 24px; }.status-icon { width: 25px; height: 25px; }.status-card > span:last-child { font-size: 10px; }.form-grid.two, .choice-row { grid-template-columns: 1fr; }.vpn-actions button { flex-basis: calc(50% - 4px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

#detail-questions fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
#detail-questions legend { font-weight: 600; margin-bottom: 10px; font-size: 13px; }
.question-choice { display: flex; align-items: center; gap: 9px; margin: 8px 0; }
.question-choice input { width: auto; flex: 0 0 auto; }
