:root {
  color-scheme: dark;
  --bg: #070a10; --surface: #101620; --surface-2: #151d29; --line: #263140;
  --text: #eef3f8; --muted: #8f9baa; --cyan: #61d7ca; --blue: #6fa8ff; --violet: #9b7bff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: radial-gradient(circle at 20% -10%, #18364d 0, transparent 33%), radial-gradient(circle at 92% 78%, #282054 0, transparent 31%), var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; z-index: -1; width: 460px; height: 460px; border-radius: 50%; filter: blur(120px); opacity: .18; }
.ambient-a { top: -220px; left: -170px; background: #38bdf8; }
.ambient-b { right: -220px; bottom: -240px; background: #8b5cf6; }
.portal { width: min(1120px, calc(100% - 40px)); margin: auto; padding: 26px 0 54px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand p, .eyebrow, .card-kicker { margin: 0; color: #87b7c8; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.brand strong { display: block; margin-top: 1px; font-size: 16px; }
.vault-mark { position: relative; display: grid; width: 52px; height: 52px; place-items: center; border: 1px solid #74ded052; border-radius: 17px; background: linear-gradient(145deg, #1b796f, #3b4da4); box-shadow: 0 12px 30px #1aa99b2b; }
.vault-mark.small { width: 42px; height: 42px; border-radius: 13px; }
.vault-mark:before { width: 17px; height: 14px; border: 2px solid white; border-radius: 5px; content: ""; }
.vault-mark:after { position: absolute; top: 12px; width: 10px; height: 10px; border: 2px solid white; border-bottom: 0; border-radius: 8px 8px 0 0; content: ""; }
.vault-mark.small:after { top: 8px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.status-badge { padding: 7px 10px; border: 1px solid #6fb9ff42; border-radius: 999px; background: #162a3d; color: #9dccf7; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.status-badge.protected { border-color: #56d1a048; background: #123326; color: #83e5bc; }
.quiet { min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 9px; background: #121923; cursor: pointer; }
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px; padding: 74px 0 46px; }
.hero h1 { max-width: 700px; margin: 8px 0 14px; font-size: clamp(38px, 7vw, 68px); line-height: 1.05; letter-spacing: -.055em; }
.hero > div > p:last-child { max-width: 650px; margin: 0; color: var(--muted); font-size: 15px; }
.hero-stat { display: flex; width: 146px; height: 146px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #ffffff18; border-radius: 50%; background: #10172299; box-shadow: inset 0 0 0 9px #ffffff03, 0 20px 60px #0005; }
.hero-stat span { font-size: 43px; font-weight: 780; line-height: 1; }
.hero-stat small { margin-top: 8px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.subscription-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.clash-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 17px; min-width: 0; padding: 22px; border: 1px solid #5fd5c556; border-radius: 22px; background: linear-gradient(120deg, #112a2a, #131a2b 58%, #1c1831); box-shadow: 0 20px 60px #0004, inset 0 1px #ffffff0a; }
.clash-card:nth-child(2) { border-color: #8e7af05c; background: linear-gradient(120deg, #211b3c, #171a2c 58%, #11242b); }
.clash-icon { display: grid; width: 66px; height: 66px; place-items: center; border-radius: 20px; background: linear-gradient(145deg, #55cfbe, #597adf); color: #07120f; font-size: 28px; font-weight: 900; }
.clash-copy h2, .section-head h2 { margin: 3px 0 3px; font-size: 21px; }
.clash-copy > p:not(.card-kicker) { margin: 0; color: var(--muted); font-size: 12px; }
.link-preview, .node-link { margin-top: 10px; overflow: hidden; color: #b8c5d2; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: flex; grid-column: 1 / -1; gap: 8px; }
.primary, .secondary, .icon-action { min-height: 42px; padding: 10px 14px; border-radius: 11px; font-size: 12px; font-weight: 750; cursor: pointer; transition: transform .15s, filter .15s, border-color .15s; }
.primary { border: 0; background: linear-gradient(110deg, #4ac7b6, #557ce0); color: #071311; box-shadow: 0 10px 24px #2aa99b2b; }
.secondary { border: 1px solid #40516a; background: #192230; }
button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 46px 0 15px; }
.section-head > p { max-width: 390px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.selection-guide { margin: 0 0 16px; padding: 13px 15px; border: 1px solid #40556b; border-radius: 15px; background: linear-gradient(120deg, #111c29, #111722); }
.selection-guide-top { display: flex; align-items: flex-start; gap: 10px; }
.guide-mark { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border: 1px solid #6fa8ff55; border-radius: 50%; background: #1a2a40; color: #a8ceff; font-size: 12px; font-weight: 800; }
.selection-guide-top strong { display: block; color: #dce8f6; font-size: 11px; }
.selection-guide-top p { margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.selection-details { margin-top: 10px; border-top: 1px solid #ffffff12; }
.selection-details summary { padding-top: 9px; color: #a9c9ee; font-size: 10px; font-weight: 700; cursor: pointer; }
.protocol-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.protocol-guide > div { padding: 9px 10px; border: 1px solid #ffffff12; border-radius: 10px; background: #ffffff04; }
.protocol-guide strong { font-size: 10px; }
.protocol-guide strong span { margin-left: 5px; color: #80b7e9; font-size: 8px; font-weight: 650; }
.protocol-guide p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.port-note { margin: 9px 0 0; color: #8190a3; font-size: 9px; line-height: 1.5; }
.server-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 2px 0 20px; }
.server-picker { display: flex; min-width: 0; min-height: 78px; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, #121a25, #0d131c); color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.server-picker[aria-pressed="true"] { border-color: #61d7ca9c; background: linear-gradient(120deg, #12302f, #141c2c); box-shadow: 0 10px 32px #0003, inset 0 0 0 1px #61d7ca24; }
.server-picker-mark { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid #61d7ca4d; border-radius: 13px; background: linear-gradient(145deg, #1c716c, #344e8a); color: #d9fffa; font-size: 17px; font-weight: 850; }
.server-picker-mark.rn { border-color: #a28aff55; background: linear-gradient(145deg, #574786, #344e8a); }
.server-picker-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.server-picker-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.server-picker-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.server-picker-count { display: grid; min-width: 44px; justify-items: center; padding: 5px 8px; border: 1px solid #ffffff12; border-radius: 10px; background: #ffffff06; }
.server-picker-count strong { font-size: 13px; line-height: 1.15; }
.server-picker-count small { color: var(--muted); font-size: 8px; }
.selected-server { margin-top: 4px; }
.selected-server-heading { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 0 2px 11px; border-bottom: 1px solid #ffffff12; }
.selected-server-heading .server-dot { width: 9px; height: 9px; }
.selected-server-heading .eyebrow { font-size: 8px; }
.selected-server-heading h3 { margin: 1px 0 0; font-size: 16px; }
.selected-server-count { margin-left: auto; padding: 5px 9px; border: 1px solid #ffffff14; border-radius: 999px; color: #aebdce; font-size: 9px; }
.server-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px #61d7ca88; }
.server-dot.rn { background: #ad91ff; box-shadow: 0 0 14px #9b7bff99; }
.node-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.node-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(150deg, #121a25, #0d131c); box-shadow: 0 12px 36px #0003; }
.node-number { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #344355; border-radius: 13px; color: #708196; font: 700 11px ui-monospace, monospace; }
.node-main { min-width: 0; }
.protocol { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #183b39; color: #75d8cd; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.protocol.hysteria2 { background: #30284a; color: #b9a5ff; }
.protocol.tuic-v5 { background: #243651; color: #91bcfa; }
.node-main h3 { margin: 6px 0 1px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.node-main > p { margin: 0; color: var(--muted); font-size: 10px; }
.node-main > p.node-transport { margin-top: 2px; color: #a9bdcf; font-size: 9px; }
.node-main > p.node-hint { margin-top: 3px; color: #8190a3; font-size: 9px; line-height: 1.4; }
.node-actions { display: flex; gap: 6px; }
.icon-action { display: flex; min-width: 62px; flex-direction: column; align-items: center; gap: 2px; padding: 7px 9px; border: 1px solid #2d3a4b; background: #111924; color: #aab8c8; font-size: 9px; }
.icon-action span { color: #7fb9ff; font-size: 17px; line-height: 1; }
.loading-card { grid-column: 1 / -1; display: flex; min-height: 150px; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: 17px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid #ffffff22; border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 38px; padding-top: 18px; border-top: 1px solid #ffffff10; color: #667487; font-size: 10px; }
.modal { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: #03050ad9; backdrop-filter: blur(10px); }
.qr-dialog { position: relative; z-index: 1; width: min(390px, 100%); padding: 29px; border: 1px solid #ffffff22; border-radius: 23px; background: #121925; box-shadow: 0 30px 100px #000c; text-align: center; }
.qr-dialog h2 { margin: 5px 0; font-size: 21px; }
.qr-dialog > p:not(.eyebrow) { margin: 0 0 18px; color: var(--muted); font-size: 11px; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #ffffff0a; font-size: 22px; cursor: pointer; }
.qr-frame { margin: 0 auto 18px; padding: 13px; border-radius: 18px; background: white; }
.qr-frame img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.qr-dialog .primary { width: 100%; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 24px; padding: 10px 15px; border: 1px solid #5d7798; border-radius: 11px; background: #172333ee; color: #d8e5f5; font-size: 12px; opacity: 0; transform: translate(-50%, 16px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-open { overflow: hidden; }
.login-view { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 34px; border: 1px solid #ffffff1d; border-radius: 24px; background: linear-gradient(150deg, #151e2bdf, #0c121cdf); box-shadow: 0 28px 90px #0009; backdrop-filter: blur(24px); }
.login-card .vault-mark { margin-bottom: 24px; }
.login-card h1 { margin: 5px 0 8px; font-size: 29px; letter-spacing: -.035em; }
.login-copy { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.login-card label { display: block; margin: 14px 0 6px; color: #c8d2df; font-size: 11px; font-weight: 750; }
.login-card input { width: 100%; height: 50px; padding: 11px 13px; border: 1px solid #344153; border-radius: 11px; background: #080d15aa; color: var(--text); }
.password-field { position: relative; }
.password-field input { padding-right: 60px; }
.password-field button { position: absolute; top: 7px; right: 7px; min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: #7f91a8; font-size: 10px; cursor: pointer; }
.login-submit { width: 100%; margin-top: 19px; }
.form-error { margin: 12px 0 0; padding: 9px 11px; border: 1px solid #8b3d4b; border-radius: 9px; background: #3c1921; color: #ffb4bd; font-size: 11px; }
.security-note { display: flex; gap: 10px; margin-top: 22px; padding: 12px; border: 1px solid #2c564d; border-radius: 11px; background: #10282180; }
.security-note > span { display: grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border-radius: 50%; background: #2d8057; color: white; font-size: 11px; }
.security-note p { margin: 0; color: #8eaa9f; font-size: 10px; }
.security-note strong { display: block; margin-bottom: 2px; color: #bfe2d6; }
@media (max-width: 820px) { .node-grid { grid-template-columns: 1fr; } .subscription-grid { grid-template-columns: 1fr; } .hero { padding-top: 52px; } }
@media (max-width: 620px) {
  .portal { width: auto; margin: 0 10px; padding-top: 14px; }
  .brand p { display: none; } .status-badge { max-width: 98px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 44px 4px 30px; }
  .hero h1 { font-size: 42px; } .hero-stat { width: 105px; height: 105px; justify-self: end; } .hero-stat span { font-size: 32px; }
  .clash-card { grid-template-columns: auto minmax(0, 1fr); padding: 18px; } .clash-icon { width: 52px; height: 52px; border-radius: 15px; }
  .card-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .section-head { display: block; margin-top: 38px; } .section-head > p { margin-top: 5px; text-align: left; }
  .selection-guide { padding: 12px; } .protocol-guide { grid-template-columns: 1fr; gap: 6px; }
  .server-switcher { gap: 8px; margin-bottom: 16px; } .server-picker { min-height: 70px; gap: 8px; padding: 10px; } .server-picker-mark { width: 35px; height: 35px; flex-basis: 35px; border-radius: 11px; } .server-picker-count { min-width: 36px; padding: 4px 6px; }
  .node-card { grid-template-columns: auto minmax(0, 1fr); padding: 14px; } .node-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .icon-action { flex-direction: row; justify-content: center; min-height: 42px; } footer { flex-direction: column; gap: 5px; }
  .login-view { padding: 12px; } .login-card { padding: 26px 21px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; } }

.passkey-login-button { display: flex; width: 100%; min-height: 68px; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid #57d0c777; border-radius: 14px; background: linear-gradient(115deg, #153331, #17223a); color: var(--text); text-align: left; cursor: pointer; box-shadow: inset 0 1px #ffffff0b, 0 9px 25px #0003; transition: border-color .15s, transform .15s, filter .15s; }
.passkey-login-button:hover:not(:disabled) { border-color: #75e9dc; }
.passkey-login-button:disabled { cursor: wait; opacity: .75; }
.passkey-glyph, .passkey-item-mark { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border: 1px solid #6ddfd244; border-radius: 12px; background: #1f615a; color: #b5fff4; font-size: 19px; }
.passkey-login-button > span:nth-child(2) { display: grid; flex: 1; gap: 2px; }
.passkey-login-button strong { font-size: 13px; }
.passkey-login-button small { color: #9bb7b5; font-size: 10px; }
.passkey-arrow { color: #88d8d0; font-size: 25px; line-height: 1; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 2px; color: #8190a3; font-size: 10px; }
.login-divider:before, .login-divider:after { height: 1px; flex: 1; background: #ffffff15; content: ""; }
.passkey-support-hint { margin: 13px 0 0; color: #e0bb83; font-size: 10px; }
.header-actions .quiet { white-space: nowrap; }
.passkey-dialog, .reauth-dialog { position: relative; z-index: 1; width: min(520px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: auto; padding: 29px; border: 1px solid #ffffff22; border-radius: 23px; background: linear-gradient(150deg, #151e2b, #0e141f); box-shadow: 0 30px 100px #000c; }
.reauth-dialog { width: min(410px, 100%); }
.passkey-dialog h2, .reauth-dialog h2 { margin: 5px 0 5px; font-size: 23px; }
.passkey-dialog-copy { max-width: 440px; margin: 0 0 18px; color: var(--muted); font-size: 11px; }
.passkey-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; margin: 0 0 18px; }
.passkey-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px; border: 1px solid #ffffff15; border-radius: 13px; background: #ffffff05; }
.passkey-item-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; font-size: 16px; }
.passkey-item-copy { display: grid; min-width: 0; gap: 2px; }
.passkey-item-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.passkey-item-copy small { color: #8391a3; font-size: 9px; }
.passkey-delete { min-height: 34px; padding: 5px 9px; border: 1px solid #743e4b; border-radius: 9px; background: #351d27; color: #ffb4bd; font-size: 10px; cursor: pointer; }
.passkey-empty { margin: 0; padding: 14px; border: 1px dashed #40516a; border-radius: 12px; color: #9eacbc; font-size: 11px; text-align: center; }
.passkey-empty.error { border-color: #743e4b; color: #ffb4bd; }
.add-passkey-form label, .reauth-dialog label { display: block; margin: 12px 0 6px; color: #c8d2df; font-size: 11px; font-weight: 750; }
.passkey-dialog input, .reauth-dialog input { width: 100%; height: 46px; padding: 10px 12px; border: 1px solid #344153; border-radius: 10px; background: #080d15aa; color: var(--text); }
.add-passkey-form .primary, .reauth-dialog form > .primary { width: 100%; margin-top: 12px; }
.reauth-dialog form .form-error { margin-top: 10px; }
.modal-open { overflow: hidden; }
@media (max-width: 620px) {
  .passkey-dialog, .reauth-dialog { padding: 25px 19px; border-radius: 20px; }
  .header-actions { gap: 6px; }
  .header-actions .quiet { padding: 5px 8px; font-size: 10px; }
}
