:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #14161a;
  --muted: #6b7280;
  --border: #e4e6eb;
  --accent: #2563eb;
  --ok-bg: #e7f6ef;
  --ok-text: #0f6e56;
  --warn-bg: #fdf1dc;
  --warn-text: #85510b;
  --danger-bg: #fdeaea;
  --danger-text: #a32d2d;
  --radius: 10px;
}

[data-theme="dark"] {
  --bg: #101215;
  --card: #191c21;
  --text: #e8eaed;
  --muted: #9aa1ab;
  --border: #2a2f36;
  --accent: #5b9bf8;
  --ok-bg: #123226;
  --ok-text: #6fd3ae;
  --warn-bg: #3a2c14;
  --warn-text: #f0b45f;
  --danger-bg: #3a1c1c;
  --danger-text: #f08b8b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.wide { max-width: 900px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}

button:hover { border-color: var(--muted); }
button:active { transform: scale(0.99); }
button:disabled { opacity: 0.5; cursor: default; }

button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger-text); border-color: var(--danger-text); }
button.sm { min-height: 34px; font-size: 13px; width: auto; padding: 6px 12px; }

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.banner { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 12px; }
.banner.ok { background: var(--ok-bg); color: var(--ok-text); }
.banner.warn { background: var(--warn-bg); color: var(--warn-text); }
.banner.danger { background: var(--danger-bg); color: var(--danger-text); }
.banner strong { display: block; font-size: 15px; }
.banner span { font-size: 13px; }

.pill { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 6px; }
.pill.ok { background: var(--ok-bg); color: var(--ok-text); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.pill.danger { background: var(--danger-bg); color: var(--danger-text); }

.stat { background: var(--bg); border-radius: var(--radius); padding: 12px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 2px; }

.timer { font-size: 32px; font-weight: 600; font-family: ui-monospace, monospace; margin: 4px 0; }

.bar { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar div { height: 100%; background: var(--ok-text); border-radius: 3px; }

.tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button {
  width: auto; min-height: 0; padding: 10px 0; font-size: 14px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); border-radius: 0; white-space: nowrap;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

.list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.item { padding: 12px; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: none; }
.item .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  font-size: 13px;
}
.item .actions a {
  padding: 4px 0;
  white-space: nowrap;
}
.item .actions a { color: var(--muted); cursor: pointer; text-decoration: none; }
.item .actions a:hover { color: var(--accent); }

.hidden { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 12px; }

/* admin polish */
.tabs {
  gap: 6px;
  border-bottom: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 16px;
}
.tabs button {
  flex: 1;
  padding: 9px 4px;
  border-radius: 8px;
  border-bottom: none;
  font-size: 13px;
  min-width: 0;
}
.tabs button.active {
  background: var(--accent);
  color: #fff;
  border-bottom: none;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.list {
  border-radius: 12px;
  background: var(--card);
}

.item .actions a {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text);
  background: var(--bg);
}
.item .actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pill { padding: 4px 10px; border-radius: 20px; font-weight: 500; }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

h3 { margin-bottom: 12px; }


/* tab grid */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  overflow: visible;
}
.tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 2px;
  font-size: 11px;
  line-height: 1.2;
}
.tabs button span {
  font-size: 17px;
  line-height: 1;
}


/* refined tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  overflow: visible;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
}
.tabs button {
  display: block;
  padding: 11px 4px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.1px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  border: none;
  transition: all .15s;
}
.tabs button:hover {
  color: var(--text);
  background: var(--card);
}
.tabs button.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* refined cards */
.card {
  border-radius: 14px;
  padding: 18px;
}
.stat {
  border-radius: 14px;
  padding: 16px;
}
.stat .label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 500;
}
.stat .value {
  font-size: 26px;
  letter-spacing: -0.5px;
}

.list { border-radius: 14px; overflow: hidden; }
.item { padding: 14px; }
.item strong { font-size: 14.5px; letter-spacing: -0.1px; }

.item .actions a {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
}

button, .btn { border-radius: 10px; font-weight: 500; }
input, select, textarea { border-radius: 10px; }

h1 { letter-spacing: -0.5px; }
h2, h3 { letter-spacing: -0.2px; }

/* active tab in accent */
.tabs button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.tabs button.active:hover {
  background: var(--accent);
  color: #fff;
}

/* remove tap flash */
* { -webkit-tap-highlight-color: transparent; }

