:root {
  --bg: #f5f7fb;
  --bg-start: #f8fafc;
  --login-bg-end: #eef2f7;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-soft: #f1f5f9;
  --surface-overlay: rgba(255, 255, 255, 0.92);
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --on-primary: #ffffff;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --success-text: #166534;
  --success-border: #bbf7d0;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-text: #991b1b;
  --danger-border: #fecaca;
  --warning: #d97706;
  --warning-soft: #fff7ed;
  --warning-text: #92400e;
  --warning-border: #fed7aa;
  --info: #0284c7;
  --info-soft: #eff6ff;
  --input-bg: #ffffff;
  --frame-bg: #0f172a;
  --frame-toolbar-bg: #111827;
  --frame-text: #e5e7eb;
  --frame-muted: #cbd5e1;
  --focus-ring: rgba(37, 99, 235, 0.12);
  --backdrop: rgba(15, 23, 42, 0.32);
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.05);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 248px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --bg-start: #111827;
  --login-bg-end: #0b1120;
  --surface: #111827;
  --surface-muted: #0f172a;
  --surface-soft: #1e293b;
  --surface-overlay: rgba(15, 23, 42, 0.94);
  --border: #263449;
  --border-strong: #334155;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --text-soft: #64748b;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --primary-border: rgba(96, 165, 250, 0.42);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --success-text: #bbf7d0;
  --success-border: rgba(74, 222, 128, 0.32);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --danger-text: #fecaca;
  --danger-border: rgba(248, 113, 113, 0.35);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --warning-text: #fde68a;
  --warning-border: rgba(251, 191, 36, 0.32);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.14);
  --input-bg: #0f172a;
  --frame-bg: #020617;
  --frame-toolbar-bg: #0f172a;
  --frame-text: #e2e8f0;
  --frame-muted: #94a3b8;
  --focus-ring: rgba(96, 165, 250, 0.18);
  --backdrop: rgba(2, 6, 23, 0.58);
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg) 100%);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

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

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

button {
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: var(--surface-overlay);
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 20;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
}

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

.nav-groups {
  display: grid;
  gap: 18px;
}

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

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 42px;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.nav-item:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.nav-icon {
  width: 18px;
  text-align: center;
  flex: 0 0 18px;
}

.sidebar-footer {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--surface-muted);
}

.sidebar-footer-title {
  font-weight: 800;
}

.main-area {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.page-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.page-body,
.stack,
.dashboard-shell,
.console-shell,
.account-list,
.settings-stack {
  display: grid;
  gap: 18px;
}

.mobile-topbar,
.sidebar-backdrop {
  display: none;
}

.panel,
.data-card,
.account-card,
.quick-card,
.empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 22px;
}

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

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

h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

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

.compact {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.6;
}

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

.stat-card {
  min-height: 112px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-meta {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 850;
}

.stat-help {
  color: var(--text-muted);
  font-size: 12px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  font-weight: 900;
}

.stat-icon.blue {
  color: var(--primary);
  background: var(--primary-soft);
}

.stat-icon.green {
  color: var(--success);
  background: var(--success-soft);
}

.stat-icon.red {
  color: var(--danger);
  background: var(--danger-soft);
}

.stat-icon.orange {
  color: var(--warning);
  background: var(--warning-soft);
}

.stat-icon.gray {
  color: var(--text-muted);
  background: var(--surface-soft);
}

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

.layout-grid > *,
.dashboard-layout > *,
.settings-layout > * {
  min-width: 0;
}

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

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

.quick-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

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

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

.link-list > a,
.link-list > button,
.link-list > form > button {
  width: 100%;
}

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

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.summary-row strong {
  display: block;
}

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

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

.button-grid {
  align-items: stretch;
}

.button-grid > form,
.button-grid > a,
.button-grid > button {
  flex: 1 1 150px;
}

.space-below-sm {
  margin-bottom: 12px;
}

.space-above-md {
  margin-top: 14px;
}

button,
.link-button,
.ghost-button,
.soft-button,
.danger-button,
.success-button {
  min-height: 40px;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

button:hover,
.link-button:hover,
.ghost-button:hover,
.soft-button:hover,
.danger-button:hover,
.success-button:hover {
  background: var(--primary-hover);
}

.ghost-button,
.soft-button,
.danger-button,
.success-button {
  border: 1px solid var(--border);
  box-shadow: none;
}

.ghost-button {
  color: var(--text);
  background: var(--surface);
}

.ghost-button:hover {
  background: var(--surface-muted);
}

.soft-button {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.soft-button:hover {
  color: var(--on-primary);
  background: var(--primary);
}

.danger-button {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.danger-button:hover {
  color: var(--on-primary);
  background: var(--danger);
}

.success-button {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-border);
}

.success-button:hover {
  color: var(--on-primary);
  background: var(--success);
}

.icon-button,
.copy-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.theme-toggle {
  min-height: 40px;
  width: 72px;
  min-width: 72px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: var(--shadow-soft);
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2px;
}

.theme-toggle:hover {
  background: var(--surface-muted);
}

.theme-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 15px;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.theme-sun {
  color: var(--warning);
}

.theme-moon {
  color: var(--text-soft);
}

html[data-theme="light"] .theme-sun,
html:not([data-theme]) .theme-sun {
  background: var(--warning);
  color: var(--on-primary);
}

html[data-theme="dark"] .theme-moon {
  background: var(--primary);
  color: var(--on-primary);
}

html[data-theme="dark"] .theme-sun {
  color: var(--warning);
}

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

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

.metric-row,
.account-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
}

label span,
.field-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

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

textarea {
  min-height: 96px;
  resize: vertical;
}

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

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

.pill,
.status-chip,
.status-pill {
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.pill.success,
.status-chip.success {
  color: var(--success);
  background: var(--success-soft);
}

.pill.warning,
.status-chip.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.pill.danger,
.status-chip.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.pill.info,
.status-chip.info {
  color: var(--info);
  background: var(--info-soft);
}

.flash {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.flash.success {
  color: var(--success-text);
  background: var(--success-soft);
  border-color: var(--success-border);
}

.flash.warning {
  color: var(--warning-text);
  background: var(--warning-soft);
  border-color: var(--warning-border);
}

.flash.error {
  color: var(--danger-text);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: var(--text-muted);
  background: var(--surface-muted);
  font-weight: 800;
}

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

.account-card,
.data-card {
  padding: 18px;
}

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

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

.account-head,
.account-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.account-ident,
.account-panel__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar-photo,
.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  color: var(--on-primary);
  background: var(--primary);
  font-weight: 850;
}

.account-name,
.account-panel__name {
  font-size: 17px;
  font-weight: 850;
}

.account-sub,
.account-panel__subline {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.metric-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-muted);
  text-align: center;
}

.metric-box .label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 6px;
}

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

.friend-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.friend-picker-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.friend-picker-title {
  color: var(--text);
  font-weight: 850;
}

.friend-picker-list {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.friend-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
}

.friend-option.selected {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.friend-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.friend-picker-empty,
.empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  border-style: dashed;
  background: var(--surface-muted);
}

.scan-account-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.scan-account-panel .section-title-row {
  align-items: center;
}

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

.modal-open {
  overflow: hidden;
}

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

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

.qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
}

