:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-strong: #edf2f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-tint: #eef6f4;
  --line: #d8e0ea;
  --line-soft: #e8eef5;
  --text: #172033;
  --text-muted: #5f6f86;
  --text-soft: #8a98aa;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eaf1ff;
  --teal: #0f766e;
  --teal-soft: #e6f6f4;
  --amber: #b45309;
  --amber-soft: #fff7e6;
  --danger: #c0362c;
  --danger-hover: #9f2b24;
  --danger-soft: #fff0ee;
  --success: #18794e;
  --success-soft: #e9f8ef;
  --shadow-sm: 0 1px 2px rgba(23, 32, 51, .05);
  --shadow-md: 0 14px 32px rgba(23, 32, 51, .08);
  --radius: 8px;
  --radius-sm: 6px;
  --focus: 0 0 0 3px rgba(37, 99, 235, .16);
  --nav-width: 280px;
  --icon-panel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M9 20V10'/%3E%3C/svg%3E");
  --icon-dashboard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 13a8 8 0 1 1 16 0'/%3E%3Cpath d='M12 13l4-4'/%3E%3Cpath d='M5 19h14'/%3E%3C/svg%3E");
  --icon-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
  --icon-account: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='M15 8h3M15 12h3M7 16h4'/%3E%3C/svg%3E");
  --icon-jobs: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13'/%3E%3Cpath d='M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
  --icon-card: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M7 15h2M12 15h5'/%3E%3C/svg%3E");
  --icon-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6V21a2 2 0 1 1-4 0v-.09a1.7 1.7 0 0 0-1-.6 1.7 1.7 0 0 0-1.88.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-.6-1H3a2 2 0 1 1 0-4h1a1.7 1.7 0 0 0 .6-1 1.7 1.7 0 0 0-.34-1.88l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-.6V3a2 2 0 1 1 4 0v1a1.7 1.7 0 0 0 1 .6 1.7 1.7 0 0 0 1.88-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.4 9a1.7 1.7 0 0 0 .6 1h1a2 2 0 1 1 0 4h-1a1.7 1.7 0 0 0-.6 1Z'/%3E%3C/svg%3E");
  --icon-profile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M6 21v-2a6 6 0 0 1 12 0v2'/%3E%3C/svg%3E");
  --icon-logout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  --icon-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  --icon-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E");
  --icon-arrow-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E");
  --icon-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 0 1-15.5 6.2L3 16'/%3E%3Cpath d='M3 12A9 9 0 0 1 18.5 5.8L21 8'/%3E%3Cpath d='M3 16v5h5M21 8V3h-5'/%3E%3C/svg%3E");
  --icon-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  --icon-stop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Crect x='6' y='6' width='12' height='12' rx='2'/%3E%3C/svg%3E");
  --icon-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M4 4.5A2.5 2.5 0 0 1 6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5z'/%3E%3C/svg%3E");
  --icon-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z'/%3E%3Cpath d='M9 12l2 2 4-5'/%3E%3C/svg%3E");
  --icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--bg);
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, 0) 260px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

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

a:hover {
  color: var(--primary-hover);
}

p {
  margin: 0 0 10px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 2.2vw, 32px);
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

code {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  background: var(--surface-soft);
  color: var(--text);
  overflow-wrap: anywhere;
}

.muted,
.hint {
  color: var(--text-muted);
}

.muted {
  font-size: 13px;
}

.hint,
small {
  display: block;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.compact-error {
  max-width: 320px;
  color: var(--danger);
  overflow-wrap: anywhere;
}

body:not(.auth) {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  min-width: 0;
}

.layout {
  grid-column: 2;
  width: min(1460px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 30px clamp(20px, 3vw, 44px) 56px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 4px 0 22px;
  border-bottom: 1px solid var(--line);
}

.page-head > div {
  min-width: 0;
}

.page-head h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-head h1::before,
.card h2::before,
.modal-head h2::before,
.auth-panel h1::before,
.settings-group h3::before,
.stat span::before,
.status-item span::before {
  content: "";
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: var(--ui-icon, var(--icon-panel)) center / contain no-repeat;
  mask: var(--ui-icon, var(--icon-panel)) center / contain no-repeat;
}

.page-head h1 {
  --ui-icon: var(--icon-dashboard);
}

.page-head .muted,
.page-head p:not(.eyebrow) {
  max-width: 780px;
  margin-top: 8px;
}

.page-actions,
.actions,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.page-actions {
  justify-content: flex-end;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0 0 9px;
  border: 1px solid #cde0ff;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .03em;
}

.nav-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nav-open,
.nav-backdrop,
.nav-close {
  display: none;
}

.topbar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: var(--nav-width);
  height: 100dvh;
  min-height: 0;
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, .92);
  box-shadow: 10px 0 28px rgba(23, 32, 51, .05);
  backdrop-filter: blur(16px);
}

.nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.topbar strong {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 840;
  white-space: nowrap;
}

.topbar strong::before {
  content: "";
  display: inline-flex;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, var(--primary), var(--teal));
  -webkit-mask: none;
  mask: none;
}

.nav-scroll {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 16px 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-group {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .06em;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
}

.nav-group:not([open]) summary::after {
  transform: rotate(-45deg);
}

.topbar .nav-group a,
.topbar .nav-footer span,
.topbar .logout-form button,
.small-button,
button,
.quick-grid a {
  --ui-icon: var(--icon-panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.topbar .nav-group a::before,
.topbar .nav-footer span::before,
.topbar .logout-form button::before,
.small-button::before,
button::before,
.quick-grid a::before {
  content: "";
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: var(--ui-icon) center / contain no-repeat;
  mask: var(--ui-icon) center / contain no-repeat;
}

.topbar .nav-group a,
.topbar .nav-footer span,
.topbar .logout-form button {
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 11px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 740;
  line-height: 1.25;
  white-space: normal;
}

.topbar .nav-group a:hover,
.topbar .logout-form button:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.nav-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.topbar .nav-footer span {
  background: var(--surface-tint);
  color: var(--text);
}

.topbar .logout-form {
  margin: 0;
}

.topbar .logout-form button {
  color: var(--danger);
  cursor: pointer;
}

.topbar .logout-form button:hover {
  border-color: #f0c1bc;
  background: var(--danger-soft);
  color: var(--danger-hover);
}

.topbar a[href="/admin"],
.topbar a[href="/dashboard"],
.topbar a[href="/dashboard#daily-checkin"],
.topbar a[href="/checkin"],
.quick-grid a[href="/admin"],
.quick-grid a[href="/dashboard"],
.quick-grid a[href="/checkin"],
a.small-button[href="/dashboard#daily-checkin"],
a.small-button[href="/admin"],
a.small-button[href="/dashboard"],
a.small-button[href="/checkin"] {
  --ui-icon: var(--icon-dashboard);
}

.topbar a[href="/admin/users"],
.topbar a[href="/promotion"],
.quick-grid a[href="/admin/users"],
.quick-grid a[href="/promotion"],
a.small-button[href="/admin/users"],
a.small-button[href="/promotion"] {
  --ui-icon: var(--icon-users);
}

.topbar a[href="/admin/accounts"],
.quick-grid a[href="/admin/accounts"],
a.small-button[href="/admin/accounts"] {
  --ui-icon: var(--icon-account);
}

.topbar a[href="/admin/jobs"],
.quick-grid a[href="/admin/jobs"],
a.small-button[href="/admin/jobs"] {
  --ui-icon: var(--icon-jobs);
}

.topbar a[href="/admin/cards"],
.topbar a[href="/admin/usage"],
.topbar a[href="/recharge"],
.quick-grid a[href="/admin/cards"],
.quick-grid a[href="/admin/usage"],
.quick-grid a[href="/recharge"],
a.small-button[href="/admin/cards"],
a.small-button[href="/admin/usage"],
a.small-button[href="/recharge"] {
  --ui-icon: var(--icon-card);
}

.topbar a[href="/admin/settings"],
.quick-grid a[href="/admin/settings"],
a.small-button[href="/admin/settings"] {
  --ui-icon: var(--icon-settings);
}

.topbar a[href="/admin/profile"],
a.small-button[href="/admin/profile"],
.topbar .nav-footer span {
  --ui-icon: var(--icon-profile);
}

.topbar .logout-form button {
  --ui-icon: var(--icon-logout);
}

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

.checkin-card {
  position: relative;
  overflow: hidden;
  border-color: #c8dbff;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(234, 241, 255, .92), rgba(230, 246, 244, .72) 46%, rgba(255, 255, 255, .96)),
    var(--surface);
}

.checkin-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--teal), var(--amber));
}

