:root {
  --ink: #17202a;
  --muted: #667085;
  --subtle: #8a94a6;
  --page: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-tint: #f1f5f9;
  --line: #d8dee8;
  --line-strong: #c7d0dd;
  --primary: #2563eb;
  --primary-deep: #1d4ed8;
  --primary-soft: #eaf1ff;
  --green: #11865a;
  --green-soft: #e8f7f0;
  --amber: #b86b00;
  --amber-soft: #fff5df;
  --red: #c3312f;
  --red-soft: #ffeded;
  --purple: #6d55c5;
  --purple-soft: #f0ecff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 28px rgba(16, 24, 40, 0.06);
  --shadow-tight: 0 1px 2px rgba(16, 24, 40, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--page);
  font-size: 14px;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  min-width: 0;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.26);
  outline-offset: 2px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.shell {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.control-hero {
  display: grid;
  grid-template-columns: minmax(400px, 1fr) minmax(220px, 0.6fr) minmax(220px, 0.55fr) minmax(220px, 0.55fr);
  grid-template-areas:
    "copy actions actions actions"
    "status url refresh refresh";
  gap: 18px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-tight);
}

.hero-copyblock {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-right: 12px;
  min-height: 112px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.app-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #1d4ed8;
  border-radius: var(--radius);
  background: #2563eb;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.08);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 760px;
  margin: 10px 0 0 58px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.relay-status {
  grid-area: status;
  min-width: 0;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.relay-status strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.relay-status p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.relay-url-field {
  grid-area: url;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
}

.relay-url-field input,
.search-box input,
.auto-refresh-box select,
.draft-form input,
.draft-form select,
.cookie-dialog input,
.cookie-dialog select,
.cookie-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(16, 24, 40, 0.02);
}

.relay-url-field input,
.search-box input,
.draft-form input,
.draft-form select,
.cookie-dialog input,
.cookie-dialog select,
.cookie-dialog textarea {
  padding: 10px 12px;
}

.auto-refresh-box {
  grid-area: refresh;
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr);
  gap: 6px 18px;
  align-content: start;
  align-items: start;
  min-width: 0;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
}

.auto-refresh-box label:not(.toggle) {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  gap: 8px;
}

.auto-refresh-box select {
  padding: 9px 10px;
}

.auto-refresh-box > span {
  grid-column: 1;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.hero-actions,
.dialog-actions,
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions {
  grid-area: actions;
  justify-content: flex-end;
  align-content: start;
  align-self: start;
  padding-top: 10px;
}

.hero-actions .ghost {
  min-width: 132px;
  width: auto;
  justify-content: center;
}

.primary,
.ghost,
.filter-pill,
.icon-button,
.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 13px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-tight);
}

.primary:hover {
  border-color: var(--primary-deep);
  background: var(--primary-deep);
}

.ghost:hover,
.filter-pill:hover,
.row-action:hover {
  border-color: var(--line-strong);
  background: var(--surface-tint);
}

.connection-ok {
  color: var(--green);
}

.connection-warn {
  color: var(--amber);
}

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

.metric-card,
.toolbar,
.brand-table-card,
.cookie-dialog,
.inspector-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-tight);
}

.metric-card {
  min-height: 108px;
  padding: 16px;
}

.metric-value {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.metric-label,
.brand-meta,
.diagnosis {
  color: var(--muted);
  line-height: 1.5;
}

.metric-label {
  font-weight: 600;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(420px, 100%);
  color: var(--muted);
  font-weight: 700;
}

.search-box span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.filters {
  justify-content: center;
}

.filter-pill {
  min-height: 36px;
  color: var(--muted);
  background: var(--surface);
}

.filter-pill.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.layout {
  display: block;
  margin-top: 16px;
}

.brand-table-card {
  overflow: hidden;
}

.brand-table-scroll {
  max-height: calc(100vh - 300px);
  overflow: auto;
}

.brand-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.brand-table .col-platform {
  width: 122px;
}

.brand-table .col-brand {
  width: 42%;
}

.brand-table .col-status {
  width: 136px;
}

.brand-table .col-shops {
  width: 150px;
}

.brand-table .col-risk {
  width: 92px;
}

.brand-table .col-runtime {
  width: 232px;
}

.brand-table .col-action {
  width: 86px;
}

.brand-table th,
.brand-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  vertical-align: middle;
}

