:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-soft: #111827;
  --panel: rgba(17, 24, 39, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.2);
  --text: #eef2ff;
  --muted: #a7b0c3;
  --muted-2: #77839a;
  --primary: #2dd4bf;
  --primary-strong: #14b8a6;
  --blue: #60a5fa;
  --accent-warm: #f59e0b;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-warm-soft: rgba(245, 158, 11, 0.1);
  --amber: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 8px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(140deg, var(--accent-soft), transparent 34%),
    linear-gradient(220deg, var(--accent-warm-soft), transparent 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body.theme-light {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-soft: #e8eef6;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.12);
  --text: #172033;
  --muted: #64748b;
  --muted-2: #7b8798;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--primary) 10%, transparent), transparent 34%),
    linear-gradient(220deg, color-mix(in srgb, var(--blue) 10%, transparent), transparent 30%),
    #f5f7fb;
}

body.palette-emerald {
  --primary: #2dd4bf;
  --primary-strong: #0f766e;
  --blue: #3b82f6;
  --accent-warm: #f59e0b;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --accent-warm-soft: rgba(245, 158, 11, 0.1);
}

body.palette-sky {
  --primary: #0ea5e9;
  --primary-strong: #0369a1;
  --blue: #22c55e;
  --accent-warm: #facc15;
  --accent-soft: rgba(14, 165, 233, 0.15);
  --accent-warm-soft: rgba(34, 197, 94, 0.1);
}

body.palette-indigo {
  --primary: #6366f1;
  --primary-strong: #4338ca;
  --blue: #06b6d4;
  --accent-warm: #f59e0b;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --accent-warm-soft: rgba(6, 182, 212, 0.1);
}

body.palette-crimson {
  --primary: #e11d48;
  --primary-strong: #be123c;
  --blue: #0ea5e9;
  --accent-warm: #f97316;
  --accent-soft: rgba(225, 29, 72, 0.13);
  --accent-warm-soft: rgba(14, 165, 233, 0.1);
}

body.palette-graphite {
  --primary: #94a3b8;
  --primary-strong: #475569;
  --blue: #22c55e;
  --accent-warm: #eab308;
  --accent-soft: rgba(148, 163, 184, 0.13);
  --accent-warm-soft: rgba(234, 179, 8, 0.12);
}

body.palette-violet {
  --primary: #a78bfa;
  --primary-strong: #7c3aed;
  --blue: #6366f1;
  --accent-warm: #f59e0b;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --accent-warm-soft: rgba(99, 102, 241, 0.1);
}

body.palette-rose {
  --primary: #fb7185;
  --primary-strong: #e11d48;
  --blue: #60a5fa;
  --accent-warm: #f59e0b;
  --accent-soft: rgba(251, 113, 133, 0.14);
  --accent-warm-soft: rgba(96, 165, 250, 0.1);
}

body.palette-amber {
  --primary: #fbbf24;
  --primary-strong: #d97706;
  --blue: #38bdf8;
  --accent-warm: #22c55e;
  --accent-soft: rgba(251, 191, 36, 0.14);
  --accent-warm-soft: rgba(56, 189, 248, 0.1);
}

body.theme-light label {
  color: #26364f;
}

body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  background: #ffffff;
  color: var(--text);
}

body.theme-light input:focus,
body.theme-light textarea:focus,
body.theme-light select:focus {
  background: #ffffff;
}

body.theme-light th {
  color: #475569;
  background: #eef4fb;
}

body.theme-light td {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.theme-light tr:hover td {
  background: rgba(15, 23, 42, 0.025);
}

body.theme-light .hero-login {
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.16), transparent 36%),
    linear-gradient(225deg, rgba(96, 165, 250, 0.16), transparent 34%),
    #f7fafc;
}

body.theme-light .login-header h1,
body.theme-light .install-card h1 {
  color: #102033;
}

body.theme-light .login-option,
body.theme-light .login-card,
body.theme-light .install-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.13);
}

body.theme-light .login-copy .muted {
  color: #405169;
}

body.theme-light .login-feature-row span {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.12);
  color: #1f2f46;
}

body.theme-light .admin-login-link {
  color: #53657d;
}

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

img,
video,
iframe {
  max-width: 100%;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(45, 212, 191, 0.8);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.14);
  background: rgba(15, 23, 42, 0.94);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: #dbeafe;
  font-size: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: top;
}

th {
  color: #cbd5e1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: left;
  background: rgba(15, 23, 42, 0.72);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.13);
  backdrop-filter: blur(14px);
}

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

.header-brand > span:last-child {
  min-width: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: visible;
}

.nav-menu-group {
  position: relative;
}

.nav-menu-group summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  cursor: pointer;
  list-style: none;
  user-select: none;
  white-space: nowrap;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.nav-menu-group summary:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 212, 191, 0.22);
}

.nav-menu-group summary > i {
  color: var(--primary);
}

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

.nav-menu-group summary::after {
  content: "\f107";
  font-family: "Font Awesome 6 Free";
  font-size: 11px;
  font-weight: 900;
  color: var(--muted-2);
  transition: transform .16s ease;
}

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

.nav-menu-group summary small {
  color: var(--muted-2);
  font-size: 11px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-menu-group.active summary,
.nav-menu-group[open] summary {
  color: var(--text);
  border-color: rgba(45, 212, 191, 0.24);
  background: rgba(45, 212, 191, 0.1);
}

.nav-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 95;
  min-width: 240px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 46%),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.nav-menu-dropdown .nav-link {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle-form,
.mobile-theme-form {
  margin: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.user-chip strong,
.user-chip small {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  color: var(--muted);
  font-size: 11px;
}

.mobile-nav-panel {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.brand img {
  max-height: 48px;
  border-radius: var(--radius);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--amber));
  color: #06101a;
  font-weight: 900;
}

.brand-mark i {
  font-size: 19px;
}

.brand-title {
  display: block;
  font-weight: 800;
  line-height: 1.15;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.nav-group-title {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 18px 10px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: var(--radius);
  color: var(--muted);
  border: 1px solid transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(45, 212, 191, 0.12);
  color: var(--text);
  border-color: rgba(45, 212, 191, 0.22);
}

.nav-icon {
  width: 22px;
  text-align: center;
  color: var(--primary);
}

.notification-button,
.header-message-button {
  position: relative;
}

.notification-button span,
.header-message-button span {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}

.notification-panel {
  position: fixed;
  z-index: 90;
  top: 74px;
  right: 16px;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

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

.notification-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.notification-item i {
  color: var(--primary);
}

.notification-item strong,
.notification-item small {
  display: block;
}

.notification-item small {
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-footer {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  flex-shrink: 0;
}

.main {
  padding: 28px;
  min-width: 0;
  width: min(1440px, 100%);
  margin: 0 auto;
}

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(45, 212, 191, .28), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(245, 158, 11, .20), transparent 24%),
    linear-gradient(rgba(5, 10, 24, .42), rgba(5, 10, 24, .90)),
    url("https://images.unsplash.com/photo-1542296332-2e44a996aa0d?q=80&w=2000&auto=format&fit=crop") center/cover;
}

.login-panel {
  width: min(920px, 100%);
  display: grid;
  gap: 22px;
}

.login-split {
  width: min(1120px, 100%);
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  align-items: center;
  gap: 32px;
}

.login-header {
  padding: 10px;
  border-radius: 18px;
}

.login-header {
  text-align: center;
}

.login-copy {
  text-align: left;
  color: white;
}

.login-header h1 {
  margin: 16px 0 8px;
  font-size: clamp(34px, 6vw, 62px);
}

.login-copy h1 {
  max-width: 720px;
  margin-top: 22px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: .98;
}

.login-copy p {
  max-width: 560px;
  font-size: 17px;
  line-height: 1.65;
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 34%),
    rgba(15, 23, 42, 0.88);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.login-card h2 {
  margin: 0;
  font-size: 26px;
}

.login-card p {
  margin: 0;
  line-height: 1.55;
}

.login-minimal {
  background: var(--login-bg,
    radial-gradient(circle at 50% 0, color-mix(in srgb, var(--primary) 22%, transparent), transparent 32%),
    radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--accent-warm) 18%, transparent), transparent 30%),
    linear-gradient(145deg, #08111f, #020617)) !important;
}

body.theme-light .login-minimal {
  background: var(--login-bg,
    radial-gradient(circle at 50% 0, color-mix(in srgb, var(--primary) 18%, transparent), transparent 34%),
    radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 30%),
    linear-gradient(145deg, #eef4fb, #ffffff)) !important;
}

.login-centered {
  width: min(var(--login-card-width, 430px), 100%);
  justify-self: center;
  text-align: left;
  gap: 20px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: 24px;
  border-color: color-mix(in srgb, var(--primary) 34%, rgba(255, 255, 255, .16));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .035)),
    rgba(15, 23, 42, var(--login-card-alpha, .88));
  box-shadow: 0 34px 90px rgba(0, 0, 0, .38);
}

