:root {
  --bg: #f1eadc;
  --surface: #fffaf0;
  --surface-soft: #eee3d1;
  --surface-muted: #f7f0e4;
  --text: #17233d;
  --muted: #625f59;
  --line: #d2c3ae;
  --line-strong: #a99b87;
  --primary: #184fbf;
  --primary-hover: #123e98;
  --primary-soft: #e7edff;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #6f4b00;
  --warning-soft: #fff1ba;
  --danger: #b53b2d;
  --danger-hover: #8f2d22;
  --danger-soft: #fde8df;
  --coral: #e65c43;
  --mustard: #efc744;
  --ink: #173e78;
  --focus: #7b38d2;
  --shadow-card: 0 16px 42px rgba(46, 40, 31, .09);
  --shadow-float: 0 22px 60px rgba(23, 35, 61, .18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --motion-fast: 160ms;
  --motion-standard: 220ms;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    linear-gradient(rgba(23, 35, 61, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 35, 61, .025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

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

button,
select,
summary,
[type="checkbox"],
[type="file"] {
  cursor: pointer;
}

button,
a,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}

a {
  color: var(--primary);
  text-underline-offset: .18em;
}

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

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--primary);
  font-weight: 750;
  text-decoration: none;
  transform: translateY(calc(-100% - 20px));
  transition: transform var(--motion-fast) ease-out;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 68px;
}

.admin-page .shell {
  width: min(1400px, calc(100% - 40px));
}

.auth-page .shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding-block: 32px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  text-wrap: balance;
}

.traffic-dashboard-grid {
  display: grid;
  gap: 18px;
}

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

.traffic-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-muted, #e9eef6);
}

.traffic-progress-bar {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--color-primary, #1e40af);
  transition: width 220ms ease;
}

.traffic-detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.traffic-detail-list dt,
.traffic-detail-list dd {
  margin: 0;
}

.traffic-detail-list dt {
  color: var(--text-muted, #5d6b82);
  font-size: .88rem;
}

.traffic-detail-list dd {
  font-size: 1.05rem;
  font-weight: 700;
}

.traffic-provider-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.traffic-provider-form h3,
.traffic-provider-form p {
  grid-column: 1 / -1;
  margin: 0;
}

.traffic-provider-form label {
  display: grid;
  gap: 6px;
  color: var(--text-muted, #5d6b82);
  font-size: .88rem;
}

@media (max-width: 760px) {
  .traffic-metrics,
  .traffic-detail-list,
  .traffic-provider-form {
    grid-template-columns: 1fr;
  }
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-family: Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  font-weight: 650;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -.02em;
  font-family: Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  font-weight: 650;
}

h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}

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

.muted,
.sync-note,
.field-help {
  color: var(--muted);
}

.section-intro,
.auth-intro {
  max-width: 68ch;
  margin-bottom: 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar-actions,
.actions,
.form-actions,
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  flex: 0 0 auto;
}

.button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    transform var(--motion-fast) ease;
}

.button:hover,
.small-button:hover {
  text-decoration: none;
}

.button:active,
.small-button:active {
  transform: translateY(1px);
}

.button:disabled,
.small-button:disabled {
  opacity: .52;
  cursor: wait;
  transform: none;
}

.button[aria-busy="true"],
.small-button[aria-busy="true"] {
  box-shadow: none;
}

.button-primary,
.small-button-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(30, 64, 175, .2);
}

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

.button-secondary,
.small-button {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface);
}

.button-secondary:hover,
.small-button:hover {
  color: var(--primary-hover);
  border-color: #7191c7;
  background: var(--surface-soft);
}

.button-quiet {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}

.button-quiet:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, .72);
}

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

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

.small-button-warning {
  color: var(--warning);
  border-color: #e7bf7f;
  background: var(--warning-soft);
}

.small-button-warning:hover {
  color: #663605;
  border-color: #c98a2c;
  background: #ffedc4;
}

.small-button {
  padding: 9px 13px;
  font-size: .875rem;
}

.input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #9eacc0;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  background: var(--surface);
  transition:
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    background-color var(--motion-fast) ease;
}

.input:hover {
  border-color: #7085a3;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .13);
}

textarea.input {
  min-height: 88px;
  resize: vertical;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0 6px 0 0;
  accent-color: var(--primary);
  vertical-align: middle;
}

input[type="file"] {
  max-width: 100%;
  padding-block: 7px;
}

label {
  color: #2f3b50;
  font-weight: 700;
}

.form-stack,
.stacked-form,
.account-form {
  display: grid;
  gap: 10px;
}

.form-stack {
  margin-top: 28px;
}

.form-stack label:not(:first-child) {
  margin-top: 4px;
}

.stacked-form {
  margin-top: 18px;
}

.stacked-form label,
.account-form label,
.settings-grid label,
.plan-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #2f3b50;
  font-size: .875rem;
  font-weight: 700;
}

.field-help,
.form-help {
  margin: 0;
  font-size: .84rem;
  line-height: 1.55;
}

.form-error {
  margin: 2px 0 0;
  border: 1px solid #f4b8b3;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #842018;
  background: var(--danger-soft);
  font-weight: 650;
}

.hero-card,
.panel,
.metric {
  border: 1px solid var(--line);
  background: var(--surface);
}

.hero-card,
.panel {
  border-radius: var(--radius-lg);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 32px;
  padding: 34px;
  box-shadow: var(--shadow-card);
}

.hero-primary {
  position: relative;
  overflow: hidden;
  border-color: #b8cafa;
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, .2), transparent 18rem),
    linear-gradient(135deg, #fff 0%, #f4f7ff 72%, #ebf2ff 100%);
}

.hero-primary::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #3b82f6, var(--primary));
  content: "";
}

.hero-card p:not(.eyebrow, .notice) {
  max-width: 62ch;
  margin-bottom: 18px;
  color: var(--muted);
}