.checkin-hero,
.checkin-stats,
.checkin-allocate-form,
.checkin-action-form,
.checkin-history {
  position: relative;
  z-index: 1;
}

.checkin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 18px;
}

.checkin-hero h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.checkin-total {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 150px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(255, 255, 255, .78);
}

.checkin-total span,
.checkin-stats span,
.checkin-allocation-item span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 740;
}

.checkin-total strong {
  color: var(--primary-hover);
  font-size: 34px;
  line-height: 1;
}

.checkin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 24px 18px;
}

.checkin-stats div {
  min-width: 0;
  border: 1px solid rgba(216, 224, 234, .88);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, .72);
}

.checkin-stats strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.checkin-note {
  margin: 0 24px 18px;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(230, 246, 244, .84);
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.checkin-action-form,
.checkin-allocate-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 0 24px 24px;
}

.checkin-allocate-form label {
  flex: 1 1 230px;
  min-width: 0;
}

.checkin-allocate-form label:nth-child(2) {
  flex: 0 1 170px;
}

.checkin-button {
  min-height: 46px;
  border: 0;
  padding: 0 22px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: #fff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, .2);
}

.checkin-button:hover {
  background: linear-gradient(135deg, var(--primary-hover), #0b615b);
  color: #fff;
}

.checkin-button.secondary {
  background: var(--teal);
  box-shadow: 0 12px 24px rgba(15, 118, 110, .18);
}

.checkin-button-large {
  min-height: 58px;
  padding: 0 28px;
  font-size: 17px;
}

.checkin-account-card .section-head {
  align-items: flex-start;
}

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

.checkin-account-list {
  display: grid;
  gap: 10px;
}

.checkin-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
}

.checkin-account-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.checkin-account-row strong,
.checkin-account-row em {
  overflow-wrap: anywhere;
}

.checkin-account-row em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
}

.checkin-account-row input {
  width: 100%;
}

.checkin-account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.proxy-stat-grid {
  margin-bottom: 20px;
}

.proxy-stat-grid .stat small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.checkin-history {
  margin: 0 24px 24px;
  border-top: 1px solid rgba(216, 224, 234, .9);
  padding-top: 16px;
}

.checkin-history h3 {
  margin-bottom: 10px;
}

.checkin-allocation-list {
  display: grid;
  gap: 8px;
}

.checkin-allocation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(255, 255, 255, .82);
}

.checkin-allocation-item > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.checkin-allocation-item > div:last-child {
  justify-items: end;
}

.checkin-leaderboard-card {
  position: relative;
  display: grid;
  gap: 12px;
  overflow: hidden;
  border-color: rgba(37, 99, 235, .18);
  background:
    radial-gradient(circle at 18% 8%, rgba(245, 158, 11, .18), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f7fbff 52%, #eefcf8 100%);
}

.checkin-leaderboard-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .62), transparent);
  transform: skewX(-18deg) translateX(-120%);
  animation: checkinStageShine 4.8s ease-in-out 1.2s infinite;
  pointer-events: none;
}

.checkin-podium {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  min-height: 172px;
  isolation: isolate;
}

.checkin-podium-place {
  display: grid;
  justify-items: center;
  align-items: end;
  gap: 10px;
  min-width: 0;
  flex: 1 1 0;
  max-width: 190px;
  text-align: center;
  animation: checkinPodiumRise .72s cubic-bezier(.2, .8, .2, 1) both;
  will-change: transform, opacity;
}

.checkin-podium-place.rank-1 {
  --podium-height: 72px;
  --podium-color: #f59e0b;
  --podium-color-dark: #b45309;
  order: 2;
  animation-delay: .08s;
}

.checkin-podium-place.rank-2 {
  --podium-height: 54px;
  --podium-color: #94a3b8;
  --podium-color-dark: #475569;
  order: 1;
  animation-delay: .2s;
}

.checkin-podium-place.rank-3 {
  --podium-height: 44px;
  --podium-color: #d97706;
  --podium-color-dark: #92400e;
  order: 3;
  animation-delay: .32s;
}

.checkin-podium-user {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 5px;
  width: min(100%, 176px);
  border: 1px solid rgba(216, 224, 234, .9);
  border-radius: var(--radius);
  padding: 10px 10px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 16px 32px rgba(15, 23, 42, .12);
  transform: translateZ(0);
}

.checkin-podium-place.rank-1 .checkin-podium-user {
  border-color: rgba(245, 158, 11, .38);
  background: linear-gradient(180deg, #fff8e6, #fff);
}

.checkin-podium-base {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(100%, 190px);
  min-height: var(--podium-height);
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .28), transparent 46%),
    linear-gradient(135deg, var(--podium-color), var(--podium-color-dark));
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
  box-shadow: 0 18px 34px rgba(15, 23, 42, .16);
}

.checkin-podium-base::before,
.checkin-podium-base::after {
  content: "";
  position: absolute;
  inset: auto 14px 10px;
  height: 1px;
  background: rgba(255, 255, 255, .36);
}

.checkin-podium-base::after {
  inset-block-end: 28px;
  opacity: .62;
}

.checkin-podium-base span {
  color: rgba(255, 255, 255, .92);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.checkin-medal {
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(37, 99, 235, .1);
  color: var(--primary-hover);
  font-size: 11px;
  font-weight: 800;
}

.checkin-podium-place.rank-1 .checkin-medal {
  background: rgba(245, 158, 11, .16);
  color: #92400e;
}

.checkin-podium-user strong,
.checkin-rank-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checkin-podium-user strong {
  color: var(--text);
  font-size: 17px;
}

.checkin-podium-user em,
.checkin-podium-user small,
.checkin-rank-row span {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.checkin-podium-user em {
  color: var(--teal);
}

.checkin-rank-list {
  display: grid;
  gap: 8px;
}

.checkin-rank-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(90px, auto) minmax(110px, auto);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
}

.checkin-rank-index {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  color: var(--text);
  font-weight: 850;
}

.ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 20px;
  align-items: start;
}