body.theme-light .login-centered {
  color: #172033;
  border-color: rgba(15, 23, 42, .1);
  background: rgba(255, 255, 255, var(--login-card-alpha, .9));
  box-shadow: 0 28px 70px rgba(15, 23, 42, .13);
}

.login-logo {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  margin: 0 auto 2px;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.login-logo.no-logo-frame {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-logo img {
  width: var(--login-logo-width, 92px);
  height: var(--login-logo-height, 92px);
  max-width: min(100%, var(--login-logo-width, 92px));
  max-height: var(--login-logo-height, 92px);
  object-fit: contain;
}

.login-heading {
  text-align: center;
  display: grid;
  gap: 6px;
}

.login-heading h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.12;
}

.login-heading p {
  max-width: 34rem;
  margin: 0 auto;
}

.login-centered form {
  gap: 16px;
}

.login-centered input {
  min-height: 54px;
  border-radius: 14px;
}

.login-centered input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--primary);
}

.login-centered .button {
  min-height: 54px;
  border-radius: 14px;
  font-size: 16px;
}

.remember-login {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.two-factor-card {
  width: min(500px, 100%);
}

.two-factor-logo {
  width: 96px;
  height: 96px;
  border-radius: 26px;
}

.two-factor-logo img {
  max-width: 74px;
  max-height: 74px;
}

.two-factor-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}

.two-factor-heading > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #04111f;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.two-factor-heading h1 {
  margin: 0;
  font-size: 24px;
}

.totp-setup-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.totp-setup-box code {
  display: block;
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--line));
  border-radius: 12px;
  background: rgba(2, 6, 23, .28);
  color: var(--text);
  font-size: 15px;
  letter-spacing: .06em;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

body.theme-light .totp-setup-box code {
  background: rgba(15, 23, 42, .04);
}

.two-factor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.two-factor-actions form {
  margin: 0;
}

.login-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.login-feature-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.48);
  color: #eef2ff;
  font-size: 13px;
  font-weight: 800;
}

.admin-login-link {
  justify-self: center;
  color: #c9d3e6;
}

.not-found-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-shell .not-found-page {
  min-height: calc(100vh - 160px);
}

.not-found-card {
  width: min(620px, 100%);
  text-align: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, var(--accent-soft), transparent 42%),
    var(--panel);
}

.not-found-code {
  display: inline-grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: 14px;
  border-radius: 28px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), var(--accent-warm));
  font-size: 30px;
  font-weight: 950;
}

.not-found-card h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
}

.not-found-card .row {
  justify-content: center;
}

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

.login-option {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: rgba(17, 24, 39, 0.76);
  box-shadow: var(--shadow);
  transition: transform .16s ease, border-color .16s ease;
}

.login-option:hover {
  transform: translateY(-3px);
  border-color: rgba(45, 212, 191, 0.45);
}

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

.page-head h1,
.page-head h2,
.card h2,
.card h3 {
  margin: 0;
}

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

.is-muted {
  opacity: .55;
}

.small {
  font-size: 12px;
}

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

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

.row.between {
  justify-content: space-between;
}

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

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

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
}

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

.license-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 310px;
}

.license-actions form {
  margin: 0;
}

.license-extend-form {
  display: flex;
  flex: 1 1 230px;
  gap: 8px;
  align-items: center;
}

.license-extend-form select {
  min-width: 118px;
}

.license-actions .button {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.result-filter-card {
  margin-bottom: 16px;
}

.result-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.result-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 760px);
  gap: 16px;
  align-items: start;
  padding: 18px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.list-toolbar h2 {
  margin: 0;
}

.list-toolbar p {
  margin: 6px 0 0;
}

.list-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 230px) auto auto;
  gap: 10px;
  align-items: center;
}

.list-filter-form input,
.list-filter-form select {
  min-height: 48px;
  width: 100%;
}

.list-filter-form .button {
  min-height: 48px;
  white-space: nowrap;
}

.table-card .page-head form.row {
  max-width: 100%;
}

.table-card .page-head form.row input {
  width: min(220px, 100%);
}

.table-card .page-head form.row select {
  width: min(210px, 100%);
}

.assignment-card h2 {
  font-size: 18px;
}

.assignment-picker {
  max-height: 390px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.select-visible-option {
  margin-bottom: 12px;
  border-style: dashed;
  background: rgba(45, 212, 191, .08);
}

.pool-select-list {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

.pool-import-form .option {
  align-items: flex-start;
}

.import-strip {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(240px, 1fr);
  gap: 10px 16px;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.import-strip > .muted {
  min-width: 0;
  line-height: 1.45;
}

.personnel-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.personnel-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.personnel-summary-card span {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.personnel-summary-card strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.personnel-summary-card small {
  color: var(--muted);
  font-weight: 800;
}

.personnel-list-card table td {
  vertical-align: middle;
}

.personnel-import-panel {
  display: grid;
  grid-template-columns: 1fr;
}

.personnel-import-panel summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--text);
}

.personnel-import-panel[open] {
  gap: 12px;
}

.import-form {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 10px;
  align-items: end;
}

.file-input-label {
  display: grid;
  gap: 7px;
  margin: 0;
}

.file-input-label > span {
  font-weight: 800;
  color: var(--text);
}

.file-input-label input[type="file"] {
  min-height: 48px;
  padding: 10px;
  cursor: pointer;
}

.assignment-page-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: min(760px, 52vw);
}

.assignment-select-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(360px, 100%);
}

.assignment-select-form select {
  width: min(280px, 32vw);
  min-height: 48px;
}

.assignment-select-form .button,
.assignment-page-actions > .button {
  min-height: 48px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.training-assignment-layout {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.assignment-settings,
.assignment-personnel-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.assignment-personnel-panel .assignment-picker {
  max-height: 560px;
}

.about-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, .16), rgba(96, 165, 250, .08)),
    var(--panel);
}

.about-infographic {
  justify-content: space-between;
  align-items: stretch;
  overflow: hidden;
}

.about-hero-copy {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 860px;
}

.about-hero .brand-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.about-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
  min-width: min(440px, 100%);
}

.about-metric-strip span,
.about-chip-grid span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.about-metric-strip strong {
  font-size: 18px;
}

.about-metric-strip small {
  color: var(--muted);
  font-weight: 700;
}

.about-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.about-flow-step {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(45, 212, 191, .08), rgba(255, 255, 255, .025));
  overflow: hidden;
}

.about-flow-step span {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #06101a;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.about-flow-step h3,
.about-flow-step p {
  margin: 0;
}

.about-flow-step p {
  color: var(--muted);
  line-height: 1.55;
}

.feature-card {
  display: grid;
  gap: 10px;
}

.feature-card > i {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), var(--amber));
}

.about-feature {
  min-height: 176px;
}

.about-stack-card {
  display: grid;
  grid-template-columns: minmax(240px, .75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: center;
}

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

.about-chip-grid span {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.about-chip-grid i {
  color: var(--primary);
}

.table-scroll {
  overflow-x: auto;
}

.stat {
  display: grid;
  gap: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 850;
}

.metric-card {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  isolation: isolate;
  animation: cardRise .42s ease both;
  border-color: rgba(45, 212, 191, 0.18);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.08), rgba(96, 165, 250, 0.04) 58%, transparent),
    var(--panel);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), #84cc16);
  opacity: .9;
}

.metric-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.metric-card .button {
  align-self: end;
}

.metric-ring {
  display: none;
}

.motivation-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-color: rgba(132, 204, 22, 0.22);
  background:
    linear-gradient(135deg, rgba(132, 204, 22, 0.10), rgba(45, 212, 191, 0.06)),
    var(--panel);
}