.actions {
  flex-direction: column;
  align-items: stretch;
  min-width: 220px;
}

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

.import-panel {
  position: relative;
  display: grid;
  gap: 22px;
  overflow: hidden;
  border: 1px solid #b8cafa;
  border-radius: var(--radius-lg);
  padding: 34px;
  color: #fffaf0;
  background: var(--ink);
  box-shadow: 10px 10px 0 rgba(230, 92, 67, .85);
}

.import-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--mustard), #e65c43);
  content: "";
}

.import-heading,
.client-choice,
.client-choice-actions,
.official-downloads {
  min-width: 0;
}

.import-heading > p:not(.eyebrow) {
  max-width: 66ch;
  color: rgba(255, 250, 240, .82);
  font-size: 1rem;
  line-height: 1.65;
}

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

.client-choice {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(255, 250, 240, .28);
  border-radius: 12px;
  padding: 20px;
  color: var(--ink);
  background: rgba(255, 250, 240, .96);
  box-shadow: 0 12px 30px rgba(10, 24, 47, .18);
}

.client-choice-primary {
  border-top: 5px solid var(--mustard);
}

.client-choice h3,
.client-choice p {
  margin: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.client-choice h3 {
  font-size: 1.2rem;
}

.client-choice p:not(.eyebrow) {
  color: #40516c;
  font-size: 1rem;
  line-height: 1.6;
}

.client-choice-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.client-choice .button,
.client-choice .text-link,
.download-link,
.backup-downloads summary {
  min-height: 44px;
}

.client-choice .text-link {
  display: inline-flex;
  align-items: center;
}

.compatibility-notice {
  margin: 0;
  border-left: 4px solid var(--mustard);
  padding: 12px 14px;
  color: var(--ink);
  background: #fff4c8;
  line-height: 1.6;
}

.official-downloads {
  display: grid;
  gap: 16px;
  border-top: 1px solid rgba(255, 250, 240, .24);
  padding-top: 22px;
}

.official-downloads h3,
.official-downloads p {
  margin: 0;
}

.official-downloads p:not(.eyebrow) {
  margin-top: 6px;
  color: rgba(255, 250, 240, .82);
}

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

.download-link {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(255, 250, 240, .35);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fffaf0;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease;
}

.download-link span {
  color: rgba(255, 250, 240, .76);
  font-size: .86rem;
}

.download-link:hover,
.download-link:focus-visible,
.download-link[data-recommended="true"] {
  color: var(--ink);
  background: var(--mustard);
  transform: translateY(-2px);
}

.download-link:hover span,
.download-link:focus-visible span,
.download-link[data-recommended="true"] span {
  color: #354055;
}

.backup-downloads {
  border: 1px solid rgba(255, 250, 240, .26);
  border-radius: 8px;
  padding: 0 14px 14px;
}

.backup-downloads summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
}

.backup-downloads .text-link {
  color: var(--mustard);
}

.karing-choice {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 10px;
  border: 1px solid rgba(255, 250, 240, .32);
  padding: 20px;
  background: rgba(255, 250, 240, .08);
}

.karing-choice-primary {
  border-top: 5px solid var(--mustard);
}

.karing-choice h3,
.karing-choice p,
.karing-fallback span,
.embedded-browser-notice span {
  margin: 0;
}

.karing-choice h3 {
  color: inherit;
  font-size: 1.15rem;
}

.karing-choice .button {
  margin-top: auto;
}

.karing-launch-status {
  font-weight: 750;
}

.karing-fallback,
.embedded-browser-notice {
  display: grid;
  gap: 8px;
  border-left: 4px solid var(--mustard);
  padding: 12px 14px;
  color: var(--ink);
  background: #fff4c8;
}

.karing-fallback[hidden],
.embedded-browser-notice[hidden] {
  display: none;
}

.karing-fallback .text-link {
  color: #173e78;
}

.embedded-browser-notice {
  grid-column: 1 / -1;
  margin-top: 14px;
}

.embedded-browser-notice .small-button {
  justify-self: start;
}

.karing-safe-actions {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.hero-primary .karing-safe-actions .text-link {
  color: #fffaf0;
}

.connection-path {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 540px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.connection-path li {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 8px;
  color: #34445e;
  font-size: .84rem;
  font-weight: 750;
}

.connection-path li:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 15px;
  left: 32px;
  width: calc(100% - 32px);
  height: 2px;
  background: #a9bfee;
  content: "";
}

.connection-path span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid #91aae0;
  border-radius: 50%;
  color: var(--primary);
  background: #fff;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.panel {
  padding: 28px;
  box-shadow: 0 8px 24px rgba(35, 62, 103, .05);
}

