:root {
  color-scheme: light;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-muted: #f7f9fb;
  --line: #d8e0e7;
  --line-strong: #b7c3ce;
  --text: #17212b;
  --muted: #647383;
  --subtle: #8794a2;
  --primary: #146c5f;
  --primary-dark: #0f554b;
  --primary-soft: #e0f3ef;
  --danger: #b42318;
  --danger-soft: #fff0ed;
  --warning: #a15c00;
  --warning-soft: #fff4df;
  --success: #18794e;
  --success-soft: #e4f7eb;
  --shadow: 0 16px 48px rgba(23, 33, 43, 0.08);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(238, 242, 246, 0.9)),
    var(--bg);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.smash-order-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--primary-dark);
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

.smash-order-link:hover,
.smash-order-link:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.user-guide-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(17, 29, 45, 0.74);
}

.user-guide-highlight {
  position: fixed;
  z-index: 1001;
  border: 3px solid #4da2ff;
  border-radius: 10px;
  box-shadow: 0 0 0 5px rgba(77, 162, 255, 0.26), 0 0 22px rgba(77, 162, 255, 0.9);
  pointer-events: none;
  transition: all 160ms ease;
}

.user-guide-popover {
  position: fixed;
  z-index: 1002;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.3);
  color: #1a3358;
}

.user-guide-popover h2 { margin: 4px 28px 8px 0; font-size: 20px; }
.user-guide-popover > p:not(.user-guide-step) { margin: 0; color: #536885; font-size: 14px; line-height: 1.65; }
.user-guide-step { margin: 0; color: #3288eb; font-size: 13px; font-weight: 800; }
.user-guide-close { position: absolute; top: 13px; right: 13px; width: 30px; height: 30px; border: 0; border-radius: 7px; background: #edf4ff; color: #557092; font-size: 23px; line-height: 1; }
.user-guide-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.user-guide-skip { border: 0; background: transparent; color: #6f7f94; font-weight: 700; }
.user-guide-next { min-width: 74px; min-height: 36px; border: 0; border-radius: 6px; background: #438fe9; color: #fff; font-weight: 800; }

.admin-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 22px 14px;
}

.admin-sidebar-brand {
  padding: 0 8px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.admin-sidebar-brand strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.admin-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 14px;
}

.admin-mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 0 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.admin-mode-tab:hover,
.admin-mode-tab.active {
  border-color: #bae6d9;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav-group-hidden {
  display: none !important;
}

.admin-nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a.active {
  border-color: #bae6d9;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.workspace {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.order-module-toggle {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.order-module-toggle button {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.order-module-toggle button.active,
.order-module-toggle button:hover {
  background: var(--primary);
  color: #fff;
}

.smash-module-panel {
  min-height: min(860px, calc(100vh - 110px));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.smash-module-panel iframe {
  display: block;
  width: 100%;
  height: min(860px, calc(100vh - 110px));
  min-height: 720px;
  border: 0;
  background: var(--bg);
}

.channel-smash-module {
  min-height: min(520px, calc(100vh - 110px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.channel-smash-panel {
  display: grid;
  gap: 0;
}

.channel-smash-order-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.8fr) minmax(160px, 0.45fr) auto;
  gap: 14px;
  align-items: end;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.channel-smash-mode-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.channel-smash-mode-field legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.channel-smash-mode-options {
  display: flex;
  gap: 12px;
  min-height: 42px;
  align-items: center;
}

.channel-smash-mode-options label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.channel-smash-order-form .inline-note {
  grid-column: 1 / -1;
}

.admin-content {
  width: min(1260px, 100%);
  padding: 28px;
}

.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 4px;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 6px;
  color: var(--muted);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.top-nav a.active,
.top-nav a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 4px;
}

.view-toggle button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.view-toggle button.active,
.view-toggle button:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

body[data-view-mode="simple"] .full-mode-only {
  display: none !important;
}

.admin-note {
  margin: 8px 0 0;
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
}

.panel-heading p,
.field-error,
.form-message,
.empty-state {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.connection,
.status-badge,
.event-count {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(520px, 0.9fr) minmax(520px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.card-key-layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.admin-content .card-key-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-collapsed > :not(.panel-heading) {
  display: none !important;
}

.admin-section-hidden {
  display: none !important;
}

.collapse-toggle {
  min-width: 54px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.panel-heading p {
  margin-bottom: 0;
}

form {
  padding: 16px;
}

#orderForm {
  display: grid;
  gap: 12px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 10px;
}

.form-section-heading {
  margin-bottom: 10px;
}

.form-section-heading h3 {
  margin-bottom: 4px;
}

.form-section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field {
  margin-bottom: 12px;
}

.field:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 7px;
  color: #2b3845;
  font-size: 13px;
  font-weight: 700;
}

.label-with-hint {
  display: flex;
  align-items: center;
  gap: 10px;
}

.optional-hint {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 104px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}

.order-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.manual-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.manual-fields-grid .field {
  margin-bottom: 0;
}

.quick-fill-field {
  display: grid;
  grid-template-rows: auto minmax(112px, auto) auto;
  margin-bottom: 0;
}

.quick-fill-field textarea {
  height: auto;
  min-height: 112px;
}

.quick-fill-message {
  margin-top: 6px;
}

.option-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 36px;
  grid-column: 1 / -1;
}

.cross-server-option-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.info-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 1px solid rgba(20, 108, 95, 0.28);
  border-radius: 50%;
  background: rgba(20, 108, 95, 0.08);
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.info-button:hover:not(:disabled) {
  transform: none;
}

.info-button::after {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: min(260px, 72vw);
  padding: 8px 10px;
  border: 1px solid rgba(20, 108, 95, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  color: var(--text);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, -4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: normal;
}

.info-button:hover::after,
.info-button:focus::after,
.info-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 108, 95, 0.14);
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 108, 95, 0.14);
}

select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 108, 95, 0.14);
}

input.invalid,
textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  color: var(--text);
}

.check-field input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--primary);
}

.check-field span {
  font-size: 13px;
  font-weight: 700;
}

.field-error {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--danger);
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 0;
  padding-top: 2px;
}

