:root {
  color-scheme: light;
  --bg: #f4fbff;
  --panel: #ffffff;
  --panel-soft: #eef8ff;
  --text: #17324d;
  --muted: #65798d;
  --line: #d8edf9;
  --accent: #1b9fe8;
  --accent-strong: #0878bd;
  --green: #12a37f;
  --yellow: #cc8500;
  --red: #d93f4a;
  --shadow: 0 18px 50px rgba(30, 128, 180, .12);
  --radius: 8px;
  --font-family: IRANSans, "IRANSansWeb", "IranSans", "Iran Sans", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  font-family: inherit;
}

html {
  direction: rtl;
  font-family: var(--font-family);
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f2fbff 0%, #f8fcff 42%, #ffffff 100%);
  color: var(--text);
  font-family: var(--font-family);
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #54c7ff);
}
.brand__sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.ops-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  position: relative;
}

.ops-pill,
.ops-switch,
.ops-test {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #dbe8ef;
  border-radius: var(--radius);
  background: #fff;
  color: #476177;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.ops-pill {
  padding: 7px 10px;
}

.ops-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #aab8c3;
  box-shadow: 0 0 0 3px rgba(170, 184, 195, .16);
}

.ops-pill.is-online {
  color: #08745b;
  border-color: #bdeee1;
  background: #eefcf8;
}

.ops-pill.is-online .ops-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 163, 127, .16);
}

.ops-pill.is-warning {
  color: #9b6400;
  border-color: #ffe1a8;
  background: #fff8ea;
}

.ops-pill.is-warning .ops-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(204, 133, 0, .16);
}

.ops-pill.is-offline {
  color: #a92833;
  border-color: #ffd3d6;
  background: #fff3f4;
}

.ops-pill.is-offline .ops-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(217, 63, 74, .14);
}

.ops-pill.is-unknown {
  color: #65798d;
  border-color: #dbe8ef;
  background: #f7fafc;
}

.ops-switch {
  min-width: 176px;
  padding: 5px 9px;
  cursor: pointer;
  justify-content: space-between;
  border-color: #c7e8df;
  background: linear-gradient(180deg, #ffffff 0%, #f2fbf8 100%);
}

.ops-switch__label {
  color: #21475f;
}

.ops-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ops-switch__track {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #cfdde6;
  border: 1px solid #b8c8d3;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  transition: background .16s ease, border-color .16s ease;
}

.ops-switch__knob {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(23, 50, 77, .25);
  transform: translateX(0);
  transition: transform .16s ease;
}

.ops-switch input:checked + .ops-switch__track {
  background: var(--green);
  border-color: var(--green);
}

.ops-switch input:checked + .ops-switch__track .ops-switch__knob {
  transform: translateX(-20px);
}

.ops-switch__state {
  min-width: 42px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.ops-switch:has(input:checked) .ops-switch__state {
  color: #08745b;
}

.ops-switch input:disabled + .ops-switch__track,
.ops-test:disabled {
  cursor: wait;
  opacity: .65;
}

.ops-test {
  padding: 7px 11px;
  cursor: pointer;
}

.ops-test:hover {
  border-color: #b7e6ff;
  background: #eef9ff;
  color: var(--accent-strong);
}

.ops-vpn-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(440px, 92vw);
  z-index: 70;
  border: 1px solid #cfe9f7;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 20px 55px rgba(23, 50, 77, .18);
  padding: 12px;
  color: var(--text);
}

.ops-vpn-panel[hidden] {
  display: none;
}

.ops-vpn-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e1f0f7;
}