.panel + .panel {
  margin-top: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.panel-heading > * {
  min-width: 0;
}

.metrics {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

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

.usage-progress-card {
  grid-column: span 2;
  background: linear-gradient(145deg, #f8fbff, #eef5ff);
}

.usage-progress-heading,
.usage-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.usage-progress-heading strong {
  color: var(--accent-strong);
  font-size: 1.35rem;
}

.usage-progress-track {
  height: 12px;
  margin: 18px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce7f5;
}

.usage-progress-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #3876d4, #2ca67a);
  transition: width 240ms ease;
}

.usage-progress-warning {
  background: linear-gradient(90deg, #d99535, #d75b54);
}

.usage-progress-meta {
  color: var(--muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.usage-progress-unavailable {
  margin: 16px 0 0;
}

.metrics-admin {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 24px;
}

.metric {
  min-width: 0;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 5px 16px rgba(35, 62, 103, .045);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric span {
  margin-bottom: 8px;
  font-size: .875rem;
  font-weight: 650;
}

.metric strong {
  display: block;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.metric small {
  margin-top: 6px;
  font-size: .78rem;
}

.metric-attention {
  border-color: #ead4ab;
  background: linear-gradient(180deg, #fff, #fffaf0);
}

.metric-system {
  border-color: #c5d5f1;
  background: linear-gradient(180deg, #fff, #f2f6ff);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  margin-left: 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
}

.status-badge-active {
  color: #05603a;
  border-color: #a8e0c3;
  background: var(--success-soft);
}

.status-badge-invited,
.status-badge-provisioning,
.status-badge-enabling {
  color: #714006;
  border-color: #efd09c;
  background: var(--warning-soft);
}

.status-badge-disabled,
.status-badge-error {
  color: #8b2119;
  border-color: #f0b4ae;
  background: var(--danger-soft);
}

.status-badge-neutral {
  color: #33445e;
  border-color: #cbd6e5;
  background: #f1f5f9;
}

.status-badge-recommended {
  color: #684800;
  border-color: #dfbf54;
  background: #fff1b8;
}

.status {
  font-size: .86rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-active,
.status-available {
  color: var(--success);
}

.status-disabled,
.status-error,
.status-unavailable {
  color: var(--danger);
}

.notice {
  border: 1px solid #edce95;
  border-left: 4px solid #c36b0c;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: #6a3907 !important;
  background: var(--warning-soft);
}

.portal-announcement {
  margin-bottom: 18px;
  border: 1px solid #adc3ef;
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: var(--text);
  background: var(--primary-soft);
}

.portal-announcement p {
  margin: 6px 0 0;
  line-height: 1.65;
}

.connection-panel,
.faq-panel {
  margin: 18px 0;
}

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

.inbound-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 16px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface-muted);
}

.inbound-card small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.inbound-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.privacy-note {
  margin: 16px 0 0;
  color: #40516c;
  font-size: .9rem;
  line-height: 1.65;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 16px 16px 54px;
  background: var(--surface-muted);
  counter-increment: step;
}

.steps li::before {
  position: absolute;
  top: 17px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  content: counter(step);
  font-size: .82rem;
  font-weight: 800;
}

.steps strong,
.steps span {
  display: block;
}

.steps span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--surface-muted);
}

.faq-list details[open] {
  border-color: #a8bee9;
  background: #f5f8ff;
}

.faq-list summary {
  min-height: 28px;
  color: var(--text);
  font-weight: 750;
}

.faq-list p {
  margin: 10px 0;
  max-width: 72ch;
  color: #40516c;
  line-height: 1.65;
}

.text-link {
  font-weight: 750;
}

.account-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr);
  align-items: start;
  gap: 28px;
}

.account-panel details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.account-panel summary {
  min-height: 44px;
  padding: 12px 15px;
  color: var(--primary);
  font-weight: 800;
}

.account-panel details[open] summary {
  border-bottom: 1px solid var(--line);
}

.account-form {
  padding: 16px;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  border: 1px solid #efb5b0;
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  color: #6f1d17;
  background: linear-gradient(135deg, #fff 0%, var(--danger-soft) 100%);
}

.danger-zone h2 {
  color: #842018;
}

.danger-zone p:last-child {
  margin-bottom: 0;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  color: var(--text);
  background: var(--surface);
}

.contact-card p {
  margin: 5px 0 0;
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.55;
}

.sync-note {
  margin: 18px 4px 0;
  font-size: .82rem;
  text-align: right;
}

.help-body {
  max-width: 78ch;
  white-space: pre-wrap;
  line-height: 1.8;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  width: max-content;
  max-width: min(420px, calc(100% - 48px));
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: #fff;
  background: #24324a;
  box-shadow: var(--shadow-float);
  font-weight: 700;
}

.toast[data-tone="success"] {
  background: #05603a;
}

.toast[data-tone="error"] {
  background: #912018;
}

.auth-card {
  position: relative;
  width: min(470px, 100%);
  overflow: hidden;
  border: 1px solid #cbd7e8;
  border-radius: 24px;
  padding: 38px;
  color: var(--text);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(30, 64, 175, .13);
}

.auth-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), #4f7ee8 62%, #8eb7ff);
  content: "";
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  color: #263957;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.brand-mark {
  display: inline-block;
  width: 25px;
  height: 25px;
  border: 7px solid var(--primary);
  border-radius: 8px 8px 8px 2px;
  background: #fff;
  box-shadow: 7px 7px 0 -4px #8eb7ff;
}

/* Admin workspace */
.admin-topbar {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.admin-notice {
  margin-bottom: 22px;
}

.admin-primary-section {
  margin-top: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.student-heading {
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.student-tools,
.table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.student-tools .input {
  width: auto;
  min-width: 135px;
}

.student-tools input[type="search"] {
  width: min(190px, 100%);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.student-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

.student-table th,
.student-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.student-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: #43516a;
  background: #f4f7fb;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .045em;
}

.student-table tbody tr {
  background: var(--surface);
  transition: background-color var(--motion-fast) ease;
}

.student-table tbody tr:hover {
  background: #f8faff;
}

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

.student-table td:first-child span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .8rem;
}

.student-table th:first-child,
.student-table td:first-child {
  padding-left: 18px;
}

.student-table th:last-child,
.student-table td:last-child {
  padding-right: 18px;
}

.student-table input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.empty {
  padding: 34px !important;
  color: var(--muted);
  text-align: center !important;
  white-space: normal !important;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  border-top: 1px solid var(--line);
  padding: 10px 22px;
  background: var(--surface-muted);
  font-size: .875rem;
}

.admin-section,
.advanced-settings-section {
  margin-top: 32px;
}

.section-heading {
  margin-bottom: 16px;
}

.admin-operations-grid,
.admin-controls,
.admin-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-operations-grid > *,
.admin-controls > *,
.admin-content-grid > * {
  min-width: 0;
}

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

.compact-panel {
  padding: 22px;
}

.compact-panel h2,
.compact-panel h3 {
  font-size: 1.18rem;
}

.faq-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.faq-admin-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .8rem;
}

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

.inbound-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inbound-detail {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
}

.inbound-detail code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: .9rem;
}

.inbound-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-identity-cell {
  min-width: 180px;
  white-space: normal !important;
}

.student-identity-cell > * {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-identity-cell .student-latest-note,
.student-identity-cell .student-internal-code {
  margin-top: 4px;
  color: var(--muted);
  font-size: .8rem;
}

.student-identity-cell .student-internal-code {
  color: var(--text);
  font-weight: 700;
}

.plan-card {
  display: grid;
  min-width: 0;
  gap: 18px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--ink);
  padding: 20px;
  background: var(--surface-muted);
}

.plan-card-header,
.plan-card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.plan-code {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.plan-summary {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
}

.plan-card h4 {
  margin: 4px 0 0;
  font-size: 1.25rem;
}

.plan-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.plan-badges .status-badge {
  margin-left: 0;
}

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

.plan-fields label {
  display: grid;
  min-width: 0;
  gap: 6px;
  font-size: .875rem;
}

.field-unit {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 650;
}

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

.plan-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  border: 0;
  padding: 0;
}

.plan-switches legend {
  width: 100%;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.plan-switches label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .84rem;
}

.plan-card-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.plan-save-status {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 750;
}

.plan-save-status[data-tone="warning"] { color: var(--warning); }
.plan-save-status[data-tone="success"] { color: var(--success); }
.plan-save-status[data-tone="error"] { color: var(--danger); }

.help-page .shell {
  width: min(1180px, calc(100% - 40px));
  padding-top: 24px;
}

.help-masthead {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border-radius: 28px;
  padding: 30px 38px 38px;
  color: #fffaf0;
  background:
    radial-gradient(circle at 84% 16%, rgba(239, 199, 68, .92) 0 8%, transparent 8.4%),
    linear-gradient(135deg, #15335f 0%, #173e78 54%, #245bb3 100%);
  box-shadow: var(--shadow-float);
}

.help-masthead::after {
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 410px;
  height: 410px;
  border: 1px solid rgba(255, 250, 240, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgba(255, 250, 240, .06), 0 0 0 108px rgba(255, 250, 240, .04);
  content: "";
}

.help-scenarios {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.help-scenarios a {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 88px;
  gap: 5px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  padding: 14px 16px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow-card);
  scroll-margin-top: 20px;
}

.help-scenarios a:hover,
.help-scenarios a:focus-visible {
  border-top-color: var(--coral);
  color: var(--primary-hover);
  background: var(--surface-soft);
}

.help-scenarios span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
}

.help-scenarios strong {
  line-height: 1.35;
}

.help-nav,
.help-brand,
.help-route,
.help-intro,
.help-contact,
.help-lightbox-bar {
  display: flex;
  align-items: center;
}

.help-nav {
  position: relative;
  z-index: 2;
  justify-content: space-between;
  gap: 20px;
}

.help-brand {
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.help-brand span:last-child {
  display: grid;
  line-height: 1.05;
}

.help-brand small {
  margin-top: 5px;
  font-size: .65rem;
  letter-spacing: .16em;
}

.help-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 730px;
  margin: 110px 0 80px;
}

.help-hero-copy h1 {
  max-width: 700px;
  margin-bottom: 22px;
  font-size: clamp(3.25rem, 8vw, 6.8rem);
  line-height: .92;
  letter-spacing: -.06em;
}

.help-hero-copy > p:last-child {
  max-width: 52ch;
  margin: 0;
  color: rgba(255, 250, 240, .84);
  font-size: 1.08rem;
}

.help-route {
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  gap: 10px 28px;
  border-top: 1px solid rgba(255, 250, 240, .3);
  padding-top: 22px;
}

.help-route span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
}

.help-route b {
  color: var(--mustard);
  font-size: .78rem;
  letter-spacing: .1em;
}

.button-light {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, .6);
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.button-light:hover {
  color: #173e78;
  background: #fffaf0;
}

.help-intro {
  align-items: flex-start;
  justify-content: space-between;
  gap: 50px;
  padding: 80px 4px 50px;
}

.help-intro > * {
  flex: 1;
}

.help-intro h2,
.help-section-heading h2,
.help-fallback h2,
.help-contact h2 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.06;
}

.help-version {
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.help-client-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 0;
}

.help-client-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
}

.help-client-tabs a:hover,
.help-client-tabs a:focus-visible,
.help-client-tabs a[aria-current="page"] {
  color: #fff;
  background: var(--primary);
}

.help-text-fallback {
  display: grid;
  gap: 10px;
  max-width: 820px;
  margin: 22px 0;
  padding-left: 1.4rem;
}

.help-text-fallback li {
  padding-left: 6px;
  line-height: 1.65;
}

.help-text-fallback strong,
.help-text-fallback span {
  display: block;
}

.help-text-fallback span {
  color: var(--muted);
}

.help-section,
.help-fallback,
.help-contact {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(28px, 5vw, 62px);
  background: rgba(255, 250, 240, .94);
  box-shadow: var(--shadow-card);
}

.help-section-heading {
  max-width: 690px;
  margin-bottom: 44px;
}

.help-section-heading > p:last-child {
  color: var(--muted);
}

.help-step-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-step {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 28px;
  border-top: 1px solid var(--line);
  padding: 42px 0;
  scroll-margin-top: 24px;
}

.help-step > article {
  min-width: 0;
}

.help-step-number {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 2.5rem;
  line-height: 1;
}

.help-step h3,
.help-trouble-card h3 {
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.help-progress {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.help-copy,
.help-faq-list p {
  max-width: 72ch;
  white-space: pre-wrap;
  line-height: 1.75;
}

.help-figure {
  margin: 28px 0 0;
}

.help-preview-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-muted);
}

.help-image-button {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  background: var(--surface-muted);
}

.help-image-button img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform var(--motion-standard) ease;
}

