:root {
  --bg: #0b0b0d;
  --bg-soft: #101013;
  --panel: #141418;
  --panel-2: #19191f;
  --border: #2a2a30;
  --gold: #c9a24d;
  --gold-light: #e3c878;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --danger: #d9534f;
  --success: #28a745;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(201, 162, 77, .14), transparent 34rem),
    linear-gradient(145deg, #080809 0%, var(--bg) 55%, #111015 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

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

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 280px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: rgba(13, 13, 16, .94);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: 20px 0 70px rgba(0, 0, 0, .32);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-close {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
  color: var(--gold-light);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(227, 200, 120, .45);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(201, 162, 77, .24), rgba(227, 200, 120, .05));
  color: var(--gold-light);
  font-weight: 800;
}

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

.brand strong {
  font-size: 15px;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.side-nav {
  display: grid;
  gap: 7px;
  margin-top: 30px;
}

.side-nav a,
.logout-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  transition: .2s ease;
}

.side-nav a:hover,
.side-nav a.active,
.logout-link:hover {
  border-color: rgba(201, 162, 77, .28);
  background: rgba(201, 162, 77, .09);
  color: var(--text);
}

.side-nav a.active {
  border-color: rgba(227, 200, 120, .48);
  box-shadow: inset 3px 0 0 var(--gold);
}

.logout-link {
  margin-top: auto;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke: var(--gold-light);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.content-shell {
  width: 100%;
  min-width: 0;
  margin-left: 280px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 32px;
  background: rgba(11, 11, 13, .78);
  border-bottom: 1px solid rgba(42, 42, 48, .7);
  backdrop-filter: blur(16px);
}

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

.topbar h1,
.hero-panel h2,
.profile-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.main-content {
  width: min(100%, 1440px);
  min-width: 0;
  padding: 28px 32px 44px;
}

.hero-panel,
.panel,
.stat-card,
.profile-header,
.empty-state {
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20, 20, 24, .96), rgba(16, 16, 19, .96));
  box-shadow: var(--shadow);
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  overflow: hidden;
}

.hero-panel h2 {
  max-width: 780px;
  font-size: clamp(27px, 4vw, 48px);
  line-height: 1.05;
}

.hero-panel p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
}

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

.stat-card {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  transition: transform .2s ease, border-color .2s ease;
}

.stat-card:hover,
.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 162, 77, .34);
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
}

.stat-card strong {
  color: var(--gold-light);
  font-size: 36px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: 18px;
}

.split-grid > * {
  min-width: 0;
}

.split-grid.wide-left {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
}

.panel {
  padding: 20px;
  transition: transform .2s ease, border-color .2s ease;
}

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

.panel-header h3 {
  margin: 0;
  font-size: 20px;
}

.panel-header p,
.empty-state p,
.notes-text {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel-header a {
  color: var(--gold-light);
  font-size: 14px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.mobile-card-list {
  display: none;
}

.mobile-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20, 20, 24, .98), rgba(16, 16, 19, .98));
  box-shadow: 0 16px 42px rgba(0, 0, 0, .28);
}

.mobile-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  opacity: .82;
}

.mobile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mobile-card-title {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.mobile-card-meta {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.mobile-card-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-card-meta strong {
  color: var(--gold-light);
  font-weight: 700;
}

.mobile-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.mobile-card-actions .btn,
.mobile-card-actions form,
.mobile-card-actions button {
  flex: 1 1 0;
  min-width: 0;
}

.mobile-card-badge {
  flex: 0 0 auto;
  white-space: nowrap;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(42, 42, 48, .78);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

td a {
  color: var(--gold-light);
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

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

.filters,
.form-grid,
.form-stack {
  display: grid;
  gap: 14px;
}

.filters {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
  align-items: end;
  margin-bottom: 18px;
}

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

.form-stack {
  grid-template-columns: 1fr;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0f0f13;
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(227, 200, 120, .78);
  box-shadow: 0 0 0 4px rgba(201, 162, 77, .12);
}

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

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid rgba(201, 162, 77, .32);
  border-radius: var(--radius);
  background: rgba(201, 162, 77, .08);
  color: var(--text);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(227, 200, 120, .64);
}

.btn-primary {
  border-color: rgba(227, 200, 120, .62);
  background: linear-gradient(145deg, var(--gold), #a98335);
  color: #111;
  font-weight: 800;
}

.btn-secondary {
  background: #18181e;
}

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

.btn-small {
  min-height: 38px;
  padding: 0 11px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.pill-success {
  border-color: rgba(40, 167, 69, .32);
  color: #8be2a0;
}

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

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  text-align: center;
}

.empty-state.compact {
  min-height: 220px;
}

.page-empty {
  min-height: calc(100vh - 190px);
}

.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(201, 162, 77, .4);
  border-radius: var(--radius);
  color: var(--gold-light);
  font-size: 28px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  margin-bottom: 18px;
}

.avatar-large {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(201, 162, 77, .16);
  color: var(--gold-light);
  font-size: 28px;
  font-weight: 800;
}

.notice {
  padding: 13px 14px;
  border: 1px solid rgba(201, 162, 77, .35);
  border-radius: var(--radius);
  background: rgba(201, 162, 77, .09);
  color: var(--gold-light);
}

.notice.danger {
  border-color: rgba(217, 83, 79, .44);
  background: rgba(217, 83, 79, .11);
  color: #ffb4b1;
}

.notice.success {
  border-color: rgba(40, 167, 69, .44);
  background: rgba(40, 167, 69, .1);
  color: #9ff0b2;
}

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

.settings-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(42, 42, 48, .82);
  border-radius: var(--radius);
  background: rgba(15, 15, 19, .74);
}

.settings-list span {
  color: var(--muted);
  font-size: 13px;
}

.settings-list strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: right;
}

.drive-settings-list {
  margin-top: 16px;
}

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

.diagnostic-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 15, 19, .78);
}