button, .btn, .tabs button, .item .actions a {
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
button:focus, .tabs button:focus { outline: none; }

.tabs button,
.tabs button * {
  -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  background-clip: padding-box;
}

.tabs button:active {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
}

.tabs button::-moz-focus-inner { border: 0; }



.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.95);
  max-width: 300px;
  padding: 18px 22px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  text-align: center;
  white-space: pre-line;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.toast.red {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-text);
}

.toast.yellow {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-text);
}

.toast.green {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: var(--ok-text);
}

.sgroup { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.sgroup-head { display: flex; align-items: center; gap: 11px; padding: 13px 14px; cursor: pointer; }
.sgroup-head .ico { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 17px; }
.sgroup-head .txt { flex: 1; min-width: 0; }
.sgroup-head .txt b { display: block; font-size: 14.5px; font-weight: 500; }
.sgroup-head .txt span { font-size: 12.5px; color: var(--muted); }
.sgroup-head .cnt { font-size: 12px; color: var(--muted); }
.sgroup-body { padding: 14px; border-top: 1px solid var(--border); background: var(--bg); }
.sgroup-body.hidden { display: none; }
.sfield { margin-bottom: 14px; }
.sfield:last-child { margin-bottom: 0; }
.sfield b { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 2px; }
.sfield i { display: block; font-size: 12px; color: var(--muted); font-style: normal; margin-bottom: 6px; line-height: 1.5; }
.sfield input, .sfield textarea, .sfield select { margin: 0; }

body.lp {
  position: relative;
  background-image:
    linear-gradient(rgba(59,130,246,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.07) 1px, transparent 1px);
  background-size: 26px 26px;
}

body.lp::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 340px;
  background: radial-gradient(circle at 50% 10%, rgba(59,130,246,.14), transparent 66%);
  pointer-events: none;
  z-index: 0;
}

body.lp .wrap { position: relative; z-index: 1; }

[data-theme="dark"] body.lp,
body.lp[data-theme="dark"] {
  background-image:
    linear-gradient(rgba(59,130,246,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.08) 1px, transparent 1px);
}

[data-theme="dark"] body.lp::before {
  background: radial-gradient(circle at 50% 10%, rgba(59,130,246,.26), transparent 66%);
}

.fcard { margin: 0; border-radius: 12px; padding: 14px; }
.fcard .fico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 9px; font-size: 15px; }
.fcard h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.fcard p { margin: 4px 0 0; font-size: 12px; }