.resettable-field {
  margin-bottom: 16px;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.inline-note {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.inline-note.error {
  color: var(--danger);
}

.inline-note.success {
  color: var(--success);
}

.inline-note.warning {
  color: var(--warning);
}

.utility-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(224, 243, 239, 0.7));
}

.utility-panel,
.usage-query-panel,
.batch-open-card-panel {
  margin-top: 18px;
}

.utility-panel-body {
  padding: 16px;
}

.taskhub-admin-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.taskhub-admin-controls {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.taskhub-admin-url-field {
  margin-bottom: 0;
}

.taskhub-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.taskhub-admin-frame {
  width: 100%;
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.utility-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.utility-column {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.utility-card {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid rgba(20, 108, 95, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 10px;
}

.utility-list > .utility-card {
  min-width: 0;
}

.utility-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.utility-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.utility-copy .danger-text {
  color: var(--danger);
  font-weight: 700;
}

.utility-action {
  display: grid;
  gap: 8px;
}

.stacked-action input {
  width: 100%;
}

.cross-server-add-card textarea {
  min-height: 112px;
}

.cross-server-result-list {
  display: grid;
  gap: 8px;
}

.cross-server-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(96px, 0.8fr) auto auto;
  gap: 8px;
  align-items: center;
}

.cross-server-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.channel-smash-admin-body {
  display: grid;
  gap: 0;
}

.channel-smash-help {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 14px 18px;
  color: var(--muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.channel-smash-help strong {
  flex: 0 0 auto;
  color: var(--text);
}

.channel-smash-sync-form,
.channel-smash-import-form,
.channel-smash-search-form,
.channel-smash-group-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.channel-smash-sync-form {
  grid-template-columns: minmax(320px, 0.5fr) auto minmax(260px, 1fr);
  align-items: end;
}

.channel-smash-import-form textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
}

.channel-smash-import-actions {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.channel-smash-search-form {
  grid-template-columns: minmax(260px, 1fr) minmax(120px, 0.25fr) minmax(120px, 0.25fr) auto;
  align-items: end;
}

.channel-smash-sync-form .field,
.channel-smash-import-form .field,
.channel-smash-search-form .field,
.channel-smash-group-form .field {
  margin-bottom: 0;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-utility-card {
  grid-column: 1 / -1;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.utility-action .ghost-button {
  justify-self: start;
}

.distributor-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(108px, 0.8fr) minmax(108px, 0.8fr);
  gap: 10px;
  align-items: start;
}

.distributor-fields .field {
  margin-bottom: 0;
}

.distributor-actions {
  margin: 12px 0 8px;
}

.distributor-generated-list {
  width: 100%;
  min-height: 96px;
  margin: 0 0 8px;
  resize: vertical;
}

.distributor-utility-card .distributor-fields {
  grid-template-columns: 1fr;
}

.distributor-secret-detail-row td {
  background: var(--surface-muted);
}

.distributor-issued-keys {
  min-width: 0;
  overflow-x: auto;
}

.nested-table {
  min-width: 760px;
  background: var(--surface);
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
}

.primary-button {
  flex: 1 1 auto;
  background: var(--primary);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-dark);
}

.ghost-button {
  flex: 0 0 auto;
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
}

.form-message {
  min-height: 22px;
  margin: 12px 0 0;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--success);
}

.form-message.warning {
  color: var(--warning);
}

.account-snapshot summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 700;
}

.account-snapshot-list {
  display: grid;
  gap: 6px;
  min-width: 320px;
  margin-top: 8px;
}

.account-snapshot-line {
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
}

.status-panel {
  min-height: 260px;
}

.status-badge.idle {
  background: var(--surface-muted);
}

.status-badge.active {
  border-color: #80b9ae;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.status-badge.success {
  border-color: #9ed7b8;
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.warning {
  border-color: #e7be75;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge.danger {
  border-color: #f1aaa3;
  background: var(--danger-soft);
  color: var(--danger);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  text-align: center;
}

.empty-mark {
  width: 48px;
  height: 48px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(var(--surface-muted), var(--surface-muted)) padding-box,
    repeating-linear-gradient(
      90deg,
      transparent 0 7px,
      rgba(20, 108, 95, 0.18) 7px 9px
    );
}

.hidden {
  display: none !important;
}

.order-content {
  padding: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.summary-grid div,
.error-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  padding: 10px;
}

dt {
  margin-bottom: 6px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.progress-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
}

.progress-step {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.progress-step.done {
  border-color: #acd5cc;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.progress-step.current {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.progress-step.error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.result-section {
  margin-top: 16px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title-row h3 {
  margin-bottom: 0;
}

.result-box {
  width: 100%;
  min-height: 112px;
  max-height: 260px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #f2f7f7;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.result-box.placeholder {
  background: var(--surface-muted);
  color: var(--muted);
  font-family: inherit;
}

.result-log-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.compact-actions {
  justify-content: flex-end;
}

.result-log-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.result-log-item,
.result-log-empty {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  padding: 10px;
}

.result-log-empty {
  color: var(--muted);
  font-size: 13px;
}

.result-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.result-log-copy-button {
  margin-left: auto;
}

.result-log-text {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.batch-open-card-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 14px;
}

.batch-open-card-input-field {
  min-width: 0;
}

.batch-open-card-options {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.batch-open-card-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.batch-open-card-actions .primary-button {
  flex: 0 0 auto;
}

.batch-open-card-actions .inline-note {
  flex: 1 1 260px;
}

.batch-open-card-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.batch-open-card-empty,
.batch-open-card-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  padding: 12px;
}

.batch-open-card-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.batch-open-card-item.active {
  border-color: #80b9ae;
  background: var(--primary-soft);
}

.batch-open-card-item.success {
  border-color: #9ed7b8;
  background: var(--success-soft);
}

.batch-open-card-item.warning {
  border-color: #e7be75;
  background: var(--warning-soft);
}

.batch-open-card-item.danger {
  border-color: #f1aaa3;
  background: var(--danger-soft);
}

.batch-open-card-main {
  min-width: 0;
}

.batch-open-card-main strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.batch-open-card-main span,
.batch-open-card-main p,
.batch-open-card-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.batch-open-card-main p {
  margin: 4px 0 0;
}

.batch-open-card-badge {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.batch-open-card-result {
  grid-column: 1 / -1;
  max-height: 180px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #f2f7f7;
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.error-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.6fr) minmax(0, 1.4fr);
  gap: 10px;
  margin: 0;
}

.error-grid dd {
  color: var(--danger);
}

.announcement-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.announcement-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 33, 43, 0.42);
}

.announcement-modal-dialog {
  position: relative;
  width: min(520px, 100%);
  border: 1px solid #f1aaa3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(23, 33, 43, 0.22);
  overflow: hidden;
}

.announcement-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #f1aaa3;
  background: var(--danger-soft);
  padding: 14px 16px;
}

.announcement-modal-heading h2 {
  margin: 0;
  color: var(--danger);
}

.announcement-modal-body {
  min-height: 96px;
  max-height: 58vh;
  overflow: auto;
  color: var(--danger);
  padding: 18px 16px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.usage-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.usage-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 33, 43, 0.42);
}

.usage-detail-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(23, 33, 43, 0.22);
  overflow: hidden;
}

.usage-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  padding: 14px 16px;
}

