:root {
  color-scheme: light;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  --primary: #1890ff;
  --primary-hover: #1769aa;
  --danger: #e0525a;
  --page-bg: #eef2f7;
  --panel-border: #dbe3ed;
  background: #f3f6fa;
  color: #1f2937;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
}

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

button,
.button-link {
  min-height: 32px;
  border: 1px solid var(--primary);
  border-radius: 2px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 30px;
  padding: 0 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

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

button.secondary,
.button-link.secondary {
  background: #fff;
  color: #24415f;
  border-color: #cbd5e1;
  font-weight: 500;
}

button.secondary:hover,
.button-link.secondary:hover {
  background: #f3f8ff;
  border-color: var(--primary);
  color: var(--primary);
}

button.danger {
  background: #fff1f2;
  color: var(--danger);
  border-color: #fecdd3;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #1f2937;
  padding: 0 12px;
}

textarea {
  min-height: 94px;
  padding: 11px 12px;
  resize: vertical;
}

.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #061929 0%, #0d2f46 46%, #eef2f7 46%);
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  padding: 28px;
}

.logo-mark,
.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ff6b4a;
  color: #fff;
  font-weight: 900;
}

.login-logo {
  display: block;
  width: 176px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

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

.login-card p {
  color: #64748b;
  margin: 0 0 22px;
}

.login-card label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #334155;
  font-weight: 700;
}

.login-card input {
  font-weight: 400;
}

.error-text {
  color: #be123c;
  min-height: 22px;
  margin-top: 10px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px 1fr;
}

.sidebar {
  background: #001529;
  color: #ffffffa6;
  padding: 0 0 12px;
  border-right: 0;
}

.brand {
  min-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 8px 10px;
}