.motivation-card > span {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.motivation-card h2,
.motivation-card p {
  margin: 0;
}

.motivation-card h2 {
  font-size: 19px;
  line-height: 1.35;
}

.home-widget-grid {
  margin-bottom: 16px;
}

.app-install-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, .10), rgba(132, 204, 22, .05)),
    var(--panel);
}

.app-install-strip h2,
.app-install-strip p {
  margin: 0;
}

.install-app-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, .14), rgba(96, 165, 250, .07)),
    var(--panel);
}

.install-app-logo {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
  font-size: 32px;
}

.install-app-logo img {
  max-width: 70px;
  max-height: 70px;
  object-fit: contain;
}

.install-app-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.install-app-card > i {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
  font-size: 24px;
}

.install-app-card h2,
.install-app-card p {
  margin: 0;
}

.home-widget-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 16px;
  border-color: rgba(96, 165, 250, .18);
  background:
    linear-gradient(135deg, rgba(96, 165, 250, .09), rgba(45, 212, 191, .045)),
    var(--panel);
}

.home-widget-card h2,
.home-widget-card p {
  margin: 0;
}

.home-widget-card h2 {
  font-size: 20px;
  line-height: 1.25;
}

.home-widget-card > span {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #06101a;
  background: linear-gradient(135deg, #60a5fa, var(--primary));
}

.home-announcements {
  margin-top: 16px;
  overflow: hidden;
  padding: clamp(14px, 2vw, 18px);
  border-color: color-mix(in srgb, var(--primary) 18%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, transparent), rgba(96, 165, 250, .035)),
    var(--panel);
}

.home-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 0 0 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.home-section-head h2,
.home-section-head p {
  margin: 7px 0 0;
}

.announcement-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.announcement-stream-list {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.announcement-stream-list article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 16px;
  background: rgba(15, 23, 42, .32);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.announcement-stream-list article:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  background: rgba(15, 23, 42, .48);
}

.announcement-stream-list article.featured {
  padding: 15px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 13%, transparent), transparent 55%),
    rgba(15, 23, 42, .42);
}

.announcement-stream-list time {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

.announcement-stream-list time strong {
  font-size: 20px;
  line-height: 1;
}

.announcement-stream-list time span {
  font-size: 10px;
  font-weight: 900;
  opacity: .78;
}

.announcement-stream-list h3,
.announcement-stream-list p {
  margin: 0;
}

.announcement-stream-list h3 {
  font-size: 16px;
  line-height: 1.3;
}

.announcement-stream-list p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.announcement-stream-list article > a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--text);
  border: 1px solid var(--line);
}

.announcement-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
}

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

.library-filter-card {
  margin-bottom: 16px;
}

.library-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.library-total {
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 10px 16px;
  border: 1px solid rgba(45, 212, 191, .18);
  border-radius: 12px;
  background: rgba(45, 212, 191, .08);
}

.library-total strong {
  font-size: 22px;
  line-height: 1;
}

.library-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border-radius: 14px;
  border-color: rgba(45, 212, 191, .16);
  background:
    linear-gradient(135deg, rgba(96, 165, 250, .07), rgba(45, 212, 191, .04)),
    var(--panel);
}

.library-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.library-card-head h2,
.library-card-head p {
  margin: 0;
}

.library-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.library-card ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: var(--muted);
  line-height: 1.55;
}

.library-card li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-top: 1px solid rgba(148, 163, 184, .13);
}

.library-card li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.library-grid-dense .library-card {
  max-height: min(72vh, 660px);
  overflow: hidden;
}

.library-note-list {
  max-height: 500px;
  overflow: auto;
  padding-right: 6px;
}

.practice-result-card {
  display: flex;
  gap: 16px;
  align-items: center;
}

.practice-result-card h2,
.practice-result-card p {
  margin: 0;
}

.leaderboard-card {
  overflow: hidden;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.leaderboard-rank {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #06101a;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.leaderboard-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-person {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.leaderboard-person small {
  font-size: 12px;
  font-weight: 700;
}

.leaderboard-item em {
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.leaderboard-item.rank-1 .leaderboard-rank {
  background: linear-gradient(135deg, #facc15, #f97316);
}

.leaderboard-item.rank-2 .leaderboard-rank {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
}

.leaderboard-item.rank-3 .leaderboard-rank {
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  white-space: nowrap;
}

.badge.success {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.1);
}

.badge.danger {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.1);
}

.badge.warn {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  cursor: pointer;
  font-weight: 700;
  transition: transform .12s ease, background .16s ease, border-color .16s ease;
}

.button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.button.primary {
  color: #06101a;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.button.blue {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.32);
}

.button.danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.3);
}

.button.ghost {
  background: transparent;
}

.button.wide {
  width: 100%;
}

.button.icon {
  min-width: 40px;
  padding: 9px;
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.notice.success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.12);
}

.notice.danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.notice.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}

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

.toast-stack.in-app-toast {
  top: 112px;
}

.toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  box-shadow: 0 22px 70px rgba(2, 6, 23, .35);
  animation: toast-in .28s ease-out both;
  transition: opacity .18s ease, transform .18s ease;
}

.toast-close {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  color: inherit;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, .62);
  backdrop-filter: blur(6px);
}

.confirm-dialog {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: 0 30px 90px rgba(2, 6, 23, .45);
}

.confirm-dialog h2,
.confirm-dialog p {
  margin: 0;
}

.confirm-dialog p {
  margin-top: 6px;
  color: var(--muted);
}

.confirm-dialog .row {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.confirm-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fbbf24;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .2);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab {
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.tab.active {
  color: #06101a;
  background: var(--primary);
  border-color: transparent;
  font-weight: 800;
}

.modalish {
  max-width: 960px;
  margin: 0 auto;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(45, 212, 191, 0.14);
  border: 1px solid rgba(45, 212, 191, 0.26);
  overflow: hidden;
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xray-canvas {
  position: relative;
  border-radius: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #020617;
  min-height: 240px;
  isolation: isolate;
  touch-action: auto;
  user-select: none;
  cursor: crosshair;
}

.xray-canvas.is-panning {
  cursor: grabbing;
}

.xray-canvas.is-zoomed {
  display: block;
  place-items: initial;
  cursor: grab;
}

.xray-canvas[data-xray-draw] {
  touch-action: none;
}

.xray-device {
  display: grid;
  gap: 10px;
}

.xray-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.42);
}

.xray-toolbar .button {
  min-width: 42px;
}

.exam-xray-device .xray-canvas {
  order: 1;
}

.exam-xray-device .xray-toolbar {
  order: 2;
  justify-content: center;
}

@media (min-width: 920px) {
  .exam-question-card[data-question-kind="xray"] {
    width: min(100%, 1080px);
    margin-inline: auto;
  }

  .exam-question-card[data-question-kind="xray"] > p,
  .exam-question-card[data-question-kind="xray"] .exam-xray-device,
  .exam-question-card[data-question-kind="xray"] .xray-answer-row,
  .exam-question-card[data-question-kind="xray"] .option-list {
    width: min(100%, 980px);
    margin-inline: auto;
  }

  .exam-xray-device {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .exam-xray-device .xray-canvas {
    grid-column: auto;
    grid-row: auto;
  }

  .exam-xray-device .xray-toolbar {
    grid-column: auto;
    grid-row: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-self: auto;
    justify-content: center;
  }
}

.xray-key {
  width: auto;
  min-width: 72px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 10px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)),
    rgba(2, 6, 23, .34);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
  cursor: pointer;
}

.xray-key strong,
.xray-key i {
  font-size: 15px;
  line-height: 1;
}

.xray-key small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.1;
}

.xray-key.active {
  border-color: color-mix(in srgb, var(--primary) 62%, transparent);
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), var(--accent-warm));
}

.xray-key.active small {
  color: rgba(6, 16, 26, .72);
}

.danger-key {
  border-color: rgba(248, 113, 113, .35);
}

.freehand-toolbar {
  justify-content: space-between;
}

.xray-canvas img {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center;
  transition: filter .16s ease, transform .16s ease;
}

.xray-canvas.is-zoomed img {
  margin: 0;
  max-height: none;
}

.exam-xray-canvas {
  aspect-ratio: 16 / 9;
  min-height: 0;
  max-height: min(62vh, 620px);
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, rgba(15, 23, 42, .92), rgba(2, 6, 23, .96)),
    #020617;
}

.exam-xray-canvas img {
  max-height: 100%;
}