.ticket-compose-card,
.ticket-list-card,
.ticket-detail-card {
  min-width: 0;
}

.ticket-form,
.ticket-reply-form {
  display: grid;
  gap: 14px;
}

.ticket-form .wide {
  grid-column: 1 / -1;
}

.ticket-list {
  display: grid;
  gap: 9px;
}

.ticket-list-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.ticket-list-item:hover,
.ticket-list-item.active {
  border-color: rgba(37, 99, 235, .35);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}

.ticket-list-item strong {
  overflow-wrap: anywhere;
}

.ticket-list-item small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.ticket-status {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(15, 23, 42, .07);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.ticket-status.status-open {
  background: rgba(245, 158, 11, .14);
  color: #92400e;
}

.ticket-status.status-replied {
  background: rgba(37, 99, 235, .12);
  color: var(--primary-hover);
}

.ticket-status.status-resolved {
  background: rgba(15, 118, 110, .12);
  color: var(--teal);
}

.ticket-status.status-closed {
  background: rgba(100, 116, 139, .13);
  color: #475569;
}

.ticket-thread {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.ticket-message {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
}

.ticket-message.from-admin {
  border-color: rgba(37, 99, 235, .2);
  background: #f7fbff;
}

.ticket-message > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.ticket-message span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.ticket-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  line-height: 1.65;
}

@keyframes checkinPodiumRise {
  from {
    opacity: 0;
    transform: translateY(26px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes checkinStageShine {
  0%,
  58% {
    transform: skewX(-18deg) translateX(-120%);
  }
  100% {
    transform: skewX(-18deg) translateX(420%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .checkin-leaderboard-card::after,
  .checkin-podium-place {
    animation: none;
  }
}

.card h2,
.modal-head h2,
.settings-group h3,
.auth-panel h1,
.stat span,
.status-item span {
  --ui-icon: var(--icon-panel);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2 {
  margin-bottom: 16px;
  font-size: 17px;
}

.settings-card h2,
.settings-group h3 {
  --ui-icon: var(--icon-settings);
}

.auth-panel h1 {
  --ui-icon: var(--icon-shield);
}

.stats-grid,
.grid,
.dashboard-grid,
.settings-grid {
  display: grid;
  gap: 16px;
}

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

.grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 20px;
}

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

.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.settings-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat {
  position: relative;
  min-height: 116px;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: auto 18px 16px auto;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.stat span {
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 780;
}

.stat strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: 31px;
  font-weight: 820;
  line-height: 1;
}

.stat:nth-child(1) span {
  --ui-icon: var(--icon-users);
}

.stat:nth-child(2) span {
  --ui-icon: var(--icon-account);
}

.stat:nth-child(3) span,
.stat:nth-child(4) span {
  --ui-icon: var(--icon-card);
}

.stat:nth-child(2)::after {
  background: var(--teal-soft);
}

.stat:nth-child(3)::after {
  background: var(--amber-soft);
}

.stat:nth-child(4)::after {
  background: var(--success-soft);
}

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

.status-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface-soft);
}

.status-item::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  align-self: stretch;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--teal));
}

.status-item span {
  --ui-icon: var(--icon-check);
  display: flex;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 760;
}

.status-item strong {
  display: block;
  max-width: 420px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.quick-grid a {
  justify-content: flex-start;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 760;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.quick-grid a:hover {
  border-color: #bdd2ff;
  background: var(--primary-soft);
  color: var(--primary-hover);
  transform: translateY(-1px);
}

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

.section-head h2 {
  margin-bottom: 0;
}

.job-record-head {
  align-items: flex-start;
}

.job-filter-form {
  align-items: end;
  margin-left: auto;
}

.job-filter-form label {
  min-width: 180px;
}

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

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

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c7d3e1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

button,
.small-button,
a.small-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

button:hover,
.small-button:hover,
a.small-button:hover {
  background: var(--primary-hover);
  color: #fff;
}

button:focus-visible,
.small-button:focus-visible,
a.small-button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button[type="button"],
button.secondary,
a.small-button,
.ghost-button {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

button[type="button"]:hover,
button.secondary:hover,
a.small-button:hover,
.ghost-button:hover {
  border-color: #bdd2ff;
  background: var(--primary-soft);
  color: var(--primary-hover);
}

button.danger,
.small-button.danger {
  border-color: transparent;
  background: var(--danger);
  color: #fff;
}

button.danger:hover,
.small-button.danger:hover {
  background: var(--danger-hover);
  color: #fff;
}

button:disabled,
input:disabled {
  opacity: .58;
  cursor: not-allowed;
}

button {
  --ui-icon: var(--icon-check);
}

button[type="button"],
button.secondary,
a.small-button {
  --ui-icon: var(--icon-arrow-left);
}

button.danger,
.small-button.danger,
form[action$="/delete"] button,
form[action$="/clear"] button {
  --ui-icon: var(--icon-trash);
}

form[action$="/stop"] button {
  --ui-icon: var(--icon-stop);
}

form[action$="/resume"] button,
form[action$="/start"] button {
  --ui-icon: var(--icon-play);
}

form[action$="/relogin"] button,
.job-rank-refresh-form button {
  --ui-icon: var(--icon-refresh);
}

form[action$="/email-code"] button {
  --ui-icon: var(--icon-mail);
}

button.job-error-badge {
  min-width: 26px;
  height: 24px;
  min-height: 24px;
  border: 1px solid var(--danger);
  border-radius: 999px;
  padding: 0 9px;
  background: var(--danger);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 7px 16px rgba(192, 54, 44, .22);
}

button.job-error-badge:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  color: #ffffff;
  transform: none;
  box-shadow: 0 9px 18px rgba(159, 43, 36, .24);
}

.home-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(202, 138, 4, .16), transparent 28rem),
    radial-gradient(circle at 18% 78%, rgba(15, 118, 110, .14), transparent 30rem),
    #11100f;
  color: #f7f3ec;
}

body.home-page {
  display: block;
  grid-template-columns: none;
}

.home-page a {
  color: inherit;
}

.home-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 16px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: rgba(17, 16, 15, .82);
  backdrop-filter: blur(18px);
}

.home-brand,
.home-nav-actions,
.home-hero-actions {
  display: flex;
  align-items: center;
}

.home-brand {
  gap: 12px;
  min-width: 0;
  font-weight: 760;
  color: #fffaf1;
}

.home-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(251, 191, 36, .34);
  border-radius: 8px;
  background: linear-gradient(145deg, #f5c542, #0f766e);
  color: #11100f;
  font-weight: 860;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
}

.home-brand-logo {
  display: block;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(251, 191, 36, .28);
  border-radius: 8px;
  padding: 3px;
  background: rgba(255, 255, 255, .08);
  object-fit: contain;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}

.home-nav-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-nav-actions a,
.home-primary-action,
.home-secondary-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 720;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.home-nav-actions a {
  color: #d9d0c2;
}

.home-nav-actions a:hover,
.home-secondary-action:hover {
  color: #fffaf1;
  background: rgba(255, 255, 255, .07);
}