.brand-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: #fbfcfe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-table tbody tr {
  cursor: pointer;
  background: var(--surface);
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.brand-table tbody tr:hover {
  background: #f8fbff;
}

.brand-table tbody tr.selected {
  background: #f2f6ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.brand-table tbody tr.selected.platform-row-meituan {
  background: #fffaf0;
  box-shadow: inset 3px 0 0 #f0b400;
}

.brand-table tbody tr.selected.platform-row-taobao {
  background: #fff6f0;
  box-shadow: inset 3px 0 0 #f97316;
}

.brand-table tbody tr.selected.platform-row-jd {
  background: #fff4f5;
  box-shadow: inset 3px 0 0 #d92d3f;
}

.table-brand-name,
.table-diagnosis {
  display: block;
}

.table-brand-name {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.table-diagnosis {
  max-width: min(640px, 100%);
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted-cell {
  color: var(--muted);
  font-weight: 700;
}

.risk-count {
  color: var(--red);
}

.brand-table code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--subtle);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-coverage {
  display: grid;
  gap: 2px;
}

.shop-coverage strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: 0;
}

.shop-coverage span,
.runtime-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.risk-badge {
  display: inline-grid;
  min-width: 34px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--green);
  font-weight: 800;
}

.risk-badge.has-risk {
  border-color: #ffc9c9;
  background: var(--red-soft);
  color: var(--red);
}

.machine-name {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 800;
}

.runtime-meta {
  display: block;
  margin-bottom: 3px;
  white-space: nowrap;
}

.runtime-mode {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  background: var(--surface-soft);
}

.runtime-mode.confirmed {
  border-color: #bce7d2;
  color: var(--green);
  background: var(--green-soft);
}

.runtime-mode.compat {
  border-color: #f7d99d;
  color: var(--amber);
  background: var(--amber-soft);
}

.row-action {
  min-height: 34px;
  padding: 7px 10px;
  color: var(--primary-deep);
}

.empty-table {
  padding: 32px;
  text-align: center;
}

.empty-table p {
  margin: 8px 0 0;
  color: var(--muted);
}

.platform-tag,
.status-pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.platform-tag {
  gap: 6px;
  color: var(--muted);
  background: var(--surface-soft);
}

