:root {
  --bg: #edf8fb;
  --bg-strong: #dff3fa;
  --surface: #ffffff;
  --surface-soft: #f7fbfd;
  --surface-tint: #eef8ff;
  --text: #162033;
  --muted: #64748b;
  --line: #d7e2ea;
  --line-strong: #b8c8d6;
  --primary: #1769e0;
  --primary-strong: #0b4eb3;
  --primary-soft: #e8f1ff;
  --cyan: #0891b2;
  --cyan-soft: #dff8fb;
  --success: #067647;
  --success-soft: #e8f8ee;
  --warning: #b54708;
  --warning-soft: #fff5dd;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --slate-soft: #eef2f6;
  --shadow: 0 18px 42px rgba(15, 35, 68, 0.09);
  --shadow-soft: 0 8px 22px rgba(15, 35, 68, 0.06);
  --radius: 8px;
  --sidebar-width: 238px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(209, 242, 249, 0.92) 0, rgba(237, 248, 251, 0.8) 220px, var(--bg) 480px),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

::selection {
  background: rgba(8, 145, 178, 0.24);
  color: var(--text);
}

* {
  scrollbar-color: #93b8ce #e6f3f7;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #e6f3f7;
}

*::-webkit-scrollbar-thumb {
  background: #93b8ce;
  border: 2px solid #e6f3f7;
  border-radius: 999px;
}

a {
  color: var(--primary-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

input::placeholder {
  color: #96a4b5;
}

input:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  border-color: var(--cyan);
  outline: 3px solid rgba(8, 145, 178, 0.2);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--text);
  color: #fff;
  border-radius: 6px;
}

.skip-link:focus {
  top: 12px;
}

.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;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  height: 100vh;
  padding: 16px 14px;
  border-right: 1px solid rgba(196, 213, 224, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 250, 253, 0.96)),
    var(--surface);
  box-shadow: 8px 0 28px rgba(15, 35, 68, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: cover;
  object-position: center 28%;
  border: 1px solid rgba(199, 218, 230, 0.95);
  border-radius: 8px;
  box-shadow: 0 9px 20px rgba(23, 105, 224, 0.16);
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #334155;
  font-weight: 700;
}

.side-nav a:hover {
  background: #f2f8fb;
  text-decoration: none;
}

.side-nav a[aria-current="page"] {
  background: linear-gradient(90deg, var(--primary-soft), #e8fbff);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px rgba(23, 105, 224, 0.12);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #e5eef6;
  color: #52657a;
  font-size: 12px;
  font-weight: 900;
}

.side-nav a[aria-current="page"] .nav-icon {
  background: var(--primary);
  color: #fff;
}

.sidebar-foot {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d7e7ef;
  border-radius: 8px;
  background: #f7fcfe;
}

.account-label,
.route-label {
  color: var(--muted);
  font-size: 12px;
}

.account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.content-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(196, 213, 224, 0.84);
  background: rgba(250, 254, 255, 0.86);
  backdrop-filter: blur(14px);
}

.content-topbar > div {
  display: grid;
  gap: 1px;
}

.content-topbar strong {
  font-size: 16px;
}

.content-topbar form,
.action-row form,
.row-actions form {
  margin: 0;
}