.xray-canvas img[hidden] {
  display: none;
}

.xray-placeholder {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
  position: relative;
  z-index: 0;
}

.danger-box,
.answer-marker {
  position: absolute;
  pointer-events: none;
}

.xray-canvas-warning {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 8;
  max-width: calc(100% - 28px);
  transform: translateX(-50%);
  padding: 9px 12px;
  border: 1px solid rgba(239, 68, 68, .42);
  border-radius: 999px;
  color: #fee2e2;
  background: rgba(127, 29, 29, .86);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.danger-freehand {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.danger-freehand polygon {
  fill: rgba(239, 68, 68, 0.2);
  stroke: rgba(239, 68, 68, 0.95);
  stroke-width: .9;
}

.danger-freehand polyline {
  fill: none;
  stroke: #f87171;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.danger-box {
  border: 2px solid var(--danger);
  background: rgba(239, 68, 68, 0.14);
}

.answer-marker {
  width: 18px;
  height: 18px;
  z-index: 4;
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.25), 0 8px 22px rgba(0, 0, 0, 0.35);
}

.question-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.exam-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, .14), rgba(96, 165, 250, .08)),
    var(--panel);
  box-shadow: var(--shadow);
}

.exam-hero h1 {
  margin: 10px 0 6px;
  font-size: 28px;
}

.exam-meta {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.exam-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 800;
}

.exam-form {
  gap: 18px;
}

.exam-question-card {
  padding: 20px;
  border-radius: 16px;
}

.exam-question-card.time-warning {
  animation: exam-alarm .75s ease-in-out infinite;
}

@keyframes exam-alarm {
  0%, 100% {
    border-color: rgba(239, 68, 68, .45);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .18), 0 10px 35px rgba(0, 0, 0, 0.18);
  }
  50% {
    border-color: rgba(239, 68, 68, .95);
    box-shadow: 0 0 0 5px rgba(239, 68, 68, .16), 0 10px 35px rgba(0, 0, 0, 0.22);
  }
}

.exam-pager {
  position: static;
  z-index: 16;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.exam-pager > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-topline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.question-topline h2 {
  margin: 0 0 5px;
}

.question-number {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #84cc16);
  color: #06101a;
  font-weight: 900;
}

.xray-answer-row .button {
  margin-left: auto;
}

.answer-freehand polygon {
  fill: rgba(45, 212, 191, 0.16);
  stroke: rgba(45, 212, 191, 0.96);
}

.answer-freehand polyline {
  stroke: #5eead4;
}

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

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.chat-box {
  height: min(46vh, 420px);
  overflow-y: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .42), rgba(20, 184, 166, .05)),
    rgba(2, 6, 23, .18);
}

.message {
  width: fit-content;
  max-width: min(76%, 720px);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 10px 24px rgba(2, 6, 23, .12);
}

.message .row.between {
  gap: 12px;
  align-items: flex-start;
}

.message .row.between strong {
  font-size: 13px;
}

.message .row.between .small {
  font-size: 11px;
}

.message p {
  margin: 7px 0 0;
  line-height: 1.55;
}

.message.mine {
  justify-self: end;
  border-color: rgba(45, 212, 191, 0.28);
  border-radius: 16px 16px 5px 16px;
  background: rgba(45, 212, 191, 0.12);
}

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

.trainer-thread-list {
  display: grid;
  gap: 10px;
}

.trainer-thread-link {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.trainer-thread-link.active {
  border-color: rgba(45, 212, 191, 0.42);
  background: rgba(45, 212, 191, 0.12);
}

.trainer-thread-link small,
.trainer-thread-link span {
  color: var(--muted);
  font-size: 12px;
}

.trainer-conversation,
.trainer-human-card {
  display: grid;
  gap: 14px;
}

.trainer-human-chat {
  height: min(48vh, 460px);
}

.profile-hero {
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(96, 165, 250, 0.08)),
    rgba(17, 24, 39, 0.82);
  overflow: hidden;
}

.profile-page {
  font-weight: 430;
}

.profile-page .page-head h1 {
  font-size: 23px;
  font-weight: 650;
}

.profile-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 18px;
  align-items: center;
}

.profile-identity-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  position: relative;
  padding: 20px;
  border: 1px solid rgba(45, 212, 191, .22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 10%, rgba(45, 212, 191, .16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025)),
    rgba(15, 23, 42, .20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 22px 60px rgba(2, 6, 23, .18);
  overflow: hidden;
}

.profile-identity-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 14px 120px;
  height: 1px;
  background: linear-gradient(90deg, rgba(45, 212, 191, .56), transparent);
  opacity: .7;
}

.profile-avatar {
  width: 84px;
  height: 84px;
  font-size: 24px;
  border-radius: 26px;
  border-color: rgba(45, 212, 191, .36);
  box-shadow: 0 18px 45px rgba(2, 6, 23, .22), inset 0 0 0 1px rgba(255, 255, 255, .08);
  flex: 0 0 auto;
}

.profile-title {
  min-width: 0;
}

.profile-title h1 {
  margin: 0 0 6px;
  font-size: 25px;
  font-weight: 650;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.profile-title p {
  margin: 0 0 10px;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-validity-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.profile-page .stat-value {
  font-size: 19px;
  font-weight: 620;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.profile-stat-card {
  min-height: 128px;
  align-content: start;
  border-color: rgba(96, 165, 250, .18);
  background:
    linear-gradient(135deg, rgba(96, 165, 250, .10), rgba(45, 212, 191, .045)),
    var(--panel);
}

.profile-stat-card .metric-icon {
  width: 36px;
  height: 36px;
}

.profile-stat-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.profile-page .card h2,
.profile-page .card h3 {
  font-size: 17px;
  font-weight: 620;
}

.tpss-card {
  display: grid;
  position: relative;
  align-content: space-between;
  gap: 12px;
  min-height: 146px;
  padding: 16px;
  border: 1px solid rgba(45, 212, 191, .26);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(45, 212, 191, .16), transparent 36%),
    linear-gradient(145deg, rgba(15, 23, 42, .72), rgba(15, 23, 42, .35)),
    rgba(15, 23, 42, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 14px 38px rgba(2, 6, 23, .15);
  overflow: hidden;
}

.tpss-card::after {
  content: "";
  display: none;
}

.validity-card-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
}

.validity-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.validity-name {
  font-size: 14px;
  font-weight: 780;
  line-height: 1.1;
  color: var(--text);
}

.validity-card-head strong {
  grid-column: auto;
  justify-self: end;
  max-width: 104px;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 999px;
  background: rgba(15, 23, 42, .24);
  color: var(--text);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.05;
  text-align: center;
}

.tpss-card > .row.between.small {
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.ogg-card {
  border-color: color-mix(in srgb, var(--blue) 38%, var(--line));
  background:
    radial-gradient(circle at 96% 2%, rgba(96, 165, 250, .20), transparent 34%),
    linear-gradient(135deg, rgba(96, 165, 250, .14), rgba(245, 158, 11, .07)),
    rgba(15, 23, 42, .34);
  position: relative;
  overflow: hidden;
}

.ogg-card::after {
  display: none;
}

.ogg-card::before {
  content: "";
  display: none;
}

.ogg-card > * {
  position: relative;
}

.ogg-card .validity-icon {
  background: linear-gradient(135deg, #60a5fa, #f59e0b);
}

.tpss-meter {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(239, 68, 68, .18), rgba(245, 158, 11, .18), rgba(34, 197, 94, .18)),
    rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .18);
  overflow: visible;
}

.tpss-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--danger), var(--amber), var(--success));
  width: calc(var(--progress, 0) * 1%);
  min-width: 0;
  animation: timeFill .8s ease both;
  box-shadow: 0 0 20px rgba(45, 212, 191, .18);
}

.tpss-meter i {
  position: absolute;
  top: 50%;
  left: calc(var(--progress, 0) * 1%);
  width: 18px;
  height: 18px;
  border: 3px solid var(--panel-strong);
  border-radius: 50%;
  background: var(--primary);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 5px rgba(45, 212, 191, .16);
  animation: timeDot 1.6s ease-in-out infinite;
}

.ogg-card .tpss-meter {
  height: 12px;
  background:
    linear-gradient(90deg, rgba(96, 165, 250, .24), rgba(45, 212, 191, .16), rgba(245, 158, 11, .18)),
    rgba(148, 163, 184, .16);
}