.usage-detail-heading h2 {
  margin: 0;
}

.usage-detail-body {
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 16px;
}

.usage-detail-body h3 {
  margin: 16px 0 8px;
  font-size: 14px;
}

.usage-detail-body pre {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  color: #f8fafc;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.usage-detail-meta {
  display: grid;
  grid-template-columns: minmax(90px, 0.3fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.usage-detail-meta dt {
  color: var(--muted);
  font-weight: 800;
}

.usage-detail-meta dd {
  margin: 0;
}

.usage-detail-account-list {
  display: grid;
  gap: 8px;
}

.events-panel {
  margin-top: 18px;
}
.table-panel {
  margin-top: 18px;
}

.usage-query-message {
  margin: 14px 18px 0;
}

.traffic-panel {
  grid-column: 1 / -1;
}

.database-panel {
  grid-column: 1 / -1;
}

.periodic-panel {
  grid-column: 1 / -1;
}

.traffic-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.traffic-controls select {
  width: 92px;
  height: 34px;
  padding: 0 8px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.database-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.periodic-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.database-search-form,
.database-ip-replace-form,
.database-clear-inventory-form,
.account-pause-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.key-search-form {
  grid-template-columns: repeat(7, minmax(0, 1fr)) auto;
}

.auto-smash-search-form {
  grid-template-columns: minmax(420px, 2fr) auto;
  padding: 20px 22px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
}

.auto-smash-schedule-form {
  grid-template-columns: minmax(220px, 0.7fr) minmax(180px, 0.45fr) auto;
}

.auto-smash-search-form input {
  min-height: 46px;
  font-size: 16px;
}

.auto-smash-search-form .database-search-actions {
  align-items: center;
}

.auto-smash-credentials {
  display: grid;
  gap: 8px;
}

.auto-smash-credentials label {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auto-smash-credentials input {
  min-width: 0;
}

.auto-smash-order-list {
  display: grid;
  gap: 20px;
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
}

.auto-smash-order-card {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--accent) 22%);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgb(18 43 60 / 6%);
}

.auto-smash-order-card-header,
.auto-smash-group-toolbar,
.auto-smash-account-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.auto-smash-order-card-header {
  padding: 16px 20px;
  background: color-mix(in srgb, var(--surface) 84%, var(--accent) 16%);
}

.auto-smash-order-card-header > div:first-child {
  display: grid;
  gap: 4px;
}

.auto-smash-order-card-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auto-smash-charge {
  color: var(--muted);
  font-size: 14px;
}

.auto-smash-charge strong {
  color: var(--ink);
}

.auto-smash-group-toolbar {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.auto-smash-group-title {
  min-width: 72px;
  color: var(--accent-strong);
  font-weight: 800;
}

.auto-smash-group-toolbar label,
.auto-smash-account-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auto-smash-group-toolbar input {
  width: 132px;
}

.auto-smash-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  padding: 20px;
}

.auto-smash-account-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 97%, var(--accent) 3%);
}