.content-area {
  width: min(1520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.auth-shell {
  width: min(1060px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 13px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(180deg, #2677ee, var(--primary));
  color: #fff;
  box-shadow: 0 10px 20px rgba(23, 105, 224, 0.22);
}

.button.primary:hover {
  background: var(--primary-strong);
  box-shadow: 0 12px 24px rgba(23, 105, 224, 0.28);
}

.button.secondary,
.button.quiet {
  background: #fff;
  color: #334155;
  border-color: var(--line);
}

.button.secondary:hover,
.button.quiet:hover {
  background: #f6fbfd;
  border-color: var(--line-strong);
}

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

.button.small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

.flash-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.flash {
  padding: 10px 12px;
  border: 1px solid #b2ddff;
  border-radius: 6px;
  background: #eef8ff;
  color: #1849a9;
}

.flash.success {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #05603a;
}

.flash.error {
  border-color: #fecdca;
  background: #fef3f2;
  color: #912018;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 420px);
  gap: 32px;
  align-items: center;
  min-height: calc(100vh - 96px);
}

.auth-brand {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.auth-brand img {
  width: 132px;
  height: 132px;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand h1 {
  max-width: 620px;
  margin: 0;
  font-size: 40px;
  line-height: 1.14;
}

.auth-brand p,
.section-head p,
.page-titlebar p,
.table-console-head p {
  margin: 0;
  color: var(--muted);
}

.auth-panel,
.work-card,
.metric-tile {
  border: 1px solid rgba(199, 216, 227, 0.95);
  border-radius: var(--radius);
  background: var(--surface);
}

.auth-panel {
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.stack-form label,
.field label {
  color: #334155;
  font-weight: 700;
}

.auth-switch {
  margin: 16px 0 0;
}

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

.page-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(189, 210, 224, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.96), rgba(235, 250, 255, 0.92) 62%, rgba(255, 247, 226, 0.78)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.page-titlebar h1 {
  margin: 0 0 3px;
  color: #102a56;
  font-size: 22px;
  line-height: 1.22;
}

.page-titlebar-compact {
  padding: 12px 16px;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.title-actions form {
  margin: 0;
}

.run-pill,
.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

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

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

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

.status.used {
  background: var(--slate-soft);
  color: #334155;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-tile {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px 14px 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.metric-tile::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 16px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
}

.metric-tile span {
  color: var(--muted);
}

.metric-tile strong {
  color: #102a56;
  font-size: 24px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.metric-available {
  background: linear-gradient(180deg, #fff, var(--success-soft));
}

.metric-available::after {
  background: var(--success);
}

.metric-reserved {
  background: linear-gradient(180deg, #fff, var(--warning-soft));
}

.metric-reserved::after {
  background: #d97706;
}

.metric-used {
  background: linear-gradient(180deg, #fff, var(--slate-soft));
}

.metric-used::after {
  background: #64748b;
}

.metric-disabled {
  background: linear-gradient(180deg, #fff, var(--danger-soft));
}

.metric-disabled::after {
  background: var(--danger);
}

.metric-token {
  background: linear-gradient(180deg, #fff, var(--cyan-soft));
}

.metric-token::after {
  background: var(--cyan);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.45fr);
  gap: 14px;
  margin-bottom: 14px;
}

.token-card {
  grid-row: span 2;
}

.work-card {
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.section-head,
.table-console-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head.inline,
.table-console-head {
  align-items: center;
}

.section-head.compact {
  display: grid;
  gap: 3px;
}

.section-head h2,
.table-console-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.config-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(260px, 1.35fr) minmax(260px, 1.25fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  background: var(--surface-soft);
}

.edit-notice {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #cde1ee;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfeff, #eef8ff);
}

.edit-notice div {
  display: grid;
  gap: 2px;
}

.edit-notice span {
  color: var(--muted);
  font-size: 12px;
}

.edit-notice strong {
  color: #102a56;
  overflow-wrap: anywhere;
}

.edit-notice p {
  margin: 0;
  color: #49647e;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.token-field {
  min-width: 0;
}

.proxy-field {
  min-width: 0;
}

.config-form .button {
  width: 100%;
}

.inline-check {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  color: var(--muted) !important;
  font-weight: 600 !important;
}

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

.input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.input-suffix input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-suffix span {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #eef6fa;
  color: #315170;
}

.token-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  margin: 14px 0 0;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.summary-item {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid #e3edf3;
  border-bottom: 1px solid #e3edf3;
}

.summary-item dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.summary-item dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.task-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  background: var(--surface-soft);
}

.task-state div {
  display: grid;
  gap: 2px;
}

.task-state span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

.state-dot.on {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(6, 118, 71, 0.1);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
}

.action-row.vertical {
  display: grid;
}

.confirm-action {
  position: relative;
}

.confirm-action summary {
  list-style: none;
}

.confirm-action summary::-webkit-details-marker {
  display: none;
}

.confirm-action form {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 15;
  display: grid;
  gap: 10px;
  width: min(280px, 80vw);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-action.compact {
  display: inline-block;
  margin-top: 8px;
}

.confirm-action.compact form {
  right: auto;
  left: 0;
}

.full-disclosure form {
  width: 100%;
}

.confirm-action p {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  margin-top: 14px;
  padding: 13px;
  border: 1px dashed #acc3d4;
  border-radius: 8px;
  background: #f8fcfd;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.empty-state.small {
  margin: 0;
  padding: 12px;
}

td time {
  color: var(--muted);
  font-size: 12px;
}

.log-table-card {
  margin-bottom: 14px;
}

.log-table {
  min-width: 980px;
}

.log-table th:nth-child(1),
.log-table td:nth-child(1) {
  width: 166px;
}

.log-table th:nth-child(2),
.log-table td:nth-child(2) {
  width: 92px;
}

.log-table th:nth-child(3),
.log-table td:nth-child(3) {
  width: 260px;
}

.log-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

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

.log-status.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.log-status.skipped,
.log-status.duplicate {
  background: var(--warning-soft);
  color: var(--warning);
}

.log-message {
  max-width: 680px;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #334155;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 132px 150px auto;
  gap: 8px;
  align-items: center;
  width: min(720px, 100%);
}

.pool-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pool-stat {
  display: grid;
  gap: 5px;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid rgba(199, 216, 227, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

.pool-stat:hover {
  border-color: #9fc5df;
  text-decoration: none;
}

.pool-stat.active {
  border-color: rgba(23, 105, 224, 0.42);
  background: linear-gradient(180deg, #fff, var(--primary-soft));
}

.pool-stat.available.active {
  background: linear-gradient(180deg, #fff, var(--success-soft));
}

.pool-stat.reserved.active {
  background: linear-gradient(180deg, #fff, var(--warning-soft));
}

.pool-stat.used.active {
  background: linear-gradient(180deg, #fff, var(--slate-soft));
}

.pool-stat.disabled.active {
  background: linear-gradient(180deg, #fff, var(--danger-soft));
}

.pool-stat span {
  color: var(--muted);
}

.pool-stat strong {
  color: #102a56;
  font-size: 22px;
  line-height: 1.1;
}

.mailbox-card {
  padding: 16px;
}

.mailbox-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(560px, 0.95fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.mailbox-toolbar h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.mailbox-toolbar h2 span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mailbox-toolbar p {
  margin: 2px 0 0;
  color: var(--muted);
}

.mailbox-filters {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #d5e3ec;
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid #e1e9ef;
  text-align: left;
  vertical-align: top;
}

th {
  background: linear-gradient(180deg, #f6fbfd, #edf6fa);
  color: #415269;
  font-weight: 800;
}

tbody tr {
  transition: background-color 130ms ease;
}

tbody tr:hover {
  background: #f7fcff;
}

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

.email-cell,
.note-cell {
  overflow-wrap: anywhere;
}

.mailbox-table {
  min-width: 1080px;
}

.mailbox-table th:nth-child(1),
.mailbox-table td:nth-child(1) {
  width: 35%;
}

.mailbox-table th:nth-child(2),
.mailbox-table td:nth-child(2) {
  width: 92px;
}

.mailbox-table th:nth-child(3),
.mailbox-table td:nth-child(3) {
  width: 154px;
}

.email-primary {
  min-width: 0;
}

.email-primary strong,
.email-primary span {
  display: block;
  overflow-wrap: anywhere;
}

.email-primary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mailbox-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: start;
  margin: 0;
}

.inline-edit {
  display: grid;
  grid-template-columns: 104px minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-edit.mailbox-edit {
  grid-template-columns: 104px minmax(180px, 1fr) auto;
}

.email-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.copy-button {
  min-width: 54px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

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

.button.disabled,
.button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.52;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(280px, 0.28fr);
  gap: 14px;
}

.account-summary {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  overflow: hidden;
}

.account-summary div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #e3edf3;
  background: #fff;
}

.account-summary div:last-child {
  border-bottom: 0;
}

.account-summary dt {
  color: var(--muted);
}

.account-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 13px;
  border: 1px solid #abefc6;
  border-radius: 8px;
  background: #ecfdf3;
  color: #05603a;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.mono {
  font-family: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
}

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

@media (max-width: 1180px) {
  .config-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 10px 12px;
  }

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

  .sidebar-foot {
    display: none;
  }

  .content-topbar {
    top: 0;
    padding: 10px 14px;
  }

  .content-area,
  .auth-shell {
    width: min(100% - 24px, 1320px);
  }

  .auth-layout,
  .dashboard-grid,
  .account-grid,
  .metric-strip,
  .pool-overview {
    grid-template-columns: 1fr;
  }

  .token-card {
    grid-row: auto;
  }

  .auth-brand {
    justify-items: center;
    text-align: center;
  }

  .table-console-head,
  .section-head.inline,
  .page-titlebar {
    align-items: stretch;
    flex-direction: column;
  }

  .filters,
  .inline-edit,
  .mailbox-toolbar,
  .mailbox-actions,
  .title-actions {
    grid-template-columns: 1fr;
  }

  .token-field,
  .proxy-field {
    min-width: 0;
  }

  .edit-notice {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .content-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .content-topbar .button,
  .side-nav a,
  .button,
  .title-actions {
    width: 100%;
  }

  .brand span {
    white-space: normal;
  }

  .auth-panel,
  .work-card {
    padding: 14px;
  }

  .auth-brand h1 {
    font-size: 30px;
  }

  .page-titlebar h1 {
    font-size: 20px;
  }

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

  .pager {
    align-items: stretch;
    flex-direction: column;
  }
}
