:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #17201e;
  --muted: #68736f;
  --line: #dce3e0;
  --line-strong: #c7d1cd;
  --primary: #0d756d;
  --primary-hover: #095f59;
  --primary-soft: #e5f4f1;
  --danger: #bd403b;
  --danger-hover: #9f312d;
  --danger-soft: #faeae8;
  --warning: #ac6e14;
  --warning-soft: #fff3d9;
  --sidebar: #171c1f;
  --sidebar-muted: #9ea8a5;
  --shadow-lg: 0 24px 70px rgb(18 32 27 / 18%);
  --shadow-sm: 0 1px 2px rgb(18 32 27 / 5%);
  --radius: 7px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, label, input, textarea { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.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; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    linear-gradient(90deg, transparent 31px, rgb(23 32 30 / 3%) 32px, transparent 33px),
    linear-gradient(transparent 31px, rgb(23 32 30 / 3%) 32px, transparent 33px),
    #eef2f0;
  background-size: 32px 32px;
}

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

.login-brand, .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 15px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 6px;
  color: white;
  background: var(--primary);
}

.brand-mark svg { width: 20px; height: 20px; }
.login-copy { margin: 54px 0 30px; }
.eyebrow { margin: 0 0 6px; color: var(--primary); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.login-copy h1, .workspace-header h1 { margin: 0; font-size: 27px; line-height: 1.2; }
.login-copy > p:last-child { margin: 10px 0 0; color: var(--muted); }
.login-form { display: grid; gap: 18px; }
.login-foot { margin: 26px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.field { display: grid; align-content: start; gap: 7px; min-width: 0; margin: 0; border: 0; padding: 0; }
.field > span, .field > legend { color: #34413d; font-size: 13px; font-weight: 650; }
.field b { color: var(--danger); }
.field small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.field input, .field textarea, .search-field input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input { height: 42px; padding: 0 12px; }
.field textarea { min-height: 84px; padding: 10px 12px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .search-field input::placeholder { color: #99a39f; }
.field input:focus, .field textarea:focus, .search-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(13 117 109 / 12%); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgb(189 64 59 / 10%); }
.field-error { color: var(--danger) !important; min-height: 0; }
.field-error:empty { display: none; }

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  transition: background .16s ease, border-color .16s ease, transform .12s ease, opacity .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: .62; transform: none; }
.button svg { width: 17px; height: 17px; }
.button-primary { color: white; background: var(--primary); border-color: var(--primary); }
.button-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button-secondary { color: #34413d; background: var(--surface); border-color: var(--line-strong); }
.button-secondary:hover { background: var(--surface-soft); }
.button-danger { color: white; background: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.button-block { width: 100%; min-height: 44px; }
.button-arrow { margin-left: auto; }
.form-error { margin: 0; padding: 10px 12px; border: 1px solid #edc2bf; border-radius: 6px; color: #8f2e2a; background: var(--danger-soft); font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  color: white;
  background: var(--sidebar);
}
.sidebar-brand { padding: 0 6px 24px; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-item, .logout-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--sidebar-muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.nav-item svg, .logout-button svg { width: 18px; height: 18px; }
.nav-item:hover, .logout-button:hover { color: white; background: rgb(255 255 255 / 6%); }
.nav-item.is-active { color: white; background: rgb(255 255 255 / 10%); }
.sidebar-footer { display: grid; gap: 14px; margin-top: auto; }
.sidebar-health { display: flex; align-items: center; gap: 10px; padding: 13px 12px; border-top: 1px solid rgb(255 255 255 / 9%); border-bottom: 1px solid rgb(255 255 255 / 9%); }
.health-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #d7a84d; box-shadow: 0 0 0 4px rgb(215 168 77 / 12%); }
.sidebar-health.is-healthy .health-dot { background: #4dc3a8; box-shadow: 0 0 0 4px rgb(77 195 168 / 12%); }
.sidebar-health.is-error .health-dot { background: #ef776f; box-shadow: 0 0 0 4px rgb(239 119 111 / 12%); }
.health-copy { min-width: 0; display: grid; }
.health-copy strong { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.health-copy small { color: var(--sidebar-muted); font-size: 11px; }
.logout-button { font-size: 13px; }
.account-actions { display: grid; gap: 3px; }

.workspace { grid-column: 2; width: 100%; max-width: 1520px; min-width: 0; padding: 34px clamp(24px, 4vw, 60px) 60px; }
.workspace-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #42504c;
  background: var(--surface);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}
.icon-button:hover { color: var(--primary); border-color: #9fc4bd; background: #f8fcfb; }
.icon-button:active { transform: scale(.96); }
.icon-button:disabled { opacity: .5; cursor: wait; }
.icon-button.is-spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-banner {
  margin: 27px 0 20px;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 15px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid #d7a84d;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.status-banner.is-healthy { border-left-color: var(--primary); }
.status-banner.is-error { border-left-color: var(--danger); }
.status-leading { min-width: 0; display: flex; align-items: center; gap: 13px; }
.status-indicator { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #d7a84d; }
.status-banner.is-healthy .status-indicator { background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.status-banner.is-error .status-indicator { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-soft); }
.status-leading strong { display: block; margin-bottom: 2px; font-size: 13px; }
.status-leading p { max-width: 600px; margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.status-banner.is-error .status-leading p { color: #8f2e2a; }
.status-metrics { display: flex; align-items: center; gap: 0; margin: 0; }
.status-metrics > div { min-width: 94px; padding: 1px 18px; border-left: 1px solid var(--line); }
.status-metrics dt { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.status-metrics dd { margin: 2px 0 0; font-size: 13px; font-weight: 750; white-space: nowrap; }

.rule-section { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.section-toolbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.section-toolbar h2 { margin: 0; font-size: 16px; }
.section-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.search-field { position: relative; display: block; width: min(100%, 300px); }
.search-field svg { position: absolute; top: 10px; left: 11px; width: 17px; height: 17px; color: #7d8884; pointer-events: none; }
.search-field input { height: 38px; padding: 0 12px 0 36px; }

.table-wrap { width: 100%; overflow-x: auto; }
.rules-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rules-table th { height: 38px; padding: 0 14px; color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 800; text-align: left; text-transform: uppercase; }
.rules-table th:nth-child(1) { width: 22%; }
.rules-table th:nth-child(2) { width: 13%; }
.rules-table th:nth-child(3) { width: 25%; }
.rules-table th:nth-child(4) { width: 19%; }
.rules-table th:nth-child(5) { width: 12%; }
.rules-table th:nth-child(6) { width: 104px; }
.rules-table td { height: 73px; padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.rules-table tbody tr { transition: background .12s ease; }
.rules-table tbody tr:hover { background: #fafcfb; }
.rule-identity { min-width: 0; display: grid; gap: 3px; }
.rule-identity strong, .upstream-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-identity strong { font-size: 13px; }
.rule-identity span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.upstream-wrap { min-width: 0; display: flex; align-items: center; gap: 5px; }
.copy-button { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border: 0; border-radius: 5px; color: #7b8783; background: transparent; cursor: pointer; }
.copy-button:hover { color: var(--primary); background: var(--primary-soft); }
.copy-button svg { width: 14px; height: 14px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 4px; color: #53605c; background: var(--surface-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.tag.cors { color: #0b675f; border-color: #b9ded8; background: var(--primary-soft); }
.tag.private { color: #84520b; border-color: #ead3a5; background: var(--warning-soft); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a8b0ad; }
.status-pill.enabled { color: #0b675f; }
.status-pill.enabled::before { background: var(--primary); }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.row-action { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 5px; color: #63706c; background: transparent; cursor: pointer; }
.row-action:hover { color: var(--primary); border-color: #c4ddd8; background: var(--primary-soft); }
.row-action.danger:hover { color: var(--danger); border-color: #ebc2bf; background: var(--danger-soft); }
.row-action svg { width: 16px; height: 16px; }

.loading-state { min-height: 230px; display: grid; align-content: center; gap: 12px; padding: 24px; }
.loading-state span { height: 42px; border-radius: 5px; background: linear-gradient(90deg, #f2f5f4 25%, #e9eeec 50%, #f2f5f4 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }
.empty-state { min-height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.empty-state.compact { min-height: 220px; }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); }
.empty-icon svg { width: 24px; height: 24px; }
.empty-state h3 { margin: 0; font-size: 16px; }
.empty-state p { max-width: 380px; margin: 7px 0 18px; color: var(--muted); }

.dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dialog::backdrop { background: rgb(17 25 23 / 58%); backdrop-filter: blur(2px); }
.dialog-form { height: 100%; max-height: calc(100vh - 36px); display: flex; flex-direction: column; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 21px 24px 18px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 19px; }
.dialog-close { width: 36px; height: 36px; border-color: transparent; }
.dialog-body { overflow-y: auto; overscroll-behavior: contain; }
.form-section { padding: 24px; border-bottom: 1px solid var(--line); }
.form-section-heading { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 11px; align-items: start; margin-bottom: 21px; }
.form-section-heading h3 { margin: 1px 0 2px; font-size: 15px; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.step-number { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #b9d8d2; border-radius: 5px; color: var(--primary); background: var(--primary-soft); font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 16px; }
.span-2 { grid-column: 1 / -1; }
.segmented-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.segmented-control label { position: relative; cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { min-height: 63px; display: grid; align-content: center; gap: 2px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); transition: border-color .16s, background .16s, box-shadow .16s; }
.segmented-control strong { font-size: 12px; }
.segmented-control small { color: var(--muted); font-size: 11px; }
.segmented-control input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.segmented-control input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-row { min-height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); cursor: pointer; }
.switch-row > span { display: grid; }
.switch-row strong { font-size: 12px; }
.switch-row small { color: var(--muted); font-size: 11px; }
.switch-row input, .switch-only input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 36px; height: 20px; display: inline-block; border-radius: 20px; background: #b9c2bf; transition: background .18s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 2px rgb(0 0 0 / 22%); transition: transform .18s ease; }
.switch-row input:checked + .switch, .switch-only input:checked + .switch { background: var(--primary); }
.switch-row input:checked + .switch::after, .switch-only input:checked + .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch, .switch-only input:focus-visible + .switch { outline: 2px solid var(--primary); outline-offset: 2px; }
.cors-title-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
.switch-only { display: inline-flex; align-items: center; padding: 5px; cursor: pointer; }
.cors-fields { position: relative; transition: opacity .16s; }
.cors-fields[aria-disabled="true"] { opacity: .46; }
.cors-fields[aria-disabled="true"]::after { content: ""; position: absolute; inset: 0; cursor: not-allowed; }
.check-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.check-options label { position: relative; cursor: pointer; }
.check-options input { position: absolute; opacity: 0; pointer-events: none; }
.check-options span { height: 34px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; color: #53605c; background: var(--surface); font-size: 11px; font-weight: 750; transition: border-color .16s, color .16s, background .16s; }
.check-options input:checked + span { color: var(--primary); border-color: #9bc8c0; background: var(--primary-soft); }
.check-options input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.compact-field input { max-width: 150px; }
.dialog-error { margin: 18px 24px; }
.dialog-footer { flex: none; display: flex; justify-content: flex-end; gap: 9px; padding: 15px 24px; border-top: 1px solid var(--line); background: var(--surface-soft); }

.confirm-dialog { width: min(430px, calc(100vw - 32px)); }
.confirm-body { padding: 28px 28px 19px; text-align: center; }
.confirm-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; color: var(--danger); background: var(--danger-soft); }
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-body h2 { margin: 0; font-size: 19px; }
.confirm-body > p:not(.form-error) { margin: 9px 0 0; color: var(--muted); }
.confirm-body strong { color: var(--ink); }
.confirm-body .form-error { margin-top: 17px; text-align: left; }
.password-dialog { width: min(470px, calc(100vw - 32px)); }
.password-body { display: grid; gap: 18px; padding: 24px; overflow-y: auto; }
.password-notice { margin: 0; padding: 10px 12px; border: 1px solid #ead3a5; border-radius: 6px; color: #70470d; background: var(--warning-soft); font-size: 12px; }

.toast-region { position: fixed; z-index: 100; top: 18px; right: 18px; width: min(360px, calc(100vw - 36px)); display: grid; gap: 9px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 12px 13px; border: 1px solid var(--line-strong); border-left: 3px solid var(--primary); border-radius: 6px; background: var(--surface); box-shadow: 0 12px 36px rgb(18 32 27 / 18%); pointer-events: auto; animation: toast-in .18s ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast > svg { width: 18px; height: 18px; margin-top: 1px; color: var(--primary); }
.toast.error > svg { color: var(--danger); }
.toast p { margin: 0; font-size: 13px; }
.toast button { width: 24px; height: 24px; display: grid; place-items: center; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.toast button svg { width: 14px; height: 14px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } }

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: 64px; flex-direction: row; align-items: center; padding: 0 20px; }
  .sidebar-brand { padding: 0; }
  .sidebar-nav { display: none; }
  .sidebar-footer { display: flex; align-items: center; gap: 10px; margin: 0 0 0 auto; }
  .sidebar-health { padding: 0 14px 0 0; border: 0; border-right: 1px solid rgb(255 255 255 / 12%); }
  .health-copy small { display: none; }
  .account-actions { display: flex; gap: 2px; }
  .logout-button { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .logout-button span { display: none; }
  .workspace { padding-top: 28px; }
  .status-banner { align-items: flex-start; }
  .status-metrics > div { min-width: 80px; padding: 1px 12px; }
  .rules-table { min-width: 850px; }
}

@media (max-width: 700px) {
  .login-view { padding: 0; place-items: stretch; background: var(--surface); }
  .login-panel { width: 100%; min-height: 100vh; padding: 28px 22px; border: 0; box-shadow: none; }
  .login-copy { margin-top: min(16vh, 120px); }
  .sidebar { height: 58px; padding: 0 14px; }
  .sidebar-brand .brand-mark { width: 31px; height: 31px; }
  .sidebar-brand > span:last-child { font-size: 13px; }
  .sidebar-health { display: none; }
  .workspace { padding: 22px 14px 36px; }
  .workspace-header { align-items: center; }
  .workspace-header h1 { font-size: 22px; }
  .header-actions .button { width: 40px; padding: 0; }
  .header-actions .button span { display: none; }
  .status-banner { display: grid; gap: 15px; margin-top: 20px; padding: 14px 15px; }
  .status-leading p { white-space: normal; }
  .status-metrics { width: 100%; border-top: 1px solid var(--line); padding-top: 11px; }
  .status-metrics > div { flex: 1; min-width: 0; padding: 0 11px; }
  .status-metrics > div:first-child { padding-left: 0; border-left: 0; }
  .status-metrics dd { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
  .section-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .search-field { width: 100%; }
  .table-wrap { overflow: visible; }
  .rules-table, .rules-table tbody { display: block; min-width: 0; }
  .rules-table thead { display: none; }
  .rules-table tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; padding: 16px; border-top: 1px solid var(--line); }
  .rules-table td { height: auto; min-width: 0; padding: 0; border: 0; }
  .rules-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
  .rules-table td:nth-child(1), .rules-table td:nth-child(3) { grid-column: 1 / -1; }
  .rules-table td:last-child { position: absolute; top: 11px; right: 10px; }
  .rules-table td:last-child::before { display: none; }
  .rule-identity { padding-right: 70px; }
  .form-section, .dialog-header { padding-left: 18px; padding-right: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .segmented-control { grid-template-columns: 1fr; }
  .cors-title-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .check-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compact-field input { max-width: none; }
  .dialog-footer { padding-left: 18px; padding-right: 18px; }
  .dialog-footer .button { flex: 1; }
  .dialog-error { margin-left: 18px; margin-right: 18px; }
}

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