.ogg-card .tpss-meter span {
  background: linear-gradient(90deg, #60a5fa, var(--primary), #f59e0b);
}

.ogg-card .tpss-meter i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 5px rgba(96, 165, 250, .14);
}

@keyframes timeFill {
  from { width: 0; }
  to { width: calc(var(--progress, 0) * 1%); }
}

@keyframes timeDot {
  0%, 100% { box-shadow: 0 0 0 5px rgba(45, 212, 191, .16); }
  50% { box-shadow: 0 0 0 9px rgba(45, 212, 191, .08); }
}

.profile-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.profile-list p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.profile-list strong {
  text-align: right;
  overflow-wrap: anywhere;
  font-weight: 580;
}

.certificate-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.certificate-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.certificate-item strong,
.certificate-item p {
  margin: 0;
}

.scope-picker {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

body.theme-light .card,
body.theme-light .table-card,
body.theme-light .question-card,
body.theme-light .exam-hero,
body.theme-light .message,
body.theme-light .option,
body.theme-light .content-preview {
  background: #ffffff;
}

body.theme-light .profile-hero {
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.15), rgba(96, 165, 250, 0.11)),
    #ffffff;
}

body.theme-light .tpss-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(241, 245, 249, .84)),
    #ffffff;
  border-color: rgba(20, 184, 166, .24);
}

body.theme-light .ogg-card {
  background:
    linear-gradient(135deg, rgba(96, 165, 250, .16), rgba(245, 158, 11, .09)),
    #ffffff;
}

body.theme-light .validity-card-head strong {
  background: rgba(255, 255, 255, .74);
  color: #0f172a;
}

body.theme-light .message.mine {
  background: rgba(20, 184, 166, 0.11);
}

body.theme-light .badge {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

body.theme-light .badge.success {
  color: #166534;
  border-color: rgba(22, 101, 52, 0.22);
  background: rgba(34, 197, 94, 0.13);
}

body.theme-light .badge.danger {
  color: #991b1b;
  border-color: rgba(153, 27, 27, 0.22);
  background: rgba(239, 68, 68, 0.13);
}

body.theme-light .badge.warn {
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.22);
  background: rgba(245, 158, 11, 0.16);
}

body.theme-light .xray-canvas {
  background: #e9eef6;
}

body.theme-light .xray-toolbar {
  background: #f8fafc;
}

body.theme-light .button:not(.primary):not(.danger) {
  color: #172033;
  background: #ffffff;
}

body.theme-light .button:not(.primary):not(.danger):hover {
  background: #f1f5f9;
}

body.theme-light .button.blue {
  color: #1d4ed8;
  background: rgba(96, 165, 250, 0.13);
}

body.theme-light .button.danger {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.12);
}

body.theme-light .notice {
  background: #ffffff;
}

body.theme-light .app-header,
body.theme-light .nav-menu-dropdown,
body.theme-light .notification-panel,
body.theme-light .mobile-nav-panel {
  background: #ffffff;
}

body.theme-light .notification-item {
  background: #f8fafc;
}

body.theme-light .nav-menu-group summary {
  background: #f8fafc;
}

body.theme-light .nav-menu-group.active summary,
body.theme-light .nav-menu-group[open] summary {
  background: rgba(20, 184, 166, 0.11);
}

body.theme-light .user-chip {
  background: #f8fafc;
}

.profile-list span {
  color: var(--muted);
}

.profile-recommendation p {
  line-height: 1.6;
}

.content-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.5);
}

.training-progress-line {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.training-progress-line span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #84cc16);
  transition: width .35s ease;
}

.training-view-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.training-sidebar {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 118px);
  overflow: auto;
}

.training-sidebar h2 {
  font-size: 18px;
}

.training-step-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.training-step-list h3 {
  margin: 12px 4px 4px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.training-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.training-step.current {
  color: var(--text);
  border-color: rgba(45, 212, 191, 0.34);
  background: rgba(45, 212, 191, 0.11);
}

.training-step.done {
  border-color: rgba(34, 197, 94, 0.28);
}

.training-step.locked {
  opacity: .58;
}

.training-step strong,
.training-step small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-step small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.training-step em {
  color: var(--muted-2);
  font-size: 11px;
  font-style: normal;
}

.step-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.12);
  color: var(--primary);
}

.training-content-panel {
  min-width: 0;
}

.training-viewer {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.22);
  overflow: hidden;
}

.training-video-player {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.training-video-player video {
  width: 100%;
  max-height: 66vh;
  border-radius: 10px;
  background: #000;
}

.document-booklet {
  min-height: 68vh;
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, .2), transparent 12%, transparent 88%, rgba(15, 23, 42, .2)),
    rgba(255, 255, 255, 0.04);
}

.booklet-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pdf-canvas-wrap {
  min-height: 58vh;
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  background: #e5e7eb;
}

.pdf-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}

.booklet-frame {
  width: 100%;
  height: 68vh;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.document-placeholder,
.training-link-card {
  min-height: 320px;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.document-placeholder > i,
.training-link-card > i {
  color: var(--primary);
  font-size: 38px;
}

.training-image-view {
  padding: 12px;
  text-align: center;
}

.training-image-view img {
  max-height: 70vh;
  border-radius: 10px;
  object-fit: contain;
}

.training-step-actions {
  margin-top: 16px;
}

.training-time-guard {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.guard-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.guard-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #84cc16);
  transition: width .3s ease;
}

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

.settings-tab-shell {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}

.settings-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-tab-nav button {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.settings-tab-nav button.active {
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.settings-section {
  display: grid;
  gap: 16px;
}

.settings-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
}

.settings-section h2 i {
  color: var(--primary);
}

.settings-savebar {
  position: sticky;
  bottom: 16px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.code-textarea {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  tab-size: 2;
}

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

.leaderboard-board {
  overflow: hidden;
  padding: 0;
  border-radius: 16px;
}

.leaderboard-board-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, .09), rgba(96, 165, 250, .06)),
    rgba(255, 255, 255, .02);
}

.leaderboard-board-head h2,
.leaderboard-board-head p {
  margin: 8px 0 0;
}

.leaderboard-mini-podium {
  display: flex;
  align-items: end;
  gap: 8px;
}

.leaderboard-mini-podium span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: #06101a;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #84cc16);
}

.leaderboard-mini-podium strong {
  font-size: 12px;
}

.leaderboard-mini-podium .rank-1 {
  height: 72px;
  background: linear-gradient(135deg, #facc15, #f97316);
}

.leaderboard-mini-podium .rank-2 {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
}

.leaderboard-mini-podium .rank-3 {
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

.leaderboard-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 10px;
}

.leaderboard-summary span {
  display: grid;
  gap: 3px;
  min-width: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .045);
}

.leaderboard-summary strong {
  font-size: 24px;
  line-height: 1;
}

.leaderboard-summary small {
  color: var(--muted);
  font-weight: 800;
}

.leaderboard-table {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.leader-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(250px, auto);
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018)),
    rgba(255, 255, 255, .018);
}

.leader-row > div {
  min-width: 0;
}

.leader-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.leader-row.rank-1 {
  border-color: rgba(250, 204, 21, .32);
  background: linear-gradient(135deg, rgba(250, 204, 21, .12), rgba(255, 255, 255, .03));
}

.leader-row.rank-2 {
  border-color: rgba(148, 163, 184, .30);
}

.leader-row.rank-3 {
  border-color: rgba(245, 158, 11, .28);
}

.leader-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 8px;
}

.leader-stats span {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 11px;
  background: rgba(2, 6, 23, .16);
}

.leader-stats strong {
  font-size: 16px;
  white-space: normal;
}

.leader-stats small {
  margin: 0;
  font-size: 11px;
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}

.leaderboard-podium h2 {
  font-size: 19px;
}

.leaderboard-podium p {
  grid-column: 2;
  margin: 0;
  color: var(--primary);
  font-weight: 800;
}

.leaderboard-showcase {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.leaderboard-quote {
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.15;
  color: rgba(238, 242, 255, .72);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.leaderboard-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 14px;
}

.leaderboard-overview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 104px;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, .18), transparent 38%),
    linear-gradient(135deg, rgba(30, 41, 59, .82), rgba(15, 23, 42, .7));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 24px 70px rgba(2, 6, 23, .28);
}

.leaderboard-overview-card p {
  margin: 0 0 12px;
  color: #dbeafe;
  font-size: 15px;
}