.help-image-button:hover img {
  transform: scale(1.012);
}

.help-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: .86rem;
}

.help-troubleshooting {
  color: #fffaf0;
  background: var(--ink);
}

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

.help-trouble-card {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  padding: 24px;
  background: rgba(255, 255, 255, .06);
}

.help-trouble-card > span {
  color: var(--mustard);
  font-weight: 800;
}

.help-trouble-card p strong {
  display: block;
  color: var(--mustard);
}

.help-fallback {
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}

.help-fallback p:not(.eyebrow) {
  max-width: 62ch;
  margin-inline: auto;
}

.help-checklist ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  counter-reset: help-check;
  list-style: none;
}

.help-checklist li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 3px 14px;
  border: 1px solid var(--line);
  padding: 18px;
  background: var(--surface-muted);
  counter-increment: help-check;
}

.help-checklist li::before {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--primary);
  font-weight: 850;
  content: counter(help-check, decimal-leading-zero);
}

.help-checklist span,
.help-faq-summary {
  color: var(--muted);
}

.help-faq-groups {
  display: grid;
  gap: 28px;
}

.help-faq-group h3 {
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 1.05rem;
}

.help-faq-list {
  display: grid;
  gap: 10px;
}

.help-faq-item {
  border: 1px solid var(--line);
  padding: 18px 20px;
  background: var(--surface-muted);
}