.auto-smash-account-card-title {
  color: var(--accent-strong);
  font-weight: 800;
}

.auto-smash-account-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auto-smash-account-actions {
  justify-content: flex-end;
}

.auto-smash-result-cell {
  min-width: 260px;
  max-width: 480px;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.auto-smash-schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.database-search-form .field,
.database-ip-replace-form .field,
.database-clear-inventory-form .field,
.account-pause-form .field {
  margin-bottom: 0;
}

.database-ip-replace-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto minmax(220px, 1fr);
}

.database-clear-inventory-form {
  grid-template-columns: minmax(220px, 0.5fr) auto minmax(260px, 1fr);
}

.account-pause-form {
  grid-template-columns: minmax(280px, 2fr) minmax(180px, 1fr) auto minmax(220px, 1fr);
}

.account-pause-output {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.account-pause-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 1px;
}

.account-pause-table {
  min-width: 920px;
}

.inline-message {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.inline-message.success {
  color: var(--success);
}

.inline-message.error {
  color: var(--danger);
}

.range-field {
  grid-column: span 2;
}

.range-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.periodic-settings-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.periodic-settings-form .field,
.periodic-toggle {
  margin-bottom: 0;
}

.periodic-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 1px;
}

.periodic-details {
  padding: 18px;
}