.fcard.c1 { background: #E8F4FD; border: 1px solid #BEDDF5; }
.fcard.c1 .fico { background: #2563EB; color: #fff; }
.fcard.c1 h3 { color: #123A63; }
.fcard.c1 p { color: #3E6892; }

.fcard.c2 { background: #E4F6EF; border: 1px solid #B5E3D2; }
.fcard.c2 .fico { background: #0F9D77; color: #fff; }
.fcard.c2 h3 { color: #0B4A38; }
.fcard.c2 p { color: #276B56; }

.fcard.c3 { background: #F0EDFD; border: 1px solid #D2C9F5; }
.fcard.c3 .fico { background: #6D5AE0; color: #fff; }
.fcard.c3 h3 { color: #332764; }
.fcard.c3 p { color: #584A8C; }

.fcard.c4 { background: #FDF0E4; border: 1px solid #F5D9BB; }
.fcard.c4 .fico { background: #C97516; color: #fff; }
.fcard.c4 h3 { color: #63400B; }
.fcard.c4 p { color: #8A5D1C; }

[data-theme="dark"] .fcard.c1 { background: rgba(37,99,235,.13); border-color: rgba(96,165,250,.28); }
[data-theme="dark"] .fcard.c1 .fico { background: rgba(96,165,250,.22); color: #93C5FD; }
[data-theme="dark"] .fcard.c1 h3 { color: #DCEAFB; }
[data-theme="dark"] .fcard.c1 p { color: #8FB3D9; }

[data-theme="dark"] .fcard.c2 { background: rgba(16,185,129,.12); border-color: rgba(52,211,153,.26); }
[data-theme="dark"] .fcard.c2 .fico { background: rgba(52,211,153,.20); color: #6EE7B7; }
[data-theme="dark"] .fcard.c2 h3 { color: #D6F5E9; }
[data-theme="dark"] .fcard.c2 p { color: #7FC9AC; }

[data-theme="dark"] .fcard.c3 { background: rgba(109,90,224,.15); border-color: rgba(167,139,250,.28); }
[data-theme="dark"] .fcard.c3 .fico { background: rgba(167,139,250,.20); color: #C4B5FD; }
[data-theme="dark"] .fcard.c3 h3 { color: #E4DEFB; }
[data-theme="dark"] .fcard.c3 p { color: #A99BD9; }

[data-theme="dark"] .fcard.c4 { background: rgba(201,117,22,.14); border-color: rgba(251,191,36,.26); }
[data-theme="dark"] .fcard.c4 .fico { background: rgba(251,191,36,.18); color: #FCD34D; }
[data-theme="dark"] .fcard.c4 h3 { color: #FAECD0; }
[data-theme="dark"] .fcard.c4 p { color: #D2AD70; }

[data-theme="dark"] .fcard.c1 { background: #12294A; border-color: #2C5A94; }
[data-theme="dark"] .fcard.c1 .fico { background: #2563EB; color: #fff; }

[data-theme="dark"] .fcard.c2 { background: #0D3B2E; border-color: #1D7A5C; }
[data-theme="dark"] .fcard.c2 .fico { background: #0F9D77; color: #fff; }

[data-theme="dark"] .fcard.c3 { background: #241E4A; border-color: #4C3F91; }
[data-theme="dark"] .fcard.c3 .fico { background: #6D5AE0; color: #fff; }

[data-theme="dark"] .fcard.c4 { background: #3D2A0E; border-color: #8A5D1C; }
[data-theme="dark"] .fcard.c4 .fico { background: #C97516; color: #fff; }

@media (max-height: 780px) {
  .wrap { padding-top: 10px; padding-bottom: 10px; }
  #appView .card { padding: 12px; margin-bottom: 8px; }
  #timer { font-size: 40px; }
  #appView h1 { font-size: 19px; }
  #appView .banner { padding: 10px 12px; }
  #appView .banner strong { font-size: 14px; }
  #appView .banner span { font-size: 12.5px; }
  #updateBtn { padding: 12px; }
  .grid2 .card { padding: 10px; }
}

@media (max-height: 780px) {
  .wrap { padding-top: 8px; padding-bottom: 8px; }
  #appView .card { padding: 10px; margin-bottom: 7px; }
  #timer { font-size: 34px; }
  #appView h1 { font-size: 18px; }
  #appView .banner { padding: 9px 11px; margin-bottom: 7px; }
  #appView .banner strong { font-size: 13.5px; }
  #appView .banner span { font-size: 12px; }
  #updateBtn { padding: 11px; margin-bottom: 7px; }
  .grid2 .card { padding: 9px; }
  #leaseCard .muted { font-size: 12px; }
  #ipLine { font-size: 12px; margin: 6px 0; }
  #appView .row .btn { padding: 9px; }
  #appView h3 { font-size: 13.5px; margin-bottom: 6px; }
  .bar { margin-top: 8px; }
}

#appView .banner.warn {
  background: #F5DC4E;
  color: #3D2F00;
  border: 1px solid #E0C420;
}
#appView .banner.warn strong { color: #3D2F00; }
#appView .banner.warn span { color: #5A4700; }

[data-theme="dark"] #appView .banner.warn {
  background: #F5DC4E;
  color: #3D2F00;
  border-color: #C9AE1A;
}
[data-theme="dark"] #appView .banner.warn strong { color: #3D2F00; }
[data-theme="dark"] #appView .banner.warn span { color: #5A4700; }

#appView .banner.st-on {
  background: #F5DC4E;
  border: 1px solid #E0C420;
}
#appView .banner.st-on strong { color: #3D2F00; }
#appView .banner.st-on span { color: #5A4700; }

#appView .banner.st-off {
  background: #4A5568;
  border: 1px solid #718096;
}
#appView .banner.st-off strong { color: #F7FAFC; }
#appView .banner.st-off span { color: #CBD5E0; }

#appView .banner.st-exp {
  background: #E53935;
  border: 1px solid #B71C1C;
}
#appView .banner.st-exp strong { color: #fff; }
#appView .banner.st-exp span { color: #FFEBEE; }

#appView .banner.st-on {
  background: #F5DC4E;
  border: 1px solid #E0C420;
}
#appView .banner.st-on strong { color: #3D2F00; }
#appView .banner.st-on span { color: #5A4700; }

#appView .banner.st-off {
  background: #4A5568;
  border: 1px solid #718096;
}
#appView .banner.st-off strong { color: #F7FAFC; }
#appView .banner.st-off span { color: #CBD5E0; }

#appView .banner.st-exp {
  background: #E53935;
  border: 1px solid #B71C1C;
}
#appView .banner.st-exp strong { color: #fff; }
#appView .banner.st-exp span { color: #FFEBEE; }

@media (max-height: 780px) {
  #appView > .card:first-child { padding: 8px 12px !important; margin-bottom: 7px !important; }
  #appView > .card:first-child > div:first-child { width: 26px !important; height: 26px !important; font-size: 13px !important; }
  #appView > .card:first-child .muted { font-size: 10.5px !important; }
  #whoLine { font-size: 13px !important; }
}

@media (max-height: 780px) {
  .wrap { padding-top: 6px; padding-bottom: 6px; }
  #appView .card { padding: 9px 11px; margin-bottom: 6px; }
  #timer { font-size: 30px; }
  #appView .banner { padding: 8px 11px; margin-bottom: 6px; }
  #appView .banner strong { font-size: 13px; }
  #appView .banner span { font-size: 12px; }
  #updateBtn { padding: 10px; margin-bottom: 6px; }
  #ipLine { font-size: 11.5px; margin: 5px 0; }
  #appView h3 { font-size: 13px; margin-bottom: 5px; }
  #appView .row .btn { padding: 8px; font-size: 13px; }
  .bar { margin-top: 6px; height: 4px; }
  #leaseCard .muted { font-size: 11.5px; }
  .grid2 .card { padding: 8px 10px; }
  #appView > .card:first-child { padding: 7px 11px !important; margin-bottom: 6px !important; }
  #appView > .card:first-child > div:first-child { width: 24px !important; height: 24px !important; font-size: 12px !important; }
}

#appView .banner strong { font-size: 16px !important; }
#appView .banner span { font-size: 14px !important; }

#appView .banner strong { font-size: 15px !important; font-weight: 600 !important; }
#appView .banner span { font-size: 13px !important; }

body.lp .banner.ok {
  background: #F5DC4E !important;
  border: 1px solid #E0C420 !important;
  color: #3D2F00 !important;
}
body.lp .banner.ok strong { color: #3D2F00 !important; }
body.lp .banner.ok span { color: #5A4700 !important; }

[data-theme="dark"] body.lp .banner.ok {
  background: #0D3B2E;
  border: 1px solid #1D7A5C;
  color: #D6F5E9;
}
[data-theme="dark"] body.lp .banner.ok strong,
[data-theme="dark"] body.lp .banner.ok span { color: #D6F5E9; }

#ticker {
  background: #F5DC4E !important;
  border: 1px solid #E0C420 !important;
  color: #3D2F00 !important;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
}

[data-theme="dark"] #ticker {
  background: #F5DC4E !important;
  color: #3D2F00 !important;
}

@media (min-width: 600px) {
  body.lp {
    display: flex;
    justify-content: center;
  }
  body.lp .wrap {
    width: 100%;
    max-width: 560px;
  }
}

@media (min-width: 900px) {
  body.lp .wrap { max-width: 1100px; padding: 32px 40px; }
  body.lp h1 { font-size: 22px; }
  body.lp .hero h2 { font-size: 34px; }
  body.lp .hero p { font-size: 15px; max-width: 480px; margin-left: auto; margin-right: auto; }
  body.lp .grid2 { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  body.lp .fcard { padding: 18px; }
  body.lp .fcard h3 { font-size: 14px; }
  body.lp .fcard p { font-size: 12px; }
  body.lp .install-row { max-width: 480px; margin: 0 auto 30px; }
  body.lp #ticker { max-width: 480px; margin-left: auto; margin-right: auto; }
}

@media (min-width: 900px) {
  body.lp .card:has(.step):not(#howCard) { display: flex; justify-content: space-around; gap: 20px; padding: 22px; }
  body.lp .card:has(.step):not(#howCard) .step { flex: 1; margin-bottom: 0; }
}

@media (min-width: 900px) {
  body.lp .between:has(#brand) {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    position: relative;
  }
  body.lp #brand { font-size: 30px; }
  body.lp .between:has(#brand) #themeBtn {
    position: absolute;
    right: 0;
    top: 4px;
  }
}

@media (min-width: 900px) {
  body.lp .card:has(> .step):not(#howCard) {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 26px;
  }
  body.lp .card:has(> .step):not(#howCard) .step {
    flex: none;
    margin-bottom: 0;
  }
}

body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) {
  background:
    radial-gradient(circle at 50% 15%, rgba(59,130,246,.2), transparent 60%),
    linear-gradient(rgba(59,130,246,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.06) 1px, transparent 1px),
    #080C14 !important;
  background-size: auto, 26px 26px, 26px 26px, auto !important;
  background-attachment: fixed !important;
}
body.lp[data-theme="light"]:has(#loginView:not(.hidden)) {
  background: var(--bg) !important;
  background-image:
    linear-gradient(rgba(59,130,246,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.07) 1px, transparent 1px) !important;
  background-size: 26px 26px !important;
}
body.lp[data-theme="light"]:has(#loginView:not(.hidden)) .card {
  background: var(--card) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}
body.lp[data-theme="light"]:has(#loginView:not(.hidden)) h2,
body.lp[data-theme="light"]:has(#loginView:not(.hidden)) h3,
body.lp[data-theme="light"]:has(#loginView:not(.hidden)) label,
body.lp[data-theme="light"]:has(#loginView:not(.hidden)) .muted {
  color: var(--text) !important;
  text-shadow: none !important;
}
body.lp[data-theme="light"]:has(#loginView:not(.hidden)) .muted {
  color: var(--muted) !important;
}
body.lp[data-theme="light"]:has(#loginView:not(.hidden)) input {
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
body.lp[data-theme="light"]:has(#loginView:not(.hidden)) .btn {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
body.lp[data-theme="dark"]:has(#loginView:not(.hidden))::before {
  display: none !important;
}
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) #loginBrand,
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) h1,
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) .muted {
  color: #94A9C4 !important;
  text-shadow: none !important;
}
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) h2,
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) h3,
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) label {
  color: #fff !important;
}
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) .card {
  background: rgba(8,14,28,.75) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(59,130,246,.2) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.4) !important;
}
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) input {
  background: rgba(255,255,255,.05) !important;
  border-color: rgba(59,130,246,.25) !important;
  color: #fff !important;
}
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) input:focus {
  border-color: rgba(59,130,246,.6) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15) !important;
}
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) .btn {
  background: rgba(59,130,246,.15) !important;
  border-color: rgba(59,130,246,.3) !important;
  color: #93C5FD !important;
}

body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) {
  overflow-x: hidden;
}
#loginView { overflow: visible; }

@media (min-width: 900px) {
  #loginView .card {
    max-width: 460px;
    padding: 32px;
  }
  #loginView #loginBrand { font-size: 22px; }
  #loginView input, #loginView button.primary { font-size: 15px; padding: 13px; }
}

body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) {
  min-height: 100dvh;
  overflow: hidden;
}
body.lp[data-theme="dark"]:has(#loginView:not(.hidden)) #loginView {
  min-height: calc(100dvh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  box-sizing: border-box;
}

.toast {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, calc(-50% + 12px)) !important;
  bottom: auto !important;
  width: calc(100% - 32px);
  max-width: 400px;
  padding: 0 !important;
  border-radius: 14px !important;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 9999;
  text-align: left !important;
  backdrop-filter: blur(8px);
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) !important;
}
.toast-row {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 15px 18px;
}
.toast-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}
.toast-txt { flex: 1; min-width: 0; }
.toast-txt b {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}
.toast-txt span {
  display: block;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 5px;
  opacity: .85;
}
.toast-bar { height: 3px; background: rgba(255,255,255,.12); }
.toast-bar i { display: block; height: 100%; width: 100%; }

.toast.green { background: rgba(13,59,46,.92); border: 1px solid #1D7A5C; color: #D6F5E9; }
.toast.green .toast-ico { background: rgba(29,158,117,.25); color: #6EE7B7; }
.toast.green .toast-bar i { background: #34D399; }

.toast.red { background: rgba(58,20,20,.92); border: 1px solid #A32D2D; color: #F7C1C1; }
.toast.red .toast-ico { background: rgba(226,75,74,.25); color: #F09595; }
.toast.red .toast-bar i { background: #E24B4A; }

.toast.yellow { background: rgba(65,50,10,.92); border: 1px solid #854F0B; color: #FAEEDA; }
.toast.yellow .toast-ico { background: rgba(239,159,39,.25); color: #FAC775; }
.toast.yellow .toast-bar i { background: #EF9F27; }

.toast:not(.green):not(.red):not(.yellow) {
  background: rgba(20,30,50,.92);
  border: 1px solid rgba(255,255,255,.15);
  color: #DCEAFB;
}
.toast:not(.green):not(.red):not(.yellow) .toast-ico { background: rgba(96,165,250,.2); color: #93C5FD; }
.toast:not(.green):not(.red):not(.yellow) .toast-bar i { background: #3B82F6; }

#dnsCheck .dc-row {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
#dnsCheck .dc-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  background: rgba(226,75,74,.22);
  color: #F09595;
}
#dnsCheck .dc-txt { flex: 1; min-width: 0; }
#dnsCheck .dc-txt strong {
  display: block;
  font-size: 15px !important;
  font-weight: 500;
  line-height: 1.4;
}
#dnsCheck .dc-txt span {
  display: block;
  font-size: 13px !important;
  line-height: 1.65;
  margin-top: 5px;
  opacity: .9;
}

#offlineScreen {
  position: fixed;
  inset: 0;
  background: #3A1414;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  text-align: center;
  padding: 24px;
}
#offlineScreen.show { display: flex; }
.off-spin {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(226,75,74,.25);
  border-top-color: #E24B4A;
  border-radius: 50%;
  animation: off-spin-rotate 0.9s linear infinite;
  margin-bottom: 24px;
}
@keyframes off-spin-rotate {
  to { transform: rotate(360deg); }
}
.off-title {
  font-size: 19px;
  font-weight: 500;
  color: #F7C1C1;
  margin: 0 0 8px;
}
.off-sub {
  font-size: 14px;
  color: #D09595;
  margin: 0;
}

.off-help {
  margin-top: 28px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(226,75,74,.25);
  max-width: 320px;
  text-align: left;
}
.off-help-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.6;
  color: #E8B8B8;
  margin-bottom: 12px;
}
.off-help-item:last-of-type { margin-bottom: 0; }
.off-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E24B4A;
  flex-shrink: 0;
  margin-top: 6px;
}
.off-help-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(226,75,74,.2);
  font-size: 12.5px;
  color: #C88B8B;
  text-align: center;
}

#offlineScreen {
  background:
    radial-gradient(circle at 50% 15%, rgba(226,75,74,.22), transparent 65%),
    linear-gradient(rgba(226,75,74,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226,75,74,.06) 1px, transparent 1px),
    #0D0A14;
  background-size: auto, 26px 26px, 26px 26px, auto;
}
.off-icon-wrap {
  width: 88px;
  height: 88px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
}
.off-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(226,75,74,.3);
}
.off-ring-1 { inset: 0; animation: off-pulse 2.2s ease-out infinite; }
.off-ring-2 { inset: 14px; animation: off-pulse 2.2s ease-out infinite .6s; }
@keyframes off-pulse {
  0% { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}
.off-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E24B4A, #A32D2D);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(226,75,74,.4);
  position: relative;
  z-index: 1;
}
.off-icon i, .off-icon svg { font-size: 24px; color: #fff; }
.off-help-ico svg { color: #F09595; }
.off-contact-btn svg { color: #fff; }
.off-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 14px;
}
.off-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E24B4A;
  animation: off-dot-fade 1.4s ease-in-out infinite;
}
.off-dots span:nth-child(2) { animation-delay: .2s; }
.off-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes off-dot-fade {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}
.off-help {
  margin-top: 28px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(226,75,74,.2);
  max-width: 300px;
  text-align: left;
  backdrop-filter: blur(6px);
}
.off-help-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.off-help-item:last-of-type { margin-bottom: 0; }
.off-help-item span {
  font-size: 12.5px;
  color: #DCB8B8;
  line-height: 1.6;
}
.off-help-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(226,75,74,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.off-help-ico i { font-size: 14px; color: #F09595; }
.off-help-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(226,75,74,.15);
  font-size: 11.5px;
  color: #C88B8B;
  text-align: center;
}
.off-contact {
  display: flex;
  gap: 14px;
  margin-top: 22px;
}
.off-contact-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.off-contact-btn i { font-size: 21px; color: #fff; }

.off-contact-text {
  margin-top: 12px;
  text-align: center;
}
.off-contact-text p {
  margin: 3px 0;
  font-size: 12.5px;
  color: #C88B8B;
  letter-spacing: .2px;
}

#editNodeList label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13px;
}
#editNodeList label:hover { background: var(--bg); }
#editNodeList input[type=checkbox] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