.brand-logo {
  display: block;
  width: 132px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.brand strong {
  display: block;
  color: #fff;
  font-size: 20px;
}

.brand span {
  color: #ffffffa6;
  font-size: 12px;
  line-height: 1.2;
  padding-left: 10px;
}

.nav {
  width: 100%;
  height: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffffa6;
  text-align: left;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 400;
  line-height: 40px;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav.active,
.nav.active:hover {
  background: #1890ff;
  color: #fff;
}

.nav:hover {
  background: #001529;
  color: #fff;
}

.shell {
  min-width: 0;
  padding: 0 16px 30px;
}

.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  margin: 0 -16px 18px;
  padding: 0 16px;
  border-bottom: 1px solid #dbe3ed;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

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

h1 {
  font-size: 28px;
  font-weight: 700;
}

h2 { font-size: 18px; }

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.topbar p,
.meta {
  color: #64748b;
}

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

.tab-view { display: none; }
.tab-view.active { display: block; }

.welcome-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #dbe3ed;
  border-left: 4px solid #1687e8;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.welcome-band p {
  color: #64748b;
  margin-top: 6px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #dbe3ed;
  border-radius: 6px;
  padding: 18px 16px 16px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: #1890ff;
}

.metric-blue::before { background: #1890ff; }
.metric-indigo::before { background: #5867c9; }
.metric-cyan::before { background: #14b8c6; }
.metric-amber::before { background: #ff9f1c; }

.metric-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #eff6ff;
  color: #1890ff;
  font-weight: 800;
  font-size: 15px;
}

.metric-indigo .metric-icon {
  background: #eef2ff;
  color: #5867c9;
}

.metric-cyan .metric-icon {
  background: #ecfeff;
  color: #0e7490;
}

.metric-amber .metric-icon {
  background: #fff7ed;
  color: #d97706;
}

.metric span {
  color: #64748b;
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 30px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-card {
  min-height: 188px;
}

.health-chart {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  --value: 0%;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#1890ff var(--value), #e5eaf0 0);
  color: #0f172a;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  box-shadow: inset 0 0 0 24px #fff, inset 0 0 0 25px rgba(15, 23, 42, 0.04);
}

.chart-legend,
.bar-list,
.activity-list {
  display: grid;
  gap: 10px;
}

.legend-item,
.activity-item,
.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.legend-item {
  color: #475569;
  font-size: 13px;
}

.legend-item strong {
  color: #0f172a;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1890ff;
  flex: 0 0 auto;
}

.legend-dot.cyan { background: #14b8c6; }
.legend-dot.amber { background: #ff9f1c; }
.legend-dot.blue { background: #1890ff; }

.bar-item {
  display: grid;
  gap: 7px;
}

.bar-head span {
  color: #475569;
  font-size: 13px;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1890ff;
}

.bar-track span.amber { background: #ff9f1c; }
.bar-track span.red { background: #e0525a; }

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.mini-stat-grid article {
  border: 1px solid #e5eaf0;
  border-radius: 5px;
  background: #f8fafc;
  padding: 12px;
}

.mini-stat-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 6px;
}

.mini-stat-grid strong {
  color: #0f172a;
  font-size: 20px;
}

.activity-item {
  border: 1px solid #e5eaf0;
  border-radius: 5px;
  padding: 10px 12px;
  background: #fff;
}

.activity-item div {
  display: grid;
  gap: 3px;
}

.activity-item span:not(.status) {
  color: #64748b;
  font-size: 12px;
}

.panel {
  background: #fff;
  border: 1px solid #dbe3ed;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

.grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 10px;
}

.message-form {
  display: grid;
  grid-template-columns: 220px 180px minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.otp-form {
  display: grid;
  grid-template-columns: 220px minmax(300px, 1fr) 170px 90px 90px 120px;
  gap: 14px 10px;
  align-items: start;
}

.message-form textarea,
.message-extra,
.otp-form textarea {
  grid-column: 1 / 4;
}

.message-send-action {
  grid-column: 1 / -1;
  justify-self: start;
  align-self: start;
  min-width: 118px;
}

.verify-form {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 0.7fr 120px;
  gap: 10px;
  align-items: start;
}

.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr 180px 1fr;
  gap: 14px 10px;
  align-items: start;
}

.report-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) 120px 90px;
  gap: 10px;
  align-items: end;
}

.report-filter-form label {
  display: grid;
  gap: 6px;
}

.report-filter-form label span {
  color: #64748b;
  font-size: 12px;
}

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

.report-summary article {
  border: 1px solid #dbe3ed;
  border-radius: 6px;
  background: #fff;
  padding: 14px 16px;
}

.report-summary span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 6px;
}

.report-summary strong {
  color: #0f172a;
  font-size: 24px;
}

.form-action {
  width: auto;
  min-height: 32px;
  align-self: start;
  white-space: nowrap;
}

.send-action {
  grid-column: 1 / 2;
  justify-self: start;
  min-width: 118px;
}

.verify-action {
  align-self: end;
  margin-bottom: 23px;
}

.save-settings-action {
  grid-column: 4 / 5;
  justify-self: stretch;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.field small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.field textarea {
  grid-column: auto;
}

.field.span-2 { grid-column: span 2; }
.field.span-5 { grid-column: 1 / -1; }

.check-field {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #dbe3ed;
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
}

.check-field input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.check-field span {
  display: grid;
  gap: 4px;
}

.check-field strong {
  color: #0f172a;
  font-size: 13px;
}

.check-field small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.smtp-secure-field {
  align-self: stretch;
}

.alert-settings-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.compact-field input {
  text-align: center;
  font-weight: 800;
}

.message-extra.hidden {
  display: none;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
}

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

th,
td {
  border-bottom: 1px solid #e5eaf0;
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}

td { color: #1f2937; }
tr:last-child td { border-bottom: 0; }

pre {
  white-space: pre-wrap;
  overflow: auto;
  margin: 12px 0 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  color: #0f3a5c;
  padding: 12px;
}

.client-output {
  margin-bottom: 12px;
}

.client-output:empty {
  display: none;
}

.token-share-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-left: 3px solid #1890ff;
  border-radius: 5px;
  background: #eff6ff;
  padding: 12px;
}

.token-share-card p {
  margin-top: 4px;
  color: #475569;
}

.token-share-card code {
  grid-column: 1 / -1;
  display: block;
  overflow: auto;
  border: 1px solid #dbe3ed;
  border-radius: 4px;
  background: #fff;
  color: #0f3a5c;
  padding: 10px;
  font-weight: 700;
}

.token-warning {
  color: #9a3412 !important;
}

.status {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
}

.status.connected,
.status.sent,
.status.verified {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0e7490;
}

.status.qr,
.status.connecting,
.status.queued,
.status.pending {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.status.failed,
.status.disconnected,
.status.error,
.status.expired {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

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

.compact { min-height: 32px; }

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

.compact-item {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
}

.api-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
  gap: 14px;
}

.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: stretch;
  background: linear-gradient(135deg, #09243a, #0e5f84);
  border: 1px solid #0b4e70;
  border-radius: 7px;
  color: #fff;
  padding: 24px;
  margin-bottom: 14px;
}

.otp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: stretch;
  background: linear-gradient(135deg, #082033, #1687e8);
  border: 1px solid #0b63b5;
  border-radius: 7px;
  color: #fff;
  padding: 22px;
  margin-bottom: 14px;
}

.settings-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: stretch;
  background: linear-gradient(135deg, #071a2b, #24415f);
  border: 1px solid #18344e;
  border-radius: 7px;
  color: #fff;
  padding: 22px;
  margin-bottom: 14px;
}

.settings-hero h2 {
  font-size: 30px;
  margin-bottom: 8px;
}

.settings-hero p {
  color: #dbeafe;
  line-height: 1.6;
  max-width: 760px;
}

.settings-status {
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 16px;
}

.settings-status div,
.settings-grid article {
  display: grid;
  gap: 4px;
}

.settings-status span {
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-status strong {
  color: #fff;
  word-break: break-word;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.settings-grid article {
  background: #f8fafc;
  border: 1px solid #dbe3ed;
  border-radius: 5px;
  padding: 12px;
}

.settings-grid span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-grid strong {
  color: #1f2937;
  word-break: break-word;
}

.otp-hero h2 {
  font-size: 30px;
  margin-bottom: 8px;
}

.otp-hero p {
  color: #dbeafe;
  line-height: 1.6;
  max-width: 760px;
}

.otp-flow-card {
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 16px;
}

.otp-flow-card strong {
  color: #fff;
  margin-bottom: 2px;
}

.otp-flow-card span {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #ecfeff;
  font-weight: 700;
  padding: 8px 10px;
}

.docs-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: #f98870;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.docs-hero h2 {
  font-size: 30px;
  margin-bottom: 8px;
}

.docs-hero p {
  max-width: 780px;
  color: #d9eef7;
  line-height: 1.6;
}

.docs-base {
  display: grid;
  align-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 18px;
}

.docs-base span {
  color: #bfe7f7;
  font-weight: 700;
}

.docs-base code {
  display: block;
  overflow: auto;
  background: #fff;
  color: #06324d;
  border-radius: 5px;
  padding: 12px;
  font-weight: 800;
}

.docs-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.docs-metrics article {
  background: #fff;
  border: 1px solid #dbe3ed;
  border-top: 3px solid #1890ff;
  border-radius: 6px;
  padding: 14px;
}

.docs-metrics strong {
  display: block;
  margin-bottom: 5px;
}

.docs-metrics span,
.doc-card p,
.doc-note,
.docs-list {
  color: #64748b;
}

.docs-callout {
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.docs-callout.danger {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.docs-callout strong {
  display: block;
  color: #7c2d12;
  margin-bottom: 4px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
}

.docs-toc {
  position: sticky;
  top: 82px;
  align-self: start;
  display: grid;
  gap: 4px;
  background: #fff;
  border: 1px solid #dbe3ed;
  border-radius: 6px;
  padding: 10px;
}

.docs-toc a {
  color: #24415f;
  text-decoration: none;
  font-weight: 700;
  padding: 9px 10px;
  border-radius: 4px;
}

.docs-toc a:hover {
  background: #eff6ff;
  color: #0b63b5;
}

.docs-content {
  display: grid;
  gap: 14px;
}

.doc-card {
  background: #fff;
  border: 1px solid #dbe3ed;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.doc-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.method {
  min-width: 58px;
  text-align: center;
  border-radius: 4px;
  padding: 5px 8px;
  color: #fff;
  background: #1687e8;
  font-size: 12px;
  font-weight: 900;
}

.method.post { background: #1890ff; }
.method.get { background: #24415f; }
.method.warn { background: #f59e0b; }

.doc-card h4 {
  margin: 0 0 8px;
  color: #334155;
}

.docs-code-grid,
.error-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.flow-steps span {
  background: #f8fafc;
  border: 1px solid #dbe3ed;
  border-left: 3px solid #1687e8;
  border-radius: 5px;
  padding: 10px;
  color: #334155;
  font-weight: 700;
}

.error-grid div {
  display: grid;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 12px;
}

.error-grid strong {
  color: #be123c;
  font-size: 18px;
}

.error-grid span {
  color: #475569;
}

.docs-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

dialog {
  border: 0;
  border-radius: 2px;
  max-width: 440px;
  width: calc(100vw - 32px);
  padding: 0;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.24);
}

dialog::backdrop { background: rgba(15, 23, 42, 0.58); }

#qrDialog {
  padding: 28px;
}

.wide-dialog {
  max-width: 760px;
}

.wide-dialog form {
  display: grid;
}

.modal-title {
  padding: 16px 20px 10px;
  border-bottom: 1px solid #e5eaf0;
}

.modal-title h2 {
  font-size: 16px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
  padding: 14px 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e5eaf0;
}

.close {
  position: absolute;
  right: 12px;
  top: 9px;
  min-height: 32px;
  background: transparent;
  border: 0;
  color: #64748b;
  font-size: 22px;
  padding: 0 8px;
  z-index: 1;
}

#qrImage {
  display: block;
  width: 320px;
  max-width: 100%;
  margin: 18px auto;
}

.hint {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  color: #1d4ed8;
  padding: 12px;
  line-height: 1.5;
}

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

  .topbar,
  .welcome-band,
  .section-head {
    display: grid;
    height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .metric-grid,
  .analytics-grid,
  .docs-metrics,
  .docs-hero,
  .otp-hero,
  .settings-hero,
  .settings-grid,
  .docs-layout,
  .docs-code-grid,
  .error-grid,
  .flow-steps,
  .grid-form,
  .message-form,
  .otp-form,
  .verify-form,
  .settings-form,
  .report-filter-form,
  .report-summary,
  .api-grid {
    grid-template-columns: 1fr;
  }

  .health-chart {
    grid-template-columns: 1fr;
  }

  .message-form textarea,
  .otp-form textarea,
  .settings-form textarea,
  .field.span-2,
  .field.span-5,
  .save-settings-action { grid-column: auto; }
}
