:root {
  --bg: #060607;
  --app: #08080a;
  --panel: #111114;
  --panel-2: #17171b;
  --panel-3: #1e1e23;
  --line: #24242a;
  --line-soft: #1a1a1f;
  --text: #f4f4f5;
  --muted: #9b9ea7;
  --label: #71717a;
  --dim: #4b4e58;
  --red: #52525b;
  --red-hi: #e4e4e7;
  --red-deep: #18181b;
  --red-line: #3f3f46;

  --f-display: "Bungee", "Noto Sans Thai", "Cairo", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", "Noto Sans Thai", "Cairo", ui-monospace, monospace;
  --f-body: "Rubik", "Noto Sans Thai", "Cairo", system-ui, sans-serif;

  --cut: 10px;
  --app-w: 460px;
  --gutter: 16px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 2px; }

.ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
:lang(ar) * { letter-spacing: 0 !important; }

.mono-label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--label);
}
[dir="rtl"] .mono-label, :lang(th) .mono-label { letter-spacing: .02em; }

.cut, .frame {
  --shape: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
}
.cut2 {
  --shape: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.cut, .cut2, .frame { clip-path: var(--shape); }
.frame {
  position: relative;
  isolation: isolate;
  background: var(--frame-line, var(--line-soft));
}
.frame::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: var(--frame-bg, var(--panel));
  clip-path: var(--shape);
}


.app {
  position: relative;
  max-width: var(--app-w);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(212, 212, 216, .06), transparent 60%),
    var(--app);
}
@media (min-width: 520px) {
  .app { box-shadow: 0 0 0 1px #121216, 0 0 80px rgba(0, 0, 0, .8); }
}
.view-enter { animation: enter .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.boot { display: grid; place-items: center; min-height: 100dvh; }
.boot span { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--gutter) 12px;
  background: linear-gradient(var(--app) 75%, transparent);
}
.topbar-end { display: flex; align-items: center; gap: 8px; flex: none; }
/* The title yields first. Two controls plus a long server name do not fit a
   360px phone beside a full-size heading, and a clipped heading reads better
   than a wrapped or squashed control. */
.title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(18px, 5.4vw, 23px);
  letter-spacing: .01em;
  text-transform: uppercase;
  line-height: 1;
}
:lang(th) .title, :lang(ar) .title { font-weight: 800; font-size: 24px; }

.lang { position: relative; }
.lang-btn {
  --cut: 6px;
  --frame-bg: var(--panel-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
}
.lang-btn .ic { width: 15px; height: 15px; color: var(--muted); }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 40;
  min-width: 208px;
  padding: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .16s, transform .16s;
}
.lang.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--muted);
  text-align: start;
}
.lang-item:hover { background: var(--panel-3); color: var(--text); }
.lang-item.sel { background: var(--panel-3); color: var(--text); font-weight: 500; }
.lang-item .ic { width: 16px; height: 16px; stroke-width: 2.2; }

/* ---- server picker (shares .lang behaviour, its own skin) ---- */
.srv-btn { gap: 6px; padding: 0 10px; font-size: 11px; letter-spacing: .06em; }
/* Two labels, one shown at a time. "Choose server" is the clearer wording and
   gets the room whenever there is room; under 430px it would push the page
   title into an ellipsis ("FEATU..."), and a clipped heading costs more than
   the extra word buys. The icon and the caret carry the meaning either way. */
.srv-btn .srv-label { text-transform: uppercase; font-style: normal; }
.srv-btn .srv-label i { font-style: normal; }
.srv-btn .srv-label b { display: none; font-weight: inherit; }
@media (max-width: 429px) {
  .srv-btn .srv-label i { display: none; }
  .srv-btn .srv-label b { display: inline; }
}
.caret-ic { width: 12px; height: 12px; fill: currentColor; stroke: none; color: var(--muted); }
.srv-menu { min-width: 284px; padding: 6px 6px 4px; }
.srv-head {
  padding: 8px 14px 6px;
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
}
.srv-item { justify-content: flex-start; align-items: center; gap: 12px; min-height: 50px; padding: 9px 12px; border-radius: 10px; }
.srv-item.sel { background: rgba(255, 255, 255, .045); }
.srv-item .ic { margin-inline-start: auto; width: 16px; height: 16px; flex: none; color: var(--red-hi); }
.srv-flag {
  width: 26px;
  height: 19px;
  flex: none;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--line);
}
.srv-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; text-align: start; }
.srv-name { font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
.srv-desc { font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.srv-hint {
  margin: 4px 0 2px;
  padding: 0 14px 6px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}
/* Under ~360px the words genuinely do not fit; the icon and caret still read
   as a dropdown, and the menu names every server anyway. */
@media (max-width: 329px) {
  .srv-btn .srv-label { display: none; }
  .srv-btn { padding: 0 8px; }
}


.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  background: var(--panel-3);
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
  transition: background .15s;
  flex: none;
}
.btn-chip:hover { background: #26262c; }
.btn-chip .ic { width: 15px; height: 15px; }

.btn-dark, .btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: background .15s, filter .15s;
}
.btn-dark { background: var(--panel-3); }
.btn-dark:hover { background: #26262c; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

.badge {
  padding: 2px 7px;
  background: var(--red-deep);
  border: 1px solid var(--red-line);
  color: var(--red-hi);
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.4;
}


.toggle {
  --cut: 7px;
  position: relative;
  flex: none;
  width: 56px;
  height: 30px;
  background: #24242a;
  transition: background .2s;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 5px;
  inset-inline-start: 5px;
  width: 20px;
  height: 20px;
  background: #5b5d66;
  transition: transform .22s cubic-bezier(.3, 1.4, .5, 1), background .2s;
}
.toggle.on { background: var(--red); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.toggle.on::after { background: #fff; transform: translateX(26px); }
[dir="rtl"] .toggle.on::after { transform: translateX(-26px); }
.toggle.mini { --cut: 5px; width: 44px; height: 24px; }
.toggle.mini::after { top: 4px; inset-inline-start: 4px; width: 16px; height: 16px; }
.toggle.mini.on::after { transform: translateX(20px); }
[dir="rtl"] .toggle.mini.on::after { transform: translateX(-20px); }


.logo {
  display: block;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .7));
  user-select: none;
  -webkit-user-drag: none;
}
.logo-lg { width: min(230px, 60vw); }
.logo-sm { width: 106px; margin: 0 auto 4px; }


.login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 14px var(--gutter) calc(18px + var(--safe-b));
}
.login-top { display: flex; justify-content: flex-end; }
.login-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 40px 0;
  background: radial-gradient(closest-side, rgba(212, 212, 216, .12), transparent);
}
.tagline {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #71717a;
  text-align: center;
}
[dir="rtl"] .tagline, :lang(th) .tagline { letter-spacing: .02em; font-size: 13px; }

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--label);
}
.sq { width: 7px; height: 7px; background: var(--red); display: inline-block; }