.ops-vpn-panel__head strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.ops-vpn-panel__head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ops-vpn-panel__head button {
  width: 28px;
  height: 28px;
  border: 1px solid #dbe8ef;
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.ops-vpn-panel__head button:hover {
  color: var(--red);
  border-color: #ffd3d6;
  background: #fff3f4;
}

.ops-vpn-panel__state {
  margin-top: 10px;
  border: 1px solid #dbe8ef;
  border-radius: var(--radius);
  background: #f7fafc;
  padding: 9px 10px;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.7;
}

.ops-vpn-panel__state.is-loading {
  color: var(--accent-strong);
  border-color: #b7e6ff;
  background: #eef9ff;
}

.ops-vpn-panel__state.is-success {
  color: #08745b;
  border-color: #bdeee1;
  background: #eefcf8;
}

.ops-vpn-panel__state.is-error {
  color: var(--red);
  border-color: #ffd3d6;
  background: #fff3f4;
}

.ops-vpn-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ops-vpn-panel__grid div {
  min-height: 68px;
  border: 1px solid #e1f0f7;
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 9px 10px;
  display: grid;
  gap: 5px;
}

.ops-vpn-panel__grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ops-vpn-panel__grid strong {
  font-size: 15px;
  font-weight: 900;
  direction: ltr;
  text-align: right;
}

.ops-vpn-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.ops-vpn-panel__meta span {
  border: 1px solid #e1f0f7;
  border-radius: 999px;
  background: #f7fbfd;
  color: #48677e;
  direction: ltr;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
}

.ops-vpn-panel pre {
  max-height: 120px;
  overflow: auto;
  margin: 10px 0 0;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  border: 1px solid #e1f0f7;
  border-radius: var(--radius);
  background: #102030;
  color: #d7efff;
  padding: 9px;
  font-size: 11px;
}

.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav a, .btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 10px 13px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--red); }
.btn:disabled { opacity: .58; cursor: not-allowed; }
.btn--sm {
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  padding: 18px;
}

.layout--sa {
  grid-template-columns: 280px 1fr;
}

.sidebar, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  min-height: calc(100vh - 100px);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.sidebar--sa {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 52%, #eef8ff 100%);
  border-color: #cae7f8;
}

.sidebar--sa .side-title {
  padding: 10px 11px;
  border: 1px solid #d9ecf7;
  border-radius: var(--radius);
  background: #ffffff;
  color: #0f4668;
}

.sidebar--sa .side-link {
  min-height: 42px;
}

.sidebar--sa .side-link.is-active {
  background: #dff3ff;
  color: #075f94;
  box-shadow: inset 3px 0 0 #1b9fe8;
}

.side-section {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid #e6f2f8;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.side-section--sa {
  border-color: #d9ecf7;
}

.side-title {
  color: #3d5f78;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 3px 8px;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 800;
}
.side-link:hover, .side-link.is-active { background: var(--panel-soft); color: var(--accent-strong); }
.side-link--danger { color: var(--red); }
.side-link--danger:hover { background: #fff3f4; color: var(--red); }

.content { min-width: 0; }
.panel__head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7fcff);
}
.panel__title { margin: 0; font-size: 20px; }
.panel__sub { color: var(--muted); margin-top: 6px; line-height: 1.8; }
.panel__body { padding: 18px 20px; }

.is-sa-shell {
  background:
    linear-gradient(180deg, #eef9ff 0%, #f8fcff 34%, #ffffff 100%);
}

.sa-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #c8e8f8;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #123b5a 0%, #0b78a6 54%, #14a184 100%);
  color: #fff;
  box-shadow: 0 20px 55px rgba(14, 97, 134, .18);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.sa-kicker {
  color: rgba(255, 255, 255, .72);
  direction: ltr;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 7px;
}

.sa-hero__title {
  margin: 0;
  font-size: 25px;
}

.sa-hero__sub {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .82);
  line-height: 1.9;
}

.sa-hero__status {
  min-width: 160px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .12);
  padding: 13px 15px;
  display: grid;
  gap: 5px;
}

.sa-hero__status span {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 800;
}

.sa-hero__status strong {
  font-size: 18px;
}

.sa-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.sa-quick-card {
  min-height: 108px;
  border: 1px solid #d5eaf6;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 14px 36px rgba(23, 50, 77, .08);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 5px;
}

.sa-quick-card:hover {
  border-color: #95d8ff;
  background: #f5fbff;
  transform: translateY(-1px);
}

.sa-quick-card__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  direction: ltr;
  color: #fff;
  background: linear-gradient(135deg, #1b9fe8, #12a37f);
  font-weight: 900;
}

.sa-quick-card strong {
  font-size: 15px;
}

.sa-quick-card small {
  color: var(--muted);
  line-height: 1.7;
}

.panel--sa {
  border-color: #cfe8f6;
}