.platform-mark {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.platform-meituan {
  border-color: #f3d36b;
  background: #fff8d6;
  color: #7a5700;
}

.platform-meituan .platform-mark {
  background: #f6c844;
  color: #3d2b00;
}

.platform-taobao {
  border-color: #ffc49d;
  background: #fff2e8;
  color: #9a3b00;
}

.platform-taobao .platform-mark {
  background: #f97316;
  color: #ffffff;
}

.platform-jd {
  border-color: #ffb8c0;
  background: #fff0f2;
  color: #a31627;
}

.platform-jd .platform-mark {
  background: #d92d3f;
  color: #ffffff;
}

.status-pill.ok {
  border-color: #bce7d2;
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.warn {
  border-color: #f7d99d;
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.bad {
  border-color: #ffc9c9;
  color: var(--red);
  background: var(--red-soft);
}

.status-pill.idle {
  border-color: #cbd9ff;
  color: var(--primary-deep);
  background: var(--primary-soft);
}

.diagnosis {
  margin-bottom: 0;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.detail-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-top-actions strong {
  font-size: 18px;
  letter-spacing: 0;
}

.detail-top-actions .eyebrow {
  margin-bottom: 4px;
}

.detail-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.detail-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.detail-row span:first-child {
  flex: 0 0 auto;
  color: var(--muted);
}

.detail-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.event-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.event {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.event strong {
  display: block;
  margin-bottom: 3px;
}

.event p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.panel-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.panel-actions.single {
  grid-template-columns: 1fr;
}

.draft-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.draft-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.draft-output {
  min-height: 360px;
  margin-top: 12px;
}

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

.draft-check,
.draft-step-card,
.next-action {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.draft-check {
  display: grid;
  gap: 5px;
  min-height: 108px;
  padding: 12px;
}

.draft-check strong,
.next-action strong {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  font-size: 12px;
}

.draft-check span,
.next-action span {
  font-weight: 800;
}

.draft-check p,
.next-action p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.draft-check.ok strong,
.next-action.ok strong {
  border-color: #bce7d2;
  color: var(--green);
  background: var(--green-soft);
}

.draft-check.warn strong,
.next-action.warn strong,
.next-action.todo strong {
  border-color: #f7d99d;
  color: var(--amber);
  background: var(--amber-soft);
}

.draft-check.bad strong,
.next-action.bad strong {
  border-color: #ffc9c9;
  color: var(--red);
  background: var(--red-soft);
}

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

.draft-step-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
}

.draft-step-card span {
  display: block;
  margin-bottom: 2px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.draft-step-card strong {
  display: block;
  font-size: 14px;
}

.draft-step-card .ghost {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.cookie-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(86vh, 880px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
}

.converter-dialog {
  width: min(920px, calc(100vw - 32px));
}

.inspector-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(90vh, 920px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
}

.cookie-dialog::backdrop,
.inspector-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.cookie-dialog form,
.inspector-dialog form {
  padding: 22px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 4px;
}

.icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--muted);
  font-size: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cookie-dialog label {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.cookie-dialog textarea {
  min-height: 168px;
  resize: vertical;
}

.cookie-dialog textarea.converter-output {
  min-height: 230px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.dialog-note {
  margin: 12px 0;
  padding: 11px 12px;
  border: 1px solid #cbd9ff;
  border-radius: var(--radius);
  color: var(--primary-deep);
  background: var(--primary-soft);
  line-height: 1.6;
}

.cookie-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.6;
}

.preview-grid {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 7px 12px;
  margin-bottom: 10px;
}

.preview-grid span {
  color: var(--muted);
  font-weight: 700;
}

.preview-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.preview-ok,
.preview-warn,
.preview-error {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.preview-ok {
  border-color: #bce7d2;
  color: var(--green);
  background: var(--green-soft);
}

.preview-warn {
  border-color: #f7d99d;
  color: var(--amber);
  background: var(--amber-soft);
}

.preview-error {
  border-color: #ffc9c9;
  color: var(--red);
  background: var(--red-soft);
}

.inspector-content {
  display: grid;
  gap: 12px;
  max-height: min(72vh, 760px);
  overflow: auto;
  padding: 2px 2px 10px;
}

.inspector-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.inspector-section h3 {
  margin-bottom: 10px;
}

.section-headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.section-headline span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.compact {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.next-action {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.inspector-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 14px;
}

.inspector-grid span {
  color: var(--muted);
  font-weight: 700;
}

.inspector-grid strong,
.inspector-grid code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.inspector-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.inspector-table th,
.inspector-table td {
  padding: 9px 8px;
  border-bottom: 1px dashed var(--line);
  text-align: left;
  vertical-align: top;
}

.inspector-table th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.code-block {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #222b3a;
  border-radius: var(--radius);
  background: #121826;
  color: #e6edf8;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 1180px) {
  .control-hero {
    grid-template-columns: minmax(360px, 1fr) minmax(260px, 0.5fr);
    grid-template-areas:
      "copy actions"
      "status status"
      "url refresh";
  }

  .hero-actions {
    justify-content: flex-start;
    padding-top: 0;
  }

  .hero-actions .ghost {
    width: auto;
  }

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

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

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 28px, 1440px);
    padding-top: 16px;
  }

  .control-hero,
  .toolbar {
    align-items: stretch;
  }

  .control-hero,
  .toolbar,
  .detail-top-actions {
    flex-direction: column;
  }

  .control-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "status"
      "url"
      "refresh"
      "actions";
    padding: 16px;
  }

  .hero-copyblock {
    padding-right: 0;
  }

  .hero-copy {
    margin-left: 0;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .ghost {
    width: 100%;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-box {
    min-width: 0;
  }

  .filters {
    justify-content: flex-start;
  }

  .summary-grid,
  .form-grid,
  .draft-form,
  .draft-checks,
  .draft-steps,
  .next-actions {
    grid-template-columns: 1fr;
  }

  .brand-table-scroll {
    max-height: none;
  }

  .metric-card {
    min-height: 92px;
  }

  .panel-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 20px;
  }

  .shell {
    width: min(100vw - 20px, 1440px);
  }

  .app-brand {
    align-items: flex-start;
  }

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

  .summary-grid {
    gap: 10px;
  }

  .detail-row,
  .draft-step-card,
  .section-headline {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-row strong {
    text-align: left;
  }

  .inspector-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .cookie-dialog form,
  .inspector-dialog form {
    padding: 16px;
  }
}