.home-nav-login,
.home-primary-action {
  border: 1px solid rgba(245, 197, 66, .46);
  background: #f2b84b;
  color: #15120d !important;
  box-shadow: 0 14px 36px rgba(202, 138, 4, .24);
}

.home-nav-login:hover,
.home-primary-action:hover {
  transform: translateY(-1px);
  background: #ffd166;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(460px, 660px);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(40px, 7vw, 92px) clamp(20px, 5vw, 72px) 48px;
}

.home-hero-copy {
  max-width: 780px;
}

.home-eyebrow {
  margin: 0 0 16px;
  color: #8ee0d3;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .12em;
}

.home-hero h1 {
  max-width: 860px;
  color: #fffaf1;
  font-size: clamp(40px, 5.3vw, 72px);
  line-height: 1.03;
  letter-spacing: 0;
}

.home-hero-text {
  max-width: 620px;
  margin: 22px 0 0;
  color: #cfc5b7;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.75;
}

.home-hero-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.home-primary-action,
.home-secondary-action {
  min-width: 146px;
}

.home-secondary-action {
  border: 1px solid rgba(255, 255, 255, .16);
  color: #f4ede2;
  background: rgba(255, 255, 255, .04);
}

.home-instrument-stage {
  position: relative;
  min-width: 0;
  min-height: 560px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, .12), transparent 38%),
    linear-gradient(315deg, rgba(245, 197, 66, .14), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 54px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 54px),
    #171514;
  box-shadow: 0 34px 90px rgba(0, 0, 0, .42);
  overflow: hidden;
  isolation: isolate;
}

.home-instrument-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  padding: 0 18px;
  background: rgba(255, 255, 255, .045);
}

.home-instrument-header span,
.home-instrument-header em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(142, 224, 211, .24);
  border-radius: 6px;
  padding: 0 10px;
  color: #8ee0d3;
  background: rgba(15, 118, 110, .14);
  font-size: 12px;
  font-style: normal;
  font-weight: 820;
  white-space: nowrap;
}

.home-instrument-header strong {
  min-width: 0;
  color: #fffaf1;
  overflow-wrap: break-word;
}

.home-instrument-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 660px);
  height: clamp(320px, 38vw, 390px);
  margin: 0 auto;
}

.plant-lines path {
  fill: none;
  stroke: rgba(183, 170, 153, .34);
  stroke-width: 10;
  stroke-linecap: round;
}

.plant-flow-dot {
  fill: #8ee0d3;
  filter: drop-shadow(0 0 12px rgba(142, 224, 211, .85));
}

.instrument-part {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform, opacity;
}

.instrument-needle {
  transform-origin: 330px 258px;
}

.instrument-dial text,
.instrument-transmitter text {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.home-instrument-notes {
  position: absolute;
  inset: 84px 22px auto;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  pointer-events: none;
}

.instrument-callout {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(245, 197, 66, .24);
  border-radius: 6px;
  padding: 0 9px;
  color: #ead7a6;
  background: rgba(0, 0, 0, .24);
  font-size: 12px;
  font-weight: 780;
  opacity: 0;
}

.home-spec-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.home-spec-card {
  min-width: 0;
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, .22);
}

.home-spec-card span {
  display: block;
  color: #b7aa99;
  font-size: 12px;
  font-weight: 720;
}

.home-spec-card strong {
  display: block;
  margin-top: 10px;
  color: #fffaf1;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1;
}

.home-spec-card:nth-child(3) strong::after {
  content: "%";
  margin-left: 2px;
  color: #8ee0d3;
  font-size: 18px;
}

.home-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 38px;
}

.home-signal-grid div,
.home-feature {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}

.home-signal-grid div {
  padding: 16px;
}

.home-signal-grid strong,
.home-signal-grid span {
  display: block;
}

.home-signal-grid strong {
  margin-bottom: 6px;
  color: #fffaf1;
  font-size: 15px;
}

.home-signal-grid span {
  color: #b9afa1;
  line-height: 1.55;
}

.home-console {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035)),
    #171514;
  box-shadow: 0 34px 90px rgba(0, 0, 0, .42);
  overflow: hidden;
}

.home-console::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, black, transparent 90%);
}

.home-console-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .035);
}

.home-console-top span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b7aa99;
}

.home-console-top span:nth-child(1) {
  background: #ef746b;
}

.home-console-top span:nth-child(2) {
  background: #f4be55;
}

.home-console-top span:nth-child(3) {
  background: #69d39f;
}

.home-console-top strong {
  margin-left: auto;
  color: #d8cec0;
  font-size: 13px;
}

.home-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.home-metric {
  min-height: 104px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  padding: 14px;
  background: rgba(0, 0, 0, .2);
}

.home-metric span {
  display: block;
  color: #a99f93;
  font-size: 12px;
}

.home-metric strong {
  display: block;
  margin-top: 16px;
  color: #fffaf1;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}

.home-metric:nth-child(3) strong::after {
  content: "%";
  margin-left: 2px;
  color: #8ee0d3;
  font-size: 18px;
}

.home-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  padding: 0 18px 18px;
}

.home-flow span {
  height: 92px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(142, 224, 211, .8), rgba(245, 197, 66, .22));
  transform-origin: bottom;
}

.home-task-list {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.home-task-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, .045);
}

.home-task-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .05);
}

.home-task-dot.is-running {
  background: #8ee0d3;
}

.home-task-dot.is-queued {
  background: #f5c542;
}

.home-task-dot.is-done {
  background: #8fcf8f;
}

.home-task-row strong,
.home-task-row span,
.home-task-row em {
  display: block;
  min-width: 0;
}

.home-task-row strong {
  color: #fffaf1;
  overflow-wrap: break-word;
}

.home-task-row span {
  margin-top: 3px;
  color: #aaa195;
  font-size: 12px;
  overflow-wrap: break-word;
}

.home-task-row em {
  color: #d9c08c;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.home-section {
  padding: 34px clamp(20px, 5vw, 72px) 80px;
}

.home-section-heading {
  max-width: 760px;
}

.home-section-heading h2 {
  color: #fffaf1;
  font-size: clamp(28px, 4vw, 44px);
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.home-feature {
  padding: 22px;
}

.home-feature-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  margin-bottom: 18px;
  background-color: #f5c542;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 22px;
}

.home-icon-account {
  mask-image: var(--icon-account);
}

.home-icon-job {
  mask-image: var(--icon-jobs);
}

.home-icon-quota {
  mask-image: var(--icon-card);
}

.home-feature h3 {
  color: #fffaf1;
  font-size: 18px;
}

.home-feature p {
  margin-top: 10px;
  color: #bbb1a5;
  line-height: 1.72;
}

@media (max-width: 980px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .home-console,
  .home-instrument-stage {
    max-width: 680px;
  }
}

