/* ==========================================================================
   Clash subscription console
   A small, dependency-free design system.
   ========================================================================== */

:root {
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --ink: #16231e;
  --ink-soft: #35463e;
  --muted: #6d7c74;
  --muted-light: #96a29b;
  --bg: #f4f5f1;
  --bg-deep: #eceee8;
  --surface: #ffffff;
  --surface-soft: #f8f9f5;
  --line: #e3e7e0;
  --line-strong: #d4dad2;

  --accent: #0f5e4c;
  --accent-strong: #0a4438;
  --accent-soft: #e7f2ec;
  --accent-wash: #f1f8f4;
  --lime: #d9f99d;

  --success: #18794e;
  --success-bg: #e9f6ef;
  --success-line: #c8e8d7;
  --warning: #9a5b13;
  --warning-bg: #fdf4e3;
  --warning-line: #f1deb8;
  --danger: #b42318;
  --danger-bg: #fdf0ee;
  --danger-line: #f3d2cd;
  --info: #205d8a;
  --info-bg: #eef6fc;
  --info-line: #d4e7f4;

  --radius-xl: 22px;
  --radius-lg: 17px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(22, 35, 30, 0.04);
  --shadow-md: 0 10px 30px -18px rgba(16, 47, 38, 0.25);
  --shadow-lg: 0 28px 70px -32px rgba(13, 53, 42, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.sidebar-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

img {
  display: block;
}

::selection {
  background: var(--lime);
  color: var(--accent-strong);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--font-mono) !important;
  font-size: 0.92em;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

.align-right {
  text-align: right !important;
}

.text-danger {
  color: var(--danger);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  transform: translateY(-180%);
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

.icon {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: -0.18em;
}

/* ==========================================================================
   Shared atoms
   ========================================================================== */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.17em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-light {
  color: var(--lime);
}

.pulse-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(15, 94, 76, 0.1);
}

.auth-brand-panel .pulse-dot {
  box-shadow: 0 0 0 4px rgba(217, 249, 157, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--lime);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-text strong {
  overflow: hidden;
  max-width: 160px;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-text small {
  color: var(--muted-light);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.3;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-neutral {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.badge-accent {
  border-color: #cfe3d9;
  background: var(--accent-soft);
  color: var(--accent);
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #cfdfd7;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

.avatar-md {
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.avatar-xs {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.avatar-lg {
  width: 58px;
  height: 58px;
  font-size: 22px;
}

.protocol-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3f6f2;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.protocol-ss {
  border-color: #cfe2da;
  background: #eef7f2;
  color: #27705a;
}

.protocol-vmess {
  border-color: #d3e1ef;
  background: #f0f6fb;
  color: #356b93;
}

.protocol-vless {
  border-color: #ddd8ee;
  background: #f5f2fb;
  color: #6653a0;
}

.protocol-trojan {
  border-color: #f0dfc2;
  background: #fcf6e9;
  color: #93621b;
}

.protocol-hysteria2 {
  border-color: #f0d3d2;
  background: #fcf1f0;
  color: #9c3c38;
}

.protocol-tuic {
  border-color: #cfe5e3;
  background: #eef9f7;
  color: #27736c;
}

.protocol-socks5,
.protocol-http {
  border-color: var(--line);
  background: #f5f6f3;
  color: #5e6d64;
}

/* Buttons */

.btn {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 630;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    transform 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 5px 14px -8px rgba(15, 94, 76, 0.65);
  color: #fff;
}

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

.btn-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink-soft);
}

.btn-secondary:hover {
  border-color: #bec9bf;
  background: #fbfcf9;
  color: var(--ink);
}

.btn-ghost {
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.btn-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  border-color: #8f1b13;
  background: #8f1b13;
  color: #fff;
}

.btn-danger-outline {
  border-color: var(--danger-line);
  background: var(--surface);
  color: var(--danger);
}

.btn-danger-outline:hover {
  border-color: #e7b7b1;
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-light {
  border-color: #fff;
  background: #fff;
  color: var(--accent-strong);
}

.btn-light:hover {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--accent-strong);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
}

.btn-outline-light:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-sm {
  height: 33px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12.5px;
}

.btn-lg {
  height: 46px;
  padding: 0 21px;
  border-radius: 11px;
  font-size: 14.5px;
}

.btn-block {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

.icon-button.danger-icon:hover {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.text-button:hover {
  text-decoration: underline;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.link-arrow:hover {
  color: var(--accent);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.form-field.has-error .input {
  border-color: #df9b93;
  background: #fffbfa;
}

.form-label {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.4;
}

.required {
  margin-left: 2px;
  color: var(--danger);
}

.input-shell {
  position: relative;
  min-width: 0;
}

.input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(22, 35, 30, 0.02);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input::placeholder {
  color: #a3aca6;
}

.input:hover {
  border-color: #c6cec6;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 94, 76, 0.1);
}

.input:disabled {
  background: #f4f5f2;
  color: var(--muted);
  cursor: not-allowed;
}

textarea.input {
  min-height: 102px;
  resize: vertical;
  line-height: 1.65;
}

select.input {
  padding-right: 36px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d7c74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.input[type="date"] {
  min-height: 42px;
}

.input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.input-shell:has(.input-action) .input {
  padding-right: 42px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-light);
  cursor: pointer;
}

.input-action:hover {
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.form-hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.form-error {
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.5;
}

.form-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.form-note .icon {
  margin-top: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 18px;
}

.form-grid:last-child {
  margin-bottom: 0;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-stack .form-field {
  margin: 0;
}

.form-submit-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.checkbox-field {
  gap: 0;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.checkbox-input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check-label {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.check-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.switch-field {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.form-grid .switch-field {
  border-bottom: 0;
  padding: 0;
}

.switch-field:last-child {
  border-bottom: 0;
}

.switch-copy {
  min-width: 0;
}

.switch-label {
  display: block;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  cursor: pointer;
}

.switch-input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.switch-track {
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: #d7ddd5;
  transition: background 0.18s ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 35, 30, 0.2);
  content: "";
  transition: transform 0.18s ease;
}

.switch-input:checked + .switch-track {
  background: var(--accent);
}

.switch-input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch-input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.conditional,
.protocol-wrap {
  min-width: 0;
}

.protocol-wrap[hidden],
.conditional[hidden] {
  display: none !important;
}

.copy-field {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 8px;
}

.copy-field .input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}

.copy-button {
  flex: 0 0 auto;
}

.secret-box {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.secret-box .input {
  font-size: 13px;
}

/* ==========================================================================
   Flash + toasts + modal
   ========================================================================== */

.flash-stack {
  position: fixed;
  z-index: 1200;
  top: 18px;
  right: 18px;
  display: flex;
  width: min(370px, calc(100vw - 36px));
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 44px -18px rgba(16, 47, 38, 0.35);
  pointer-events: auto;
  animation: flash-in 0.24s ease both;
}

.flash p {
  flex: 1;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
  word-break: break-word;
}

.flash-symbol {
  display: flex;
  margin-top: 1px;
  color: var(--muted);
}

.flash-success {
  border-left-color: var(--success);
}

.flash-success .flash-symbol {
  color: var(--success);
}

.flash-danger {
  border-left-color: var(--danger);
}

.flash-danger .flash-symbol {
  color: var(--danger);
}

.flash-info {
  border-left-color: var(--info);
}

.flash-info .flash-symbol {
  color: var(--info);
}

.flash-close {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-light);
  cursor: pointer;
}

.flash-close:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.modal {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 28, 22, 0.5);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 500px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  outline: none;
  animation: modal-in 0.2s ease both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.modal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--warning);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-card h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.modal-hint {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* ==========================================================================
   Notice
   ========================================================================== */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.notice-icon {
  display: flex;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--muted);
}

.notice > div {
  min-width: 0;
}

.notice strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
}

.notice p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-line;
  word-break: break-word;
}

.notice-info {
  border-color: var(--info-line);
  background: var(--info-bg);
}

.notice-info .notice-icon {
  color: var(--info);
}

.notice-success {
  border-color: var(--success-line);
  background: var(--success-bg);
}

.notice-success .notice-icon {
  color: var(--success);
}

.notice-warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.notice-warning .notice-icon {
  color: var(--warning);
}

.notice-danger {
  border-color: var(--danger-line);
  background: var(--danger-bg);
}

.notice-danger .notice-icon {
  color: var(--danger);
}

.notice-inline {
  padding: 10px 12px;
  margin: 0;
  border-radius: 9px;
}

.notice-inline p {
  font-size: 11.5px;
}

.api-card > .notice-inline {
  margin: 4px 0 18px;
}

.notice-announcement {
  background: #fbfcf8;
}

.traffic-sync-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.65;
}

.traffic-sync-note .icon {
  flex: 0 0 auto;
  margin-top: 1px;
}

.traffic-sync-note.is-warning {
  color: var(--warning);
}

.quota-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 17px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.quota-summary > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.quota-summary span {
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
}

.quota-summary strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   App shell + navigation
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  width: 244px;
  height: 100vh;
  flex: 0 0 244px;
  flex-direction: column;
  padding: 21px 15px 15px;
  border-right: 1px solid var(--line);
  background: #fbfcf9;
}

.sidebar-brand {
  display: block;
  padding: 0 7px;
}

.side-nav {
  display: flex;
  overflow-y: auto;
  flex-direction: column;
  gap: 22px;
  margin-top: 29px;
  padding: 0 1px;
  scrollbar-width: thin;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-label {
  margin: 0 0 6px;
  padding: 0 11px;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  height: 39px;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 520;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-link .icon {
  color: #89968f;
}

.nav-link:hover {
  background: #f1f4ef;
  color: var(--ink);
}

.nav-link.is-active {
  border-color: #d8e7df;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 620;
}

.nav-link.is-active .icon {
  color: var(--accent);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border-radius: 10px;
  color: var(--ink);
}

.sidebar-user:hover {
  background: #f1f4ef;
}

.sidebar-user-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.sidebar-user-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.sidebar-user > .icon {
  color: var(--muted-light);
}

.sidebar-logout {
  display: flex;
  width: 100%;
  height: 33px;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  text-align: left;
}

.sidebar-logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.app-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.page {
  width: 100%;
  max-width: 1260px;
  flex: 1;
  margin: 0 auto;
  padding: 37px 38px 26px;
}

.mobile-topbar {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  z-index: 25;
  inset: 0;
  background: rgba(11, 30, 23, 0.45);
  backdrop-filter: blur(2px);
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.6;
}

/* ==========================================================================
   Page header + cards + layouts
   ========================================================================== */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-head h1 {
  margin-top: 5px;
  font-size: clamp(25px, 2.6vw, 31px);
  font-weight: 720;
  letter-spacing: -0.042em;
  line-height: 1.2;
}

.page-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 17px;
}

.title-with-avatar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
}

.title-with-avatar h1 {
  margin: 0;
}

.title-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  font-size: 12px;
}

.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head.compact {
  margin-bottom: 12px;
}

.card-head h2 {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.card-eyebrow {
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.card-description {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.head-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.card > .form-field {
  margin-bottom: 17px;
}

.card > .form-field:last-child {
  margin-bottom: 0;
}

.card > .switch-field {
  margin-bottom: 10px;
}

.card > .switch-field + .form-field,
.card > .form-grid + .form-field {
  margin-top: 16px;
}

.section-divider {
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

.action-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.action-line-bordered {
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  align-items: start;
  gap: 19px;
}

.form-main,
.form-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 17px;
}

.form-side .card,
.form-main .card {
  margin: 0;
}

.side-card {
  padding: 19px;
}

.submit-card .btn + .btn {
  margin-top: 8px;
}

.side-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  align-items: start;
  gap: 19px;
}

.settings-main,
.settings-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 17px;
}

.form-grid-switches {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* ==========================================================================
   Stats
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 10px;
}

.stat-icon.mint {
  background: var(--accent-soft);
  color: var(--accent);
}

.stat-icon.blue {
  background: #eaf2f9;
  color: #2f6896;
}

.stat-icon.amber {
  background: #fbf1dd;
  color: #98601d;
}

.stat-icon.violet {
  background: #f1edfa;
  color: #6d58a3;
}

.stat-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.stat-value {
  margin: 2px 0 1px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stat-value small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.stat-meta {
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.45;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-bottom: 19px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.status-strip a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.status-strip a:hover {
  color: var(--ink);
}

.status-strip strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.success {
  background: var(--success);
}

.status-dot.neutral {
  background: #9ba8a1;
}

.status-dot.warning {
  background: #d39435;
}

.status-dot.danger {
  background: var(--danger);
}

.status-strip-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--muted-light);
  font-size: 10.5px;
}

/* ==========================================================================
   Dashboard widgets
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.78fr);
  align-items: start;
  gap: 17px;
}

.dashboard-grid .nodes-card {
  grid-column: 1 / -1;
}

.usage-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.usage-number {
  color: var(--ink);
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.3;
}

.usage-number span {
  color: var(--muted-light);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.usage-percent {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
}

.usage-caption {
  margin: 5px 0 13px;
  color: var(--muted);
  font-size: 11.5px;
}

.progress {
  overflow: hidden;
  height: 8px;
  border-radius: 99px;
  background: #edf0ea;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.progress.is-warning > span {
  background: #c58427;
}

.progress.is-danger > span {
  background: var(--danger);
}

.progress-indeterminate {
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent-soft) 0,
    var(--accent-soft) 12px,
    #f6f9f6 12px,
    #f6f9f6 24px
  );
}

.progress-indeterminate > span {
  width: 100%;
  background: transparent;
}

.usage-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.quota-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.quota-meta > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.quota-meta strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-label {
  display: block;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
}

.meta-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-light);
  font-size: 10px;
}

.card-description + .copy-field {
  margin-bottom: 9px;
}

.inline-hint {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 9px;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.6;
}

.inline-hint .icon {
  margin-top: 1px;
}

.subscription-quick .card-head > .icon {
  color: var(--muted-light);
}

.subscription-quick .card-actions {
  margin-top: 13px;
}

.node-list {
  display: flex;
  flex-direction: column;
  list-style: none;
}

.node-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}

.node-item:first-child {
  padding-top: 2px;
}

.node-item:last-child {
  padding-bottom: 2px;
  border-bottom: 0;
}

.node-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(24, 121, 78, 0.09);
}

.node-status-dot.is-off {
  background: #a6b1aa;
  box-shadow: 0 0 0 3px rgba(120, 135, 126, 0.08);
}

.node-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.node-main strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 570;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-main span {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.node-tile {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.node-tile-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.node-tile strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 620;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-tile > span {
  color: var(--muted-light);
  font-size: 10.5px;
}

/* Subscription page */

.subscription-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.7fr);
  align-items: start;
  gap: 17px;
  margin-bottom: 17px;
}

.subscription-main {
  padding: 24px;
}

.subscription-side {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.subscription-url-box {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.url-label-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.detail-grid > div {
  min-width: 0;
}

.detail-grid dt {
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  line-height: 1.5;
  text-transform: uppercase;
}

.detail-grid dd {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 580;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.qr-card {
  text-align: center;
}

.qr-card .card-head {
  text-align: left;
}

.qr-frame {
  display: grid;
  place-items: center;
  padding: 10px;
  margin: 6px auto 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.qr-frame img {
  width: min(100%, 220px);
  height: auto;
  border-radius: 4px;
}

.qr-hint {
  color: var(--muted-light);
  font-size: 10.5px;
}

.qr-unavailable {
  display: flex;
  min-height: 170px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted-light);
  font-size: 11px;
}

.mini-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.mini-steps li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.mini-steps span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.mini-steps p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.danger-row strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 620;
}

.danger-row p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.danger-row form {
  flex: 0 0 auto;
}

/* Account */

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: start;
  gap: 17px;
}

.account-subscription-card {
  grid-column: 1 / -1;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.profile-head > div {
  min-width: 0;
  flex: 1;
}

.profile-head h2 {
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-head p {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-list {
  display: flex;
  flex-direction: column;
}

.meta-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.meta-list > div:last-child {
  border-bottom: 0;
}

.meta-list dt {
  flex: 0 0 auto;
  color: var(--muted-light);
  font-size: 11.5px;
  line-height: 1.6;
}

.meta-list dd {
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: right;
  text-overflow: ellipsis;
}

.two-col-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}

.compact-meta > div {
  padding: 7px 0;
}

.action-line + .notice {
  margin-top: 17px;
}

/* ==========================================================================
   Admin widgets
   ========================================================================== */

.admin-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: stretch;
  gap: 17px;
  margin-bottom: 17px;
}

.admin-overview-split {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
}

.chart-card {
  display: flex;
  flex-direction: column;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 184px;
  margin: 4px 0 8px;
  padding-top: 12px;
}

.bar-column {
  display: flex;
  height: 166px;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.bar-count {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
}

.bar-track {
  display: flex;
  width: min(100%, 34px);
  height: 130px;
  align-items: flex-end;
  border-radius: 6px 6px 3px 3px;
  background: #f4f6f2;
}

.bar-fill {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 3px 3px;
  background: #cfe2d7;
  transition: height 0.35s ease;
}

.bar-column:last-child .bar-fill {
  background: var(--accent);
}

.bar-label {
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.3;
  white-space: nowrap;
}

.chart-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 9px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 10.5px;
}

.chart-foot span,
.chart-foot a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.registration-card {
  display: flex;
  flex-direction: column;
}

.registration-card form {
  margin-bottom: 13px;
}

.quick-links {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.quick-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 1px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11.5px;
}

.quick-links a:last-child {
  border-bottom: 0;
}

.quick-links a .icon:last-child {
  margin-left: auto;
  color: var(--muted-light);
}

.quick-links a:hover {
  color: var(--accent);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
}

.activity-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.activity-list li:first-child {
  padding-top: 2px;
}

.activity-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: #b4c4bb;
}

.activity-list strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 620;
  line-height: 1.5;
}

.activity-list p {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.activity-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.5;
}

/* Filters */

.filter-card {
  margin-bottom: 17px;
  padding: 13px 15px;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-field > .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--muted-light);
  pointer-events: none;
}

.search-field .input {
  padding-left: 38px;
}

.compact-select {
  width: auto;
  min-width: 128px;
  max-width: 168px;
}

/* Tables */

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-head {
  padding: 21px 22px 16px;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f9faf7;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfcf9;
}

.compact-table th {
  padding: 9px 10px;
}

.compact-table td {
  padding: 10px;
}

.user-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.user-cell:hover strong {
  color: var(--accent);
}

.user-cell > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.user-cell strong {
  overflow: hidden;
  max-width: 180px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-cell small {
  overflow: hidden;
  max-width: 180px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-table .user-cell strong {
  font-size: 11.5px;
}

.usage-inline {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.usage-inline strong {
  font-size: 11.5px;
  font-weight: 600;
}

.usage-inline span {
  color: var(--muted-light);
  font-size: 10px;
}

.usage-cell {
  min-width: 128px;
}

.mini-progress {
  overflow: hidden;
  width: 100%;
  max-width: 120px;
  height: 4px;
  margin-top: 5px;
  border-radius: 99px;
  background: #edf0eb;
}

.mini-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.mini-progress.is-warning > span {
  background: #c58427;
}

.mini-progress.is-danger > span {
  background: var(--danger);
}

.mini-role {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border: 1px solid #d9e8e0;
  border-radius: 4px;
  background: #f0f8f4;
  color: var(--accent);
  font-size: 7.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  vertical-align: 1px;
}

.cell-note {
  display: block;
  color: var(--warning);
  font-size: 9px;
  line-height: 1.4;
}

.server-name-cell {
  display: flex;
  min-width: 140px;
  flex-direction: column;
}

.server-name-cell strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.server-name-cell span {
  overflow: hidden;
  max-width: 220px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.row-actions form {
  display: inline-flex;
  margin: 0;
}

.self-mark {
  display: inline-grid;
  min-width: 27px;
  height: 24px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted-light);
  font-size: 9px;
}

.small-strong {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.log-action {
  display: inline-flex;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8faf7;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}

.log-detail {
  max-width: 320px;
  color: var(--muted) !important;
  line-height: 1.65;
  word-break: break-word;
}

/* Pagination */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.page-link {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}

.page-link:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.page-link.is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.page-link.is-disabled {
  color: var(--line-strong);
  cursor: default;
}

.page-link.is-disabled:hover {
  border-color: transparent;
  background: transparent;
}

.page-ellipsis {
  padding: 0 2px;
  color: var(--muted-light);
  font-size: 11px;
}

/* Empty states */

.empty-state {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted-light);
}

.empty-state h3 {
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 650;
}

.empty-state p {
  max-width: 360px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.empty-state-sm {
  min-height: 150px;
  padding: 20px;
}

.empty-state-sm .empty-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 8px;
}

.empty-state-sm p {
  margin-bottom: 0;
}

.empty-state-xs {
  min-height: 110px;
  padding: 15px 5px;
}

.empty-state-xs .empty-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 6px;
}

.empty-state-xs p {
  margin-bottom: 5px;
}

/* ==========================================================================
   Admin details
   ========================================================================== */

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 17px;
}

.detail-main,
.detail-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 17px;
}

.note-box {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.note-box p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-line;
}

.assigned-nodes {
  display: flex;
  flex-direction: column;
}

.assigned-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.assigned-node:first-child {
  padding-top: 0;
}

.assigned-node:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.assigned-node-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.assigned-node-main > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.assigned-node-main strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assigned-node-main span {
  overflow: hidden;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.password-display > span {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.password-display .icon-button {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-color: transparent;
  background: transparent;
}

.danger-card {
  border-color: var(--danger-line);
}

.danger-card .card-eyebrow {
  color: #b56b63;
}

.danger-card .card-head > .icon {
  color: #c07b74;
}

/* Sidebar node checkboxes */

.node-check-list {
  display: flex;
  max-height: 330px;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  margin: 7px -4px 0;
  padding: 0 4px;
  scrollbar-width: thin;
}

.node-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 7px;
  border-radius: 8px;
  cursor: pointer;
}

.node-check:hover {
  background: var(--surface-soft);
}

.node-check input {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.node-check-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.node-check-title {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-check-meta {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-check .badge {
  min-height: 18px;
  padding: 1px 5px;
  font-size: 8px;
}

.check-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--line-strong);
  font-size: 10px;
}

.side-hint {
  margin-bottom: 4px;
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: none;
}

.help-list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.help-list .icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--success);
}

.help-list li.warning-item {
  color: var(--warning);
}

.help-list li.warning-item .icon {
  color: var(--warning);
}

.compact-help {
  margin-top: 10px;
}

/* Share-link import */

.import-table .import-select-col {
  width: 54px;
  text-align: center;
}

.import-table td:first-child {
  text-align: center;
}

.import-checkbox {
  margin: 0;
  vertical-align: middle;
}

.import-row-skipped {
  opacity: 0.62;
}

.import-node-cell {
  display: flex;
  min-width: 170px;
  flex-direction: column;
  gap: 2px;
}

.import-node-cell strong {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 620;
  line-height: 1.45;
}

.import-warnings {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  color: var(--warning);
  font-size: 9.5px;
  line-height: 1.45;
}

.import-warning-list {
  margin: 5px 0 0 16px;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.import-warning-list li + li {
  margin-top: 2px;
}

.import-footnote {
  margin-top: 10px;
  padding: 0 2px;
}

.compact-notice {
  margin-top: 15px;
}

.install-command-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.install-command-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.update-agent-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.update-agent-block h3 {
  margin: 5px 0 7px;
  font-size: 15px;
}

.update-agent-block .form-hint {
  margin-bottom: 10px;
}

.mini-code {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Settings API */

.api-card {
  margin-top: 19px;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-top: 2px;
}

.api-key-label {
  margin-top: 15px;
}

.api-grid .copy-field {
  margin-top: 6px;
}

.api-grid form {
  margin-top: 11px;
}

.code-block {
  overflow-x: auto;
  margin: 6px 0 0;
  padding: 13px 14px;
  border: 1px solid #d8e2dc;
  border-radius: 10px;
  background: #f5f8f5;
  color: #2e4b3e;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.75;
  white-space: pre;
}

.code-block code {
  font-family: inherit;
}

.compact-help code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

/* ==========================================================================
   Flash and page composition animation
   ========================================================================== */

@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Authentication
   ========================================================================== */

.auth-body {
  background: #f5f6f2;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(390px, 0.88fr) minmax(480px, 1.12fr);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  padding: 37px clamp(32px, 4.8vw, 70px) 31px;
  background: #0d352b;
  color: #f1f6f1;
}

.auth-brand-panel::before {
  position: absolute;
  top: -150px;
  right: -170px;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(217, 249, 157, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(217, 249, 157, 0.035),
    0 0 0 150px rgba(217, 249, 157, 0.02);
  content: "";
  pointer-events: none;
}

.auth-brand-panel::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 60%;
  height: 55%;
  background-image: radial-gradient(rgba(217, 249, 157, 0.18) 0.8px, transparent 0.8px);
  background-size: 17px 17px;
  content: "";
  mask-image: linear-gradient(to top left, #000, transparent 72%);
  opacity: 0.4;
  pointer-events: none;
}

.auth-brand-link {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  color: #f1f6f1;
}

.auth-brand-panel .brand-text strong {
  color: #f5f9f4;
}

.auth-brand-panel .brand-text small {
  color: rgba(233, 246, 237, 0.45);
}

.auth-brand-panel .brand-mark {
  background: var(--lime);
  color: var(--accent-strong);
}

.auth-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 465px;
  margin: auto 0;
  padding: 48px 0;
}

.auth-brand-copy h1 {
  margin-top: 19px;
  color: #f6faf4;
  font-size: clamp(35px, 4.05vw, 53px);
  font-weight: 660;
  letter-spacing: -0.052em;
  line-height: 1.12;
}

.auth-brand-lead {
  max-width: 390px;
  margin-top: 20px;
  color: rgba(229, 241, 232, 0.66);
  font-size: 13px;
  line-height: 1.8;
}

.auth-feature-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 35px;
  list-style: none;
}

.auth-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(233, 244, 235, 0.75);
  font-size: 11.5px;
}

.auth-feature-list .icon {
  color: var(--lime);
  opacity: 0.8;
}

.auth-brand-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 19px;
  border-top: 1px solid rgba(217, 249, 157, 0.12);
  color: rgba(229, 241, 232, 0.35);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 38px clamp(24px, 5vw, 76px);
  background: #f5f6f2;
}

.auth-panel-top {
  position: absolute;
  top: 27px;
  right: clamp(24px, 5vw, 76px);
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.auth-card {
  width: min(100%, 438px);
  padding: 31px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: 0 26px 60px -42px rgba(17, 46, 36, 0.35);
}

.auth-card-head {
  margin-bottom: 23px;
}

.auth-card-head h2 {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.auth-card-head > p:last-child {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.auth-form .form-field {
  margin-bottom: 15px;
}

.auth-form .form-grid {
  gap: 14px;
  margin-bottom: 15px;
}

.auth-form .form-grid .form-field {
  margin-bottom: 0;
}

.auth-form .checkbox-field {
  margin-bottom: 0;
}

.auth-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 19px;
}

.auth-support {
  display: inline-flex;
  max-width: 210px;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-switch {
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
}

.auth-switch a {
  margin-left: 3px;
  color: var(--accent);
  font-weight: 650;
}

.auth-legal {
  margin-top: 21px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.6;
  text-align: center;
}

.setup-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.setup-steps span {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

.setup-steps i {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: normal;
}

.setup-steps span.is-active {
  color: var(--accent);
  font-weight: 600;
}

.setup-steps span.is-active i {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ==========================================================================
   Landing
   ========================================================================== */

.landing-body {
  background: #f5f6f1;
}

.landing-container {
  width: 100%;
  max-width: 1190px;
  margin: 0 auto;
  padding: 0 30px;
}

.landing-header {
  position: relative;
  z-index: 2;
  padding: 22px 0;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.landing-links {
  display: flex;
  align-items: center;
  gap: 27px;
  margin-left: auto;
}

.landing-links a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.landing-links a:hover {
  color: var(--ink);
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.landing-login {
  padding: 0 12px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 67px 0 96px;
}

.hero::before {
  position: absolute;
  z-index: 0;
  top: -220px;
  right: -100px;
  width: 720px;
  height: 720px;
  border: 1px solid rgba(15, 94, 76, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 100px rgba(15, 94, 76, 0.018),
    0 0 0 220px rgba(15, 94, 76, 0.012);
  content: "";
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: 58px;
}

.hero-copy {
  max-width: 590px;
}

.hero-copy h1 {
  margin-top: 17px;
  color: var(--ink);
  font-size: clamp(43px, 5.1vw, 64px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1.1;
}

.hero-copy h1 span {
  color: var(--accent);
}

.hero-lead {
  max-width: 480px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 27px;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  color: var(--muted-light);
  font-size: 10px;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 23px;
  margin-top: 36px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
}

.hero-proof span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-proof .icon {
  color: var(--accent);
}

.hero-visual {
  position: relative;
  padding: 24px 20px 26px;
}

.visual-glow {
  position: absolute;
  z-index: -1;
  top: 4%;
  right: -6%;
  width: 84%;
  height: 82%;
  border-radius: 50%;
  background: rgba(15, 94, 76, 0.13);
  filter: blur(70px);
}

.mock-window {
  position: relative;
  overflow: hidden;
  border: 1px solid #dfe6de;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.15deg);
}

.mock-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid #ebeee9;
  background: #fafbf8;
}

.mock-dots {
  display: flex;
  gap: 4px;
}

.mock-dots i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d7ded7;
}

.mock-url {
  color: #a2ada5;
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.mock-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: #63917e;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.mock-live i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #55a481;
}

.mock-body {
  padding: 20px;
}

.mock-greeting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.mock-greeting > div {
  display: flex;
  flex-direction: column;
}

.mock-greeting small {
  color: #9aa59d;
  font-size: 8px;
}

.mock-greeting strong {
  margin-top: 2px;
  color: #1e3128;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.mock-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #eaf4ed;
  color: #3b705b;
  font-size: 9px;
  font-weight: 700;
}

.mock-traffic {
  padding: 13px;
  border: 1px solid #e8ece6;
  border-radius: 11px;
  background: #f8faf6;
}

.mock-traffic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mock-traffic-head > span {
  color: #849188;
  font-size: 8px;
}

.mock-traffic-head strong {
  color: #1c3529;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.mock-traffic-head small {
  color: #849188;
  font-size: 8px;
  font-weight: 400;
}

.mock-progress {
  overflow: hidden;
  height: 5px;
  margin-top: 12px;
  border-radius: 99px;
  background: #e8eee6;
}

.mock-progress span {
  display: block;
  width: 43%;
  height: 100%;
  border-radius: inherit;
  background: #2f745d;
}

.mock-traffic-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: #9aa59d;
  font-size: 7px;
}

.mock-sub {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #e8ece6;
  border-radius: 10px;
}

.mock-sub-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 7px;
  background: #edf5ef;
  color: #39725d;
}

.mock-sub > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.mock-sub small {
  color: #9aa59d;
  font-size: 7px;
}

.mock-sub code {
  overflow: hidden;
  color: #496556;
  font-family: var(--font-mono);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mock-copy {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 1px solid #e5ebe4;
  border-radius: 6px;
  color: #859a8d;
}

.mock-nodes {
  margin-top: 14px;
}

.mock-node-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  color: #9aa59d;
  font-size: 8px;
}

.mock-node {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6.5px 1px;
  border-bottom: 1px solid #f0f2ee;
  color: #4b5c51;
  font-size: 8px;
}

.mock-node:last-child {
  border-bottom: 0;
}

.flag-dot {
  display: block;
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
}

.flag-hk {
  background: #d06d63;
}

.flag-jp {
  background: #9c7cbd;
}

.flag-sg {
  background: #d4a04e;
}

.mock-latency {
  margin-left: auto;
  color: #78a18d;
  font-family: var(--font-mono);
  font-size: 7px;
}

.float-card {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 9px 9px;
  border: 1px solid rgba(223, 231, 222, 0.9);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 30px -23px rgba(21, 54, 40, 0.5);
  backdrop-filter: blur(8px);
}

.float-one {
  bottom: -2px;
  left: -21px;
}

.float-two {
  top: 7px;
  right: -9px;
}

.float-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 8px;
  background: #eef6ef;
  color: #3b725d;
}

.float-card > div {
  display: flex;
  flex-direction: column;
}

.float-card strong {
  color: #2a4235;
  font-size: 8.5px;
  font-weight: 650;
}

.float-card small {
  color: #96a399;
  font-size: 7px;
}

.features {
  padding: 84px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}

.section-intro {
  max-width: 560px;
  margin: 0 auto 37px;
  text-align: center;
}

.section-intro .eyebrow {
  justify-content: center;
}

.section-intro h2 {
  margin-top: 12px;
  font-size: clamp(27px, 3vw, 37px);
  letter-spacing: -0.045em;
}

.section-intro > p:last-child {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.feature-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.feature-card:hover {
  border-color: #cbd9d0;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid #dce9e0;
  border-radius: 11px;
  background: var(--accent-wash);
  color: var(--accent);
}

.feature-card h3 {
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 650;
}

.feature-card p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.how {
  padding: 87px 0;
}

.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 70px;
}

.section-intro-left {
  margin: 0;
  text-align: left;
}

.section-intro-left .eyebrow {
  justify-content: flex-start;
}

.section-intro-left h2 {
  margin-top: 12px;
}

.section-intro-left > p:last-of-type {
  margin-top: 15px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.section-intro-left .btn {
  margin-top: 22px;
}

.step-list {
  display: flex;
  flex-direction: column;
  list-style: none;
}

.step-list li {
  display: flex;
  gap: 20px;
  padding: 23px 0;
  border-top: 1px solid var(--line);
}

.step-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.step-list li:last-child {
  padding-bottom: 0;
}

.step-number {
  flex: 0 0 28px;
  padding-top: 2px;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.step-list h3 {
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 650;
}

.step-list p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.landing-cta {
  padding: 0 0 76px;
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 39px 42px;
  border-radius: 22px;
  background: #0d352b;
  background-image: radial-gradient(rgba(217, 249, 157, 0.15) 0.7px, transparent 0.7px);
  background-size: 19px 19px;
  color: #fff;
}

.cta-inner h2 {
  color: #f5faf5;
  font-size: clamp(22px, 2.6vw, 31px);
  letter-spacing: -0.045em;
}

.cta-inner p {
  margin-top: 6px;
  color: rgba(231, 243, 232, 0.54);
  font-size: 11.5px;
}

.cta-inner .hero-actions {
  flex: 0 0 auto;
  margin: 0;
}

.landing-footer {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.landing-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted-light);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Error pages
   ========================================================================== */

.error-body {
  background: #f5f6f1;
}

.error-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1150px;
  margin: 0 auto;
  padding: 24px 28px;
}

.error-main {
  display: flex;
  min-height: calc(100vh - 185px);
  align-items: center;
  justify-content: center;
  padding: 30px 24px 80px;
}

.error-card {
  position: relative;
  width: min(100%, 480px);
  padding: 42px 36px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.error-code {
  display: block;
  color: #c3d1c8;
  font-family: var(--font-mono);
  font-size: 58px;
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 1;
}

.error-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin: -7px auto 15px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
}

.error-card h1 {
  font-size: 21px;
  letter-spacing: -0.035em;
}

.error-card p {
  max-width: 330px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 23px;
}

.error-footer {
  padding: 0 24px 25px;
  color: var(--muted-light);
  font-size: 9.5px;
  text-align: center;
}

/* ==========================================================================
   Responsive layout
   ========================================================================== */

@media (max-width: 1120px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-value {
    font-size: 24px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  }

  .form-layout,
  .settings-layout,
  .detail-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .account-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-subscription-card {
    grid-column: auto;
  }

  .subscription-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .node-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-shell {
    grid-template-columns: minmax(340px, 0.78fr) minmax(440px, 1.22fr);
  }

  .hero-grid {
    gap: 35px;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 5.1vw, 55px);
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 258px;
    height: 100%;
    transform: translateX(-102%);
    border-right-color: var(--line);
    box-shadow: 0 0 70px rgba(11, 30, 23, 0.16);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    height: 59px;
    align-items: center;
    gap: 9px;
    padding: 0 17px;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 252, 249, 0.93);
    backdrop-filter: blur(10px);
  }

  .mobile-topbar .icon-button {
    border-color: transparent;
    background: transparent;
  }

  .mobile-brand {
    display: flex;
    min-width: 0;
    flex: 1;
    justify-content: center;
    color: var(--ink);
  }

  .mobile-brand .brand {
    gap: 8px;
  }

  .mobile-brand .brand-mark {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 8px;
  }

  .mobile-brand .brand-text strong {
    font-size: 14px;
  }

  .mobile-brand .brand-text small {
    display: none;
  }

  .mobile-topbar > .avatar {
    text-decoration: none;
  }

  .page {
    padding: 28px 23px 25px;
  }

  .page-head {
    gap: 14px;
  }

  .page-actions {
    padding-top: 16px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-grid .nodes-card {
    grid-column: auto;
  }

  .form-layout,
  .settings-layout,
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-side,
  .settings-side,
  .detail-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .form-side .submit-card,
  .settings-side .submit-card {
    grid-column: 1 / -1;
  }

  .detail-side .danger-card {
    grid-column: auto;
  }

  .subscription-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .subscription-side {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    align-items: stretch;
  }

  .qr-card {
    height: 100%;
  }

  .guide-card {
    height: 100%;
  }

  .admin-overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-overview-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-shell {
    display: block;
    min-height: 100vh;
  }

  .auth-brand-panel {
    min-height: 74px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 16px 25px;
  }

  .auth-brand-panel::before,
  .auth-brand-panel::after,
  .auth-brand-copy,
  .auth-brand-foot {
    display: none;
  }

  .auth-panel {
    min-height: calc(100vh - 74px);
    justify-content: flex-start;
    padding: 70px 24px 30px;
  }

  .auth-panel-top {
    top: 27px;
    right: 24px;
  }

  .auth-card {
    padding: 27px;
  }

  .hero {
    padding: 48px 0 70px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 46px;
  }

  .hero-copy {
    max-width: 620px;
  }

  .hero-visual {
    width: min(100%, 490px);
    margin: 0 auto;
    padding: 10px 22px 22px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .how-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 35px;
  }

  .section-intro-left {
    max-width: 600px;
  }

  .cta-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 32px;
  }

  .cta-inner .hero-actions {
    margin-top: 7px;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 23px 16px 22px;
  }

  .mobile-topbar {
    padding: 0 11px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 19px;
  }

  .page-head h1 {
    font-size: 26px;
  }

  .page-actions {
    width: 100%;
    padding-top: 3px;
  }

  .page-actions .btn {
    flex: 1;
  }

  .title-with-avatar {
    gap: 10px;
  }

  .title-with-avatar h1 {
    font-size: 25px;
  }

  .card {
    padding: 18px;
  }

  .card-head {
    margin-bottom: 15px;
  }

  .card-head h2 {
    font-size: 15px;
  }

  .stats-grid {
    gap: 9px;
  }

  .stat-card {
    gap: 9px;
    padding: 13px;
  }

  .stat-icon {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
    border-radius: 8px;
  }

  .stat-icon .icon {
    width: 16px;
    height: 16px;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-meta {
    font-size: 9px;
  }

  .form-grid,
  .form-grid-switches {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .two-col-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .quota-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .quota-summary strong {
    white-space: normal;
  }

  .quota-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .quota-meta strong {
    font-size: 10.5px;
  }

  .detail-grid,
  .detail-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .node-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .subscription-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .qr-card,
  .guide-card {
    height: auto;
  }

  .import-actions .btn {
    flex: 1;
  }

  .danger-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .danger-row form,
  .danger-row form .btn {
    width: 100%;
  }

  .form-side,
  .settings-side,
  .detail-side {
    display: flex;
    flex-direction: column;
  }

  .form-side .card,
  .settings-side .card,
  .detail-side .card {
    width: 100%;
  }

  .filter-card {
    padding: 11px;
  }

  .filter-form {
    align-items: stretch;
  }

  .search-field {
    width: 100%;
    flex-basis: 100%;
  }

  .compact-select {
    flex: 1;
    max-width: none;
    min-width: 0;
  }

  .filter-form > .btn {
    flex: 1;
  }

  .table-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 16px 17px 12px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 11px;
  }

  .pagination {
    justify-content: center;
    padding: 12px;
  }

  .page-footer {
    flex-direction: column;
    gap: 4px;
    margin-top: 30px;
    padding: 14px 2px;
  }

  .notice {
    gap: 9px;
    padding: 12px;
  }

  .notice-icon {
    margin-top: 0;
  }

  .auth-panel {
    padding: 64px 15px 25px;
  }

  .auth-card {
    padding: 21px;
    border-radius: 17px;
  }

  .auth-card-head h2 {
    font-size: 23px;
  }

  .auth-legal {
    margin-top: 15px;
  }

  .flash-stack {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }

  .modal {
    padding: 13px;
  }

  .modal-card {
    padding: 22px;
  }

  .secret-box {
    flex-direction: column;
  }

  .api-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .api-card {
    margin-top: 16px;
  }

  .landing-container {
    padding: 0 19px;
  }

  .landing-header {
    padding: 18px 0;
  }

  .landing-links {
    display: none;
  }

  .landing-nav-actions .btn {
    height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }

  .landing-nav-actions .landing-login {
    display: none;
  }

  .landing-body .brand-text small {
    display: none;
  }

  .landing-body .brand-text strong {
    max-width: 120px;
    font-size: 14px;
  }

  .hero {
    padding: 35px 0 55px;
  }

  .hero-copy h1 {
    margin-top: 13px;
    font-size: clamp(36px, 11vw, 48px);
  }

  .hero-lead {
    margin-top: 17px;
    font-size: 12.5px;
    line-height: 1.8;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 23px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-proof {
    gap: 14px;
    margin-top: 26px;
    padding-top: 16px;
    font-size: 9.5px;
  }

  .hero-visual {
    display: none;
  }

  .features {
    padding: 51px 0;
  }

  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-card {
    padding: 19px;
  }

  .how {
    padding: 54px 0;
  }

  .section-intro {
    margin-bottom: 27px;
  }

  .section-intro h2 {
    font-size: 27px;
  }

  .section-intro-left .btn {
    width: 100%;
  }

  .step-list li {
    gap: 13px;
    padding: 18px 0;
  }

  .landing-cta {
    padding-bottom: 48px;
  }

  .cta-inner {
    padding: 27px 23px;
    border-radius: 18px;
  }

  .cta-inner .hero-actions {
    width: 100%;
  }

  .landing-footer {
    padding: 16px 0;
  }

  .landing-footer-inner {
    flex-direction: column;
    gap: 4px;
  }

  .error-header {
    padding: 19px;
  }

  .error-main {
    min-height: calc(100vh - 150px);
    padding: 15px 16px 60px;
  }

  .error-card {
    padding: 31px 22px;
  }

  .error-code {
    font-size: 48px;
  }

  .error-actions {
    flex-direction: column;
  }

  .error-actions .btn {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card {
    align-items: center;
  }

  .stat-value {
    font-size: 22px;
  }

  .auth-brand-panel {
    padding: 13px 17px;
  }

  .auth-brand-panel .brand-mark {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .auth-brand-panel .brand-text strong {
    font-size: 14px;
  }

  .setup-steps {
    gap: 2px;
    padding: 6px;
  }

  .setup-steps span {
    gap: 3px;
    font-size: 8px;
  }

  .bar-chart {
    gap: 4px;
  }

  .bar-track {
    width: 100%;
  }

  .compact-select {
    min-width: 0;
    flex-basis: 100%;
  }

  .page-actions {
    flex-direction: column;
  }

  .page-actions .btn {
    width: 100%;
  }

  .table-head .head-meta {
    display: none;
  }

  .secret-box .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
