@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  color-scheme: light;
  --primary: #445bd8;
  --primary-deep: #3148bf;
  --primary-soft: #eef1ff;
  --ink: #162033;
  --ink-soft: #526074;
  --muted: #667286;
  --canvas: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #fbfcfe;
  --border: #e4e8f0;
  --border-strong: #d4dbe8;
  --success: #1c9b67;
  --success-soft: #e9f8f1;
  --danger: #d65368;
  --danger-soft: #fff0f2;
  --warning: #b97819;
  --warning-soft: #fff8e8;
  --shadow-sm: 0 1px 2px rgba(20, 34, 59, 0.04), 0 6px 18px rgba(20, 34, 59, 0.04);
  --shadow-lg: 0 22px 60px rgba(30, 44, 82, 0.18);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --control-height: 44px;
  --ease: 180ms ease;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: 'Fira Sans', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; text-decoration: none; }
button, input, select { touch-action: manipulation; }
input::placeholder { color: #8792a5; opacity: 1; }

:focus-visible { outline: 3px solid rgba(68, 91, 216, 0.35); outline-offset: 3px; }
.is-hidden { display: none !important; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; color: #fff; background: var(--primary-deep); border-radius: 8px; transform: translateY(-150%); transition: transform 180ms ease; }
.skip-link:focus { transform: translateY(0); }

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 20px;
  overflow: hidden;
  position: relative;
  background: #f4f6fb;
}

.auth-ambient { position: absolute; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.auth-ambient-one { width: 420px; height: 420px; top: -160px; right: -120px; background: rgba(68, 91, 216, 0.13); }
.auth-ambient-two { width: 300px; height: 300px; bottom: -160px; left: -90px; background: rgba(28, 155, 103, 0.09); }

.auth-card {
  position: relative;
  width: min(100%, 448px);
  padding: 42px 42px 34px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(228, 232, 240, 0.92);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.brand-lockup, .brand { display: inline-flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.brand-lockup b, .brand-title b { color: var(--primary); font-weight: 600; }
.brand-mark { display: inline-grid; width: 42px; height: 42px; place-items: center; color: white; background: var(--primary); border-radius: 8px; }
.brand-mark svg { width: 23px; height: 23px; }
.eyebrow { margin: 0; color: var(--primary); font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; }
.auth-card .eyebrow { margin-top: 38px; }
.auth-card h1 { margin: 8px 0 8px; font-size: clamp(28px, 4vw, 36px); line-height: 1.1; letter-spacing: -0.04em; }
.auth-copy { margin: 0 0 28px; color: var(--ink-soft); }
.auth-form { display: grid; gap: 10px; }
.auth-form label, .form-field > span, .filter-field > span { color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.35; }
.password-field { position: relative; }
.password-field input { padding-right: 46px; }
.field-action { position: absolute; top: 50%; right: 4px; display: grid; width: 40px; height: 40px; padding: 0; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 8px; transform: translateY(-50%); }
.field-action:hover { color: var(--primary); background: var(--primary-soft); }
.field-action svg { width: 17px; height: 17px; }
.field-help, .form-field small { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-error { min-height: 18px; margin: 2px 0 0; color: var(--danger); font-size: 13px; }
.auth-footnote { display: flex; align-items: center; gap: 8px; margin: 28px 0 0; color: var(--muted); font-size: 12px; }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid var(--border); backdrop-filter: blur(18px); }
.topbar-inner { display: flex; min-height: 76px; max-width: 1600px; margin: 0 auto; padding: 0 40px; align-items: center; gap: 42px; }
.brand { flex: 0 0 auto; }
.brand-title { white-space: nowrap; }
.brand-title em { color: var(--ink-soft); font-style: normal; font-weight: 500; }
.main-nav { display: flex; align-self: stretch; gap: 12px; }
.nav-tab { position: relative; display: inline-flex; min-width: 128px; padding: 0 8px; align-items: center; justify-content: center; gap: 10px; color: var(--muted); background: transparent; border: 0; font-size: 16px; font-weight: 600; }
.nav-tab::after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; content: ''; background: transparent; border-radius: 3px 3px 0 0; }
.nav-tab:hover, .nav-tab.is-active { color: var(--ink); }
.nav-tab.is-active::after { background: var(--primary); }
.nav-tab svg { width: 20px; height: 20px; stroke-width: 1.8; }
.topbar-actions { display: flex; margin-left: auto; align-items: center; gap: 18px; }
.service-status { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: 13px; font-weight: 600; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.status-dot-success { background: var(--success); box-shadow: 0 0 0 4px rgba(28, 155, 103, 0.11); }

.main-content { max-width: 1600px; margin: 0 auto; padding: 48px 40px 80px; }
.page-heading { display: flex; margin-bottom: 34px; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 5px 0 2px; font-size: clamp(32px, 4vw, 46px); line-height: 1.08; letter-spacing: -0.05em; }
.page-subtitle { margin: 0; color: var(--ink-soft); font-size: 18px; }
.button { display: inline-flex; min-height: 44px; padding: 0 18px; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 9px; font-weight: 600; transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.button:active { transform: translateY(1px); }
.button svg { width: 17px; height: 17px; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 8px 18px rgba(68, 91, 216, 0.2); }
.button-primary:hover { background: var(--primary-deep); box-shadow: 0 10px 22px rgba(68, 91, 216, 0.28); }
.button-secondary { color: var(--ink-soft); background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.button-secondary:hover { color: var(--primary); border-color: rgba(68, 91, 216, 0.4); background: var(--primary-soft); }
.button-ghost { min-height: 44px; padding: 0 10px; color: var(--ink-soft); background: transparent; }
.button-ghost:hover { color: var(--primary); background: var(--primary-soft); }
.button-danger-ghost { color: var(--danger); background: transparent; border-color: transparent; }
.button-danger-ghost:hover { background: var(--danger-soft); }
.button-wide { width: 100%; margin-top: 4px; }

.notice-card, .setup-banner { display: flex; padding: 23px 26px; align-items: flex-start; gap: 18px; border: 1px solid #dfe4f0; border-radius: var(--radius-md); }
.notice-card { margin-bottom: 24px; background: #f5f7ff; }
.notice-icon, .setup-icon { flex: 0 0 auto; display: grid; width: 30px; height: 30px; margin-top: 2px; place-items: center; color: var(--primary); }
.notice-icon svg, .setup-icon svg { width: 28px; height: 28px; }
.notice-copy { min-width: 0; }
.notice-copy strong, .setup-banner strong { display: block; font-size: 17px; }
.notice-copy p, .setup-banner p { margin: 5px 0 13px; color: var(--ink-soft); font-size: 15px; }
.endpoint-row { display: flex; max-width: 780px; min-height: 48px; padding: 0 6px 0 13px; align-items: center; gap: 10px; background: #fff; border: 1px solid #e0e4ef; border-radius: 9px; }
.endpoint-row code { min-width: 0; overflow: hidden; color: var(--ink); font-family: var(--mono); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.endpoint-row .icon-button { margin-left: auto; }
.setup-banner { margin-bottom: 24px; background: var(--warning-soft); border-color: #f0dfb8; }
.setup-banner .setup-icon { color: var(--warning); }
.setup-banner strong { color: #744d12; }

.metric-grid { display: grid; margin: 0 0 38px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.metric-card { min-height: 136px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.metric-card-accent { background: linear-gradient(135deg, #445bd8, #6478e2); border-color: transparent; color: #fff; }
.metric-label, .metric-meta { display: block; color: var(--ink-soft); font-size: 13px; }
.metric-card-accent .metric-label, .metric-card-accent .metric-meta { color: rgba(255, 255, 255, 0.78); }
.metric-card strong { display: block; margin: 10px 0 4px; font-size: 34px; line-height: 1; letter-spacing: -0.04em; }

.section-toolbar { display: flex; margin-bottom: 16px; align-items: center; justify-content: space-between; gap: 20px; }
.section-toolbar h2 { margin: 0; font-size: 23px; letter-spacing: -0.03em; }
.section-meta { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 20px; }
.rule-card { display: flex; min-height: 0; padding: var(--space-6); flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease); }
.rule-card:hover { border-color: #cbd3e6; box-shadow: 0 10px 28px rgba(20, 34, 59, 0.08); transform: translateY(-2px); }
.rule-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rule-card h3 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.035em; }
.rule-team { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; }
.status-badge { display: inline-flex; flex: 0 0 auto; min-height: 29px; padding: 0 11px; align-items: center; border-radius: 6px; font-size: 12px; font-weight: 700; }
.status-badge-enabled { color: var(--success); background: var(--success-soft); }
.status-badge-disabled { color: #697386; background: #edf0f4; }
.rule-body { margin-top: var(--space-5); }
.secret-row { display: grid; margin-bottom: var(--space-3); grid-template-columns: 116px minmax(0, 1fr); align-items: center; gap: var(--space-3); }
.secret-row > span:first-child { color: var(--ink-soft); font-size: 14px; line-height: 1.35; }
.secret-value { display: block; min-width: 0; min-height: 40px; padding: 8px 12px; overflow: hidden; color: var(--ink); background: #f3f5f9; border: 1px solid #e1e6ef; border-radius: 9px; font-size: 14px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.secret-value-secret, .secret-value-url { font-family: var(--mono); font-size: 12px; }
.secret-value-plain { color: var(--ink-soft); }
.event-tags { display: flex; min-height: 29px; margin-top: var(--space-4); flex-wrap: wrap; gap: 7px; }
.event-tag { display: inline-flex; min-height: 29px; padding: 0 9px; align-items: center; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.rule-scope { display: flex; min-height: 24px; margin-top: 10px; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.rule-scope span { display: inline-flex; align-items: center; gap: 5px; }
.rule-scope svg { width: 14px; height: 14px; }
.rule-footer { display: flex; margin-top: var(--space-5); padding-top: 18px; align-items: center; border-top: 1px solid var(--border); gap: var(--space-4); }
.switch-row { display: inline-flex; min-height: 42px; align-items: center; gap: 10px; cursor: pointer; }
.switch-row input, .switch-control { width: 46px; height: 26px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control { position: relative; display: inline-block; flex: 0 0 auto; background: #dce1ea; border-radius: 999px; transition: background 180ms ease; }
.switch-control::after { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; content: ''; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform 180ms ease; }
.switch-row input:checked + .switch-control { background: var(--primary); }
.switch-row input:checked + .switch-control::after { transform: translateX(20px); }
.switch-row > span:last-child { display: grid; gap: 1px; color: var(--ink-soft); font-size: 14px; }
.switch-row > span:last-child small { color: var(--muted); font-size: 11px; }
.rule-footer > .switch-row > span:last-child { display: inline; font-size: 14px; }
.rule-footer > .switch-row > span:last-child small { display: none; }
.text-button { display: inline-flex; min-height: 40px; padding: 0 7px; align-items: center; gap: 7px; color: var(--ink-soft); background: transparent; border: 0; font-weight: 600; }
.text-button:hover { color: var(--primary); }
.text-button.danger:hover { color: var(--danger); }
.text-button svg { width: 18px; height: 18px; }
.rule-actions { display: flex; margin-left: auto; gap: 8px; }
.empty-state { display: grid; min-height: 280px; padding: 35px; place-items: center; color: var(--muted); text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.empty-state strong { display: block; color: var(--ink); font-size: 18px; }
.empty-state p { max-width: 420px; margin: 6px auto 0; }

.filter-bar { display: flex; margin-bottom: 22px; padding: 17px 20px; align-items: flex-end; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.filter-field { display: grid; min-width: 230px; gap: 7px; }
.filter-field select, .form-field input, .form-field select, .password-field input { width: 100%; min-height: var(--control-height); padding: 0 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; outline: 0; transition: border-color var(--ease), box-shadow var(--ease); }
.filter-field select, .form-field select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 11px) 50%; background-repeat: no-repeat; background-size: 6px 6px, 6px 6px; }
.form-field input, .form-field select { background-color: var(--surface-soft); }
.filter-field select:focus, .form-field input:focus, .form-field select:focus, .password-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(68, 91, 216, 0.1); }
.filter-refresh { margin-left: auto; }
.records-panel { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.records-table-wrap { overflow-x: auto; }
.records-table { width: 100%; min-width: 830px; border-collapse: collapse; text-align: left; }
.records-table th { padding: 18px 20px; color: var(--ink-soft); background: #f9fafc; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; white-space: nowrap; }
.records-table td { padding: 17px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.records-table tbody tr:last-child td { border-bottom: 0; }
.records-table tbody tr.record-row { cursor: pointer; }
.records-table tbody tr.record-row:hover { background: #fbfcff; }
.records-table tbody tr.record-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; background: #f4f6ff; }
.record-time { color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.record-rule { color: var(--ink); font-weight: 600; }
.record-team { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.record-event { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); white-space: nowrap; }
.record-event svg { width: 16px; color: var(--primary); }
.record-project { display: block; max-width: 360px; overflow: hidden; color: var(--ink-soft); font-family: var(--mono); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.record-title { display: block; max-width: 360px; margin-top: 4px; overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.record-status { display: inline-flex; min-height: 28px; padding: 0 10px; align-items: center; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.record-status-success { color: var(--success); background: var(--success-soft); }
.record-status-failed { color: var(--danger); background: var(--danger-soft); }
.record-status-skipped { color: #697386; background: #edf0f4; }
.record-status-pending { color: #9a6a16; background: #fff5d9; }

.modal { position: fixed; z-index: 50; inset: 0; display: grid; padding: 24px; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18, 27, 46, 0.48); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(100%, 760px); max-height: calc(100vh - 48px); overflow: auto; padding: 30px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); }
.record-detail-card { width: min(100%, 820px); }
.modal-header { display: flex; margin-bottom: 24px; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-header h2 { margin: 6px 0 0; font-size: 27px; letter-spacing: -0.04em; }
.icon-button { display: inline-grid; width: 44px; height: 44px; padding: 0; place-items: center; color: var(--ink-soft); background: transparent; border: 0; border-radius: 8px; }
.icon-button:hover { color: var(--primary); background: var(--primary-soft); }
.icon-button svg { width: 18px; height: 18px; }
.rule-form { display: grid; gap: 0; }
.form-grid { display: grid; gap: var(--space-4); }
.form-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-field { display: grid; gap: var(--space-2); }
.form-field > span b { color: var(--danger); }
.form-section { display: grid; margin-top: var(--space-6); padding-top: var(--space-6); gap: var(--space-4); border-top: 1px solid var(--border); }
.form-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-section-heading strong { font-size: 16px; }
.form-section-heading span { color: var(--muted); font-size: 12px; }
.event-options { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.event-option { position: relative; }
.event-option input { position: absolute; opacity: 0; pointer-events: none; }
.event-option label { display: inline-flex; min-height: 40px; padding: 0 13px; align-items: center; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-size: 13px; transition: color var(--ease), background var(--ease), border-color var(--ease); }
.event-option label:hover { color: var(--primary); border-color: rgba(68, 91, 216, .45); }
.event-option input:checked + label { color: var(--primary-deep); background: var(--primary-soft); border-color: rgba(68, 91, 216, .55); font-weight: 600; }
.form-section .switch-row { min-height: 0; padding: 14px 16px; align-items: flex-start; gap: 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; }
.form-section .switch-row > span:last-child { gap: 3px; }
.form-section .switch-row > span:last-child strong { color: var(--ink); font-size: 14px; line-height: 1.35; }
.rule-form > .switch-row { min-height: 0; margin-top: var(--space-6); padding-top: 20px; align-items: flex-start; border-top: 1px solid var(--border); }
.modal-actions { display: flex; margin-top: var(--space-6); justify-content: flex-end; gap: 10px; }

.record-detail-status { margin: -8px 0 20px; }
.record-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--border); border: 1px solid var(--border); border-radius: 12px; }
.record-detail-item { min-width: 0; padding: 14px 16px; background: var(--surface-soft); }
.record-detail-item > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.record-detail-item strong { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.5; }
.record-detail-item code { color: var(--ink-soft); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.record-detail-link { color: var(--primary-deep); text-decoration: none; }
.record-detail-link:hover { text-decoration: underline; }
.record-detail-section { margin-top: 24px; }
.record-detail-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.record-detail-section-heading h3 { margin: 0; color: var(--ink); font-size: 16px; }
.record-detail-section-heading span { color: var(--muted); font-size: 12px; }
.record-detail-message, .record-detail-error { margin: 10px 0 0; padding: 14px 16px; overflow: auto; color: var(--ink-soft); background: #f7f8fb; border: 1px solid var(--border); border-radius: 10px; font-family: var(--mono); font-size: 12px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.record-detail-message { max-height: 260px; }
.record-detail-error { color: var(--danger); background: var(--danger-soft); border-color: rgba(188, 65, 84, .18); }

.toast { position: fixed; z-index: 70; right: 24px; bottom: 24px; max-width: min(360px, calc(100vw - 48px)); padding: 13px 16px; color: #fff; background: #1d283c; border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #a83b4d; }

@media (max-width: 1000px) {
  .topbar-inner { padding: 0 24px; gap: 22px; }
  .brand-title em { display: none; }
  .main-content { padding: 36px 24px 64px; }
  .rules-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .topbar-inner { min-height: 66px; flex-wrap: wrap; padding: 13px 16px 0; gap: 8px; }
  .brand { order: 1; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-title { font-size: 16px; }
  .topbar-actions { order: 2; }
  .service-status { display: none; }
  .main-nav { order: 3; width: 100%; height: 42px; }
  .nav-tab { flex: 1; min-width: 0; font-size: 14px; }
  .main-content { padding: 32px 16px 56px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 35px; }
  .page-subtitle { font-size: 16px; }
  .page-heading > .button { width: 100%; }
  .notice-card, .setup-banner { padding: 18px; }
  .metric-grid { grid-template-columns: 1fr; gap: 10px; }
  .metric-card { min-height: 108px; }
  .metric-card strong { font-size: 30px; }
  .section-toolbar { align-items: flex-start; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-field { min-width: 0; }
  .filter-refresh { margin-left: 0; }
  .modal { padding: 10px; }
  .modal-card { max-height: calc(100vh - 20px); padding: 22px 18px; border-radius: 16px; }
  .form-grid-two { grid-template-columns: 1fr; }
  .record-detail-grid { grid-template-columns: 1fr; }
  .record-detail-section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .form-section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .secret-row { grid-template-columns: 1fr; gap: 5px; }
  .rule-card { padding: 20px; }
  .rule-footer { flex-wrap: wrap; gap: 10px; }
  .rule-actions { width: 100%; margin-left: 0; justify-content: flex-end; }
}

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