@media (max-width: 720px) {
  .home-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    position: static;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .home-brand {
    min-width: 0;
  }

  .home-nav-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .home-nav-actions a {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .home-hero {
    padding-top: 30px;
  }

  .home-hero h1 {
    font-size: 32px;
    line-height: 1.08;
  }

  .home-hero-text {
    font-size: 16px;
    line-height: 1.7;
  }

  .home-primary-action,
  .home-secondary-action {
    flex: 1 1 150px;
    min-width: 0;
    font-size: 15px;
  }

  .home-signal-grid,
  .home-feature-grid,
  .home-metrics,
  .home-spec-grid {
    grid-template-columns: 1fr;
  }

  .home-signal-grid {
    display: none;
  }

  .home-instrument-stage {
    min-height: auto;
  }

  .home-instrument-header {
    grid-template-columns: 1fr;
    align-items: flex-start;
    padding: 14px;
  }

  .home-instrument-header span,
  .home-instrument-header em {
    width: max-content;
    max-width: 100%;
  }

  .home-instrument-svg {
    height: 340px;
  }

  .home-instrument-notes {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 18px 12px;
  }

  .instrument-callout {
    opacity: 1;
  }

  .home-flow {
    grid-template-columns: repeat(5, 1fr);
  }

  .home-task-row {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .home-task-row em {
    grid-column: 2;
  }
}

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

#openCoursePicker,
#confirmCoursePicker {
  --ui-icon: var(--icon-book);
}

#selectAllAccounts,
#clearSelectedAccounts,
#closeCoursePicker,
#cancelCoursePicker {
  --ui-icon: var(--icon-check);
}

#clearSelectedAccounts,
#closeCoursePicker,
#cancelCoursePicker {
  --ui-icon: var(--icon-arrow-left);
}

.license-card-submit button,
#openCreateUserModal {
  --ui-icon: var(--icon-plus);
}

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

.inline-form input {
  width: auto;
  min-width: 190px;
}

.row-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.row-form label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-form input[type="number"] {
  width: 104px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.checkbox-row input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.register-code-form {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.settings-card {
  max-width: none;
}

.settings-compact-card {
  padding: 20px;
}

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

.settings-card-head h2 {
  margin-bottom: 3px;
}

.settings-compact-card > .form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.settings-compact-card > .form > .alert,
.settings-compact-card > .form > .settings-tab-shell,
.settings-compact-card > .form > .settings-full,
.settings-compact-card > .form > .form-footer {
  grid-column: 1 / -1;
}

.settings-tab-shell {
  display: grid;
  gap: 12px;
}

.settings-tab-radio {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.settings-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}

.settings-tab-list label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: #fff;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

#settingsTabCore:checked ~ .settings-tab-list label[for="settingsTabCore"],
#settingsTabSpeed:checked ~ .settings-tab-list label[for="settingsTabSpeed"],
#settingsTabMail:checked ~ .settings-tab-list label[for="settingsTabMail"],
#settingsTabBusiness:checked ~ .settings-tab-list label[for="settingsTabBusiness"] {
  border-color: rgba(37, 99, 235, .28);
  background: var(--primary-soft);
  color: var(--primary-hover);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .08);
}

.settings-tab-panels {
  min-width: 0;
}

.settings-tab-panel {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.settings-tab-panel > .settings-full {
  grid-column: 1 / -1;
}

#settingsTabCore:checked ~ .settings-tab-panels .settings-tab-core,
#settingsTabSpeed:checked ~ .settings-tab-panels .settings-tab-speed,
#settingsTabMail:checked ~ .settings-tab-panels .settings-tab-mail,
#settingsTabBusiness:checked ~ .settings-tab-panels .settings-tab-business {
  display: grid;
}

.settings-group {
  position: relative;
  display: grid;
  gap: 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 14px 14px 17px;
  background: var(--surface-soft);
}

.settings-group + .settings-group {
  margin-top: 12px;
}

.settings-compact-card > .form > .settings-group + .settings-group {
  margin-top: 0;
}

.settings-group::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--teal);
}

.settings-standalone {
  margin-top: 12px;
}

.settings-compact-card .settings-grid {
  gap: 10px;
}

.settings-compact-card label {
  gap: 6px;
  font-size: 12px;
}

.settings-compact-card input,
.settings-compact-card select {
  height: 36px;
  padding-inline: 10px;
  font-size: 13px;
}

.settings-compact-card textarea {
  min-height: 74px;
  font-size: 13px;
}

.settings-compact-card .hint,
.settings-compact-card .muted {
  font-size: 12px;
}

.speed-preset-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
}

.speed-preset-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.speed-preset-card summary span {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 820;
}

.speed-preset-card summary small {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speed-preset-card .settings-grid {
  margin-top: 8px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.form-footer button {
  flex: 0 0 auto;
}

.license-card-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.icon-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--surface-soft);
}

.field-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.2;
}

.field-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #c6dcff;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 12px;
  font-weight: 840;
}