.database-search-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 1px;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 18px 14px;
}

.batch-text-delete {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 0 18px 18px;
  border-bottom: 1px solid var(--line);
}

.batch-text-delete .field {
  margin-bottom: 0;
}

.batch-text-delete textarea {
  min-height: 96px;
  resize: vertical;
}

.batch-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-right: auto;
}

.table-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.database-results {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.database-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.database-result-heading h3 {
  margin-bottom: 0;
}

.account-table {
  min-width: 1180px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td,
.selected-row td {
  background: var(--primary-soft);
}

.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.metric-card.danger-card strong {
  color: var(--danger);
}

.traffic-split {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  padding: 18px;
}

.traffic-series {
  display: grid;
  gap: 10px;
  align-content: start;
}

.traffic-bar-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 136px;
  align-items: center;
  gap: 10px;
}

.traffic-bar-label,
.traffic-bar-meta,
.traffic-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.traffic-bar-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.traffic-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.traffic-recent {
  min-width: 0;
}

.traffic-recent-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.traffic-recent-title h3 {
  margin-bottom: 0;
}

.compact-table {
  min-width: 620px;
}

.generated-list {
  width: calc(100% - 36px);
  min-height: 196px;
  margin: 18px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #f2f7f7;
  padding: 12px;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.card-key-usage-table {
  min-width: 960px;
}

.order-feedback-table {
  min-width: 1180px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  color: var(--subtle);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 800;
}

.data-table td {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.usage-query-detail-row td {
  background: #f8fafb;
}

.usage-query-result {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #f2f7f7;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.data-table th.card-key-quota-head,
.data-table td.card-key-quota-cell {
  border-bottom-color: #aebbc7;
  background: #dfe6ee;
  color: #263442;
  font-weight: 800;
}

.data-table th.card-key-quota-head {
  color: #415365;
}

.danger-button {
  border-color: #f1aaa3;
  background: var(--danger-soft);
  color: var(--danger);
}

.danger-button:hover:not(:disabled) {
  background: #ffe2dc;
  color: var(--danger);
}

.table-number-input,
.table-select {
  width: 100%;
  min-width: 84px;
  border: 1px solid #aebbc7;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  padding: 7px 8px;
}

.table-number-input:focus,
.table-select:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(44, 137, 120, 0.16);
  outline-offset: 1px;
}

.quota-remaining-value {
  display: inline-flex;
  min-width: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.52);
  padding: 7px 8px;
}

.quota-invalid {
  color: var(--danger);
  background: var(--danger-soft);
}

.table-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-empty {
  color: var(--muted) !important;
  text-align: center !important;
}

@media (max-width: 900px) {
  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-content {
    padding: 18px;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    padding: 18px;
  }

  .admin-shell {
    padding: 0;
  }

  .page-title,
  .layout-grid,
  .card-key-layout {
    display: block;
  }

  .title-actions {
    justify-content: space-between;
    margin-top: 12px;
  }

  .order-module-toggle {
    width: 100%;
  }

  .order-module-toggle button {
    flex: 1;
  }

  .smash-module-panel,
  .smash-module-panel iframe,
  .channel-smash-module {
    min-height: calc(100vh - 132px);
    height: calc(100vh - 132px);
  }

  .order-entry-grid {
    grid-template-columns: 1fr;
  }

  .quick-fill-field textarea {
    min-height: 128px;
  }

  .utility-list {
    grid-template-columns: 1fr;
  }

  .batch-open-card-form {
    grid-template-columns: 1fr;
  }

  .channel-smash-order-form {
    grid-template-columns: 1fr;
  }

  .traffic-panel,
  .database-panel,
  .periodic-panel {
    margin-bottom: 18px;
  }

  .metric-grid,
  .database-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .database-search-form,
  .database-ip-replace-form,
  .database-clear-inventory-form,
  .account-pause-form,
  .key-search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auto-smash-search-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .auto-smash-order-card-header,
  .auto-smash-group-toolbar,
  .auto-smash-account-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .auto-smash-group-toolbar input {
    width: 100%;
  }

  .auto-smash-account-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .channel-smash-sync-form,
  .channel-smash-import-actions,
  .channel-smash-search-form {
    grid-template-columns: 1fr;
  }

  .range-field {
    grid-column: 1 / -1;
  }

  .periodic-settings-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .database-search-actions,
  .account-pause-actions,
  .inline-message {
    grid-column: 1 / -1;
  }

  .batch-text-delete {
    grid-template-columns: 1fr;
  }

  .periodic-toggle,
  .periodic-actions {
    grid-column: 1 / -1;
  }

  .traffic-split {
    grid-template-columns: 1fr;
  }

  .title-actions {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 12px;
  }

  .connection {
    display: inline-block;
  }

  .status-panel {
    margin-top: 18px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .distributor-fields {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .layout-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-panel {
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 12px;
  }

  .admin-shell {
    padding: 0;
  }

  .admin-content {
    padding: 12px;
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .status-badge,
  .event-count {
    display: inline-block;
    margin-top: 12px;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav a {
    flex: 1 1 0;
    justify-content: center;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .manual-fields-grid {
    grid-template-columns: 1fr;
  }

  .option-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .utility-action .ghost-button {
    justify-self: stretch;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    align-items: stretch;
  }

  .traffic-controls {
    align-items: stretch;
    margin-top: 12px;
  }

  .traffic-controls select,
  .traffic-controls button {
    flex: 1 1 0;
  }

  .metric-grid,
  .database-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .database-search-form,
  .database-ip-replace-form,
  .database-clear-inventory-form,
  .account-pause-form,
  .key-search-form,
  .periodic-settings-form,
  .database-results {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .range-inputs {
    grid-template-columns: 1fr;
  }

  .database-search-actions,
  .account-pause-actions,
  .database-result-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .database-search-actions button {
    width: 100%;
  }

  .table-heading-actions {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    margin-top: 12px;
  }

  .table-heading-actions button {
    width: 100%;
  }

  .periodic-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .periodic-actions button {
    width: 100%;
  }

  .batch-open-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-open-card-actions button,
  .batch-open-card-actions .inline-note {
    width: 100%;
  }

  .batch-open-card-item {
    grid-template-columns: 1fr;
  }

  .batch-open-card-badge {
    justify-self: start;
  }

  .traffic-split {
    padding: 12px;
  }

  .traffic-bar-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .traffic-bar-meta {
    grid-column: 2;
  }

  .summary-grid,
  .error-grid,
  .progress-track {
    grid-template-columns: 1fr;
  }
}