.stats--sa .stat {
  background: linear-gradient(180deg, #fff, #f7fcff);
}

.quota-grid--sa .quota-card {
  background: linear-gradient(180deg, #fff, #f4fbff);
}

.messages { display: grid; gap: 10px; margin-bottom: 14px; }
.message {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.message.success { border-color: #bdeee1; background: #eefcf8; color: #08745b; }
.message.error { border-color: #ffd3d6; background: #fff3f4; color: var(--red); }

.learning-panel .panel__body {
  padding-top: 16px;
}

.learning-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.learning-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8ebf5;
  border-radius: 8px;
  background: #fff;
  color: #35556c;
  padding: 0 12px;
  font-weight: 900;
  font-size: 12px;
}

.learning-chip.is-active,
.learning-chip:hover {
  background: #eaf8ff;
  border-color: #a8dcf6;
  color: var(--accent-strong);
}

.learning-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
}

.learning-kpis--compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 260px));
}

.learning-kpi {
  min-height: 96px;
  border: 1px solid #d9edf7;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcff 100%);
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.learning-kpi--primary {
  background: linear-gradient(135deg, #0f6e92 0%, #0fa27c 100%);
  border-color: transparent;
  color: #fff;
}

.learning-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.learning-kpi--primary span {
  color: rgba(255, 255, 255, .78);
}

.learning-kpi strong {
  font-size: 24px;
  direction: ltr;
  text-align: right;
}

.learning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.learning-grid--wide {
  align-items: stretch;
}

.learning-report-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.learning-report-nav__item {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8ebf5;
  border-radius: 8px;
  background: #fff;
  color: #254b64;
  padding: 0 13px;
  font-weight: 900;
  font-size: 12px;
}

.learning-report-nav__item.is-active,
.learning-report-nav__item:hover {
  background: #eaf8ff;
  border-color: #a8dcf6;
  color: var(--accent-strong);
}

.learning-report-nav__item--live {
  border-color: #bfeee2;
  background: #effcf8;
  color: #08745b;
}

.learning-filterbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.learning-card .panel__title {
  font-size: 18px;
}

.learning-list {
  display: grid;
  gap: 12px;
}

.learning-list--compact {
  margin-top: 14px;
}

.learning-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  align-items: center;
  border: 1px solid #e6f2f8;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.learning-row__text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.learning-row__text strong {
  color: #16344a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-row__text span,
.learning-row__metric {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.learning-row__metric {
  direction: ltr;
  color: #0d8f72;
}

.learning-row--online {
  border-color: #c9f1e6;
  background: linear-gradient(180deg, #fff 0%, #f5fffb 100%);
}

.learning-bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: #edf5fa;
  overflow: hidden;
}

.learning-bar span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #1b9fe8, #11a983);
}

.learning-bar--video span {
  background: linear-gradient(90deg, #6b9cff, #16b6a1);
}

.learning-empty {
  border: 1px dashed #cfe4f0;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  font-weight: 800;
}

.learning-filter select {
  min-width: 260px;
  border: 1px solid #d5e9f4;
  border-radius: 8px;
  background: #fff;
  color: #1c3d56;
  padding: 10px 12px;
  font-weight: 800;
}

.learning-report-table th,
.learning-report-table td {
  vertical-align: middle;
}

.learning-table-link {
  color: #12384f;
  font-weight: 900;
}

.learning-table-link:hover {
  color: var(--accent-strong);
}

.learning-table-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mono-cell {
  direction: ltr;
  text-align: right;
  white-space: nowrap;
}

.learning-progress-cell {
  min-width: 120px;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.learning-progress-cell::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  height: 8px;
  border-radius: 999px;
  background: #edf5fa;
}

.learning-progress-cell span {
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
  display: block;
  height: 8px;
  min-width: 4px;
  max-width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1b9fe8, #11a983);
}

.learning-progress-cell strong {
  color: #0d8f72;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.learning-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
}

.learning-status.is-live {
  background: #e9fbf5;
  color: #08745b;
  border: 1px solid #bfeee2;
}

.learning-heatmap {
  display: grid;
  grid-template-columns: repeat(12, minmax(70px, 1fr));
  gap: 9px;
}

.learning-heat {
  min-height: 74px;
  border: 1px solid #d6ebf6;
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #0fa27c var(--heat), #ffffff), color-mix(in srgb, #1b9fe8 var(--heat), #ffffff)),
    #ffffff;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  color: #17384f;
}

.learning-heat strong {
  direction: ltr;
  font-size: 13px;
}

.learning-heat span {
  direction: ltr;
  color: #46677d;
  font-size: 11px;
  font-weight: 900;
}

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

.learning-split + .table-wrap--compact {
  margin-top: 14px;
}

.learning-split div {
  border: 1px solid #d9edf7;
  border-radius: 8px;
  background: #f8fcff;
  padding: 14px;
  display: grid;
  gap: 7px;
}

.learning-split span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.learning-split strong {
  color: #12384f;
  font-size: 26px;
}

.speed-chart {
  min-height: 252px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 12px;
  align-items: end;
}

.speed-bar {
  min-height: 220px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  justify-items: center;
  align-items: end;
}

.speed-bar span {
  direction: ltr;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.speed-bar i {
  width: 100%;
  max-width: 44px;
  height: max(8px, var(--height));
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #1b9fe8 0%, #0fa27c 100%);
  box-shadow: 0 10px 25px rgba(15, 135, 146, .16);
}

.speed-bar strong {
  direction: ltr;
  color: #17384f;
  font-size: 12px;
}

.speed-chart .learning-empty {
  grid-column: 1 / -1;
  align-self: center;
}

.learning-detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.learning-detail-nav {
  position: sticky;
  top: 84px;
  padding: 14px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.learning-detail-main {
  min-width: 0;
}

.learning-detail-nav__head {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.learning-detail-nav__head strong {
  color: #12384f;
  font-size: 15px;
  font-weight: 950;
}

.learning-detail-nav__head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.learning-nav-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.learning-nav-search input {
  min-width: 0;
  padding: 9px 10px;
  font-size: 12px;
}

.learning-nav-list,
.learning-tree-nav {
  display: grid;
  gap: 8px;
}

.learning-nav-item,
.learning-tree-nav__item {
  border: 1px solid #e0eff7;
  border-radius: 8px;
  background: #fff;
  color: #17384f;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.learning-nav-item:hover,
.learning-nav-item.is-active,
.learning-tree-nav__item:hover,
.learning-tree-nav__item.is-active {
  border-color: #9bd8f4;
  background: #edf9ff;
}

.learning-nav-item strong,
.learning-tree-nav__item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 950;
}

.learning-nav-item span,
.learning-nav-item small,
.learning-tree-nav__item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.learning-nav-item small {
  direction: ltr;
  text-align: right;
}

.learning-tree-nav__item {
  margin-right: var(--indent);
  border-style: solid;
}

.learning-tree-nav__item:not(a) {
  background: #f8fcff;
}

.learning-tree-nav__item.is-disabled {
  opacity: .65;
}

.auth-shell {
  min-height: calc(100vh - 66px);
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.auth-card {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; gap: 7px; }
label { font-weight: 800; color: #284764; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-family: var(--font-family);
}
input:focus, select:focus, textarea:focus {
  border-color: #8dd5ff;
  box-shadow: 0 0 0 4px rgba(27, 159, 232, .12);
}
.field-error { color: var(--red); font-size: 12px; line-height: 1.8; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.8; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.stat {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
}
.stat__num { font-size: 26px; font-weight: 900; color: var(--accent-strong); }
.stat__label { color: var(--muted); margin-top: 4px; }

.tree-page {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 360px;
  gap: 16px;
}

.tree-workspace {
  display: grid;
  gap: 14px;
}

.tree-actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f4fbff);
  padding: 12px;
}

.tree-actionbar__title {
  font-weight: 900;
}

.tree-actionbar__sub {
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
}

.tree-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tree-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.tree {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  min-height: 420px;
  padding: 8px;
  overflow: auto;
}
.tree--full {
  min-height: 460px;
}
.tree ul { list-style: none; margin: 0; padding: 0 20px 0 0; }
.tree > ul { padding-right: 0; }
.tree--full ul { padding: 0; }
.tree-node { margin: 4px 0; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 34px;
  padding: 4px 8px;
  cursor: pointer;
}
.tree--full .tree-row {
  padding-right: calc(6px + (var(--depth, 0) * 20px));
}
.tree-row--root {
  background: #eaf7ff;
  border-color: #b4e4ff;
}
.tree-row:hover { background: #f7fcff; border-color: var(--line); }
.tree-row.is-selected { background: #e9f7ff; border-color: #a8ddfb; }
.tree-row.is-drop { outline: 2px solid #54c7ff; }
.tree-row.is-dragging { opacity: .55; }
.tree-row.is-drop-before,
.tree-row.is-drop-after {
  position: relative;
}
.tree-row.is-drop-before::before,
.tree-row.is-drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: calc(8px + (var(--depth, 0) * 20px));
  height: 3px;
  border-radius: 999px;
  background: #1b9fe8;
  box-shadow: 0 0 0 3px rgba(27, 159, 232, .13);
}
.tree-row.is-drop-before::before { top: -4px; }
.tree-row.is-drop-after::after { bottom: -4px; }
.tree-titlebox {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.tree-title { font-weight: 900; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  overflow: hidden;
}
.tree-meta[hidden] { display: none; }
.storage-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.storage-chip__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.storage-chip__actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}
.storage-action {
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  padding: 1px 5px;
}
.storage-action:disabled {
  cursor: wait;
  opacity: 0.55;
}
.storage-chip--ready {
  color: var(--green);
  border-color: #bdeee1;
  background: #eefcf8;
}
.storage-chip--failed,
.storage-chip--retrying,
.storage-chip--canceled {
  color: var(--red);
  border-color: #ffd3d6;
  background: #fff3f4;
}
.storage-chip--uploading {
  color: var(--accent-strong);
  border-color: #b7e6ff;
  background: #eef9ff;
}
.storage-chip--queued {
  color: var(--yellow);
  border-color: #ffe1a8;
  background: #fff8ea;
}
.storage-chip--paused {
  color: var(--muted);
  border-color: #d7e2ea;
  background: #f6f9fb;
}
.tree-toggle {
  width: 22px;
  height: 22px;
  border: 1px solid #c8dfeb;
  border-radius: 4px;
  background: #fff;
  color: var(--accent-strong);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 900;
  line-height: 1;
}
.tree-toggle:disabled {
  border-color: transparent;
  background: transparent;
  cursor: default;
}
.node-icon { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; background: var(--panel-soft); color: var(--accent-strong); font-weight: 900; font-size: 12px; }
.badge {
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}
.badge.ready { color: var(--green); border-color: #bdeee1; background: #eefcf8; }
.badge.pending, .badge.queued { color: var(--yellow); border-color: #ffe1a8; background: #fff8ea; }
.badge.processing { color: var(--accent-strong); border-color: #b7e6ff; background: #eef9ff; }
.badge.failed { color: var(--red); border-color: #ffd3d6; background: #fff3f4; }
.badge.root { color: var(--accent-strong); border-color: #b7e6ff; background: #eef9ff; }
.drop-root {
  border: 1px dashed #9edcff;
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  text-align: center;
}
.drop-root.is-drop { background: #eef9ff; color: var(--accent-strong); }

.toolbox { display: grid; gap: 12px; }
.tool-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}
.tool-title { font-weight: 900; margin-bottom: 10px; }
.selected-box {
  border: 1px solid #b7e6ff;
  background: #eef9ff;
  border-radius: var(--radius);
  padding: 10px;
  color: var(--accent-strong);
  font-weight: 800;
}
.toast {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 8px;
}
.toast-item {
  background: #17324d;
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 43, 68, .34);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(23, 50, 77, .18);
  padding: 16px;
}

.modal-card--wide {
  width: min(760px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--red);
  background: #fff7f8;
}

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

.modal-note {
  color: var(--muted);
  line-height: 1.9;
  margin: 0;
}

.modal-error {
  border: 1px solid #ffd3d6;
  background: #fff3f4;
  color: var(--red);
  border-radius: var(--radius);
  padding: 10px 12px;
  line-height: 1.8;
}

.upload-progress {
  display: grid;
  gap: 8px;
  border: 1px solid #ccecf8;
  background: #f2fbff;
  border-radius: var(--radius);
  padding: 10px 12px;
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #284764;
  font-size: 13px;
  font-weight: 800;
}

.upload-progress__track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9eef8;
}

.upload-progress__fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  transition: width .18s ease;
}

.panel--spaced {
  margin-top: 16px;
}

.panel__head--actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

.data-table th {
  background: #f2fbff;
  color: #284764;
  font-weight: 900;
  white-space: nowrap;
}

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

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

.table-actions {
  text-align: center !important;
  white-space: nowrap;
}

.table-actions > .btn,
.table-actions > form {
  margin-inline: 3px;
}

.table-actions > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.table-actions form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-block: 0;
  vertical-align: middle;
}

.billing-package-table {
  min-width: 980px;
}

.billing-package-table th:last-child,
.billing-package-actions-cell {
  width: 350px;
  min-width: 350px;
}

.billing-package-actions-cell {
  padding-block: 10px !important;
}

.billing-action-panel {
  width: min(100%, 320px);
  margin-left: auto;
  margin-right: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #dff1fb;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f8fcff);
}

.billing-action-panel form,
.order-action-bar form {
  margin: 0;
}

.billing-action-panel__top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.billing-action-panel .btn,
.billing-action-panel select {
  width: 100%;
}

.billing-crypto-form,
.order-crypto-form {
  display: grid !important;
  align-items: center;
  gap: 8px;
}

.billing-crypto-form {
  grid-template-columns: minmax(0, 1fr) 106px;
}

.billing-crypto-form select,
.order-crypto-form select {
  min-width: 0;
  height: 36px;
  padding: 7px 10px;
  direction: rtl;
  font-size: 12px;
}

.billing-action-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px dashed #cde8f7;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.billing-orders-table {
  min-width: 1220px;
}

.billing-orders-table th:last-child,
.billing-order-actions {
  width: 520px;
  min-width: 520px;
}

.billing-order-actions {
  text-align: right !important;
  white-space: normal;
}

.order-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  direction: rtl;
}

.order-action-bar .btn {
  min-width: 96px;
}

.order-action-bar > .btn {
  display: inline-flex;
}

.order-crypto-form {
  grid-template-columns: 172px 96px;
}

.empty-cell {
  color: var(--muted);
  text-align: center !important;
  padding: 28px 14px !important;
}

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

.hash-cell {
  max-width: 260px;
  white-space: normal;
  word-break: break-all;
}

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

.license-form {
  display: grid;
  gap: 16px;
}

.license-form__grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(180px, .8fr) minmax(140px, .5fr);
  align-items: start;
  gap: 12px;
}

.student-search__selected {
  min-height: 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.student-search {
  position: relative;
}

.student-search__results {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 6px;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 30;
  box-shadow: 0 16px 42px rgba(23, 50, 77, .12);
}

.student-search__results[hidden] {
  display: none;
}

.student-search__item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  text-align: right;
}

.student-search__item:hover {
  border-color: #b7e6ff;
  background: #eef9ff;
}

.student-search__name {
  font-weight: 900;
}

.student-search__meta,
.student-search__empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.student-search__empty {
  padding: 9px 10px;
}

.license-tree {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px;
}

.license-tree__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.license-tree__item {
  margin: 4px 0;
}

.license-tree__row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 9px calc(10px + (var(--depth, 0) * 24px)) 9px 10px;
  text-align: right;
}

.license-tree__row:hover {
  border-color: var(--line);
  background: #f7fcff;
}

.license-tree__row.is-selected {
  border-color: #8dd5ff;
  background: #e9f7ff;
}

.license-tree__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.license-tree__empty {
  color: var(--muted);
  padding: 10px;
  line-height: 1.8;
}

.license-target-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
}

.windows-tree {
  max-height: min(52vh, 430px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px;
}

.windows-tree__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.windows-tree__item {
  margin: 2px 0;
}

.windows-tree__row {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 8px 3px 6px;
  padding-right: calc(6px + (var(--depth, 0) * 18px));
}

.windows-tree__row:hover {
  border-color: var(--line);
  background: #f7fcff;
}

.windows-tree__toggle {
  width: 20px;
  height: 20px;
  border: 1px solid #c8dfeb;
  border-radius: 4px;
  background: #fff;
  color: var(--accent-strong);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 900;
  line-height: 1;
}

.windows-tree__toggle:disabled {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.windows-tree__checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.windows-tree__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.windows-tree__empty {
  color: var(--muted);
  line-height: 1.8;
  padding: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.active {
  color: var(--green);
  border-color: #bdeee1;
  background: #eefcf8;
}

.status-pill.inactive,
.status-pill.revoked {
  color: var(--red);
  border-color: #ffd3d6;
  background: #fff3f4;
}

.status-pill.blocked,
.status-pill.denied,
.status-pill.error {
  color: var(--red);
  border-color: #ffd3d6;
  background: #fff3f4;
}

.status-pill.success {
  color: var(--green);
  border-color: #bdeee1;
  background: #eefcf8;
}

.status-pill.throttled {
  color: var(--yellow);
  border-color: #ffe1a8;
  background: #fff8ea;
}

.status-pill--ready {
  color: var(--green);
  border-color: #bdeee1;
  background: #eefcf8;
}

.status-pill--failed,
.status-pill--retrying,
.status-pill--canceled {
  color: var(--red);
  border-color: #ffd3d6;
  background: #fff3f4;
}

.status-pill--uploading {
  color: var(--accent-strong);
  border-color: #b7e6ff;
  background: #eef9ff;
}

.status-pill--queued {
  color: var(--yellow);
  border-color: #ffe1a8;
  background: #fff8ea;
}

.status-pill--paused {
  color: var(--muted);
  border-color: #d7e2ea;
  background: #f6f9fb;
}

.code-pill {
  display: inline-flex;
  direction: ltr;
  border: 1px solid #b7e6ff;
  border-radius: var(--radius);
  background: #eef9ff;
  color: var(--accent-strong);
  padding: 6px 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-weight: 800;
  line-height: 1.6;
  max-width: min(560px, 62vw);
  white-space: normal;
  word-break: break-all;
}

.code-pill--short {
  max-width: 150px;
  padding-block: 4px;
}

.inline-link {
  color: var(--accent-strong);
  font-weight: 900;
}

.data-table--compact th,
.data-table--compact td {
  padding: 9px 10px;
  font-size: 13px;
}

.license-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
  padding: 11px 12px;
  display: grid;
  gap: 5px;
}

.detail-row span,
.license-code-block span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.license-code-block {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.event-filter {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(160px, .8fr) minmax(160px, .8fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.event-filter__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pagination__item,
.pagination__meta {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 11px;
  font-weight: 800;
}

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

.pagination__item.is-disabled {
  opacity: .55;
}

.pagination--compact {
  justify-content: stretch;
  gap: 6px;
}

.pagination--compact .pagination__item,
.pagination--compact .pagination__meta {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 8px;
  text-align: center;
  font-size: 11px;
}

.event-log {
  margin: 10px 0 0;
  padding-inline-start: 20px;
  max-height: 260px;
  overflow: auto;
}

.event-log li {
  margin-bottom: 8px;
}

.event-log span {
  color: var(--muted);
  font-size: 12px;
}

.event-log p {
  margin: 2px 0 0;
}

.watermark-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.watermark-editor {
  display: grid;
  gap: 14px;
}

.settings-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 14px;
}

.settings-section__title {
  margin: 0;
  font-size: 16px;
  color: #17324d;
}

.toggle-line,
.check-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
  color: #284764;
}

.toggle-line input,
.check-tile input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.watermark-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.check-tile {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
  padding: 10px;
}

.watermark-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.watermark-controls--compact {
  align-items: end;
}

.range-control {
  display: grid;
  grid-template-columns: 1fr 42px 36px;
  align-items: center;
  gap: 8px;
}

.range-control input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

.range-control output {
  direction: ltr;
  text-align: center;
  font-weight: 900;
  color: var(--accent-strong);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.watermark-preview {
  position: sticky;
  top: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f7fcff);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.watermark-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.watermark-preview__title {
  font-weight: 900;
}

.watermark-preview__meta {
  color: var(--muted);
  font-size: 12px;
}

.watermark-screen {
  --preview-wm-opacity: .34;
  --preview-wm-size: 15px;
  --preview-wm-angle: -18deg;
  --preview-static-opacity: .46;
  --preview-static-size: 13px;
  --preview-static-angle: 0deg;
  --preview-static-margin: 5%;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid #dbeafe;
  background:
    radial-gradient(circle at 35% 30%, rgba(105, 167, 255, .18), transparent 26%),
    linear-gradient(135deg, #06111f, #0b1b2f 56%, #102944);
  color: #fff;
}

.watermark-screen.is-disabled::after {
  content: "واترمارک غیرفعال";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .72);
  font-weight: 900;
  background: rgba(6, 17, 31, .42);
}

.watermark-screen__video-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
  color: rgba(255, 255, 255, .22);
}

.watermark-screen__marks span,
.watermark-screen__static span {
  position: absolute;
  font-size: var(--preview-wm-size);
  opacity: var(--preview-wm-opacity);
  transform: rotate(var(--preview-wm-angle));
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .72);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.watermark-screen__marks span {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watermark-screen__static span {
  max-width: 74%;
  font-size: var(--preview-static-size);
  opacity: var(--preview-static-opacity);
  transform: translate(-50%, -50%) rotate(var(--preview-static-angle));
  overflow: hidden;
  text-overflow: ellipsis;
}

.watermark-screen__static span[data-position="top-right"] {
  top: var(--preview-static-margin);
  right: var(--preview-static-margin);
  transform: translate(0, 0) rotate(var(--preview-static-angle));
}

.watermark-screen__static span[data-position="top-left"] {
  top: var(--preview-static-margin);
  left: var(--preview-static-margin);
  transform: translate(0, 0) rotate(var(--preview-static-angle));
}

.watermark-screen__static span[data-position="top-center"] {
  top: var(--preview-static-margin);
  right: 50%;
}

.watermark-screen__static span[data-position="center"] {
  top: 50%;
  right: 50%;
}

.watermark-screen__static span[data-position="bottom-right"] {
  right: var(--preview-static-margin);
  bottom: calc(var(--preview-static-margin) + 24px);
  transform: translate(0, 0) rotate(var(--preview-static-angle));
}

.watermark-screen__static span[data-position="bottom-left"] {
  left: var(--preview-static-margin);
  bottom: calc(var(--preview-static-margin) + 24px);
  transform: translate(0, 0) rotate(var(--preview-static-angle));
}

.watermark-screen__static span[data-position="bottom-center"] {
  right: 50%;
  bottom: calc(var(--preview-static-margin) + 24px);
}

.watermark-screen__controls {
  position: absolute;
  right: 14px;
  left: 14px;
  bottom: 12px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}

.watermark-screen__controls::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: rgba(255, 255, 255, .8);
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.quota-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f4fbff);
  padding: 14px;
  display: grid;
  gap: 5px;
}

.quota-card__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quota-card strong {
  color: var(--accent-strong);
  font-size: 20px;
}

.filter-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-form .form-row {
  min-width: min(280px, 100%);
}

.status-pill.pending,
.status-pill.queued,
.status-pill.retrying {
  color: var(--yellow);
  background: #fff8e6;
  border-color: #f5d27d;
}

.status-pill.paid,
.status-pill.succeeded {
  color: var(--green);
  background: #eefcf8;
  border-color: #bdeee1;
}

.status-pill.failed,
.status-pill.canceled,
.status-pill.expired {
  color: var(--red);
  background: #fff3f4;
  border-color: #ffd3d6;
}

@media (max-width: 980px) {
  .layout, .tree-page, .license-form__grid, .license-target-picker, .watermark-layout, .watermark-controls, .event-filter { grid-template-columns: 1fr; }
  .layout--sa { grid-template-columns: 1fr; }
  .learning-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-grid { grid-template-columns: 1fr; }
  .learning-detail-layout { grid-template-columns: 1fr; }
  .learning-detail-nav {
    position: static;
    max-height: none;
  }
  .learning-heatmap { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .learning-filterbar { grid-template-columns: 1fr; }
  .learning-progress-cell { min-width: 96px; }
  .sidebar { min-height: auto; }
  .topbar__inner { align-items: flex-start; flex-direction: column; padding: 12px 16px; }
  .brand { width: 100%; }
  .ops-bar { width: 100%; justify-content: flex-start; }
  .watermark-preview { position: static; }
  .sa-hero { align-items: stretch; flex-direction: column; }
  .sa-hero__status { min-width: 0; }
}

@media (max-width: 620px) {
  .topbar__inner { padding: 12px 14px; }
  .ops-pill,
  .ops-switch,
  .ops-test { flex: 1 1 calc(50% - 8px); }
  .nav { width: 100%; }
  .nav a, .btn { flex: 1; }
  .stats { grid-template-columns: 1fr; }
  .form-columns { grid-template-columns: 1fr; }
  .learning-kpis { grid-template-columns: 1fr; }
  .learning-heatmap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .speed-chart { grid-template-columns: repeat(3, minmax(46px, 1fr)); }
  .learning-filter select { min-width: 0; width: 100%; }
  .learning-report-nav__item { flex: 1 1 calc(50% - 8px); }
}