.diagnostic-card strong,
.diagnostic-card p {
  display: block;
}

.diagnostic-card strong {
  margin-top: 12px;
  color: var(--text);
  font-size: 15px;
}

.diagnostic-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.diagnostic-log {
  display: grid;
  gap: 10px;
}

.upload-form {
  display: grid;
  gap: 18px;
}

.upload-section {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(42, 42, 48, .82);
  border-radius: var(--radius);
  background: rgba(15, 15, 19, .68);
}

.upload-section h4 {
  margin: 0 0 14px;
  font-size: 18px;
}

.step-label {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(227, 200, 120, .42);
  border-radius: var(--radius);
  background: rgba(201, 162, 77, .1);
  color: var(--gold-light);
  font-weight: 800;
}

.segmented-control,
.client-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.segmented-control label,
.client-choice-card {
  position: relative;
  min-height: 62px;
}

.segmented-control input,
.client-choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  min-height: 1px;
}

.segmented-control span,
.client-choice-card > span {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0f0f13;
  color: var(--muted);
  cursor: pointer;
  transition: .18s ease;
}

.client-choice-card > span {
  align-items: flex-start;
  justify-content: center;
}

.client-choice-card strong,
.client-choice-card small {
  display: block;
}

.client-choice-card strong {
  color: var(--text);
  font-size: 15px;
}

.client-choice-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.segmented-control input:checked + span,
.client-choice-card input:checked + span {
  border-color: rgba(227, 200, 120, .64);
  background: rgba(201, 162, 77, .12);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--gold);
}

.field-label,
.procedure-fallback small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.procedure-fallback {
  padding: 12px;
  border: 1px dashed rgba(201, 162, 77, .24);
  border-radius: var(--radius);
  background: rgba(201, 162, 77, .04);
}

.field-label {
  margin-bottom: 10px;
}

.procedure-fallback small {
  margin-top: 7px;
}

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

.procedure-choice {
  min-height: 64px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0f0f13;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}

.procedure-choice[hidden] {
  display: none !important;
}

.procedure-choice:hover,
.procedure-choice.active {
  border-color: rgba(227, 200, 120, .64);
  background: rgba(201, 162, 77, .12);
  box-shadow: inset 3px 0 0 var(--gold);
}

.procedure-choice strong,
.procedure-choice span {
  display: block;
}

.procedure-choice strong {
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.procedure-choice span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.file-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-placeholder {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  border: 1px solid rgba(227, 200, 120, .34);
  border-radius: var(--radius);
  background: rgba(201, 162, 77, .09);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 800;
}

.file-inline > span:last-child,
.file-inline .mobile-card-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-drop input {
  padding: 13px;
}

.file-drop small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.file-drop .file-warning {
  color: #ffcf8a;
}

.upload-file-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.upload-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(160px, .45fr) minmax(180px, .6fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(10, 10, 13, .68);
}

.upload-file-card strong,
.upload-file-card span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.upload-file-card strong {
  color: var(--text);
  font-size: 14px;
}

.upload-file-card > div > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-card-list.always-visible {
  display: grid;
  gap: 12px;
}

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

.session-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 15, 19, .78);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .26);
}

.session-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.session-card h4,
.session-card p {
  margin: 0;
}

.session-card h4 {
  font-size: 17px;
  line-height: 1.25;
}

.session-card p,
.session-card-meta {
  color: var(--muted);
}

.session-card p {
  margin-top: 5px;
  font-size: 13px;
}

.session-card-meta {
  display: grid;
  gap: 7px;
  margin-top: 13px;
  font-size: 14px;
}

.session-card-meta span {
  overflow-wrap: anywhere;
}

.session-card-meta strong {
  color: var(--gold-light);
}

.session-card-actions {
  display: flex;
  margin-top: 14px;
}

button[disabled] {
  cursor: wait;
  opacity: .72;
}