.help-faq-item h4 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.help-faq-summary {
  margin: 0;
}

.help-faq-item details {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.help-faq-list summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--primary);
  font-size: .9rem;
  font-weight: 800;
}

.help-faq-list details > :not(summary) {
  margin-left: 0;
}

.help-contact {
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 20px;
  color: #fffaf0;
  background: #15335f;
}

.help-contact > * {
  flex: 1;
}

.help-contact-template {
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, .07);
}

.help-contact-template span,
.help-contact-template code {
  display: block;
}

.help-contact-template span {
  margin-bottom: 10px;
  color: var(--mustard);
  font-weight: 800;
}

.help-contact-template code {
  margin-bottom: 18px;
  white-space: pre-wrap;
  font-family: inherit;
}

.help-lightbox {
  width: min(1100px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 20px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.help-lightbox::backdrop {
  background: rgba(10, 20, 38, .82);
}

.help-lightbox-bar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.help-lightbox-bar h2 {
  margin: 0;
  font-size: 1.2rem;
}

.help-lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.help-preview-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.help-admin-workspace {
  margin-top: 36px;
  scroll-margin-top: 20px;
}

.help-admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

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

.help-client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}

.help-client-grid [hidden] {
  display: none;
}

.help-platform-card {
  display: grid;
  gap: 5px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--text);
  text-align: left;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(35, 62, 103, .045);
  transition: border-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.help-platform-card:hover {
  border-color: #7191c7;
  transform: translateY(-2px);
}

.help-platform-card[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.help-platform-card span {
  font-size: 1.05rem;
  font-weight: 850;
}

.help-platform-card strong {
  color: var(--primary);
  font-size: .82rem;
}

.help-platform-card small {
  color: var(--muted);
}

.help-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 18px;
}

.help-admin-grid > .panel {
  min-width: 0;
  margin: 0;
}

.help-steps-card {
  grid-column: 1;
}

.help-step-editor-card {
  grid-column: 2;
  grid-row: 2 / span 2;
}

.help-step-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.help-step-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-muted);
}

.help-step-admin-row > div:first-child {
  display: grid;
  min-width: 0;
}

.help-step-admin-row span {
  color: var(--primary);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .06em;
}

.help-step-admin-row small {
  color: var(--muted);
}

.help-image-selection {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-muted);
}

.help-image-selection img {
  display: block;
  width: 100%;
  max-height: 220px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.help-image-selection > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

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

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

.visibility-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}

.visibility-options legend {
  padding: 0 6px;
  color: #2f3b50;
  font-size: .86rem;
  font-weight: 800;
}

.visibility-options label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: .86rem;
}

.advanced-settings-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 24px rgba(35, 62, 103, .04);
}

.advanced-settings-shell > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
  padding: 18px 24px;
  border-radius: inherit;
  list-style: none;
}

.advanced-settings-shell > summary::-webkit-details-marker {
  display: none;
}

.advanced-settings-shell > summary:hover {
  background: var(--surface-soft);
}

.advanced-settings-shell[open] > summary {
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface-soft);
}

.advanced-settings-shell > summary .eyebrow {
  display: block;
  margin-bottom: 5px;
}

.summary-hint {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: .86rem;
  font-weight: 800;
}

.summary-hint::after {
  display: inline-block;
  margin-left: 7px;
  content: "+";
  font-size: 1.1rem;
  line-height: 1;
}

.advanced-settings-shell[open] .summary-hint::after {
  content: "−";
}

.advanced-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
}

.advanced-settings-grid .panel {
  box-shadow: none;
}

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