.leaderboard-progress {
  height: 12px;
  overflow: hidden;
  margin: 8px 0 16px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .22);
}

.leaderboard-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e5735c, #f2d35d);
}

.leaderboard-gauge {
  width: 94px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(15, 23, 42, .96) 0 48%, transparent 49%),
    conic-gradient(#f5d56a calc(var(--score) * 1%), rgba(148, 163, 184, .2) 0);
}

.leaderboard-gauge strong {
  font-size: 23px;
}

.leaderboard-total {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.leaderboard-total span {
  color: #dbeafe;
  font-size: 16px;
  line-height: 1.05;
}

.leaderboard-total strong {
  font-size: 26px;
}

.leaderboard-showcase .leaderboard-board {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, .24);
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, .18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(245, 158, 11, .12), transparent 34%),
    rgba(15, 23, 42, .72);
}

.leaderboard-board-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.leaderboard-board-title h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
}

.leaderboard-board-title span {
  color: #f5d56a;
  font-size: 24px;
}

.leaderboard-showcase .leader-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 82px;
  padding: 12px 14px;
  margin-top: 10px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, .12), rgba(255, 255, 255, .035)),
    rgba(15, 23, 42, .52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.leader-identity {
  display: grid;
  grid-template-columns: 42px 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.leader-avatar {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: visible;
  isolation: isolate;
  border: 3px solid rgba(132, 204, 22, .72);
  border-radius: 50%;
  background: rgba(148, 163, 184, .18);
}

.leader-avatar img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  clip-path: circle(50%);
  object-fit: cover;
  overflow: hidden;
}

.leader-avatar i {
  font-size: 22px;
  color: var(--muted);
}

.leader-avatar em {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06101a;
  background: #a3e635;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.leader-identity strong {
  display: block;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.05;
}

.leader-identity small {
  display: block;
  margin-top: 4px;
  color: rgba(226, 232, 240, .72);
  font-size: 13px;
  font-weight: 650;
}

.leaderboard-showcase .leader-stats {
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  align-self: center;
  min-width: 190px;
  padding: 8px 10px;
  border: 1px solid rgba(45, 212, 191, .28);
  border-radius: 999px;
  background: rgba(20, 184, 166, .18);
}

.leaderboard-showcase .leader-stats span {
  border: 0;
  border-radius: 0;
  padding: 0 10px;
  background: transparent;
  text-align: center;
}

.leaderboard-showcase .leader-stats span + span {
  border-left: 1px solid rgba(226, 232, 240, .25);
}

.leaderboard-showcase .leader-stats strong {
  font-size: 18px;
}

.leaderboard-showcase .rank-2 {
  border-color: rgba(245, 213, 106, .46);
}

.leaderboard-showcase .rank-3 {
  border-color: rgba(245, 213, 106, .36);
}

.trainer-recommendation {
  margin-top: 16px;
}

.exam-review-card.correct {
  border-color: rgba(34, 197, 94, 0.28);
}

.exam-review-card.wrong {
  border-color: rgba(239, 68, 68, 0.3);
}

.review-xray-image {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #020617;
}

.review-xray-image img {
  display: block;
  width: 100%;
}

.review-marker {
  display: block;
}

.simulator-grid {
  align-items: start;
}

.simulator-card h2,
.simulator-console-head h2 {
  margin: 0;
}

.xray-simulator-stage {
  max-width: 1180px;
  margin-inline: auto;
}

.simulator-device {
  display: grid;
  grid-template-areas:
    "head"
    "screen"
    "toolbar"
    "bag"
    "interpret";
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(45, 212, 191, .22);
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, .12), transparent 34%),
    linear-gradient(145deg, rgba(15, 23, 42, .92), rgba(2, 6, 23, .96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .03);
}

.simulator-console-head,
.simulator-bag-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.simulator-console-head {
  grid-area: head;
}

.simulator-counter {
  min-width: 84px;
  padding: 10px 12px;
  border: 1px solid rgba(45, 212, 191, .25);
  border-radius: 12px;
  color: var(--primary);
  background: rgba(2, 6, 23, .28);
  font-weight: 900;
  text-align: center;
}

.simulator-toolbar {
  grid-area: toolbar;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  padding: 12px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .72), rgba(2, 6, 23, .62)),
    rgba(2, 6, 23, .5);
}

.simulator-xray-canvas {
  grid-area: screen;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: grid;
  place-items: center;
  border: 10px solid rgba(15, 23, 42, .86);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(45, 212, 191, .04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(45, 212, 191, .04) 1px, transparent 1px),
    #020617;
  background-size: 36px 36px;
}

.simulator-xray-canvas img {
  margin: auto;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.simulator-bag-controls {
  grid-area: bag;
  flex-wrap: wrap;
  padding-top: 2px;
}

.baggage-interpretation {
  grid-area: interpret;
  padding: 12px 14px;
  border: 1px solid rgba(45, 212, 191, .22);
  border-radius: 12px;
  color: var(--text);
  background: rgba(2, 6, 23, .32);
  line-height: 1.55;
  font-weight: 650;
}

.feedback-question-list,
.feedback-survey-list {
  display: grid;
  gap: 12px;
}

.feedback-question-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1.4fr) minmax(160px, .5fr) minmax(0, .9fr) 44px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}

.feedback-question-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
  font-weight: 900;
}

.feedback-survey-card,
.feedback-response,
.feedback-user-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
}

.feedback-response-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.feedback-response-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 900;
}

.feedback-response p {
  margin: 0;
}

.certificate-template-card {
  display: grid;
  gap: 12px;
}