.field-hint {
  min-height: 16px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.license-card-submit {
  display: flex;
  align-items: end;
  min-width: 0;
}

.license-card-submit button {
  width: 100%;
}

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

.quick-filter-group .small-button[aria-pressed="true"] {
  border-color: rgba(37, 99, 235, .28);
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.generated-cards-panel {
  width: min(560px, 100%);
}

.generated-cards-body {
  padding: 18px 20px;
}

.generated-cards-text {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.65;
  white-space: pre;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  max-width: 100%;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 11px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

td {
  color: var(--text);
}

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

tr:hover td {
  background: #fbfcfe;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.25;
  white-space: nowrap;
}

.job-status-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

button.job-error-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  min-height: 24px;
  border: 1px solid var(--danger);
  border-radius: 999px;
  padding: 0 9px;
  background: var(--danger);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(192, 54, 44, .22);
}

button.job-error-badge:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  color: #ffffff;
  box-shadow: 0 9px 18px rgba(159, 43, 36, .24);
}

button.job-error-badge:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

button.job-error-badge::before {
  display: none;
}

.status-valid,
.status-starting,
.status-running,
.rank-monitor-reached,
.rank-monitor-watching {
  background: var(--success-soft);
  color: var(--success);
}

.status-invalid,
.status-failed,
.rank-monitor-failed,
.rank-monitor-disabled,
.error-login,
.error-other {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-queued,
.status-stopped,
.rank-gap-badge,
.rank-monitor-catching_up,
.error-course {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-success {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.status-unknown,
.rank-monitor-pending {
  background: var(--surface-soft);
  color: var(--text-muted);
}

.rank-gap-badge {
  justify-content: flex-start;
  max-width: 100%;
  margin-top: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rank-monitor-box {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.job-rank-refresh-form {
  margin: 8px 0 10px;
}

.toast-stack {
  position: fixed;
  top: 22px;
  right: 18px;
  z-index: 190;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 24px));
  pointer-events: none;
}

.alert:not(.inline) {
  position: fixed;
  top: 22px;
  right: 18px;
  z-index: 190;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(390px, calc(100vw - 24px));
  border: 1px solid #cde0ff;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  margin: 0;
  padding: 13px 12px 13px 14px;
  background: rgba(255, 255, 255, .96);
  color: var(--text);
  box-shadow: 0 16px 38px rgba(23, 32, 51, .16);
  backdrop-filter: blur(14px);
  overflow-wrap: anywhere;
  pointer-events: auto;
  animation: toast-in .18s ease-out;
}

.toast-stack .alert:not(.inline) {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
}

.alert.toast-success,
.alert.success:not(.inline) {
  border-color: #bfe5cd;
  border-left-color: var(--success);
  background: rgba(249, 255, 251, .96);
}

.alert.toast-warning {
  border-color: #f4d49b;
  border-left-color: var(--amber);
  background: rgba(255, 251, 242, .96);
}

.alert.toast-error {
  border-color: #f0c1bc;
  border-left-color: var(--danger);
  background: rgba(255, 250, 249, .96);
}

.alert.error:not(.inline) {
  border-color: #f0c1bc;
  border-left-color: var(--danger);
  background: rgba(255, 250, 249, .96);
}

.global-email-prompt {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 185;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(460px, calc(100vw - 24px));
  border: 1px solid #f0c1bc;
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: rgba(255, 250, 249, .97);
  color: var(--text);
  box-shadow: 0 16px 38px rgba(23, 32, 51, .16);
  backdrop-filter: blur(14px);
}

.global-email-prompt div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.global-email-prompt strong,
.global-email-prompt span {
  overflow-wrap: anywhere;
}

.global-email-prompt span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.global-email-prompt button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 0;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.email-bind-state {
  display: grid;
  gap: 4px;
  border: 1px solid #e5e7eb;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #fffbeb;
}

.email-bind-state.verified {
  border-left-color: var(--success);
  background: #f0fdf4;
}

.email-bind-state span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.email-bind-form {
  margin-top: 14px;
}

.email-code-control {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.email-code-control input {
  flex: 1 1 auto;
  min-width: 0;
}

.email-code-control button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.email-code-control button:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.toast-message {
  min-width: 0;
}

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 20px;
  line-height: 1;
}

.toast-close::before {
  display: none;
}

.toast-close:hover {
  background: var(--surface-soft);
  color: var(--text);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

.alert.inline {
  display: inline-flex;
  margin: 0;
  border: 1px solid #f0c1bc;
  border-radius: var(--radius);
  padding: 4px 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  vertical-align: middle;
}

.empty-state {
  border: 1px dashed #c5d0df;
  border-radius: var(--radius);
  padding: 26px;
  background: var(--surface-soft);
  color: var(--text-muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.progress-cell {
  min-width: 190px;
}

.progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-meta strong {
  color: var(--text);
  font-size: 15px;
}

.progress-meta span {
  color: var(--text-muted);
  font-size: 12px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 1px solid #d6e0ec;
  border-radius: 999px;
  background: #eef3f8;
}

.progress-bar span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  transition: width .2s ease;
}

.progress-cell .muted {
  margin-top: 8px;
  line-height: 1.5;
}

.job-row-course {
  display: inline-block;
  max-width: 280px;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.job-create-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
}

.job-create-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.job-create-step strong,
.job-submit-panel strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 780;
}

.step-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 820;
}

.compact-grid {
  margin-bottom: 0;
}

.job-submit-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #cce4df;
  border-radius: var(--radius);
  padding: 16px;
  background: var(--teal-soft);
}

.job-submit-panel > div {
  min-width: 0;
}

.job-submit-actions {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.account-search {
  margin-top: 4px;
}

.account-search input {
  max-width: 560px;
}

.account-pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 10px;
  max-height: min(52vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.check-row {
  display: flex;
  align-items: flex-start;
  justify-content: stretch;
  gap: 12px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text-muted);
}

.check-row:has(input:checked) {
  border-color: #abd5ce;
  background: var(--teal-soft);
}

.check-row > input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 4px;
}

.account-choice-body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.account-choice-label {
  display: block;
  color: var(--text);
  font-weight: 760;
  line-height: 1.45;
}

.job-course-summary,
.account-entitlement-summary {
  display: block;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.account-card-list {
  display: grid;
  gap: 14px;
}

.account-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.account-card-head,
.account-card-body,
.account-card-actions {
  padding: 16px;
}

.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.account-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.account-title strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.account-title span {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.account-id {
  width: fit-content;
  min-height: 23px;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  background: var(--primary-soft);
  color: var(--primary-hover) !important;
  font-weight: 800;
}

.account-status {
  flex: 0 0 auto;
}

.account-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 12px;
  align-items: start;
}

.account-panel {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.account-edit-panel {
  display: grid;
  gap: 10px;
}

.course-chip {
  display: block;
  max-width: 100%;
  min-height: 27px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-account-form {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.account-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  min-width: 0;
}

.account-edit-grid label {
  gap: 5px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 760;
}

.account-edit-grid input,
.account-edit-grid select {
  height: 34px;
  border-radius: var(--radius-sm);
  padding: 0 9px;
  font-size: 12px;
}

.account-extra {
  min-width: 0;
}

.account-extra summary {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.account-extra textarea {
  height: 66px;
  min-height: 66px;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.account-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.rank-panel,
.account-meta-panel {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12px;
}

.rank-panel strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.rank-panel small {
  color: var(--text-soft);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.panel-label {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .04em;
}

.readonly-entitlement {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  color: var(--text-muted);
}

.readonly-entitlement .small-button {
  justify-self: start;
  margin-top: 2px;
}

.account-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  background: #fbfcfe;
}

.account-card-actions form,
.account-card-actions > button {
  min-width: 0;
  margin: 0;
}

.account-card-actions .small-button,
.account-card-actions button.small-button {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.job-detail-toggle {
  min-width: 0;
}

.job-detail-toggle summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
}

.job-detail-toggle summary::-webkit-details-marker {
  display: none;
}

.job-detail-toggle summary::after {
  content: "Expand";
  margin-left: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.job-detail-toggle[open] summary::after {
  content: "Collapse";
}

.job-detail-body {
  min-width: 0;
  max-width: min(760px, 80vw);
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.job-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.job-detail-grid section {
  min-width: 0;
}

.job-detail-grid section > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.job-detail-grid p {
  margin-bottom: 6px;
}

.modal-backdrop,
.captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 32, 51, .56);
}

.modal-panel,
.captcha-modal__panel {
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(760px, 92vh);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(23, 32, 51, .28);
}

.captcha-modal__panel {
  width: min(400px, 100%);
}

.modal-head,
.modal-actions,
.captcha-modal__head,
.captcha-modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h2 {
  margin-bottom: 4px;
}

.modal-actions,
.captcha-modal__actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
  background: var(--surface-soft);
}

.modal-form {
  overflow: auto;
  padding: 20px;
}

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

.announcement-modal {
  z-index: 220;
}

.announcement-panel {
  max-height: min(780px, calc(100dvh - 32px));
}

.announcement-modal-body {
  display: grid;
  gap: 14px;
}

.announcement-content {
  line-height: 1.7;
  color: var(--text);
  overflow-wrap: anywhere;
}

.announcement-content p,
.announcement-content ul,
.announcement-content ol,
.announcement-content blockquote,
.announcement-content pre {
  margin: 0 0 10px;
}

.announcement-content ul,
.announcement-content ol {
  padding-left: 22px;
}

.announcement-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 8px 12px;
  background: var(--primary-soft);
}

.announcement-content img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: min(420px, 52vh);
  margin: 10px 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  object-fit: contain;
}

.announcement-item {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}

.announcement-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}

.announcement-item-head h3 {
  min-width: 0;
  font-size: 16px;
}

.announcement-item-head span {
  flex: 0 0 auto;
  color: var(--text-soft);
  font-size: 12px;
}

.announcement-item-actions {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.modal-form .modal-actions {
  margin: 20px -20px -20px;
}

.modal-form .announcement-item-actions {
  margin: 0;
}

.announcement-admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: start;
}

.announcement-editor-card,
.announcement-admin-item {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.announcement-admin-list {
  display: grid;
  gap: 10px;
}

.announcement-admin-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.announcement-admin-item summary span {
  min-width: 0;
  color: var(--text);
  font-weight: 780;
  overflow-wrap: anywhere;
}

.announcement-admin-item summary small {
  flex: 0 0 auto;
  margin: 0;
}

.announcement-admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.announcement-admin-actions .checkbox-row {
  flex: 1 1 160px;
  margin: 0;
}

.announcement-admin-actions .small-button {
  flex: 0 0 auto;
}

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

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rich-editor-toolbar button {
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 0 11px;
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: none;
}

.rich-editor {
  min-height: 150px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.rich-editor:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.rich-preview-block {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.rich-preview-block > strong {
  color: var(--text-muted);
  font-size: 12px;
}

.course-picker-list {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 16px 20px;
}

.course-picker-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.4fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}

.course-picker-account,
.course-picker-control {
  min-width: 0;
}

.course-picker-account strong,
.course-picker-account span,
.picker-course-status {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.picker-course-status {
  margin-top: 4px;
}

.captcha-card {
  max-width: 720px;
}

.captcha-help {
  margin-bottom: 18px;
}

.captcha-section,
.slider-captcha,
.puzzle-captcha {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
}

.captcha-section {
  justify-content: center;
  margin: 0 0 18px;
}

.captcha-image {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.puzzle-captcha__stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22px 22px, rgba(23, 32, 51, .12) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(135deg, #f8fafc 0%, #e0f2fe 46%, #ecfdf5 100%);
}

.puzzle-captcha__hole,
.puzzle-captcha__piece {
  position: absolute;
  border-radius: var(--radius);
}

.puzzle-captcha__hole {
  border: 2px dashed rgba(23, 32, 51, .45);
  background: rgba(255, 255, 255, .58);
  box-shadow: inset 0 2px 8px rgba(23, 32, 51, .16);
}

.puzzle-captcha__piece {
  border: 1px solid rgba(37, 99, 235, .9);
  background: rgba(37, 99, 235, .82);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
}

.slider-captcha-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.slider-captcha-track span {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.puzzle-captcha input[type="range"],
.slider-captcha input[type="range"] {
  width: 100%;
  height: 48px;
  margin: 2px 0 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

.puzzle-captcha input[type="range"]::-webkit-slider-runnable-track,
.slider-captcha input[type="range"]::-webkit-slider-runnable-track {
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eaf0f6;
}

.puzzle-captcha input[type="range"]::-webkit-slider-thumb,
.slider-captcha input[type="range"]::-webkit-slider-thumb {
  width: 54px;
  height: 34px;
  margin-top: -12px;
  border: 2px solid var(--primary-hover);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #60a5fa, var(--primary));
  box-shadow: 0 6px 14px rgba(37, 99, 235, .24);
  -webkit-appearance: none;
  appearance: none;
}

.puzzle-captcha input[type="range"]::-moz-range-track,
.slider-captcha input[type="range"]::-moz-range-track {
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eaf0f6;
}

.puzzle-captcha input[type="range"]::-moz-range-thumb,
.slider-captcha input[type="range"]::-moz-range-thumb {
  width: 54px;
  height: 34px;
  border: 2px solid var(--primary-hover);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #60a5fa, var(--primary));
  box-shadow: 0 6px 14px rgba(37, 99, 235, .24);
  cursor: pointer;
}

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(15, 118, 110, .10) 48%, rgba(180, 83, 9, .06)),
    var(--bg);
}

.auth-panel {
  position: relative;
  display: grid;
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 74px 34px 34px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-md);
}

.auth-panel::before {
  content: "AUTO ANSWER";
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 34px;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  color: #fff;
  font-size: 12px;
  font-weight: 860;
  letter-spacing: .08em;
}

.auth-panel h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

.auth-panel form {
  margin-top: 24px;
}

.auth-panel > p:last-child {
  margin-top: 24px;
}

body.auth.login-page {
  display: block;
  min-height: 100vh;
  padding: 0;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, .18), transparent 34%),
    linear-gradient(300deg, rgba(245, 197, 66, .16), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 56px),
    #11100f;
  color: #f7f3ec;
}

.login-page .login-nav {
  background: rgba(17, 16, 15, .9);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(360px, 460px);
  gap: clamp(28px, 6vw, 88px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(36px, 7vw, 84px) clamp(20px, 5vw, 72px);
}

.login-copy {
  max-width: 740px;
}

.login-copy h1 {
  max-width: 760px;
  color: #fffaf1;
  font-size: clamp(42px, 5.4vw, 74px);
  line-height: 1.04;
}

.login-copy p:not(.home-eyebrow) {
  max-width: 620px;
  margin-top: 22px;
  color: #cfc5b7;
  font-size: 18px;
  line-height: 1.78;
}

.login-visual {
  position: relative;
  width: min(420px, 80vw);
  aspect-ratio: 1;
  margin-top: 42px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 42px),
    rgba(255, 255, 255, .04);
  overflow: hidden;
}

.login-ring,
.login-needle,
.login-node {
  position: absolute;
  display: block;
}

.login-ring {
  inset: 18%;
  border: 14px solid rgba(247, 243, 236, .18);
  border-top-color: #8ee0d3;
  border-right-color: #f5c542;
  border-radius: 50%;
}

.login-ring-inner {
  inset: 32%;
  border-width: 8px;
  border-left-color: #f97316;
  opacity: .86;
}

.login-needle {
  left: 50%;
  top: 50%;
  width: 34%;
  height: 6px;
  border-radius: 999px;
  background: #f97316;
  transform-origin: left center;
}

.login-node {
  width: 18px;
  height: 18px;
  border: 3px solid #f5c542;
  border-radius: 50%;
  background: #11100f;
  box-shadow: 0 0 0 8px rgba(245, 197, 66, .08);
}

.login-node-a {
  left: 18%;
  top: 24%;
}

.login-node-b {
  right: 20%;
  top: 32%;
}

.login-node-c {
  left: 48%;
  bottom: 18%;
}

.login-card {
  display: grid;
  gap: 18px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 34px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035)),
    rgba(23, 21, 20, .94);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .42);
}

.login-card-head h2 {
  color: #fffaf1;
  font-size: 30px;
}

.login-card .alert {
  margin: 0;
  border-color: rgba(248, 113, 113, .32);
  background: rgba(127, 29, 29, .28);
  color: #fecaca;
}

.login-form {
  gap: 16px;
}

.login-form label {
  color: #d9d0c2;
  font-weight: 780;
}

.login-form input {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .24);
  color: #fffaf1;
}

.login-form input:focus {
  border-color: rgba(142, 224, 211, .7);
  box-shadow: 0 0 0 3px rgba(142, 224, 211, .16);
}

.login-form button {
  min-height: 48px;
  background: #f2b84b;
  color: #15120d;
  box-shadow: 0 14px 36px rgba(202, 138, 4, .24);
}

.login-register-link {
  margin: 0;
  color: #bdb4a8;
}

.login-register-link a {
  color: #8ee0d3;
  font-weight: 820;
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }
}

