@font-face {
  font-family: "DM Sans";
  src: url("latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
:root {
  --ink: #172627;
  --faint: #627277;
  --green: #096c5b;
  --line: #d8e0df;
  font: 16px/1.5 "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f3f4;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; min-height: 100svh; margin: 0; display: grid; place-items: center; padding: 34px; }
.shell { width: min(100%, 1000px); min-width: 0; }
button, select, input { font: inherit; color: inherit; accent-color: var(--green); }
button, select { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: wait; opacity: .65; }
button, select, input { transition: color .18s, background .18s, box-shadow .18s; }
:focus-visible { outline: 3px solid #21a98d; outline-offset: 3px; }
header, nav, .brand, .tool, .host-line, .host-foot, .row, .presets button, .primary, footer, footer > span {
  display: flex; align-items: center;
}
header, .row, footer { justify-content: space-between; }
header { margin: 0 1px 23px 1px; }
nav { gap: 8px; }
.brand { font-size: 21px; font-weight: 750; gap: 9px; letter-spacing: -.25px; }
.brand img { width: 41px; }
.tool { gap: 6px; padding: 8px 11px; font-size: 14px; color: #43565a; border-radius: 9px; }
.tool:hover { background: #e2e9eb; color: var(--ink); }
.tool i, .presets i { font-size: 19px; }
main { display: grid; grid-template-columns: .91fr 1.09fr; border: 1px solid #dce4e4;
  border-radius: 24px; overflow: hidden; background: #fff;
  box-shadow: 0 16px 45px -24px #20393e38, 0 4px 14px -8px #0e2b3522; }
section { min-width: 0; padding: 42px 44px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 35px; font-weight: 680; letter-spacing: -.9px; line-height: 1.25; }
h2 { font-size: 23px; font-weight: 650; line-height: 1.35; }
.host { display: flex; justify-content: space-between; flex-direction: column; color: white;
  background: radial-gradient(78% 56% at 56% 49%, #316961 0%, #1e4846 46%, #102e32 82%, #0e292d 100%); }
.host-line { font-size: 14px; gap: 10px; margin-top: 9px; color: #e3f2f0; }
#led { color: #99b2bb; background: currentColor; width: 8px; height: 8px; border-radius: 50%; }
#led[data-state=ready] { color: #61edb2; box-shadow: 0 0 10px #57eca444; }
#led[data-state=auth], #led[data-state=pair], #led[data-state=missing] { color: #f0bd72; }
#led[data-state=offline], #led[data-state=error] { color: #ff9b82; }
#refresh { color: #b3cdc9; font-size: 17px; height: 28px; border-radius: 6px; display: grid; place-items: center; }
#refresh:hover { color: #fff; background-color: #ffffff15; }
#refresh:disabled i { animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.scene { position: relative; width: 100%; flex: 1; min-height: 220px; isolation: isolate; pointer-events: none; }
.scene img { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(102%,372px); filter: drop-shadow(0 21px 13px #061a1baa); }
.host-foot { gap: 14px; padding-top: 21px; align-items: flex-start; border-top: 1px solid #a2c6c72f; }
.host-foot i { color: #87dcbe; font-size: 25px; }
.host-foot strong { font-weight: 600; font-size: 16px; }
.host-foot p { margin-top: 5px; color: #c2d6d8; font-size: 14px; line-height: 1.65; }
.settings { padding: 40px 44px; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); margin: 21px 0 24px; gap: 9px; }
.presets button { justify-content: center; border-radius: 10px; min-height: 46px; font-size: 14px; gap: 7px; font-weight: 550; border: 1px solid var(--line); }
.presets button:hover { background-color: #f1f6f5; }
.presets button[aria-pressed=true] { color: #085f4f; border-color: #12806b; box-shadow: inset 0 0 0 0.5px #12806b; background-color: #e6f6f0; }
.dimensions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
label { font-size: 14px; font-weight: 550; cursor: pointer; }
.dimensions label { display: block; margin-bottom: 7px; }
.select { position: relative; }
select { appearance: none; -webkit-appearance: none; width: 100%; padding: 10px 36px 10px 13px; font-weight: 530; font-size: 15px; border-radius: 9px; border: 1px solid var(--line); }
.select i { position: absolute; color: #57696b; font-size: 14px; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
select:hover, #mbps:hover { background: #f5f8f7; }
.rates { margin: 18px 0 20px; }
.rate-number { color: var(--faint); font-weight: 500; font-size: 14px; }
#mbps { width: 56px; text-align: center; background: white; padding: 4px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px; font-size: 15px; font-weight: 620; -moz-appearance: textfield; }
#mbps::-webkit-inner-spin-button, #mbps::-webkit-outer-spin-button { -webkit-appearance: none; }
#slider { width: 100%; margin: 9px 0 0; cursor: pointer; height: 22px; display: block; appearance: none; -webkit-appearance: none; background: transparent; }
#slider::-webkit-slider-runnable-track { height: 5px; border-radius: 12px;
  background: linear-gradient(to right, var(--green) var(--progress), #e5eaeb var(--progress)); }
#slider::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 17px; height: 17px;
  border: 2px solid white; margin-top: -6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px #086f5b45,0 2px 3px #163d3e2b; }
.preferences { display: grid; gap: 12px; padding: 16px 0 26px; border-top: 1px solid #e5ebea; }
.compact select { padding: 5px 24px 5px 9px; border: none; text-align-last: right; font-size: 14px; color: #4a6165; }
.compact i { right: 1px; }
#stats { appearance: none; -webkit-appearance: none; position: relative; margin: 0; width: 40px; height: 23px;
  background: #aab9bb; cursor: pointer; border-radius: 20px; }
#stats:checked { background: var(--green); }
#stats::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: white; transition: transform .15s; }
#stats:checked::after { transform: translateX(17px); }
.primary { background: var(--green); color: white; justify-content: center; gap: 10px; width: 100%; min-height: 50px; border-radius: 11px; font-weight: 620; }
.primary i { font-size: 19px; }
.primary:hover { background: #08594b; }
footer { color: #5a6c70; font-size: 13px; margin: 18px 5px 0; gap: 8px; }
footer i { font-size: 16px; margin-right: 6px; }
dialog { padding: 25px 30px 32px; border: none; border-radius: 18px; color: var(--ink); width: min(calc(100% - 32px),442px); }
dialog::backdrop { background: #13292c73; backdrop-filter: blur(4px); }
dialog p, dialog ol { color: #496065; font-size: 15px; margin: 14px 0 22px; line-height: 1.75; }
dialog ol { padding-left: 22px; }
dialog li { margin: 9px 0; }
dialog h3 { font-size: 16px; margin: 21px 0 0; }
dialog h3 + p, dialog h3 + ol { margin: 5px 0 0; }
#close { padding: 9px; margin-right: -9px; }
.digits { display: block; width: 100%; margin-top: 9px; border: 1px solid var(--line); border-radius: 10px;
  text-align: center; font-size: 27px; padding: 11px 0; font-weight: 650; letter-spacing: .17em; font-variant-numeric: tabular-nums; }
#pin { color: var(--green); font-size: 38px; background: #f2faf8; }
#pin:empty { display: none; }
.note { font-size: 13px; }
#logout { color: #a0332e; background: #fbeeea; }
#error { color: #a0332e; margin-bottom: 0; font-size: 14px; }
#toast { position: fixed; bottom: 28px; padding: 11px 20px; border-radius: 10px; background: #183638; color: white; font-size: 14px; text-align: center; max-width: 88vw; }
@media (max-width: 970px) { section, .settings { padding: 32px; } .presets button { gap: 5px; } }
@media (max-width: 840px) {
  body { padding: 24px 16px; }
  main { grid-template-columns: 1fr; border-radius: 18px; }
  .shell { max-width: 540px; }
  header { margin: 0 0 14px; }
  h1 { font-size: clamp(22px, 5.6vw, 30px); }
  h2 { font-size: 20px; }
  .brand { font-size: 18px; gap: 6px; }
  .brand img { width: 34px; }
  .tool { padding: 6px; font-size: 13px; }
  .host { display: grid; grid-template-columns: 58% 42%; align-items: center; padding: 10px 24px 21px; background-position: center; background: radial-gradient(68% 90% at 74% 28%,#346861,#112d31); }
  .scene { min-height: 115px; }
  .host-foot { grid-column: 1/-1; gap: 10px; padding-top: 12px; }
  .host-foot p { font-size: 13px; margin-top: 2px; }
  .host-foot strong { font-size: 14px; }
  .scene img { width: min(100%, 160px); filter: drop-shadow(0 9px 6px #081719a0); }
  .host-line { gap: 7px; font-size: 13px; margin-top: 3px; }
  .settings { padding: 23px 24px 26px; }
  .presets { margin: 16px 0 18px; gap: 6px; }
  .preferences { padding-bottom: 20px; }
  select, #mbps { font-size: 16px; }
  footer { flex-wrap: wrap; font-size: 12px; }
}
@media (max-width: 450px) {
  nav { gap: 0; }
  nav .tool { gap: 4px; }
  .host, .settings { padding-left: 18px; padding-right: 18px; }
  .presets button { font-size: 13px; padding: 3px; min-height: 42px; }
  .presets i { font-size: 16px; }
  .dimensions { gap: 8px; }
  .dimensions select { padding: 9px 22px 9px 9px; font-size: 15px; }
  .dimensions i { right: 7px; }
}
@media (max-width: 370px) { nav .tool i, .presets i { display: none; } body { padding-inline: 10px; } }
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; transition: none !important; } }