.qr-modal__dialog {
  position: relative;
  width: min(92vw, 420px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-strong);
  padding: 18px;
  display: grid;
  gap: 16px;
}

.qr-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.qr-modal__head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.qr-modal__body {
  min-height: 300px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  display: grid;
  place-items: center;
  padding: 18px;
}

.qr-modal__image {
  width: min(100%, 280px);
  height: auto;
  border-radius: var(--radius-sm);
  background: #fff;
}

.qr-modal__image[hidden],
.qr-modal__placeholder[hidden] {
  display: none;
}

.qr-modal__placeholder {
  color: var(--text-muted);
  text-align: center;
}

.qr-modal__actions {
  justify-content: flex-end;
}

.login-workspace-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.browser-frame-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--frame-bg);
}

.browser-frame-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--frame-toolbar-bg);
  color: var(--frame-text);
}

.url-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.desktop-frame {
  width: 100%;
  height: min(68vh, 720px);
  min-height: 520px;
  border: 0;
  display: block;
  background: var(--frame-bg);
}

.frame-help {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  color: var(--frame-muted);
  background: var(--frame-toolbar-bg);
  font-size: 13px;
}

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

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--border-strong);
}

.status-item.pending .status-dot {
  background: var(--primary);
}

.status-item.success .status-dot {
  background: var(--success);
}

.status-item.error .status-dot {
  background: var(--danger);
}

.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 14px;
  line-height: 1.65;
}

.data-card {
  overflow: hidden;
}

.data-card__head,
.data-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.data-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}

.data-card__title.success {
  color: var(--success);
}

.data-card__title.danger {
  color: var(--danger);
}

.data-card__title.warning {
  color: var(--warning);
}

.data-card__title.info {
  color: var(--info);
}

.data-card__table {
  margin-top: 12px;
}

.data-card__extra {
  display: none;
  margin-top: 12px;
}

.data-card__extra.is-open {
  display: block;
}

.data-card__footer {
  justify-content: flex-end;
  margin-top: 12px;
}

.data-card__footer-button {
  min-height: auto;
  padding: 0;
  color: var(--primary);
  background: transparent;
}

.data-card__footer-button:hover {
  background: transparent;
  color: var(--primary-hover);
  text-decoration: underline;
}

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

.console-account-list {
  display: grid;
  gap: 18px;
}

.console-footer {
  color: var(--text-muted);
  text-align: center;
}

.code-block {
  margin: 0;
  max-height: 520px;
  overflow: auto;
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--frame-bg);
  color: #dbeafe;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.code-block.light {
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.code-block.tall {
  min-height: 420px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(
    180deg,
    var(--bg-start) 0%,
    var(--login-bg-end) 100%
  );
}

.login-card {
  width: min(100%, 420px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

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

.login-flash {
  margin: 16px 0;
}

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

  .layout-grid,
  .dashboard-layout,
  .content-grid,
  .account-list,
  .account-grid {
    grid-template-columns: 1fr;
  }
}

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

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    height: 58px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-overlay);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 300px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

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

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 15;
    background: var(--backdrop);
  }

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

  .main-area {
    padding: 20px 16px 28px;
  }

  .page-header,
  .section-title-row,
  .panel-header,
  .account-head,
  .account-panel__header {
    flex-direction: column;
    align-items: stretch;
  }

  .layout-grid,
  .dashboard-layout,
  .settings-layout,
  .login-workspace-grid,
  .scan-status-list,
  .quick-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .stats-grid,
  .form-grid,
  .settings-grid,
  .metric-row,
  .account-metrics {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 25px;
  }

  .panel,
  .account-card,
  .data-card {
    padding: 16px;
  }

  table {
    min-width: 640px;
  }

  .desktop-frame {
    min-height: 420px;
  }
}
