:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --fg: #202827;
  --dim: #586461;
  --dim2: #6c7573;
  --acc: #126755;
  --border: #dce2df;
  --line: #dce2df;
  --ok: #187052;
  --warn: #946015;
  --bad: #b23838;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; flex: none; vertical-align: middle; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.portal-shell { display: grid; grid-template-columns: minmax(360px, 44%) minmax(0, 1fr); min-height: 100svh; }
.portal-atlas { position: sticky; top: 0; height: 100svh; min-height: 660px; padding: 40px 44px 48px; display: flex; flex-direction: column; background: #151c1d; color: #eff4f1; overflow: hidden; }
.landscape-photo { position: absolute; inset: 0; }
.landscape-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 58% center; }
.portal-atlas::after { content: ""; position: absolute; inset: 0; background: #0e211526; pointer-events: none; }
.brand { position: relative; z-index: 1; display: flex; gap: 12px; align-items: center; color: #fff; width: fit-content; font-size: 19px; font-weight: 650; line-height: 1.25; text-shadow: 0 1px 12px #10201b; }
.brand:hover { text-decoration: none; }
.brand-symbol { color: #79d4b8; }
.brand-symbol svg { width: 37px; height: 37px; stroke-width: 1.4; }
.brand small { display: block; font-size: 11px; font-weight: 400; margin-top: 6px; color: #edf5f1; }
.atlas-heading { position: relative; z-index: 1; margin-top: auto; text-shadow: 0 1px 12px #10201b; }
.eyebrow { display: block; color: var(--dim2); font: 11px/1.5 "SFMono-Regular", Consolas, monospace; }
.atlas-heading .eyebrow { color: #edf5f1; }
.atlas-heading h1 { font-size: 28px; line-height: 1.35; margin: 12px 0 18px; font-weight: 500; overflow-wrap: anywhere; }
.atlas-rule { display: block; width: 32px; height: 2px; background: #79d4b8; }
.portal-workspace { min-width: 0; display: flex; flex-direction: column; padding: 0 48px; }
.workspace-header { min-height: 98px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.workspace-label { color: var(--dim2); }
.workspace-header > a:last-child { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); min-height: 44px; }
.workspace-header svg { width: 15px; height: 15px; }
.mobile-brand { display: none; }
.wrap { width: 100%; max-width: 440px; margin: 0 auto; padding: 80px 0 64px; flex: 1; }
.portal-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); gap: 12px; margin-bottom: 38px; }
.portal-tab { position: relative; min-height: 46px; padding: 10px 0 13px; background: transparent; border: 0; border-radius: 0; color: var(--dim); font-size: 13px; white-space: nowrap; }
.portal-tab:hover { color: var(--fg); }
.portal-tab.on { color: var(--acc); font-weight: 650; }
.portal-tab.on::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--acc); }
.tab-pane { display: none; }
.tab-pane.on { display: block; animation: appear 160ms ease-out; }
.card { min-width: 0; }
.form-heading { margin-bottom: 28px; }
.form-heading h2 { font-size: 27px; line-height: 1.4; font-weight: 600; margin: 10px 0 8px; }
.form-heading p { color: var(--dim); margin: 0; font-size: 13px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.f { display: block; margin-bottom: 20px; }
.f > span { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--fg); }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 48px; border: 1px solid #ccd5d0; border-radius: 5px; background: #fff; color: var(--fg); padding: 11px 13px; box-shadow: none; transition: border-color 140ms, box-shadow 140ms; }
input::placeholder, textarea::placeholder { color: #75817b; font-size: 13px; }
input:hover, select:hover { border-color: #95aaa0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px #12675514; }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #fff inset; -webkit-text-fill-color: var(--fg); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; }
.f.check-row { display: flex; align-items: center; gap: 9px; }
.f.check-row input { width: 17px; height: 17px; min-height: 0; accent-color: var(--acc); margin: 0; }
.f.check-row > span { margin: 0; }
.f > .password-field { position: relative; display: block; margin: 0; }
.password-field input { padding-right: 49px; }
.password-field .password-toggle { position: absolute; inset: 2px 2px 2px auto; width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--dim); }
.password-toggle:hover { color: var(--acc); background: #edf4f0; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
button:not(.portal-tab) { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 16px; background: #fff; color: var(--fg); border: 1px solid #ccd5d0; border-radius: 5px; font-size: 13px; font-weight: 500; transition: background 140ms, border-color 140ms; }
button:not(.portal-tab):hover { background: #edf2ef; border-color: #a3b7ac; }
button.primary { background: var(--acc); border-color: var(--acc); color: #fff; min-height: 48px; font-weight: 600; }
button.primary:hover { background: #0c5344; border-color: #0c5344; }
button:disabled { cursor: not-allowed; opacity: .6; }
button[aria-busy="true"] { cursor: progress; }
button.sm { min-height: 36px; padding: 6px 12px; font-size: 12px; }
.login-actions { display: grid; grid-template-columns: 1fr; gap: 7px; margin-top: 26px; }
.login-actions .primary { justify-content: space-between; padding-inline: 18px; }
#btn-login-query, #btn-renew-query { background: transparent; border-color: transparent; color: var(--dim); }
#btn-login-query:hover, #btn-renew-query:hover { color: var(--acc); background: #edf2ef; }
#btn-guest { width: 100%; justify-content: space-between; margin-top: 6px; }
#tab-pane-renew > .card > .btn-row { display: grid; grid-template-columns: 1fr; }
.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; flex: none; }
.ok-box, .err-box, .notice { margin-top: 18px; padding: 14px 16px; border: 1px solid #c7dece; border-radius: 5px; background: #eef6f0; color: #295b3c; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.err-box { background: #fff1ef; border-color: #eacac4; color: var(--bad); }
.notice { margin: 0 0 24px; background: #fbf5e6; border-color: #e6d8ae; color: #72561c; white-space: pre-wrap; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 500; }
.badge.ok { background: #d9eee0; color: var(--ok); }
.badge.warn { background: #f5e8c7; color: var(--warn); }
.badge.bad { background: #f7dfdb; color: var(--bad); }
.muted, .hint { color: var(--dim); font-size: 12px; overflow-wrap: anywhere; }
.hint { margin-top: 10px; }
#guest-target:not(:empty) { margin: -6px 0 20px; }
.config-download { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); }
.config-account { grid-column: 1 / -1; color: var(--dim); font-size: 12px; margin-bottom: 6px; overflow-wrap: anywhere; }
.config-download button { min-width: 0; font-size: 12px; white-space: normal; }
#portal-nodes { border-top: 1px solid var(--border); padding-top: 24px; margin-top: 26px !important; }
#viewing-settings, #udp-settings { margin-top: 26px !important; padding-top: 24px !important; }
.kv-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: 12px; }
.kv-grid b { color: var(--dim); font-weight: 500; }
.kv-val { min-width: 0; overflow-wrap: anywhere; }
.workspace-footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0 28px; border-top: 1px solid var(--border); color: var(--dim2); font-size: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: grid; gap: 10px; max-width: min(400px, calc(100% - 32px)); pointer-events: none; }
.toast > div { padding: 12px 18px; background: #202b27; color: #fff; border-radius: 5px; font-size: 13px; box-shadow: 0 8px 24px #1728201a; overflow-wrap: anywhere; }
.toast > div.bad { background: #843e37; }
.icon-tool { width: 44px; padding: 0 !important; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 1600px) {
  .portal-atlas { padding-inline: 64px; }
  .portal-workspace { padding-inline: 72px; }
}
@media (max-width: 1100px) {
  .portal-shell { grid-template-columns: minmax(300px, 40%) minmax(0, 1fr); }
  .portal-atlas { padding: 30px 28px 24px; }
  .portal-workspace { padding-inline: 32px; }
}
@media (max-width: 800px) {
  .portal-shell { display: block; }
  .portal-atlas { display: none; }
  .portal-workspace { min-height: 100svh; padding-inline: 28px; }
  .workspace-header { min-height: 84px; }
  .workspace-label { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-size: 15px; font-weight: 650; }
  .mobile-brand svg { color: var(--acc); width: 24px; height: 24px; }
  .wrap { padding-top: 28px; padding-bottom: 48px; }
  input, select, textarea { font-size: 16px; }
  .workspace-footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .portal-workspace { padding-inline: 20px; }
  .portal-switch { gap: 6px; }
  .portal-tab { font-size: 12px; }
  .form-heading h2 { font-size: 25px; }
}
@media (max-width: 480px) {
  .config-download { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