.key-field {
  --cut: 12px;
  --frame-line: #2c2c33;
  --frame-bg: #0e0e11;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  padding: 0 8px 0 18px;
  transition: background .2s;
}
[dir="rtl"] .key-field { padding: 0 18px 0 8px; }
.key-field:focus-within { --frame-line: #4a4a54; }
.key-field.invalid { --frame-line: var(--red); }
.key-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .1em;
  color: var(--text);
}
.key-field input::placeholder { color: #3d3f48; }
.shake { animation: shake .38s; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.form-error { min-height: 22px; padding-top: 6px; font-size: 13px; color: #d4d4d8; }
.form-error:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline-end: 8px;
  vertical-align: 1px;
  background: currentColor;
}

.btn-primary {
  --cut: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 60px;
  background: var(--red);
  font-family: var(--f-display);
  font-size: 19px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  transition: filter .15s, transform .1s;
}
:lang(th) .btn-primary, :lang(ar) .btn-primary { font-weight: 800; font-size: 20px; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(.99); }

.spin { display: block; flex: none; width: 20px; height: 20px; overflow: visible; animation: spin 2.2s linear infinite; }
.spin circle { fill: none; stroke-width: 2.6; }
.spin-lg { width: 28px; height: 28px; }
.spin-lg circle { stroke-width: 2; }
.spin-lg .spin-track { stroke: #202026; }
.spin-lg .spin-arc { stroke: #7a7f8c; }
.spin-track { stroke: rgba(255, 255, 255, .22); }
.spin-arc {
  stroke: #fff;
  stroke-linecap: round;
  stroke-dasharray: 1 60;
  animation: spin-dash 1.6s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes spin-dash {
  0% { stroke-dasharray: 1 60; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 34 60; stroke-dashoffset: -12; }
  100% { stroke-dasharray: 34 60; stroke-dashoffset: -59; }
}
.btn-primary .spin { display: none; }
.btn-primary.loading { cursor: progress; }
.btn-primary.loading:active { transform: none; }
.btn-primary.loading .spin {
  display: block;
  animation: spin 2.2s linear infinite, fade-in .3s ease-out;
}

.btn-primary.idle, .btn-primary:disabled:not(.loading) { background: var(--panel-3); color: #545761; filter: none; transform: none; }
.btn-primary .ic { width: 18px; height: 18px; stroke-width: 2; }
.btn-primary.loading .btn-label { animation: fade-in .3s ease-out; }
@keyframes fade-in { from { opacity: 0; } }

.login-note { margin-top: 14px; text-align: center; font-size: 14px; color: #d3d4d8; }
.login-note.dim { margin-top: 6px; font-size: 13px; color: #71717a; }

.demo-keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.demo-keys .mono-label { width: 100%; text-align: center; font-size: 9px; }
.demo-key {
  padding: 4px 6px;
  border: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--label);
}
.demo-key:hover { color: var(--text); border-color: #3a3a42; }


.page {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 var(--gutter) calc(var(--nav-h) + var(--safe-b) + 20px);
  min-height: calc(100dvh - 62px);
}
.page-home { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 110px); }


.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 40;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: min(100%, var(--app-w));
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  transform: translateX(-50%);
  background: #0a0a0c;
  border-top: 1px solid var(--line-soft);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--dim);
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: color .2s;
}
[dir="rtl"] .tab, :lang(th) .tab { letter-spacing: 0; font-size: 11px; }
.tab .ic { width: 21px; height: 21px; }
.tab.active { color: var(--text); }
.tab.active .ic { color: var(--red-hi); }
.tab::before {
  content: "";
  position: absolute;
  top: -1px;
  width: 34px;
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 12px var(--red), 0 0 2px var(--red);
  transform: scaleX(0);
  transition: transform .25s;
}
.tab.active::before { transform: scaleX(1); }


.status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: var(--panel-2);
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pill i { width: 7px; height: 7px; background: #5b5d66; }
.pill.on { color: #e6fbe9; }
.pill.on i { background: #22d36b; box-shadow: 0 0 8px #22d36b; }
.refreshed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--label);
}
.refreshed .ic { width: 13px; height: 13px; opacity: 0; transition: opacity .2s; }
.refreshed:hover .ic, .refreshed.busy .ic { opacity: 1; }
.refreshed.busy .ic { animation: spin .7s linear infinite; }
[dir="rtl"] .refreshed, :lang(th) .refreshed { letter-spacing: 0; font-size: 12px; }

.gauge {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / .93;
  margin: 6px 0 4px;
}
.corner { position: absolute; width: 18px; height: 18px; border: 0 solid #3a3b44; }
.corner.tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.corner.tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.gauge-glow {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(212, 212, 216, .20), rgba(212, 212, 216, .06) 60%, transparent);
}
.gauge-svg { position: absolute; width: 92%; height: 100%; }
.tick { stroke: #34353d; stroke-width: 2.4; stroke-linecap: butt; }
.tick.major { stroke: #44454e; stroke-width: 2.8; }
.tick.lit {
  stroke: var(--red);
  filter: drop-shadow(0 0 3px rgba(228, 228, 231, .65));
  animation: tick-in .5s both;
  animation-delay: calc(var(--i) * 18ms + 150ms);
}
@keyframes tick-in { from { stroke: #34353d; filter: none; } }
.gauge-mark { fill: var(--red-hi); filter: drop-shadow(0 0 5px var(--red)); }
.gauge.is-expired .tick { stroke: #2a2b31; }
.gauge.is-expired .time-left { color: var(--red-hi); }
.gauge-center { position: relative; text-align: center; }
.time-left {
  font-family: var(--f-display);
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: .01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .7);
  white-space: nowrap;
}
:lang(th) .time-left, :lang(ar) .time-left { font-weight: 800; font-size: 36px; }
.time-label {
  margin-top: 8px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #71717a;
}

.key-row {
  --frame-bg: var(--panel);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 8px 0 16px;
}
[dir="rtl"] .key-row { padding: 0 16px 0 8px; }
.key-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .06em;
}
[dir="rtl"] .key-value { text-align: end; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 78px;
  padding: 12px 12px 14px;
}
.stat .mono-label { font-size: 9.5px; }
.stat b { font-size: 13.5px; font-weight: 600; line-height: 1.25; word-break: break-word; }

.cta-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  z-index: 35;
  width: min(100% - 2 * var(--gutter), var(--app-w) - 2 * var(--gutter));
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 26px rgba(212, 212, 216, .22));
}
.cta {
  --cut: 14px;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 78px;
  background: linear-gradient(100deg, #3f3f46, #27272a);
  color: #fff;
  text-align: start;
  transition: filter .15s, transform .1s;
}
.cta:hover { filter: brightness(1.07); }
.cta:active { transform: scale(.99); }
.cta:disabled { filter: grayscale(1) brightness(.5); }
.cta-text { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 18px; }
.cta-text b { font-family: var(--f-display); font-weight: 400; font-size: 19px; text-transform: uppercase; line-height: 1.05; }
:lang(th) .cta-text b, :lang(ar) .cta-text b { font-weight: 800; font-size: 20px; }
.cta-text small { font-size: 13px; opacity: .88; }
.cta-plus {
  --cut: 10px;
  display: grid;
  place-items: center;
  width: 64px;
  margin: 7px;
  background: rgba(0, 0, 0, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.cta-plus .ic { width: 28px; height: 28px; stroke-width: 2; }


.feat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
  font-size: 13px;
  color: var(--muted);
}
.feat-head b { font-family: var(--f-mono); font-weight: 800; font-size: 13px; color: var(--red-hi); }
.feat-list { display: flex; flex-direction: column; gap: 10px; }

.feat { --cut: 14px; --frame-line: #1e1e23; --frame-bg: #0f0f12; }
.feat-main { display: flex; align-items: flex-start; gap: 14px; padding: 16px 14px 16px 16px; }
[dir="rtl"] .feat-main { padding: 16px 16px 16px 14px; }
.feat-text { flex: 1; min-width: 0; }
.feat-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.feat-num { font-family: var(--f-mono); font-weight: 800; font-size: 11px; color: var(--dim); transition: color .2s; }
.feat.is-on .feat-num { color: var(--red-hi); }
.feat h3 { font-family: var(--f-display); font-weight: 400; font-size: 16.5px; text-transform: uppercase; line-height: 1.15; }
:lang(th) .feat h3, :lang(ar) .feat h3 { font-weight: 800; font-size: 17px; }
.feat-text p { margin-top: 5px; font-size: 13.5px; color: var(--muted); }
.feat .toggle { margin-top: 2px; }

.feat-opts {
  padding: 14px 16px 16px;
  border-top: 1px dashed #26262c;
  transition: opacity .25s;
}
.feat-opts[inert] { opacity: .32; }
.opt-label { display: flex; align-items: center; gap: 7px; min-height: 14px; margin-bottom: 12px; }
.opt-label:empty { display: none; }
.opt-label .ic { width: 12px; height: 12px; stroke-width: 2.2; }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 5px; }

.choices .choice {
  height: auto;
  min-height: 32px;
  padding: 5px 4px;
  font-size: 9px;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.choice, .preset {
  --cut: 8px;
  height: 46px;
  padding: 0 4px;
  background: var(--panel-3);
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: .02em;
  color: #8c8f99;
  transition: background .15s, color .15s;
}
.choice:hover, .preset:hover { color: var(--text); background: #25252b; }
.choice.sel, .preset.sel { background: var(--red); color: #fff; }


/* OPTIONS -> FEATURES.
   Each row is the line the customer gets, rebuilt from the same parts the
   customer card uses: the mono number, the Bungee name, the real .badge chip.
   The owner edits a thing they can see instead of three abstract controls.
   --cut is set explicitly: .card declares 14px and custom properties inherit,
   so .opt-row.cut was silently a 14px notch. Nothing inside the row is
   clipped, so the corner motif reads once per row rather than three times. */
.opt-rows { display: flex; flex-direction: column; gap: 8px; }
.opt-row { --cut: 10px; background: var(--panel-2); padding: 11px 12px 12px; }
.opt-row.is-off { background: #131316; }

.opt-head { display: flex; align-items: center; gap: 10px; }
.opt-pv { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.opt-pv-num { flex: none; font-family: var(--f-mono); font-weight: 800; font-size: 11px; color: var(--red-hi); }
.opt-row.is-off .opt-pv-num { color: var(--dim); }
.opt-pv-name {
  flex: 1;
  min-width: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 13.5px;
  text-transform: uppercase;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Every other Bungee block in the product carries this; without it Thai and
   Arabic fall back to a thin Noto/Cairo face. See .feat h3 and .notes h3. */
:lang(th) .opt-pv-name, :lang(ar) .opt-pv-name { font-weight: 800; font-size: 14px; }
.opt-row.is-off .opt-pv-name { color: var(--muted); }
.opt-pv .badge { flex: none; }
.opt-head .toggle { flex: none; }

/* The badge rail: five exclusive slots. Nothing in it is solid red -- in this
   row red means "the feature is on", and only the toggle gets to say that. */
.opt-rail { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.opt-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 2px;
  background: #1b1b20;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.opt-slot:hover { background: #212127; }
.opt-slot[aria-checked="true"] { background: #0b0b0e; border-color: #3a3a44; }
.opt-slot .badge { opacity: .55; max-width: 100%; overflow: hidden; transition: opacity .15s; }
.opt-slot:hover .badge { opacity: .8; }
.opt-slot[aria-checked="true"] .badge { opacity: 1; }
.opt-tag {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6a6e7a;
}
.opt-slot[aria-checked="true"] .opt-tag { color: var(--text); }
/* "None" is the absence of a badge, so it is drawn as an empty outline rather
   than as a fourth badge competing with the three real ones. */
.opt-tag.is-ghost { padding: 2px 6px; border: 1px dashed #32323b; }
.opt-own-slot { display: flex; align-items: center; gap: 4px; }
.opt-own-slot .ic { width: 12px; height: 12px; color: #6a6e7a; }
.opt-slot[aria-checked="true"] .opt-own-slot .ic { color: var(--text); }

/* The field is the Own slot's disclosure. Deliberately NOT .text-field:
   `.card-body .text-field` forces 50px + an 18px bottom margin, which is
   exactly where the dead space under every row was coming from. */
.opt-own {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin-top: 6px;
  padding: 0 10px;
  background: #0d0d10;
  border: 1px solid var(--line);
  border-inline-start: 2px solid var(--red);
}
.opt-own input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  font-family: var(--f-body);
  font-size: 13.5px;
  color: var(--text);
}
.opt-own input::placeholder { color: #4d505a; }
.opt-own-n { flex: none; font-family: var(--f-mono); font-size: 10px; color: var(--dim); }
.opt-own-n.is-max { color: var(--red-hi); }
.subs { display: flex; flex-direction: column; gap: 6px; }
.sub-row {
  --cut: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 0 12px 0 14px;
  background: #16161a;
  font-size: 14.5px;
  color: #c9cad0;
}

.angle-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.angle-val {
  font-family: var(--f-display);
  font-size: 30px;
  line-height: 1;
  color: var(--red-hi);
  text-shadow: 0 0 18px rgba(212, 212, 216, .35);
  direction: ltr;
}
.slider { position: relative; height: 40px; margin-bottom: 10px; }
.slider-track { position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: #2a2a31; }
.slider-track i { position: absolute; top: -6px; width: 1px; height: 14px; background: #3a3b44; }
.slider-track i:first-child { left: 0 !important; }
.slider-fill {
  position: absolute;
  top: 0;
  left: var(--from);
  width: calc(var(--to) - var(--from));
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 8px rgba(212, 212, 216, .5);
}
.slider input {
  position: absolute;
  inset: 0;
  width: calc(100% + 12px);
  margin: 0 -6px;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.slider input::-webkit-slider-runnable-track { height: 40px; background: none; }
.slider input::-moz-range-track { height: 40px; background: none; }
.slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 30px;
  margin-top: 5px;
  background: #c9cad0;
  border: 0;
  border-radius: 1px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .5);
}
.slider input::-moz-range-thumb {
  width: 12px;
  height: 30px;
  background: #c9cad0;
  border: 0;
  border-radius: 1px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .5);
}
.slider input:active::-webkit-slider-thumb { background: #fff; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.preset { font-size: 12px; direction: ltr; }

/* Body V1 head-shot RATE seek-bar: reuses .slider (track/fill/thumb) and adds a
   danger zone + warn marker above the warn line. */
.rate-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rate-val { font-family: var(--f-display); font-size: 30px; line-height: 1; color: var(--red-hi); text-shadow: 0 0 18px rgba(212, 212, 216, .35); direction: ltr; }
.rate-val.safe { color: #d7d8dd; text-shadow: none; }
.slider.rate, .slider.rate .slider-track { overflow: visible; }
.rate-danger { position: absolute; top: 0; left: var(--warn, 60%); right: 0; height: 2px; background: repeating-linear-gradient(90deg, rgba(212, 212, 216, .45) 0 5px, transparent 5px 9px); }
.slider.rate .slider-fill { z-index: 1; }
.rate-warn { position: absolute; left: var(--warn, 60%); top: -13px; transform: translateX(-50%); font-family: var(--f-mono); font-size: 9px; font-weight: 700; letter-spacing: .08em; color: #8a8d97; white-space: nowrap; pointer-events: none; }
.rate-warn i { display: block; width: 1px; height: 8px; background: #3a3b44; margin: 2px auto 0; }
.rate-ends { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 10px; color: var(--dim); letter-spacing: .08em; }
.rate-note { margin-top: 12px; min-height: 18px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.rate-note .pill { font-family: var(--f-mono); font-weight: 800; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; background: var(--red-deep); border: 1px solid var(--red-line); color: var(--red-hi); }
.dns { display: flex; align-items: center; gap: 10px; margin-top: 16px; cursor: pointer; user-select: none; }
.dns input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; background: #24242a; position: relative;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%); }
.dns input:checked { background: var(--red); }
.dns input:checked::after { content: ""; position: absolute; inset: 6px; background: #fff; }
.dns span { font-size: 13px; color: var(--muted); }


.device { --cut: 14px; --frame-line: #26262c; --frame-bg: #0f0f12; padding: 16px; }
.device-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.badge-test { background: #2a210b; border-color: #5a4a1a; color: #ffc451; }
.badge-risk { background: #18181b; border-color: #3f3f46; color: #a1a1aa; }
.badge-off { background: #17171b; border-color: #2c2c34; color: #8a8a93; }
/* The owner's own wording, in the house red like the built-ins. It still reads
   apart from NEW because of the red spine and because text-transform is off:
   the three presets are always caps, a custom badge keeps the case it was
   typed in. The spine is an inset shadow, not a border, so the chip's box
   stays the same width and cannot reflow .feat-title on the customer card.
   text-transform: none also fixes a real bug -- .badge force-uppercases, so an
   owner who typed "Hot fix" was shipping "HOT FIX" to every customer, against
   the "shown verbatim" promise. */
.badge-custom {
  background: var(--red-deep);
  border-color: var(--red-line);
  color: var(--red-hi);
  box-shadow: inset 2px 0 0 var(--red);
  padding-inline-start: 9px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: none;
}
[dir="rtl"] .badge-custom { box-shadow: inset -2px 0 0 var(--red); }
.toggle.is-locked { opacity: .4; cursor: not-allowed; }
.feat.is-locked .feat-text { opacity: .65; }
.badge-lock {
  padding: 4px 8px;
  background: var(--red-deep);
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #d4d4d8;
}
[dir="rtl"] .badge-lock, :lang(th) .badge-lock { letter-spacing: 0; font-size: 11px; }
.device-model {
  margin-top: 14px;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.1;
  word-break: break-all;
}
[dir="rtl"] .device-model { text-align: right; }
.device-platform { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.device-id { margin-top: 10px; font-family: var(--f-mono); font-size: 11.5px; color: var(--dim); }
[dir="rtl"] .device-id { text-align: right; }
.device .btn-dark { margin-top: 16px; height: 50px; }

.notes {
  --cut: 14px;
  --frame-bg: #0f0f12;
  display: block;
  width: 100%;
  padding: 14px 16px 16px;
  text-align: start;
}
.notes:hover { --frame-line: #2c2c33; }
.notes-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.notes-link { display: inline-flex; align-items: center; gap: 4px; }
.notes-link .ic { width: 14px; height: 14px; }
.notes h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 14.5px;
  text-transform: uppercase;
  line-height: 1.2;
}
.ver { font-family: var(--f-display); color: var(--red-hi); font-size: 1.25em; flex: none; }
.notes p { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.list-row {
  --cut: 12px;
  --frame-bg: #0f0f12;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 8px 14px 8px 8px;
  text-align: start;
}
[dir="rtl"] .list-row { padding: 8px 8px 8px 14px; }
.list-row:hover { --frame-line: #2c2c33; }
.sq-icon {
  --cut: 8px;
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  background: var(--panel-3);
  font-family: var(--f-display);
  font-size: 16px;
  color: #d9dade;
}
.sq-icon .ic { width: 14px; height: 14px; }
.list-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.list-text b { font-family: var(--f-display); font-weight: 400; font-size: 15px; text-transform: uppercase; }
:lang(th) .list-text b, :lang(ar) .list-text b, :lang(th) .notes h3, :lang(ar) .notes h3 { font-weight: 800; }
.list-text small { font-size: 13px; color: var(--muted); }
.row-end { color: var(--dim); width: 16px; height: 16px; }

.section-label { margin: 8px 0 -2px; }

/* Which proxy box this key connects through.
   Four columns on a fixed grid rather than a flex row, so the flags, the names
   and the numbers line up down the list instead of each row setting its own
   positions. That alignment is what makes two servers comparable at a glance,
   which is the only thing this control exists to do. */
.regions { display: flex; flex-direction: column; gap: 8px; }
.region-row {
  --cut: 12px;
  --frame-bg: #0f0f12;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  padding: 10px 14px;
  text-align: start;
  cursor: pointer;
  transition: border-color .15s;
}
.region-flag {
  width: 28px;
  height: 21px;
  object-fit: cover;
  border-radius: 2px;
  /* A hairline keeps a white or light flag from dissolving into the card. */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14);
}
.region-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.region-text b {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 15px;
  text-transform: uppercase;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:lang(th) .region-text b, :lang(ar) .region-text b { font-weight: 800; }
.region-best {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #3ddc84;
}
/* The number is the point of the row, so it gets the only tabular figures in
   the panel -- without them 57 and 118 sit at different widths and the column
   stops reading as a column. */
.region-ping {
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}
.region-ping i { font-style: normal; font-size: 9.5px; font-weight: 700; margin-inline-start: 2px; opacity: .65; }
.ping.is-good { color: #3ddc84; }
.ping.is-fair { color: #ffc451; }
.ping.is-poor { color: var(--red-hi); }
.ping.is-none, .ping.is-wait { color: var(--dim); font-size: 14px; }
.ping.is-wait { animation: pingwait 1.1s ease-in-out infinite; }
@keyframes pingwait { 0%, 100% { opacity: .35; } 50% { opacity: .8; } }
.region-mark { display: flex; align-items: center; justify-content: center; color: var(--red-hi); }
.region-mark .ic { width: 16px; height: 16px; }
.region-row.sel { --frame-line: var(--red-line); --frame-bg: #141418; }
.region-row:not(.sel):hover { --frame-line: #2c2c33; }
.region-hint { margin: 10px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .ping.is-wait { animation: none; opacity: .6; }
}


.topbar-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.back-btn {
  --cut: 6px;
  --frame-bg: var(--panel-2);
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
}
.back-btn:hover { --frame-bg: var(--panel-3); }
.back-btn .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.walkthrough {
  --cut: 14px;
  --frame-bg: #0b0b0e;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.grid-bg {
  position: absolute;
  inset: 1px;
  background-image:
    linear-gradient(#1c1c22 1px, transparent 1px),
    linear-gradient(90deg, #1c1c22 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at center, #000 50%, rgba(0, 0, 0, .35));
  mask-image: radial-gradient(ellipse 75% 85% at center, #000 50%, rgba(0, 0, 0, .35));
}
.walkthrough .mono-label { position: relative; color: #5d6474; }
.walkthrough video { position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); object-fit: cover; background: #000; }
.page-setup .section-label { margin-top: 12px; }
.setup-steps { display: flex; flex-direction: column; gap: 10px; }
li.list-row:hover { --frame-line: var(--line-soft); }
.step-row .sq-icon { font-size: 15px; color: #aeb1ba; }
.step-row.is-key .sq-icon { background: var(--red); color: #fff; }
.step-row.is-key .list-text b { color: #d4d4d8; }


.tg-channel { --cut: 14px; --frame-bg: #0f0f12; display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; }
[dir="rtl"] .tg-channel { padding: 12px 12px 12px 14px; }
.tg-avatar {
  --cut: 10px;
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  overflow: hidden;
  background: var(--red);
}
.tg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tg-avatar .ic { width: 26px; height: 26px; color: #fff; }
.tg-post-card { --cut: 14px; --frame-bg: #0b0b0e; padding: 8px 6px; }
.tg-post { display: block; width: 100%; height: 320px; border: 0; color-scheme: dark; transition: height .2s; }
.page-telegram .btn-wide { margin-top: 4px; }

.logout-wrap { margin-top: auto; padding-top: 24px; }
.btn-logout {
  --cut: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 58px;
  background: linear-gradient(180deg, #1f1f24, #141418);
  font-family: var(--f-display);
  font-size: 16px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #d4d4d8;
  transition: background .15s;
}
:lang(th) .btn-logout, :lang(ar) .btn-logout { font-weight: 800; }
.btn-logout:hover { background: #27272e; }
.btn-logout .ic { width: 17px; height: 17px; }


.top-actions { display: flex; align-items: center; gap: 8px; }
.balance-chip {
  --cut: 6px;
  --frame-bg: var(--panel-2);
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 13px;
}


.text-field {
  --cut: 10px;
  --frame-line: #2a2a31;
  --frame-bg: #0e0e11;
  display: flex;
  align-items: center;
  height: 58px;
  padding: 0 16px;
  transition: background .15s;
}
.text-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  font-size: 15px;
  color: var(--text);
}
.text-field input::placeholder { color: #464953; }
.text-field:focus-within { --frame-line: #52525b; }
.text-field.invalid { --frame-line: #a1a1aa; }
.rs-login .field-label { margin-bottom: 8px; }
.rs-login .text-field + .field-label { margin-top: 16px; }


.card { --cut: 14px; --frame-line: #1e1e23; --frame-bg: #0f0f12; }
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #1c1c21;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #c9cad0;
}
.card-head .ic { width: 15px; height: 15px; color: var(--muted); }
.card-body { padding: 16px; }
.card-loading { display: grid; place-items: center; min-height: 130px; }
.empty { padding: 30px 16px; text-align: center; font-size: 13.5px; color: #5c606c; }
.empty-cta { display: flex; justify-content: center; margin-top: -14px; padding-bottom: 24px; }
.link-btn { cursor: pointer; transition: color .15s; }
.link-btn:hover { color: var(--text); }
.mono-label.ok { color: #3ddc84; }


.balance-big { margin: 2px 0 18px; font-family: var(--f-display); font-size: 40px; line-height: 1; text-align: start; }
[dir="rtl"] .balance-big { text-align: right; }
.btn-wide { height: 54px; font-size: 16px; gap: 10px; }
.stat-num { font-family: var(--f-display); font-weight: 400 !important; font-size: 22px !important; }
.rows { margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid #19191e; }
.row:first-child { border-top: 0; }
.row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row-main b { font-weight: 500; font-size: 14.5px; }
.row-main small { font-size: 12.5px; color: #626674; }
.mono-key { font-family: var(--f-mono); font-weight: 700 !important; font-size: 13px !important; letter-spacing: .04em; }
.row-side { flex: none; }
.amount { flex: none; font-family: var(--f-mono); font-weight: 800; font-size: 14px; white-space: nowrap; }
.amount.pos { color: #3ddc84; }


.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 18px; }
.plan {
  --cut: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 64px;
  background: var(--panel-3);
  transition: background .15s;
}
.plan b { font-family: var(--f-display); font-weight: 400; font-size: 11px; text-transform: uppercase; color: #c9cad0; }
:lang(th) .plan b, :lang(ar) .plan b { font-weight: 700; font-size: 12px; }
.plan span { font-family: var(--f-mono); font-weight: 700; font-size: 13.5px; }
.plan:hover { background: #25252b; }
.plan.sel { background: var(--red); }
.plan.sel b { color: #fff; }
.stepper { display: grid; grid-template-columns: 50px 1fr 50px; gap: 6px; margin-bottom: 6px; }
.stepper > * { height: 50px; }
.step-btn { --cut: 8px; display: grid; place-items: center; background: var(--panel-3); transition: background .15s; }
.step-btn:hover { background: #25252b; }
.step-btn .ic { width: 18px; height: 18px; }
.count-field { --cut: 8px; --frame-line: #2a2a31; --frame-bg: #0e0e11; display: flex; }
.count-field:focus-within { --frame-line: #52525b; }
.count-field input {
  width: 100%;
  background: none;
  border: 0;
  outline: none;
  text-align: center;
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 18px;
  -moz-appearance: textfield;
}
.count-field input::-webkit-outer-spin-button,
.count-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quick-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 18px; }
.quick {
  --cut: 8px;
  height: 38px;
  background: var(--panel-3);
  font-family: var(--f-display);
  font-size: 11px;
  color: #8c8f99;
  transition: background .15s, color .15s;
}
.quick:hover { color: var(--text); }
.quick.sel { background: var(--red); color: #fff; }
.card-body .text-field { height: 50px; margin-bottom: 18px; }
/* Admin / Reseller choice in the New-account form: two selectable tiles that
   reuse the OPTIONS panel's .opt-slot look, one always active. */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.role-slot {
  height: 50px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.role-slot[aria-checked="true"] { color: var(--text); border-color: var(--red); }
.na-brand-row[hidden] { display: none; }
.select-field { position: relative; }
.select-field select {
  width: 100%;
  height: 100%;
  padding: 0 32px 0 14px;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.select-field::after {
  content: "";
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  width: 8px; height: 8px;
  margin-top: -5px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 14px;
  background: #131317;
}
.bal-calc { display: flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-weight: 700; font-size: 13.5px; color: #5c606c; }
.bal-calc b { color: var(--text); transition: color .2s; }
.bal-calc b.short { color: #d4d4d8; }
.btn-buy { height: 58px; }
.generated {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px -16px -16px;
  padding: 14px 16px 16px;
  border-top: 1px dashed #26262c;
  animation: enter .35s cubic-bezier(.2, .8, .2, 1);
}
.gen-head { display: flex; align-items: center; justify-content: space-between; }


.keys-tools { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-bottom: 1px solid #1c1c21; }
.search {
  --cut: 10px;
  --frame-line: #2a2a31;
  --frame-bg: #0e0e11;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 14px;
  color: #5c606c;
}
.search:focus-within { --frame-line: #52525b; }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 15px; color: var(--text); }
.search input::placeholder { color: #4d505a; }

.filters { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  --cut: 7px;
  flex: 1 0 auto;
  height: 38px;
  padding: 0 8px;
  background: var(--panel-3);
  font-family: var(--f-display);
  font-size: 9.5px;
  color: #8c8f99;
  transition: background .15s, color .15s;
}
:lang(th) .filter, :lang(ar) .filter { font-weight: 700; font-size: 12px; }
.filter:hover { color: var(--text); }
.filter.sel { background: var(--red); color: #fff; }
.select-field { --cut: 10px; --frame-line: #2a2a31; --frame-bg: #0e0e11; position: relative; display: flex; height: 50px; }
.select-field select {
  width: 100%;
  height: 100%;
  padding: 0 44px 0 16px;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
[dir="rtl"] .select-field select { padding: 0 16px 0 44px; }
.select-field option { background: var(--panel-2); color: var(--text); }
.select-field .ic { position: absolute; top: 50%; inset-inline-end: 14px; margin-top: -9px; color: var(--muted); pointer-events: none; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #1c1c21; }
.list-head-actions { display: flex; gap: 18px; }

.key-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #19191e; transition: background .15s; }
.key-item:last-child { border-bottom: 0; }
.key-item.selecting { cursor: pointer; }
.key-item.is-sel { background: rgba(212, 212, 216, .08); }
.check { --cut: 5px; display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px; background: var(--panel-3); }
.is-sel .check { background: var(--red); }
.check .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.key-body { flex: 1; min-width: 0; }
.key-top { display: flex; align-items: center; gap: 6px; }
.key-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: .03em;
}
.icon-btn { display: grid; place-items: center; flex: none; width: 28px; height: 28px; color: var(--muted); transition: color .15s; }
.icon-btn:hover { color: var(--text); }
.icon-btn .ic { width: 15px; height: 15px; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  margin-inline-start: auto;
  padding: 5px 9px;
  background: var(--panel-2);
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.status i { width: 6px; height: 6px; background: currentColor; opacity: .75; }
.status i.live { border-radius: 50%; opacity: 1; box-shadow: 0 0 8px currentColor; animation: live 1.6s ease-in-out infinite; }
@keyframes live { 50% { opacity: .35; } }
.s-active { color: #3ddc84; background: rgba(61, 220, 132, .08); }
.s-expired { color: #ffa94d; background: rgba(255, 169, 77, .08); }
.s-revoked { color: #d4d4d8; background: var(--red-deep); }
.key-note { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 13.5px; color: #cfd6ea; text-align: start; }
.key-note.empty { color: #5c606c; }
.key-note .ic { width: 13px; height: 13px; color: var(--muted); }
.key-meta {
  margin-top: 8px;
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .1em;
  line-height: 1.7;
  text-transform: uppercase;
  color: #5c606c;
}
.key-actions { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; }
.key-op {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .15s;
}
.key-op:hover { color: var(--text); }
.op-delete, .op-revoke { color: #d4d4d8; }
.key-op.armed { color: #d4d4d8; animation: live 1s ease-in-out infinite; }
.key-op .spin { width: 15px; height: 15px; }
[dir="rtl"] .key-meta, [dir="rtl"] .key-op, [dir="rtl"] .status { letter-spacing: 0; }
.page-keys { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 90px); }

.bulk-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
  z-index: 35;
  width: min(100% - 2 * var(--gutter), var(--app-w) - 2 * var(--gutter));
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .7));
  animation: enter .25s ease-out;
}
.bulk-bar {
  --cut: 12px;
  --frame-line: #34343c;
  --frame-bg: var(--panel-2);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
}
[dir="rtl"] .bulk-bar { padding: 8px 16px 8px 8px; }
.bulk-bar .mono-label { flex: 1; color: var(--text); }
.btn-chip:disabled { opacity: .4; }
.btn-chip.danger { color: #d4d4d8; }
.btn-chip.armed { background: var(--red); color: #fff; }


.account { padding: 16px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.account-name { font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1.1; text-transform: uppercase; word-break: break-all; }
.role-badge {
  flex: none;
  padding: 5px 9px;
  background: var(--panel-3);
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-key { margin-bottom: 12px; font-family: var(--f-mono); font-weight: 700; font-size: 13px; color: var(--muted); }


.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metric { --cut: 14px; --frame-line: #1e1e23; --frame-bg: #0f0f12; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px; }
.metric .mono-label { font-size: 9.5px; }
.metric-num { font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; text-align: start; }
[dir="rtl"] .metric-num { text-align: right; }
.metric small { font-size: 12.5px; color: #6b6f7c; }
.btn-add {
  --cut: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  background: var(--panel-3);
  font-family: var(--f-display);
  font-size: 16px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text);
  transition: background .15s;
}
:lang(th) .btn-add, :lang(ar) .btn-add { font-weight: 800; }
.btn-add:hover { background: #26262c; }
.btn-add .ic { width: 18px; height: 18px; stroke-width: 2; }
.warn { color: #ffa94d; }
.sub { font-size: 13px; color: var(--muted); }
.hint { margin-bottom: 14px; font-size: 13px; line-height: 1.5; color: #6b6f7c; }
.hint b { font-weight: 500; color: var(--text); }
.hint.center { margin: 4px 0 0; text-align: center; }
.tag {
  display: inline-block;
  padding: 2px 6px;
  background: var(--panel-3);
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.tag.off { background: var(--red-deep); color: #d4d4d8; }


.card-head > .chip-warn, .card-head > .head-link, .card-head > .head-num { margin-inline-start: auto; }
.head-link { display: inline-flex; align-items: center; gap: 6px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--muted); transition: color .15s; }
.head-link:hover { color: var(--text); }
.head-link .ic { width: 13px; height: 13px; }
.head-num { font-family: var(--f-display); font-weight: 400; font-size: 18px; letter-spacing: 0; color: var(--text); }
.chip-warn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  background: rgba(255, 169, 77, .1);
  font-size: 10px;
  color: #ffa94d;
}
.chip-warn::before { content: ""; width: 6px; height: 6px; background: currentColor; }
.chip-warn.out { background: var(--red-deep); color: #d4d4d8; }


.credits .balance-big, .sold-body .balance-big { margin-bottom: 8px; }
.credit-notes { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #26262c; font-size: 13px; color: #6b6f7c; }
.cost-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px; border-top: 1px solid #1c1c21; color: var(--muted); }
.cost-toggle .ic { width: 16px; height: 16px; transition: transform .2s; }
.cost-toggle.open .ic { transform: rotate(180deg); }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.price-tile { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; background: #131317; }
.price-tile .mono-label { font-size: 9.5px; }
.price-tile b { font-family: var(--f-mono); font-weight: 800; font-size: 15px; text-align: start; }
[dir="rtl"] .price-tile b { text-align: right; }
.cost-grid { padding: 0 16px 16px; }
.rows > li > .row-btn { border-top: 0; }
.rows > li + li > .row-btn { border-top: 1px solid #19191e; }
.row-btn { width: 100%; text-align: start; transition: background .15s; }
.row-btn:hover { background: #131317; }
.rs-name { font-family: var(--f-display); font-weight: 400 !important; font-size: 15px !important; text-transform: uppercase; overflow-wrap: anywhere; }
:lang(th) .rs-name, :lang(ar) .rs-name { font-weight: 700 !important; }
.rs-name .tag { margin-inline-start: 8px; vertical-align: 2px; }
.row-end-group { display: flex; align-items: center; gap: 14px; flex: none; }
.row-end-group small { font-size: 12.5px; color: #626674; }
.rs-row .row-main { flex: 1; }
.amount.zero { color: #ffa94d; }
.warn-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #1c1c21;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #ffa94d;
}
.warn-line .ic { width: 14px; height: 14px; }
.act-row { justify-content: flex-start; }
.act-row .row-main { flex: 1; }
.act-icon { --cut: 6px; display: grid; place-items: center; flex: none; width: 34px; height: 34px; background: var(--panel-3); color: #3ddc84; }
.act-icon .ic { width: 15px; height: 15px; }
.ok-label { font-family: var(--f-mono); font-weight: 700; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #3ddc84; }
.row-main small .note, .key-who .note { color: #cfd6ea; }


.seg-bar { display: flex; gap: 3px; height: 6px; margin-bottom: 14px; background: #16161a; }
.seg-bar i { flex: 1 1 0; min-width: 4px; }
.seg-active { background: #3ddc84; }
.seg-unactivated { background: #d9dade; }
.seg-expired { background: #4b4e58; }
.seg-revoked { background: #ffc94d; }
.legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.legend div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.legend b { font-family: var(--f-display); font-weight: 400; font-size: 17px; overflow-wrap: anywhere; text-align: start; }
[dir="rtl"] .legend b { text-align: right; }
.legend .mono-label { font-size: 9px; }
.lg-active { color: #3ddc84; }
.lg-expired { color: #6d7486; }
.lg-revoked { color: #ffc94d; }
.plan-solo { height: 50px; }
.quick-counts.q5 { grid-template-columns: repeat(5, 1fr); }
.cost-line { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.cost-line span + span { font-family: var(--f-mono); font-size: 12px; color: #6b6f7c; }
.cost-line .short { color: #d4d4d8 !important; }
.search-count { flex: none; font-size: 10px; color: #4d505a; }
.key-who { margin-top: 8px; font-size: 13px; color: #8c8f99; overflow-wrap: anywhere; }
.link-btn.armed { color: #d4d4d8; animation: live 1s ease-in-out infinite; }
.link-btn .spin { width: 14px; height: 14px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid #19191e; }
.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text);
}
.pager-btn:disabled { color: #3d3f48; }
.pager-btn .ic { width: 14px; height: 14px; }
.key-op .ic { width: 13px; height: 13px; margin-inline-end: 6px; }


.topbar-start .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-new .field-label { margin-bottom: 8px; }
.rs-new .frame + .field-label { margin-top: 16px; }
.card-body.rs-new .text-field { margin-bottom: 0; }
.rs-new .btn-primary { margin-top: 4px; }
.rs-new .hint { margin: 12px 0 0; }
.money-field {
  --cut: 10px;
  --frame-line: #2a2a31;
  --frame-bg: #0e0e11;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 0 14px;
  direction: ltr;
}
.money-field i { font-style: normal; font-family: var(--f-mono); font-weight: 700; color: #5c606c; }
.money-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.money-field input::placeholder { color: #464953; }
.money-field:focus-within { --frame-line: #52525b; }
.money-field.invalid { --frame-line: #a1a1aa; }
.money-field.sm { flex: none; width: 128px; height: 44px; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #19191e; }
.price-row:first-of-type { border-top: 0; }
.price-name { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.price-name b { font-family: var(--f-display); font-weight: 400; font-size: 13px; text-transform: uppercase; }
:lang(th) .price-name b, :lang(ar) .price-name b { font-weight: 700; }
.price-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.price-tags small { font-family: var(--f-mono); font-size: 10px; color: #5c606c; }
.btn-save { margin-top: 14px; }
.btn-dark { gap: 10px; }
.btn-dark .ic { width: 16px; height: 16px; }
.btn-dark:disabled { color: #545761; }
.btn-dark:disabled:hover { background: var(--panel-3); }
.btn-dark .spin { width: 18px; height: 18px; }
.btn-del { background: linear-gradient(180deg, #1f1f24, #141418); color: #d4d4d8; }
.btn-del:hover { background: #27272e; }
.adjust-form { display: flex; flex-direction: column; gap: 10px; }
.card-body.adjust-form .text-field { margin-bottom: 0; }
.seg2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.seg2 .filter { height: 42px; font-size: 10.5px; }
/* Aim height: Custom off = the named stops, on = a free value in the band.
   A framed row rather than a bare tickbox, so it reads as part of the card
   instead of floating in it -- and a checkbox, not the sliding switch that
   turns features on and off. */
.aim-mode {
  --cut: 10px;
  --frame-line: #2a2a31;
  --frame-bg: #121216;
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0 12px 0 14px;
  color: #cfcfd6;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: color .15s;
}
.aim-mode:hover { --frame-line: #3a3a44; }
.aim-mode.on { --frame-line: var(--accent); --frame-bg: #18181d; color: #fff; }
.aim-mode .am-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.aim-mode .am-text b { font-size: 13.5px; font-weight: 700; letter-spacing: .02em; }
.aim-mode .am-text small { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; color: #6b6f7c; transition: color .15s; }
.aim-mode.on .am-text small { color: var(--accent-soft); }
/* The box itself: angular to match the frame, empty until checked. */
.aim-mode .am-box {
  --cut: 6px;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1b1b21;
  box-shadow: inset 0 0 0 1px #3a3a44;
  color: transparent;
  transition: background .15s, box-shadow .15s, color .15s;
}
.aim-mode.on .am-box { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: #fff; }
.aim-mode .am-box .ic { width: 15px; height: 15px; }
/* With Custom on, the remaining stops are anatomy labels, not buttons. */
.aim.is-custom .aim-stop { cursor: default; opacity: .75; }
.aim.is-custom .aim-stop .tk { visibility: hidden; }
.btn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; }
.account .sub { margin-top: 2px; }
.account .balance-big { margin: 10px 0 8px; }
.sheet-sub { display: block; margin-top: 6px; font-size: 13px; color: #6b6f7c; }
.page-resellers .rows .status { margin-inline-start: 0; }


.sheet-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.sheet-root:empty { display: none; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .25s;
}
.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--app-w));
  max-height: 86dvh;
  padding: 10px var(--gutter) calc(16px + var(--safe-b));
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .6);
  transform: translate(-50%, 100%);
  transition: transform .3s cubic-bezier(.2, .9, .25, 1);
}
.sheet-root.open { pointer-events: auto; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: translate(-50%, 0); }
.sheet-handle { width: 40px; height: 3px; margin: 0 auto 16px; background: #34353d; }
.sheet-title { font-family: var(--f-display); font-weight: 400; font-size: 19px; text-transform: uppercase; margin-bottom: 14px; }
:lang(th) .sheet-title, :lang(ar) .sheet-title { font-weight: 800; }
.sheet-body { overflow-y: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.sheet-text { font-size: 15px; color: var(--muted); line-height: 1.5; }
.sheet-actions { display: flex; gap: 8px; margin-top: 20px; }

.updates { display: flex; flex-direction: column; gap: 8px; }
.update { --cut: 12px; --frame-bg: #0f0f12; padding: 14px; }
.update-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.update .ver { font-size: 15px; }
.update h3 { font-family: var(--f-display); font-weight: 400; font-size: 14px; text-transform: uppercase; }
.update p { margin-top: 6px; font-size: 13.5px; color: var(--muted); }



.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 150;
  max-width: min(90vw, 400px);
  padding: 11px 16px;
  background: var(--panel-3);
  border: 1px solid #2e2e35;
  border-inline-start: 3px solid var(--red);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .6);
  font-size: 13.5px;
  transform: translate(-50%, -20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { color: #e4e4e7; }

@media (max-width: 360px) {
  :root { --gutter: 12px; }
  .time-left { font-size: 34px; }
  .choice { font-size: 10px; }
  .stat { padding: 10px; }
  .stat b { font-size: 12.5px; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  .view-enter, .shake, .tick.lit, .btn-label { animation: none !important; }
}


.muted { color: #9a9aa0; font-size: 13px; margin: 2px 0 0; }
.api-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.api-fresh {
  padding: 12px; margin: 10px 0 14px;
  border: 1px solid rgba(74, 222, 128, .35); border-radius: 12px;
  background: rgba(74, 222, 128, .07);
}
.api-fresh .mono-label { color: #4ade80; }
.api-key-val {
  display: block; margin: 8px 0; padding: 10px 12px;
  background: #0b0b0d; border: 1px solid #26262b; border-radius: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; word-break: break-all; color: #eaeaea; user-select: all;
}
.api-docs {
  margin-top: 12px; padding: 12px;
  background: #0b0b0d; border: 1px solid #1e1e22; border-radius: 12px; overflow-x: auto;
}
.api-docs .mono-label { color: #8a8a90; }
.api-pre {
  display: block; margin: 8px 0 0; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.55; color: #c6c6cc;
}
.api-leak {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 14px; padding: 11px 13px;
  border: 1px solid rgba(247, 185, 89, .35); border-radius: 12px;
  background: rgba(247, 185, 89, .08); color: #f7b955;
  font-size: 12.5px; line-height: 1.55;
}
.api-leak::before { content: "\26A0"; font-size: 14px; line-height: 1.35; }


.skin-wrap { padding: 6px 0 20px; }
.skin-master { display: flex; align-items: center; justify-content: space-between; gap: 14px; --cut: 12px; --frame-line: #1e1e23; --frame-bg: #0f0f12; padding: 13px 14px; margin-bottom: 12px; }
.skin-master-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.skin-master-text b { font-family: var(--f-display); font-weight: 400; font-size: 15px; text-transform: uppercase; line-height: 1.15; }
:lang(th) .skin-master-text b, :lang(ar) .skin-master-text b { font-weight: 800; font-size: 16px; }
.skin-master-text small { font-size: 12.5px; color: var(--muted); }
.skin-stage.is-off { opacity: .35; pointer-events: none; filter: grayscale(1); transition: opacity .2s, filter .2s; }
.skin-stage { position: relative; width: 100%; max-width: 380px; margin: 0 auto; aspect-ratio: 5 / 7; }
.skin-char {
  position: absolute; left: 50%; top: 10%; transform: translateX(-50%); z-index: 1;
  height: 88%; width: auto; max-width: 72%; object-fit: contain;
  pointer-events: none; user-select: none; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .55));
}
/* Above the character (z-index 1), below the slot buttons (z-index 3), so the
   pointer lines read as drawn ON the figure instead of disappearing behind it. */
.skin-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.skin-lines line { stroke: rgba(161, 161, 170, .7); stroke-width: 1.3; stroke-linecap: round; }
.skin-lines circle, .skin-lines ellipse { fill: #a1a1aa; }

.skin-slot { position: absolute; z-index: 3; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; background: none; border: none; cursor: pointer; }
.skin-slot:active { transform: scale(.95); }
.slot-pic { position: relative; display: inline-flex; }
.skin-slot.off .skin-art { opacity: .4; }
.slot-check { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: #15151a; border: 1px solid #45454f; color: #fff; z-index: 2; }
.slot-check.on { background: var(--accent, #a1a1aa); border-color: var(--accent, #a1a1aa); }
.slot-check .ic { width: 14px; height: 14px; }


.aim { --accent: #a1a1aa; --accent-soft: #e4e4e7; padding-top: 4px; }

.aim-top { display: flex; direction: ltr; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.aim-pct { font-family: var(--f-display); font-size: 33px; color: var(--accent-soft); line-height: 1; transform: skewX(-8deg); font-variant-numeric: tabular-nums; }
.aim-zone { font-size: 14px; font-weight: 700; color: #d4d4d8; }
.aim-cap { margin-left: auto; font-size: 12px; font-weight: 500; color: #86858c; }

.aim-row { position: relative; display: flex; direction: ltr; align-items: stretch; gap: 12px; height: 210px; }
.aim-stops { position: relative; flex: 1 1 auto; list-style: none; margin: 0; padding: 0; min-width: 0; }
.aim-stops li { position: absolute; left: 0; right: 0; transform: translateY(50%); }
.aim-stop { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; cursor: pointer; padding: 3px 2px; white-space: nowrap; }
.aim-stop .pc { font-style: normal; font-size: 12px; font-weight: 700; color: #7e7d84; font-variant-numeric: tabular-nums; transition: color .2s; }
.aim-stop .nm { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  font-size: 14px; color: #8f8e95; transition: color .2s; }
.aim-stop .tk { flex: 0 0 auto; width: 9px; height: 2px; border-radius: 1px; background: #33333b; transition: width .22s, background .22s; }
.aim-stop:hover .nm { color: #a7a7af; }
.aim-stop.sel .pc { color: var(--accent-soft); }
.aim-stop.sel .nm { color: var(--text); font-weight: 700; }
.aim-stop.sel .tk { width: 18px; background: var(--accent); }

.aim-slider { position: relative; width: 30px; flex: 0 0 auto; cursor: ns-resize; touch-action: none; }
.aim-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.aim-track { position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; transform: translateX(-50%); background: #2a2a33; border-radius: 3px; overflow: hidden; }

.aim-fill { position: absolute; left: 0; right: 0; bottom: 0; height: var(--pos, 0%); background: var(--accent); transition: height .28s cubic-bezier(.22, .9, .3, 1); }
.aim-thumb { position: absolute; left: 50%; bottom: var(--pos, 0%); width: 30px; height: 14px; transform: translate(-50%, 50%); background: #eef3f1; border-radius: 7px; box-shadow: 0 2px 7px rgba(0, 0, 0, .5); transition: bottom .28s cubic-bezier(.22, .9, .3, 1); }
.aim-thumb::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; transform: translate(-50%, -50%); background: #a6a6ae; border-radius: 1px; }

.aim-fig { width: 104px; flex: 0 0 auto; height: 100%; overflow: visible; }
.aim-hatch { height: calc(var(--hb, 107) * 1px); transition: height .28s cubic-bezier(.22, .9, .3, 1); }
.aim-marker { transform: translateY(calc(var(--my, 108) * 1px)); transition: transform .28s cubic-bezier(.22, .9, .3, 1); }
.aim-line { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 7 5; opacity: .9; }
.aim-box { fill: none; stroke: var(--accent); stroke-width: 2; }
.aim-dot { fill: var(--accent); }
.aim-note { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 12.5px; color: var(--accent); }
.aim-note::before { content: ""; flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.aim-note.is-hidden { display: none; }

@media (max-width: 400px) {
  .aim-row { gap: 8px; }
  .aim-fig { width: 78px; }
  .aim-stop { gap: 8px; }
  .aim-stop .nm { font-size: 13px; }
  .aim-stop .pc { font-size: 11px; }
  /* Five slots across ~280px. Measured widest label is English at 43px, Thai
     "ทดสอบ" at 52px; trimming the chip's own padding and tracking buys the
     ~8px that keeps the longest one off the edge. */
  .opt-rail { gap: 3px; }
  .opt-slot .badge { padding: 2px 5px; letter-spacing: .06em; }
  .opt-tag { letter-spacing: .06em; }
  .opt-tag.is-ghost { padding: 2px 4px; }
}
.skin-slot .slot-label { font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: #b7b7bf; text-align: center; line-height: 1.15; }
.skin-art { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 4px; background: #262630; border: 1px solid #3a3a44; }
.skin-art.q { border-color: transparent; background: none; }
.skin-art .art-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.skin-art .art-ic { position: relative; z-index: 1; width: 86%; height: 86%; object-fit: contain; }
.skin-slot .skin-art { width: 58px; height: 58px; }
.skin-slot.set .skin-art { box-shadow: 0 0 0 2px var(--accent, #a1a1aa); }
/* Seven slots: three down the left, four down the right, evenly spaced so the
   pointer lines never cross each other. */
.pos-head { top: 13%; left: 0; }
.pos-face { top: 43%; left: 0; }
.pos-shoes { top: 73%; left: 0; }
.pos-mask { top: 6%; right: 0; }
.pos-suit { top: 29%; right: 0; }
.pos-tshirt { top: 52%; right: 0; }
.pos-underwear { top: 75%; right: 0; }
.skin-save { margin-top: 16px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
/* Save + Restore stack full-width: the labels are long once uppercased with
   letter-spacing, and longer again in th/ar, so a 2-up grid overflows on a
   narrow phone. Equal heights so the pair reads as one block. */
.skin-actions { margin-top: 16px; display: grid; gap: 8px; }
.skin-actions .skin-save { margin-top: 0; }
.skin-restore { width: 100%; height: 60px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.skin-restore .ic { width: 16px; height: 16px; }
/* Picker: a fixed search bar above a scrolling result grid, so the sheet never
   grows past the viewport no matter how many items match. */
.skin-pick { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.skin-pick .search { flex: 0 0 auto; }
/* minmax(0, 1fr), not 1fr: a bare 1fr floors each column at its content's
   min-content width, so one long catalogue name ("Alpha Flameborn
   (Facepaint)") stretched its column to 204px while its neighbours sat at
   82px. Real item names only arrived with the full catalogue, which is why the
   hand-written 3-item list never showed it. */
.skin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.skin-tile { min-width: 0; }
/* No 300x300 artwork exists for this item, so the tile is showing the slot's
   default picture. Dim it so nobody reads that placeholder as the real skin. */
.skin-tile.noart .skin-art { opacity: .45; }
/* Queued icons have no src yet. Fade each in as it lands so the grid fills
   smoothly instead of snapping tile by tile. */
.skin-art .art-ic { opacity: 1; transition: opacity .18s ease-out; }
.skin-art .art-ic[data-src] { opacity: 0; }
.skin-pager:empty { display: none; }
.skin-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 2px; }
.skin-pager .pg { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 36px; background: var(--panel-3); border: 0; border-radius: 8px; color: #d6d6dc; cursor: pointer; }
.skin-pager .pg:disabled { opacity: .35; cursor: default; }
.skin-pager .pg .ic { width: 17px; height: 17px; }
.skin-pager .pg-at { font-size: 11.5px; color: #8a8a90; min-width: 54px; text-align: center; }
.skin-tile .tile-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.skin-pick .skin-grid { max-height: min(56vh, 420px); overflow-y: auto; align-content: start; padding-right: 2px; -webkit-overflow-scrolling: touch; }
.skin-loading { grid-column: 1 / -1; display: flex; justify-content: center; padding: 28px 0; }
.skin-more { grid-column: 1 / -1; margin: 4px 0 0; text-align: center; font-size: 11.5px; color: #6b6f7c; line-height: 1.4; }
.skin-tile { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 8px; background: #141417; border: 1px solid #2a2a30; border-radius: 8px; color: #d6d6dc; cursor: pointer; }
.skin-tile.sel { border-color: var(--accent, #a1a1aa); }
.skin-tile .skin-art { width: 100%; aspect-ratio: 1; }
.skin-tile .tile-name { font-size: 11px; color: #cfcfd6; text-align: center; line-height: 1.2; }
.skin-tile .tile-id { font-size: 9px; color: #8a8a90; letter-spacing: .03em; }

/* Owner -> Site -> Proxy nodes. Deliberately plain: this card exists to be read
   at a glance, and the only thing that matters is whether the dot is lit. */
.node-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.node-row + .node-row { border-top: 1px solid var(--line-soft); margin-top: 8px; padding-top: 12px; }
.node-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #3a3a44; }
.node-dot.ok { background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .14); }
.node-name { font-family: var(--f-mono); font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.node-meta { margin-inline-start: auto; font-size: 12px; color: var(--muted); }

/* Video hero logo & monochrome gauge badge */
.logo-vid {
  width: min(230px, 62vw);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(212, 212, 216, .22);
  box-shadow: 0 0 42px rgba(212, 212, 216, .14), 0 14px 32px rgba(0, 0, 0, .85);
  background: #060607;
}
.logo-sm {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 50%;
}