.certificate-template-preview {
  aspect-ratio: 1.414 / 1;
  position: relative;
  display: grid;
  align-content: end;
  gap: 7px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--accent, #2dd4bf) 42%, var(--line));
  border-radius: 12px;
  background:
    linear-gradient(0deg, var(--accent, #2dd4bf) 0 8px, transparent 8px),
    linear-gradient(90deg, var(--accent, #2dd4bf) 0 7px, transparent 7px),
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent, #2dd4bf) 16%, transparent), transparent 34%),
    #ffffff;
  color: #0f172a;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

.certificate-template-preview::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #2dd4bf) 38%, transparent);
  pointer-events: none;
}

.certificate-template-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
}

.certificate-template-preview span {
  color: color-mix(in srgb, var(--accent, #2dd4bf) 62%, #0f172a);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.certificate-template-preview strong {
  font-size: 22px;
  line-height: 1.05;
}

.certificate-template-preview small {
  color: #475569;
  font-weight: 800;
}

.dropzone {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(45, 212, 191, .42);
  border-radius: 12px;
  background: rgba(45, 212, 191, .055);
}

.dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(45, 212, 191, .12);
}

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

.certificate-live-preview {
  position: relative;
  aspect-ratio: 1.414 / 1;
  overflow: hidden;
  min-height: 360px;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid color-mix(in srgb, var(--accent, #2dd4bf) 54%, var(--line));
  border-radius: 16px;
  background:
    radial-gradient(circle at 86% 22%, color-mix(in srgb, var(--accent, #2dd4bf) 14%, transparent), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(241, 245, 249, .9)),
    #ffffff;
  color: #172033;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .18);
}

.certificate-live-preview::before,
.certificate-live-preview::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.certificate-live-preview::before {
  inset: 24px;
  border: 2px solid color-mix(in srgb, var(--accent, #2dd4bf) 48%, transparent);
}

.certificate-live-preview::after {
  right: -70px;
  top: -70px;
  width: 240px;
  height: 240px;
  border: 28px solid color-mix(in srgb, var(--accent, #2dd4bf) 18%, transparent);
  border-radius: 50%;
}

.cert-preview-ribbon {
  position: absolute;
  inset: auto 0 0 0;
  height: 12px;
  background: linear-gradient(90deg, var(--accent, #2dd4bf), color-mix(in srgb, var(--accent, #2dd4bf) 56%, #0f172a));
}

.cert-draggable {
  position: absolute;
  z-index: 2;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.cert-draggable.dragging {
  cursor: grabbing;
  outline: 2px dashed var(--accent, #2dd4bf);
  outline-offset: 4px;
}

.cert-preview-top,
.cert-preview-signature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cert-preview-top {
  max-width: min(68%, 520px);
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .08);
}

.cert-preview-top strong {
  overflow-wrap: anywhere;
  font-size: clamp(14px, 2vw, 20px);
}

.cert-logo-slot {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  color: #0f766e;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .1);
}

.cert-logo-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.cert-preview-main {
  max-width: min(70%, 560px);
  display: grid;
  gap: 9px;
}

.cert-preview-main span {
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.cert-preview-main h3 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.05;
}

.cert-preview-main p {
  max-width: 680px;
  margin: 0;
  color: #475569;
  line-height: 1.55;
}

.cert-preview-details {
  display: grid;
  gap: 6px;
  min-width: 250px;
  padding: 13px 16px;
  border-left: 6px solid var(--accent, #2dd4bf);
  border-radius: 0 12px 12px 0;
  background: rgba(241, 245, 249, .92);
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.cert-preview-signature {
  min-width: 190px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 10px;
  border-top: 2px solid var(--accent, #2dd4bf);
  text-align: left;
}

.cert-signature-image {
  display: block;
  min-height: 26px;
}

.cert-signature-image img {
  display: block;
  width: auto;
  max-width: 150px;
  max-height: 48px;
  object-fit: contain;
}

.cert-preview-signature b {
  color: #0f172a;
}

.cert-preview-signature small {
  display: block;
  color: #64748b;
}

.filter-disclosure {
  padding: 12px;
}

.filter-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
  list-style: none;
}

.filter-disclosure > summary::-webkit-details-marker {
  display: none;
}

.filter-disclosure[open] > summary {
  margin-bottom: 12px;
}

.guide-timeline {
  display: grid;
  gap: 12px;
}

.guide-step {
  display: grid;
  grid-template-columns: 38px 42px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.guide-index,
.guide-step > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #06101a;
  background: linear-gradient(135deg, var(--primary), #84cc16);
  font-weight: 900;
}

.guide-step > i {
  color: var(--primary);
  background: rgba(45, 212, 191, .12);
}

.guide-step h2,
.guide-step p {
  margin: 0;
}

html[dir="rtl"] .header-nav,
html[dir="rtl"] .row,
html[dir="rtl"] .simulator-console-head,
html[dir="rtl"] .simulator-bag-controls {
  direction: rtl;
}

body.theme-light .assignment-settings,
body.theme-light .assignment-personnel-panel,
body.theme-light .training-viewer,
body.theme-light .training-step,
body.theme-light .leaderboard-item,
body.theme-light .leader-row,
body.theme-light .leaderboard-board-head,
body.theme-light .leaderboard-summary span,
body.theme-light .leader-stats span,
body.theme-light .import-strip,
body.theme-light .announcement-stream-list article,
body.theme-light .certificate-item,
body.theme-light .scope-picker,
body.theme-light .chat-box,
body.theme-light .about-metric-strip span,
body.theme-light .about-flow-step,
body.theme-light .about-chip-grid span,
body.theme-light .training-time-guard,
body.theme-light .document-booklet,
body.theme-light .home-widget-card,
body.theme-light .library-card,
body.theme-light .exam-pager,
body.theme-light .settings-tab-shell,
body.theme-light .feedback-question-row,
body.theme-light .feedback-survey-card,
body.theme-light .feedback-response,
body.theme-light .feedback-user-card {
  background: #f8fafc;
}

body.theme-light .leaderboard-quote {
  color: #314155;
  text-shadow: none;
}

body.theme-light .leaderboard-overview-card,
body.theme-light .leaderboard-showcase .leaderboard-board,
body.theme-light .leaderboard-showcase .leader-row {
  background: #ffffff;
}

body.theme-light .leaderboard-showcase .leaderboard-board {
  border-color: rgba(15, 23, 42, .12);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
}

body.theme-light .leaderboard-showcase .leader-row {
  box-shadow: none;
  color: #172033;
}

body.theme-light .leaderboard-showcase .leader-stats {
  border-color: rgba(15, 118, 110, .18);
  background: rgba(20, 184, 166, .1);
}

body.theme-light .leaderboard-showcase .leader-stats span + span {
  border-left-color: rgba(15, 23, 42, .14);
}

body.theme-light .leaderboard-overview-card p,
body.theme-light .leaderboard-total span,
body.theme-light .leader-identity small {
  color: #475569;
}

body.theme-light .certificate-template-preview {
  background: #ffffff;
}

body.theme-light .simulator-device {
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, .13), transparent 34%),
    linear-gradient(145deg, #f8fafc, #e2e8f0);
}

body.theme-light .xray-key {
  background: #ffffff;
}

body.theme-light .home-announcements .announcement-stream-list article {
  background: rgba(255, 255, 255, .72);
}

.install-page {
  background:
    linear-gradient(rgba(5, 10, 24, .62), rgba(5, 10, 24, .88)),
    url("https://images.unsplash.com/photo-1555949963-ff9fe0c870eb?q=80&w=2000&auto=format&fit=crop") center/cover;
}

.install-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.install-card {
  width: min(760px, 100%);
  padding: 28px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.install-card h1 {
  margin: 16px 0 8px;
}

.mobile-menu-button {
  display: none;
}

.hide-mobile {
  display: initial;
}

@media (max-width: 980px) {
  .login-split {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .login-copy {
    text-align: center;
  }

  .login-copy h1,
  .login-copy p {
    margin-left: auto;
    margin-right: auto;
  }

  .login-feature-row {
    justify-content: center;
  }

  .app-shell {
    display: block;
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .header-brand {
    gap: 9px;
  }

  .header-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .header-brand img {
    max-height: 40px;
  }

  .brand-title {
    max-width: 58vw;
    font-size: 14px;
  }

  .brand-subtitle,
  .header-nav,
  .user-chip,
  .logout-form {
    display: none;
  }

  .mobile-nav-panel {
    position: fixed;
    z-index: 90;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 340px);
    height: 100dvh;
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 18px 14px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }

  body.nav-open .mobile-nav-panel {
    transform: translateX(0);
  }

  body.nav-open::before {
    content: "";
    position: fixed;
    z-index: 84;
    inset: 0;
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(3px);
  }

  .mobile-logout {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .topbar {
    display: flex;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .main {
    padding: 18px;
    padding-bottom: 28px;
  }

  .exam-hero {
    grid-template-columns: 1fr;
  }

  .exam-form {
    padding-bottom: 112px;
  }

  .exam-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .exam-meta span {
    justify-content: center;
  }

  .exam-pager {
    position: fixed;
    left: 10px;
    right: 10px;
    display: grid;
    grid-template-columns: 1fr;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 90;
    border-radius: 16px;
  }

  .exam-pager .row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .xray-answer-row .button {
    margin-left: 0;
    width: 100%;
  }

  .profile-hero-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-identity-card {
    width: 100%;
    max-width: 520px;
    justify-content: center;
  }

  .profile-title {
    display: grid;
    justify-items: center;
  }

  .profile-badges {
    justify-content: center;
  }

  .profile-validity-stack {
    width: 100%;
    max-width: 520px;
  }

  .training-assignment-layout,
  .training-view-layout,
  .leaderboard-hero,
  .leaderboard-board-head,
  .library-filter-bar,
  .personnel-summary-grid,
  .library-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .leaderboard-item .muted,
  .leaderboard-item em {
    grid-column: 2;
  }

  .leaderboard-mini-podium {
    justify-content: start;
  }

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

  .leader-stats {
    grid-column: 1 / -1;
  }

  .training-sidebar {
    position: static;
    max-height: none;
  }

  .profile-title h1 {
    font-size: 22px;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .login-options {
    grid-template-columns: 1fr;
  }

  .page-head {
    display: grid;
  }

  .list-toolbar,
  .import-strip,
  .about-stack-card {
    grid-template-columns: 1fr;
  }

  .about-infographic {
    display: grid;
    grid-template-columns: 1fr;
  }

  .list-filter-form,
  .import-form,
  .assignment-select-form {
    grid-template-columns: 1fr;
    display: grid;
    width: 100%;
  }

  .assignment-page-actions {
    display: grid;
    grid-template-columns: 1fr;
    max-width: none;
    width: 100%;
  }

  .assignment-select-form select,
  .assignment-page-actions .button,
  .list-filter-form .button,
  .import-form .button {
    width: 100%;
  }

  .about-flow,
  .about-metric-strip,
  .about-chip-grid,
  .leaderboard-summary {
    grid-template-columns: 1fr;
  }

  .leaderboard-showcase {
    gap: 10px;
  }

  .leaderboard-filter-bar {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .leaderboard-overview-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
  }

  .leaderboard-quote {
    font-size: 19px;
    line-height: 1.25;
  }

  .leaderboard-gauge {
    width: 78px;
    justify-self: start;
  }

  .leaderboard-total {
    justify-items: start;
    text-align: left;
  }

  .leaderboard-showcase .leaderboard-board {
    padding: 12px;
    border-radius: 14px;
  }

  .leaderboard-showcase .leader-row {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
    padding: 10px;
    border-radius: 13px;
  }

  .leader-identity {
    grid-template-columns: 34px 46px minmax(0, 1fr);
    gap: 9px;
  }

  .leader-avatar {
    width: 44px;
    height: 44px;
  }

  .leader-identity strong {
    font-size: 17px;
  }

  .leader-identity small {
    font-size: 12px;
  }

  .leaderboard-showcase .leader-stats {
    min-width: 0;
    width: 100%;
    border-radius: 12px;
    padding: 8px;
  }

  .feedback-question-row {
    grid-template-columns: 1fr;
  }

  .feedback-question-index {
    width: 100%;
  }

  .filter-disclosure {
    padding: 10px;
    border-radius: 12px;
  }

  .filter-disclosure > summary {
    min-height: 42px;
  }

  .library-filter-bar {
    grid-template-columns: 1fr;
  }

  .certificate-live-preview {
    border-radius: 12px;
    padding: 16px;
    min-height: 300px;
  }

  .cert-logo-slot {
    width: 48px;
    height: 48px;
  }

  .cert-preview-main h3 {
    font-size: 24px;
  }

  .cert-preview-top,
  .cert-preview-main,
  .cert-preview-details {
    max-width: 82%;
  }

  .cert-preview-details {
    min-width: 0;
    font-size: 11px;
    padding: 9px 10px;
  }

  .guide-step {
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
  }

  .guide-step > i {
    display: none;
  }

  .guide-index {
    width: 32px;
    height: 32px;
  }

  .simulator-console-head,
  .simulator-bag-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .simulator-bag-controls {
    gap: 8px;
  }

  .simulator-bag-controls .button {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding-inline: 10px;
  }

  .simulator-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
  }

  .xray-key {
    min-width: 0;
    min-height: 50px;
    padding: 7px 5px;
  }

  .xray-key strong,
  .xray-key i {
    font-size: 13px;
  }

  .xray-key small {
    font-size: 9px;
  }

  .simulator-xray-canvas {
    min-height: 0;
    max-height: none;
    border-width: 6px;
    border-radius: 14px;
  }
}

@media (max-width: 980px) and (orientation: landscape) {
  .main {
    padding: 12px;
  }

  .xray-simulator-stage {
    max-width: none;
  }

  .simulator-device {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 150px);
    grid-template-areas:
      "head head"
      "screen toolbar"
      "bag toolbar"
      "interpret toolbar";
    gap: 10px;
    padding: 10px;
  }

  .simulator-console-head {
    flex-direction: row;
    align-items: center;
  }

  .simulator-toolbar {
    grid-template-columns: 1fr;
    align-content: start;
    max-height: calc(100dvh - 104px);
    overflow-y: auto;
    padding: 8px;
  }

  .xray-key {
    min-width: 0;
    padding: 7px 8px;
  }

  .simulator-xray-canvas {
    min-height: 0;
    max-height: calc(100dvh - 136px);
  }

  .simulator-bag-controls {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .simulator-bag-controls .button {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding-inline: 9px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .hero-login.login-minimal {
    background: var(--login-mobile-bg, var(--login-bg)) !important;
    background-size: cover !important;
    background-position: center !important;
  }

  th,
  td {
    padding: 11px 10px;
  }

  .hide-mobile {
    display: none;
  }

  .card,
  .install-card,
  .login-card,
  .login-option {
    padding: 14px;
    border-radius: 10px;
  }

  .main {
    padding: 12px;
    padding-bottom: 24px;
  }

  .page-head {
    gap: 10px;
    margin-bottom: 14px;
  }

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

  .page-head .button,
  .page-head form,
  .page-head select {
    width: 100%;
  }

  .button {
    min-height: 42px;
    justify-content: center;
  }

  .motivation-card {
    padding: 12px;
    gap: 10px;
    align-items: flex-start;
    border-radius: 13px;
  }

  .motivation-card > span {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 14px;
    flex: 0 0 auto;
  }

  .motivation-card h2 {
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
  }

  .home-widget-grid {
    gap: 10px;
  }

  .home-widget-card {
    min-height: auto;
    padding: 12px;
    gap: 10px;
    border-radius: 13px;
  }

  .home-widget-card > span {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 14px;
  }

  .home-widget-card h2 {
    font-size: 16px;
    line-height: 1.3;
  }

  .app-install-strip,
  .install-app-hero {
    grid-template-columns: 1fr;
    display: grid;
    text-align: left;
  }

  .app-install-strip .button {
    width: 100%;
  }

  .install-app-logo {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    font-size: 22px;
  }

  .library-card {
    padding: 14px;
    border-radius: 13px;
  }

  .library-card-head {
    align-items: flex-start;
  }

  .library-card li {
    padding: 8px 0 8px 18px;
  }

  .home-announcements {
    padding: 12px;
  }

  .xray-simulator-stage {
    margin-inline: -6px;
  }

  .simulator-device {
    padding: 10px;
  }

  .simulator-xray-canvas {
    aspect-ratio: auto;
    height: calc((100vw - 20px) * .5625 + 7px);
    min-height: 214px;
  }

  .announcement-stream-head {
    align-items: flex-start;
  }

  .announcement-stream-list article {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
  }

  .announcement-stream-list article > a {
    display: none;
  }

  .announcement-stream-list time {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .chat-box {
    height: min(58vh, 460px);
    padding: 10px;
  }

  .message {
    max-width: 92%;
  }

  .certificate-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .certificate-item .button {
    grid-column: 2;
    justify-self: start;
  }

  .profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 22px;
  }

  .profile-identity-card {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
  }

  .profile-validity-stack {
    gap: 8px;
  }

  .tpss-card {
    padding: 10px;
    border-radius: 12px;
  }

  .validity-card-head {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 6px 8px;
    text-align: left;
  }

  .validity-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    font-size: 12px;
  }

  .validity-name {
    font-size: 12px;
  }

  .validity-card-head strong,
  .tpss-card .small {
    font-size: 11px;
  }

  .validity-card-head strong {
    max-width: 82px;
    padding: 4px 6px;
  }

  .leaderboard-board-head {
    padding: 16px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-copy p {
    font-size: 15px;
  }

  .exam-meta {
    grid-template-columns: 1fr;
  }

  .exam-hero {
    padding: 14px;
    border-radius: 12px;
  }

  .exam-hero h1 {
    font-size: 24px;
  }

  .exam-xray-canvas {
    aspect-ratio: auto;
    height: calc((100vw - 28px) * .5625 + 10px);
    max-height: calc(62vh + 10px);
  }

  .question-card {
    padding: 14px;
  }

  .question-topline {
    align-items: flex-start;
  }

  .exam-pager {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 10px;
    border-radius: 12px;
  }

  .xray-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .xray-toolbar .button {
    min-width: 0;
    padding-inline: 8px;
  }

  .training-step {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .training-step em {
    grid-column: 2;
  }

  .document-booklet,
  .booklet-frame {
    min-height: 58vh;
    height: 58vh;
  }

  .pdf-canvas-wrap {
    min-height: 48vh;
    padding: 8px;
  }

  .settings-savebar {
    bottom: 8px;
  }

  .toast-stack,
  .toast-stack.in-app-toast {
    top: auto;
    right: 10px;
    bottom: 12px;
    width: min(420px, calc(100vw - 20px));
  }

  .settings-tab-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-tab-nav button {
    justify-content: center;
    width: 100%;
  }

  .row {
    align-items: stretch;
  }

  .row .button,
  .row input,
  .row select {
    flex: 1 1 auto;
  }

  .license-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .license-extend-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .license-actions .button,
  .license-actions select {
    width: 100%;
  }

  .result-filter-grid,
  .trainer-thread-layout {
    grid-template-columns: 1fr;
  }

  .result-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .trainer-human-chat {
    height: min(54vh, 420px);
  }
}