.portal-settings-panel,
.admin-content-grid > *,
.advanced-settings-grid > * {
  min-width: 0;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.inline-form label,
.inline-form input[type="file"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

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

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

  .student-heading {
    flex-direction: column;
  }

  .student-tools {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .shell,
  .admin-page .shell {
    width: min(100% - 32px, 1120px);
    padding-top: 32px;
  }

  .hero-card {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

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

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

  .admin-operations-grid,
  .admin-controls,
  .admin-content-grid,
  .advanced-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .operation-wide,
  .advanced-wide {
    grid-column: auto;
  }

  .plan-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }
}

@media (max-width: 680px) {
  .shell,
  .admin-page .shell {
    width: min(100% - 24px, 1120px);
    padding: 24px 0 48px;
  }

  .auth-page .shell {
    padding-block: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .button {
    flex: 1 1 0;
  }

  .hero-card,
  .panel {
    padding: 21px;
    border-radius: 16px;
  }

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

  .metrics-admin,
  .metrics-student,
  .inbound-grid,
  .steps,
  .settings-grid,
  .plan-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric {
    padding: 17px;
  }

  .usage-progress-card {
    grid-column: auto;
  }

  .connection-path {
    margin-top: 20px;
  }

  .connection-path li {
    font-size: .76rem;
  }

  .connection-path li:not(:last-child)::after {
    left: 30px;
    width: calc(100% - 30px);
  }

  .steps li {
    min-height: 0;
  }

  .panel-heading,
  .danger-zone,
  .contact-card,
  .faq-admin-row,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .danger-zone {
    padding: 20px;
  }

  .danger-zone .button,
  .contact-card .button,
  .panel-heading > .button {
    width: 100%;
  }

  .sync-note {
    text-align: left;
  }

  .auth-card {
    width: 100%;
    border-radius: 18px;
    padding: 30px 22px;
  }

  .auth-brand {
    margin-bottom: 28px;
  }

  .student-heading {
    padding: 20px;
  }

  .student-tools,
  .table-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .student-tools .input,
  .student-tools input[type="search"],
  .student-tools .small-button {
    width: 100%;
  }

  .row-actions {
    max-width: min(78vw, 620px);
    flex-wrap: wrap;
  }

  .advanced-settings-shell > summary {
    align-items: flex-start;
    min-height: 78px;
    padding: 16px 18px;
  }

  .advanced-settings-grid {
    padding: 12px;
  }

  .advanced-settings-grid .panel {
    padding: 18px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }
}

@media (max-width: 390px) {
  .shell,
  .admin-page .shell {
    width: min(100% - 20px, 1120px);
  }

  h1 {
    font-size: 1.85rem;
  }

  .hero-card,
  .panel {
    padding: 18px;
  }

  .connection-path li {
    font-size: .7rem;
    letter-spacing: -.01em;
  }

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

  .topbar-actions .button {
    width: 100%;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .auth-page .shell {
    place-items: start center;
    padding-block: 18px;
  }

  .auth-brand {
    margin-bottom: 20px;
  }
}

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

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

/* Campus Pass editorial system */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  width: min(980px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.auth-cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(32px, 5vw, 62px);
  color: #fffaf0;
  background:
    linear-gradient(135deg, transparent 0 64%, rgba(239, 199, 68, .96) 64% 78%, transparent 78%),
    linear-gradient(20deg, rgba(230, 92, 67, .96) 0 20%, transparent 20%),
    var(--ink);
}

.auth-cover-admin {
  background:
    linear-gradient(135deg, transparent 0 66%, rgba(230, 92, 67, .94) 66% 80%, transparent 80%),
    linear-gradient(22deg, rgba(239, 199, 68, .94) 0 17%, transparent 17%),
    #102f60;
}

.auth-cover-activate {
  background:
    linear-gradient(135deg, transparent 0 66%, rgba(24, 79, 191, .96) 66% 80%, transparent 80%),
    linear-gradient(22deg, rgba(239, 199, 68, .95) 0 18%, transparent 18%),
    var(--coral);
}

.auth-cover-brand,
.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.auth-cover-brand strong,
.admin-brand strong,
.auth-brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.auth-cover-brand small,
.admin-brand small,
.auth-brand small {
  display: block;
  margin-top: 3px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.brand-mark-light {
  border-color: var(--mustard);
}

.cover-issue {
  margin-bottom: 18px;
  color: var(--mustard);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
}

.auth-cover-copy h2 {
  max-width: 12em;
  margin-bottom: 20px;
  color: inherit;
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -.055em;
}

.auth-cover-copy > p:last-child {
  max-width: 36em;
  margin: 0;
  color: rgba(255, 250, 240, .8);
}

.auth-cover-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .34);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.auth-layout .auth-card {
  width: auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: clamp(32px, 5vw, 58px);
  box-shadow: none;
}

.auth-layout .auth-card::before {
  display: none;
}

.pricing-section {
  position: relative;
  width: min(980px, 100%);
  margin-top: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: clamp(28px, 5vw, 52px);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.pricing-section::before {
  position: absolute;
  top: 0;
  right: clamp(24px, 6vw, 70px);
  width: 84px;
  height: 10px;
  background: var(--coral);
  content: "";
}

.pricing-section > h2 {
  max-width: 14em;
  margin-bottom: 28px;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
}

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

.pricing-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 5px solid var(--ink);
  padding: 24px 20px 20px;
  background: var(--surface-muted);
}

.pricing-card-recommended {
  border-color: var(--primary);
  border-top-color: var(--mustard);
  background: var(--primary-soft);
  box-shadow: 8px 8px 0 var(--mustard);
}

.pricing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 14px;
  padding: 3px 10px;
  color: var(--ink);
  background: var(--mustard);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.pricing-card h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 14px;
}

.pricing-price strong {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(2rem, 5vw, 2.7rem);
  line-height: 1;
}

.pricing-price span,
.pricing-card .muted {
  font-size: .82rem;
}

.pricing-card ul {
  margin: 18px 0;
  padding-left: 1.2em;
}

.auth-brand span:last-child {
  display: block;
}

.hero-card,
.panel,
.metric,
.contact-card,
.danger-zone,
.portal-announcement {
  border-color: var(--line);
  background: rgba(255, 250, 240, .94);
}

.hero-primary {
  color: #fffaf0;
  background:
    linear-gradient(115deg, transparent 0 72%, rgba(230, 92, 67, .9) 72%),
    var(--ink);
  box-shadow: 10px 10px 0 rgba(230, 92, 67, .85);
}

.hero-primary .muted,
.hero-primary p,
.hero-primary .eyebrow {
  color: rgba(255, 250, 240, .82);
}

.hero-primary .client-choice {
  color: var(--ink);
  background: #fffaf0;
}

.hero-primary .client-choice .eyebrow {
  color: #795b00;
}

.hero-primary .client-choice h3 {
  color: var(--ink);
}

.hero-primary .client-choice p:not(.eyebrow) {
  color: #40516c;
}

.hero-primary .compatibility-notice {
  color: #5f4200;
  background: #fff1ba;
}

.hero-primary .official-downloads {
  border: 1px solid #d2c3ae;
  border-radius: 12px;
  padding: 20px;
  color: var(--ink);
  background: #fffaf0;
}

.hero-primary .official-downloads .eyebrow {
  color: #795b00;
}

.hero-primary .official-downloads p:not(.eyebrow) {
  color: #40516c;
}

.hero-primary .download-link {
  border-color: #173e78;
  color: #fffaf0;
  background: #173e78;
}

.hero-primary .download-link span {
  color: #fffaf0;
}

.hero-primary .download-link:hover,
.hero-primary .download-link:focus-visible,
.hero-primary .download-link[data-recommended="true"] {
  border-color: #efc744;
  color: #173e78;
  background: #efc744;
}

.hero-primary .download-link:hover span,
.hero-primary .download-link:focus-visible span,
.hero-primary .download-link[data-recommended="true"] span {
  color: #354055;
}

.hero-primary .backup-downloads {
  color: var(--ink);
  background: #f7f0e4;
}

.hero-primary .backup-downloads .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--primary);
}

.hero-primary .connection-path li {
  color: #fffaf0;
}

.hero-primary .connection-path li:not(:last-child)::after {
  background: rgba(255, 250, 240, .45);
}

.hero-primary .connection-path span {
  border-color: var(--mustard);
  color: var(--ink);
  background: var(--mustard);
}

.metric {
  border-radius: 2px;
}

.metric:nth-child(2) {
  background: #f7ebcb;
}

.admin-page .shell {
  width: min(1560px, calc(100% - 32px));
  padding-block: 24px 64px;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.admin-sidebar {
  position: sticky;
  top: 24px;
  z-index: 20;
  overflow: hidden;
  border-radius: 14px;
  color: #fffaf0;
  background: var(--ink);
  box-shadow: var(--shadow-card);
}

.admin-brand {
  padding: 24px 20px;
  color: inherit;
  text-decoration: none;
}

.admin-brand:hover {
  color: inherit;
}

.admin-sidebar nav {
  display: grid;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, .2);
}

.admin-sidebar nav a {
  min-height: 44px;
  padding: 11px 12px;
  border-left: 3px solid transparent;
  border-radius: 5px;
  color: rgba(255, 250, 240, .8);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a:focus-visible,
.admin-sidebar nav a[aria-current="page"] {
  border-left-color: var(--mustard);
  color: var(--ink);
  background: var(--mustard);
}

.admin-content {
  min-width: 0;
}

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

.admin-section-anchor {
  scroll-margin-top: 24px;
}

.admin-data-section {
  margin-top: 28px;
}

.admin-data-list,
.history-list,
.alert-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.alert-card,
.audit-row,
.history-row,
.empty-state {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.alert-heading,
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.alert-heading > div {
  display: grid;
  gap: 3px;
}

.alert-heading time,
.history-row time,
.audit-row time {
  color: var(--muted);
  font-size: .82rem;
}

.audit-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(100px, 1fr) minmax(100px, .7fr) minmax(150px, .8fr);
  gap: 12px;
  align-items: center;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.history-row time {
  font-weight: 700;
}

.portal-dialog {
  width: min(680px, calc(100% - 28px));
  max-height: min(760px, calc(100dvh - 40px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.portal-dialog::backdrop {
  background: rgba(17, 31, 54, .62);
  backdrop-filter: blur(3px);
}

.action-dialog {
  width: min(560px, calc(100% - 28px));
}

.action-dialog h2 {
  margin-bottom: 12px;
}

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

.dialog-fields {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.dialog-fields label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.dialog-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.dialog-preview {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  font-weight: 700;
}

.dialog-checkbox {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  min-height: 44px;
  gap: 10px !important;
}

.dialog-checkbox input {
  width: 20px;
  height: 20px;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.auth-register-panel,
.registration-closed {
  margin-top: 22px;
}

.auth-register-panel summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  color: var(--primary);
  font-weight: 800;
}

.auth-register-panel .form-stack {
  margin-top: 18px;
}

.purchase-fieldset {
  min-width: 0;
  margin: 4px 0 0;
  border: 0;
  padding: 0;
}

.purchase-fieldset legend {
  margin-bottom: 9px;
  padding: 0;
  font-weight: 750;
}

.purchase-plan-options {
  display: grid;
  gap: 10px;
}

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

.purchase-plan-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 64px;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.purchase-plan-option:has(input:checked) {
  border-color: var(--primary);
  box-shadow: inset 4px 0 0 var(--primary);
}

.purchase-plan-option input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
}

.purchase-plan-option span,
.purchase-plan-option strong,
.purchase-plan-option small {
  display: block;
}

.purchase-plan-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
}

.purchase-plan-option b {
  color: var(--primary);
  font-size: 1.05rem;
}

.order-panel {
  border-top: 5px solid var(--mustard);
}

.order-form {
  display: grid;
  gap: 14px;
}

.order-form > label {
  font-weight: 750;
}

.order-form > .input {
  width: min(100%, 360px);
}

.order-form > .button {
  justify-self: start;
}

.order-total {
  margin: 0;
  color: var(--muted);
}

.order-total strong {
  margin-left: 8px;
  color: var(--text);
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 1.5rem;
}

.order-receipt {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 22px 0;
  border-block: 1px solid var(--line);
}

.order-receipt div {
  min-width: 0;
  padding: 13px 10px;
}

.order-receipt dt {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
}

.order-receipt dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.status-badge-pending_verification {
  color: var(--warning);
  background: var(--warning-soft);
}

.forced-password-panel {
  max-width: 760px;
  margin-inline: auto;
  border-top: 5px solid var(--coral);
}

.order-center {
  border-top: 6px solid var(--mustard);
}

.order-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

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

.order-admin-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 5px solid var(--ink);
  padding: 17px;
  background: var(--surface-muted);
}

.order-admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-admin-heading h3 {
  margin: 2px 0 0;
}

.order-admin-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 15px 0;
}

.order-admin-facts dt {
  color: var(--muted);
  font-size: .72rem;
}

.order-admin-facts dd {
  margin: 2px 0 0;
  font-weight: 750;
}

.order-card-summary {
  color: var(--muted);
}

.order-error {
  padding: 10px 12px;
  color: var(--danger);
  background: var(--danger-soft);
}

.student-security-summary {
  margin-block: 18px 26px;
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  background: var(--primary-soft);
  font-weight: 750;
}

.student-note-form {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.student-note-form > label {
  font-weight: 750;
}

.student-note-form > button {
  justify-self: start;
}

.student-note-list {
  display: grid;
  gap: 10px;
}

.student-note-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--surface-muted);
}

.student-note-card p {
  margin: 0;
  white-space: pre-wrap;
}

.student-note-card small {
  color: var(--muted);
  line-height: 1.55;
}

.student-note-card .small-button {
  justify-self: start;
}

.temporary-password {
  display: block;
  overflow-wrap: anywhere;
  margin: 18px 0;
  border: 1px dashed var(--line-strong);
  padding: 16px;
  color: var(--text);
  background: var(--surface-muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 800;
  user-select: all;
}

.restricted-pass-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .38fr);
  gap: 30px;
}

.support-copy-card {
  display: grid;
  align-content: center;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 22px;
  background: var(--surface);
}

.support-copy-card strong {
  overflow-wrap: anywhere;
  font-size: 1.35rem;
}

.section-rule {
  width: 100%;
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.status-badge-open {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-badge-acknowledged {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-badge-closed {
  color: var(--success);
  background: var(--success-soft);
}

@media (max-width: 1060px) {
  .admin-page .shell {
    width: min(100% - 28px, 1120px);
  }

  .admin-workspace {
    display: block;
  }

  .admin-menu-button {
    position: sticky;
    top: 10px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    color: #fff;
    background: var(--ink);
    font-weight: 800;
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(310px, calc(100% - 48px));
    overflow-y: auto;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform var(--motion-standard) ease;
  }

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

  .admin-page.admin-navigation-open {
    overflow: hidden;
  }

  .admin-page.admin-navigation-open::before {
    position: fixed;
    z-index: 70;
    inset: 0;
    background: rgba(17, 31, 54, .56);
    content: "";
  }

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

  .help-admin-grid {
    grid-template-columns: 1fr;
  }

  .help-steps-card,
  .help-step-editor-card {
    grid-column: auto;
    grid-row: auto;
  }

  .plan-card-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .auth-page .shell {
    place-items: start center;
    width: min(100% - 24px, 620px);
  }

  .auth-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .restricted-pass-card {
    grid-template-columns: 1fr;
  }

  .purchase-plan-grid,
  .order-receipt,
  .pricing-grid,
  .order-list,
  .order-admin-facts {
    grid-template-columns: 1fr;
  }

  .order-receipt div + div {
    border-top: 1px solid var(--line);
  }

  .auth-cover {
    min-height: 330px;
    padding: 30px;
  }

  .auth-cover-copy h2 {
    font-size: clamp(2rem, 9vw, 3.1rem);
  }

  .help-masthead {
    min-height: 520px;
    padding: 24px;
  }

  .help-hero-copy {
    margin: 90px 0 70px;
  }

  .help-intro,
  .help-contact {
    display: block;
  }

  .help-intro > div + div,
  .help-contact > div + div {
    margin-top: 28px;
  }

  .help-trouble-grid {
    grid-template-columns: 1fr;
  }

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

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

  .karing-import-grid,
  .help-checklist ol {
    grid-template-columns: 1fr;
  }

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

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

  .help-admin-heading,
  .help-step-admin-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .help-editor-card .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .help-editor-card .form-actions .button,
  .help-editor-card .form-actions .small-button {
    width: 100%;
  }

  .auth-cover {
    min-height: 280px;
    padding: 24px 22px;
  }

  .auth-cover-footer {
    display: none;
  }

  .auth-layout .auth-card {
    padding: 30px 22px;
  }

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

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

  .plan-card-header,
  .plan-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .plan-badges {
    justify-content: flex-start;
  }

  .plan-fields {
    grid-template-columns: 1fr;

  }

  .import-panel {
    gap: 18px;
    padding: 24px 18px;
    box-shadow: 6px 6px 0 rgba(230, 92, 67, .85);
  }

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

  .plan-field-wide {
    grid-column: auto;
  }

  .plan-card-footer .small-button {
    width: 100%;
  }

  .help-page .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .help-masthead {
    min-height: 500px;
    border-radius: 20px;
    padding: 20px;
  }

  .help-nav .button {
    padding-inline: 12px;
  }

  .help-brand small {
    display: none;
  }

  .help-hero-copy h1 {
    font-size: clamp(3.2rem, 17vw, 4.5rem);
  }

  .help-route {
    gap: 8px 18px;
  }

  .help-scenarios {
    grid-template-columns: 1fr;
  }

  .help-scenarios a {
    min-height: 72px;
  }

  .karing-safe-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .karing-safe-actions .button,
  .karing-safe-actions .text-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .help-intro {
    padding: 52px 4px 28px;
  }

  .help-section,
  .help-fallback,
  .help-contact {
    border-radius: 18px;
    padding: 26px 20px;
  }

  .help-step {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 32px 0;
  }

  .help-step-number {
    font-size: 1.8rem;
  }

  .help-faq-list details > :not(summary) {
    margin-left: 0;
  }

  .help-platform-grid {
    grid-template-columns: 1fr;
  }

  .history-row,
  .alert-heading,
  .dialog-heading {
    align-items: stretch;
    flex-direction: column;
  }
}