@media (max-width: 720px) {
  .login-copy h1 {
    font-size: 34px;
  }

  .login-copy p:not(.home-eyebrow) {
    font-size: 16px;
  }
}

button.loading,
button[disabled].loading,
form.submitting button[type="submit"] {
  position: relative;
  color: transparent;
  pointer-events: none;
}

button.loading::after,
form.submitting button[type="submit"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-loading-spinner .6s linear infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }

  to {
    transform: rotate(1turn);
  }
}

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

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

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .license-card-form {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body:not(.auth) {
    display: block;
  }

  .nav-open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    border-bottom: 1px solid var(--line);
    padding: 0 16px;
    background: rgba(255, 255, 255, .94);
    color: var(--text);
    font-size: 15px;
    font-weight: 820;
    box-shadow: 0 8px 24px rgba(23, 32, 51, .08);
    backdrop-filter: blur(12px);
    cursor: pointer;
  }

  .nav-open-lines {
    position: relative;
    width: 22px;
    height: 16px;
    flex: 0 0 auto;
    border-top: 2px solid currentColor;
  }

  .nav-open-lines::before,
  .nav-open-lines::after {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    border-top: 2px solid currentColor;
  }

  .nav-open-lines::before {
    top: 5px;
  }

  .nav-open-lines::after {
    top: 12px;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: block;
    background: rgba(23, 32, 51, .44);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }

  .topbar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 220;
    width: min(86vw, 320px);
    max-width: 100vw;
    height: 100dvh;
    padding: 16px 14px;
    transform: translateX(-104%);
    transition: transform .2s ease;
  }

  .nav-toggle:checked ~ .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle:checked ~ .topbar {
    transform: translateX(0);
  }

  .nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 10px;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 740;
    cursor: pointer;
  }

  .layout {
    display: block;
    width: 100%;
    max-width: 100vw;
    padding: 76px 12px 36px;
  }

  .toast-stack,
  .alert:not(.inline) {
    top: 70px;
    z-index: 190;
  }

  .page-head,
  .section-head,
  .job-submit-panel,
  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions,
  .job-submit-actions {
    justify-content: flex-start;
  }

  .form.two,
  .stats-grid,
  .grid,
  .quick-grid,
  .settings-grid,
  .settings-compact-card > .form,
  .settings-tab-panel,
  .announcement-admin-layout,
  .license-card-form {
    grid-template-columns: 1fr;
  }

  .account-card-body {
    grid-template-columns: 1fr;
  }

  .email-code-control {
    flex-direction: column;
  }

  .email-code-control button {
    width: 100%;
  }

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

  .inline-form,
  .row-form {
    align-items: stretch;
    flex-direction: column;
  }

  .checkin-hero,
  .checkin-allocation-item {
    align-items: stretch;
    flex-direction: column;
  }

  .checkin-total,
  .checkin-allocation-item > div:last-child {
    justify-items: start;
  }

  .checkin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 16px;
  }

  .checkin-hero,
  .checkin-action-form,
  .checkin-allocate-form {
    padding-inline: 16px;
  }

  .checkin-account-row {
    grid-template-columns: 1fr;
  }

  .checkin-account-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .checkin-note,
  .checkin-history {
    margin-inline: 16px;
  }

  .checkin-podium {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    min-height: 136px;
  }

  .checkin-podium-place {
    flex: 0 1 31%;
    max-width: 118px;
    gap: 6px;
  }

  .checkin-podium-place.rank-1 {
    flex-basis: 34%;
  }

  .checkin-podium-user,
  .checkin-podium-base {
    width: 100%;
  }

  .checkin-podium-user {
    gap: 4px;
    padding: 8px 4px;
  }

  .checkin-podium-user strong {
    max-width: 100%;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .checkin-podium-user em,
  .checkin-podium-user small {
    font-size: 10px;
  }

  .checkin-medal {
    padding: 3px 6px;
    font-size: 10px;
  }

  .checkin-podium-place.rank-1 {
    --podium-height: 54px;
  }

  .checkin-podium-place.rank-2 {
    --podium-height: 42px;
  }

  .checkin-podium-place.rank-3 {
    --podium-height: 34px;
  }

  .checkin-podium-base {
    clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
  }

  .checkin-podium-base span {
    font-size: 24px;
  }

  .checkin-rank-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .ticket-layout {
    grid-template-columns: 1fr;
  }

  .ticket-message > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-form input,
  .inline-form select,
  .inline-form button,
  .inline-form .small-button,
  .row-form input,
  .row-form select,
  .row-form button,
  .row-form .small-button,
  .row-form input[type="number"] {
    width: 100%;
    min-width: 0;
  }

  .row-form label {
    align-items: stretch;
    flex-direction: column;
  }

  .table-wrap {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    background: transparent;
  }

  thead {
    display: none;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  th,
  td {
    width: 100%;
    max-width: none;
    border-bottom: 0;
    padding: 8px 0;
    overflow-wrap: anywhere;
  }

  td + td {
    border-top: 1px solid var(--line-soft);
  }

  td[data-label] {
    display: grid;
    grid-template-columns: minmax(84px, .34fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  td[data-label]::before {
    content: attr(data-label);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 780;
  }

  td[data-label] > * {
    min-width: 0;
  }

  .progress-cell {
    min-width: 0;
  }

  .job-detail-body {
    max-width: 100%;
  }

  .job-detail-grid,
  .course-picker-row {
    grid-template-columns: 1fr;
  }

  .modal-backdrop,
  .captcha-modal {
    align-items: stretch;
    padding: 12px;
  }

  .modal-panel,
  .captcha-modal__panel {
    max-height: calc(100vh - 24px);
  }

  .modal-head,
  .modal-actions,
  .captcha-modal__head,
  .captcha-modal__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .announcement-modal {
    align-items: stretch;
    padding: 10px;
  }

  .announcement-panel {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .announcement-item {
    padding: 12px;
  }

  .announcement-item-head,
  .announcement-admin-item summary {
    flex-direction: column;
  }

  .modal-head .small-button,
  .modal-actions button,
  .captcha-modal__actions button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .card {
    padding: 16px;
  }

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

  .stat {
    min-height: 104px;
  }

  .account-card-head,
  .account-card-body,
  .account-card-actions {
    padding: 14px;
  }

  .account-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .account-status {
    align-self: flex-start;
  }

  .account-side,
  .account-edit-grid,
  .account-card-actions {
    grid-template-columns: 1fr;
  }

  .account-card-actions {
    justify-content: stretch;
  }

  .settings-compact-card {
    padding: 16px;
  }

  .settings-card-head,
  .speed-preset-card summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .speed-preset-card summary small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .account-card-actions .small-button,
  .account-card-actions button.small-button,
  .form-footer button,
  .page-actions .small-button,
  .page-actions button {
    width: 100%;
  }

  .course-chip {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .auth-panel {
    padding: 66px 24px 28px;
  }

  .auth-panel::before {
    padding: 0 24px;
  }
}

@media (max-width: 420px) {
  .topbar {
    width: min(92vw, 320px);
  }

  .topbar .nav-group a,
  .topbar .nav-footer span,
  .topbar .logout-form button {
    min-height: 42px;
    font-size: 13px;
  }

  .modal-form,
  .course-picker-list {
    padding: 16px;
  }

  .toast-stack,
  .alert:not(.inline) {
    top: 70px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  td[data-label] {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