.toast-stack {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: min(360px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(201, 162, 77, .38);
  border-radius: var(--radius);
  background: rgba(20, 20, 24, .96);
  box-shadow: var(--shadow);
  animation: toastIn .24s ease both;
}

.toast-success {
  border-color: rgba(40, 167, 69, .45);
}

.toast-error {
  border-color: rgba(217, 83, 79, .52);
}

.toast-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
}

.toast-hide {
  animation: toastOut .2s ease both;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-card {
  width: min(100%, 460px);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(20, 20, 24, .95);
  box-shadow: var(--shadow);
}

.install-card {
  width: min(100%, 560px);
}

.login-brand {
  margin-bottom: 30px;
}

.login-card h1 {
  margin: 0 0 22px;
  font-size: clamp(28px, 6vw, 42px);
  line-height: 1.05;
}

.login-card p {
  color: var(--muted);
}

.mobile-menu {
  display: none;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #141418;
  color: var(--text);
}

.icon-btn span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--gold-light);
}

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

.check-row input {
  width: 18px;
  min-height: 18px;
}

.check-row span {
  margin: 0;
}

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

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: min(320px, 85vw);
    max-width: 85vw;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }

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

  .sidebar-close {
    display: inline-grid;
    place-items: center;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: none;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(2px);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .content-shell {
    margin-left: 0;
  }

  .mobile-menu {
    display: block;
    flex: 0 0 auto;
  }

  .topbar {
    min-height: 78px;
    padding: 16px 20px;
  }

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

  .split-grid,
  .split-grid.wide-left {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .topbar {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
  }

  .topbar h1 {
    overflow: hidden;
    font-size: 20px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .eyebrow {
    margin-bottom: 3px;
    font-size: 10px;
  }

  .topbar-actions .btn {
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  .main-content {
    width: 100%;
    padding: 14px;
  }

  .hero-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 20px;
  }

  .hero-panel h2 {
    font-size: 25px;
    line-height: 1.12;
  }

  .hero-panel p {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
  }

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

  .hero-panel,
  .profile-header,
  .panel-header,
  .table-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    gap: 12px;
    margin-bottom: 16px;
  }

  .filters .btn {
    width: 100%;
  }

  .responsive-card-panel .table-wrap {
    display: none;
  }

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

  .panel,
  .stat-card,
  .profile-header,
  .empty-state {
    box-shadow: 0 16px 42px rgba(0, 0, 0, .32);
  }

  .panel {
    padding: 16px;
  }

  .panel-header {
    gap: 10px;
    margin-bottom: 14px;
  }

  .panel-header h3 {
    font-size: 18px;
  }

  .diagnostic-grid,
  .drive-actions,
  .segmented-control,
  .client-choice-grid,
  .procedure-choice-grid,
  .upload-file-card {
    grid-template-columns: 1fr;
  }

  .upload-section {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .settings-list div {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-list strong {
    text-align: left;
  }

  .stat-card {
    min-height: 106px;
    padding: 16px;
  }

  .stat-card strong {
    font-size: 32px;
  }

  .btn,
  input,
  select,
  textarea {
    min-height: 48px;
  }

  .btn-small {
    min-height: 44px;
  }

  .table-actions,
  .form-actions {
    gap: 10px;
  }

  .table-actions .btn,
  .table-actions form,
  .table-actions button,
  .form-actions .btn,
  .form-actions button {
    width: 100%;
  }

  table {
    min-width: 620px;
  }

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

@media (max-width: 480px) {
  .sidebar {
    width: 85vw;
    padding: 18px 14px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .side-nav {
    margin-top: 24px;
  }

  .side-nav a,
  .logout-link {
    min-height: 48px;
    padding: 0 12px;
    font-size: 14px;
  }

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

  .topbar-actions {
    grid-column: 1 / -1;
  }

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

  .main-content {
    padding: 12px;
  }

  .hero-panel {
    padding: 16px;
  }

  .hero-panel h2 {
    font-size: 22px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 14px 0;
  }

  .stat-card {
    min-height: 96px;
  }

  .stat-card span {
    font-size: 13px;
  }

  .stat-card strong {
    font-size: 29px;
  }

  .mobile-card {
    padding: 15px;
  }

  .mobile-card-head {
    flex-direction: column;
    gap: 10px;
  }

  .mobile-card-title {
    font-size: 16px;
  }

  .mobile-card-actions {
    flex-direction: column;
  }

  .mobile-card-actions .btn,
  .mobile-card-actions form,
  .mobile-card-actions button {
    width: 100%;
  }

  .session-card-head,
  .session-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .session-card-actions .btn {
    width: 100%;
  }

  .upload-section {
    gap: 12px;
  }

  .login-body {
    align-items: start;
    padding: 14px;
  }

  .login-card {
    margin-top: 20px;
    padding: 22px;
  }

  .toast-stack {
    right: 12px;
    left: 12px;
    top: 12px;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }
}
