/* ============ tokens ============ */
:root {
  --bg: #060607;
  --app: #08080a;
  --panel: #111114;
  --panel-2: #17171b;
  --panel-3: #1e1e23;
  --line: #24242a;
  --line-soft: #1a1a1f;
  --text: #f4f4f5;
  --muted: #9b9ea7;
  --label: #6d7486;
  --dim: #4b4e58;
  --red: #e0262c;
  --red-hi: #ff3a40;
  --red-deep: #2a0b0d;
  --red-line: #5a1a1d;

  --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;
}

/* ============ base ============ */
*, *::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;
}
/* faint scanlines over everything */
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); }
/* letter-spacing breaks Arabic letter joining */
: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-corner shapes ============
   .cut  = bottom-right corner cut
   .cut2 = top-left + bottom-right cut
   .frame draws a 1px border that follows the cut (bg = border, ::before = fill) */
.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 frame ============ */
.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(224, 38, 44, .05), 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); } }

/* ============ top bar + language ============ */
.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);
}
.title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 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; }

/* ============ shared controls ============ */
.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 switch */
.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 ============ */
.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 ============ */
.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(224, 38, 44, .1), transparent);
}
.tagline {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #5d7189;
  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: #ff6b6f; }
.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); }
/* Spinner: a slow turn while the arc stretches and shrinks */
.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;
}
/* empty form / can't buy: grey, flat */
.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: #5d7189; }

.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; }

/* ============ pages ============ */
.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); }

/* ============ tab bar ============ */
.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); }

/* ============ home ============ */
.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(224, 38, 44, .24), rgba(224, 38, 44, .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(255, 58, 64, .7));
  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: #5d7189;
}

.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(224, 38, 44, .35));
}
.cta {
  --cut: 14px;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 78px;
  background: linear-gradient(100deg, #e3282e, #d01f25);
  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; }

/* ============ features ============ */
.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; }
/* Marker choices can be many, with long names -> compact, wrapping cells that
   fit the panel instead of overflowing it. (Angle .preset buttons untouched.) */
.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; }

.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(224, 38, 44, .45);
  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(224, 38, 44, .6);
}
.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; }

/* ============ manage ============ */
.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-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: #ff5a5f;
}
[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; }

/* ============ setup guide ============ */
.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: #ff6b6f; }

/* ============ telegram ============ */
.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, #2a0f11, #1d0a0c);
  font-family: var(--f-display);
  font-size: 16px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #ff4d52;
  transition: background .15s;
}
:lang(th) .btn-logout, :lang(ar) .btn-logout { font-weight: 800; }
.btn-logout:hover { background: #32110f; }
.btn-logout .ic { width: 17px; height: 17px; }

/* ============ reseller ============ */
.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 inputs */
.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: #6e2427; }
.text-field.invalid { --frame-line: #b8393d; }
.rs-login .field-label { margin-bottom: 8px; }
.rs-login .text-field + .field-label { margin-top: 16px; }

/* cards */
.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; }

/* home */
.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; }

/* shop */
.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: #6e2427; }
.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; }
.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: #ff6b6f; }
.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 */
.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: #6e2427; }
.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; }
/* fits five chips on a 390px phone; narrower screens scroll sideways */
.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(224, 38, 44, .07); }
.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: #ff5a5f; 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: #ff4d52; }
.key-op.armed { color: #ff8a4c; 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: #ff5a5f; }
.btn-chip.armed { background: var(--red); color: #fff; }

/* settings */
.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); }

/* ============ admin ============ */
.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: #ff6b6f; }

/* card header extras, pushed to the end */
.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: #ff5a5f; }

/* home */
.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; }

/* keys */
.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: #ff6b6f !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: #ff8a4c; 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; }

/* resellers */
.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: #6e2427; }
.money-field.invalid { --frame-line: #b8393d; }
.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, #2a0f11, #1d0a0c); color: #ff4d52; }
.btn-del:hover { background: #32110f; }
.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; }
.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 ============ */
.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 ============ */
.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: #ffb3b5; }

@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; }
}

/* Drop decorative motion, but keep loading spinners turning at their normal speed:
   shrinking an infinite animation's duration makes it spin wildly instead of stopping. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  .view-enter, .shake, .tick.lit, .btn-label { animation: none !important; }
}
