:root {
  color-scheme: light;
  --canvas: #f6f8fb;
  --surface: #ffffff;
  --soft: #f2f5f9;
  --line: #e1e6ee;
  --line-strong: #d1d8e4;
  --ink: #192236;
  --muted: #697389;
  --muted-light: #929bad;
  --accent: #5d62d8;
  --accent-dark: #484db9;
  --accent-soft: #eeeeff;
  --mint: #3e9d82;
  --mint-soft: #e7f7f1;
  --amber: #a86a21;
  --amber-soft: #fff4e5;
  --danger: #b74658;
  --danger-soft: #fff0f2;
  --shadow: 0 18px 55px rgba(41, 49, 78, 0.1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: radial-gradient(circle at 88% -10%, rgba(93, 98, 216, 0.11), transparent 28rem), var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { color: inherit; font: inherit; }
button, select, label, input[type="checkbox"], input[type="radio"] { cursor: pointer; }
button { border: 0; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: 0.58; }
:focus-visible { outline: 3px solid rgba(93, 98, 216, 0.28); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  border-radius: 10px;
  background: var(--accent-dark);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.brand { display: inline-flex; align-items: center; width: fit-content; color: inherit; text-decoration: none; gap: 11px; }
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--accent-dark);
  border: 1px solid #dbdcf6;
  border-radius: 14px;
  background: linear-gradient(145deg, #eeedff, #fff);
  box-shadow: 0 8px 20px rgba(69, 73, 170, 0.12);
  font-size: 16px;
  font-weight: 850;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: 0.08em; }
.brand small { margin-top: 2px; color: var(--muted-light); font-size: 9px; font-weight: 750; letter-spacing: 0.13em; text-transform: uppercase; }
.brand.compact .brand-mark { width: 40px; height: 40px; }

.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: 0.18em; text-transform: uppercase; }

.login-view {
  display: grid;
  width: min(1120px, calc(100% - 48px));
  min-height: 100vh;
  align-items: center;
  margin: 0 auto;
  padding: 64px 0;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.75fr);
  gap: clamp(50px, 8vw, 110px);
}
.login-copy h1 { max-width: 650px; margin: 28px 0 0; font-size: clamp(42px, 5vw, 68px); letter-spacing: -0.055em; line-height: 1.08; }
.login-copy > p:last-child { max-width: 610px; margin: 25px 0 0; color: var(--muted); font-size: 16px; line-height: 1.85; }
.login-card {
  width: 100%;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
}
.card-heading { display: flex; align-items: center; margin-bottom: 27px; gap: 12px; }
.card-heading h2, .card-heading p { margin: 0; }
.card-heading h2 { font-size: 20px; }
.card-heading p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.soft-icon { display: grid; width: 44px; height: 44px; place-items: center; color: var(--accent-dark); border-radius: 14px; background: var(--accent-soft); font-size: 12px; font-weight: 850; }

.field { display: grid; min-width: 0; margin-top: 16px; gap: 7px; }
.field > span, .fieldset-label { color: #4d576d; font-size: 10px; font-weight: 750; }
.field input, .field select, .field textarea, .control {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: #30394d;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  font-size: 12px;
}
.field textarea { min-height: 110px; padding: 11px 12px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus, .control:focus { border-color: #aaade7; outline: 3px solid rgba(93,98,216,0.13); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check-line { display: flex; align-items: flex-start; margin-top: 14px; color: var(--muted); font-size: 11px; gap: 8px; }
.check-line input { margin-top: 2px; }
.check-grid { display: flex; flex-wrap: wrap; margin-top: 8px; gap: 7px; }
.check-pill { position: relative; }
.check-pill input { position: absolute; opacity: 0; }
.check-pill span { display: inline-flex; min-height: 34px; align-items: center; padding: 0 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 10px; font-weight: 700; }
.check-pill input:checked + span { color: var(--accent-dark); border-color: #c6c8ee; background: var(--accent-soft); }
.check-pill input:focus-visible + span { outline: 3px solid rgba(93,98,216,0.25); outline-offset: 2px; }

.primary-button, .secondary-button, .danger-button, .ghost-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 780;
  gap: 7px;
}
.primary-button { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); box-shadow: 0 8px 18px rgba(74,79,186,0.2); }
.secondary-button { color: #4d566b; border: 1px solid var(--line); background: #fff; }
.danger-button { color: #a63d4d; border: 1px solid #f0cbd1; background: var(--danger-soft); }
.ghost-button { min-height: 34px; padding: 0 10px; color: var(--muted); background: var(--soft); font-size: 10px; }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); }
.secondary-button:hover:not(:disabled), .ghost-button:hover:not(:disabled) { color: var(--accent-dark); border-color: #caccef; background: var(--accent-soft); }
.danger-button:hover:not(:disabled) { color: #8f3040; background: #ffe3e7; }
.full { width: 100%; margin-top: 22px; }
.inline-alert { margin-top: 14px; padding: 11px 12px; color: #9f3b4a; border: 1px solid #f0cbd2; border-radius: 10px; background: var(--danger-soft); font-size: 10px; line-height: 1.55; }
.security-note { margin: 16px 0 0; color: var(--muted-light); font-size: 9px; line-height: 1.6; }

.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  min-width: 0;
  padding: 22px 17px 17px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(18px);
  flex-direction: column;
}
.sidebar-top { display: grid; gap: 14px; }
.environment-chip { width: fit-content; padding: 5px 8px; color: var(--mint); border-radius: 999px; background: var(--mint-soft); font-size: 9px; font-weight: 800; }
.admin-nav { display: grid; margin-top: 25px; gap: 4px; }
.nav-item { display: flex; min-width: 0; min-height: 43px; align-items: center; padding: 0 10px; color: var(--muted); border-radius: 11px; background: transparent; gap: 10px; text-align: left; }
.nav-item > span { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--soft); font-size: 9px; font-weight: 850; }
.nav-item b { overflow: hidden; font-size: 11px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover, .nav-item.is-active { color: var(--accent-dark); background: var(--accent-soft); }
.nav-item.is-active > span { color: #fff; background: var(--accent); }
.admin-identity { display: grid; align-items: center; margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; }
.identity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.admin-identity strong, .admin-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-identity strong { font-size: 10px; }
.admin-identity small { margin-top: 3px; color: var(--muted-light); font-size: 8px; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 11px; }
.icon-button:hover { color: var(--accent-dark); background: var(--accent-soft); }

.main-panel { width: 100%; max-width: 1500px; min-width: 0; margin: 0 auto; padding: 38px clamp(22px, 4vw, 58px) 70px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-header h1 { margin: 0; font-size: clamp(30px, 4vw, 45px); letter-spacing: -0.045em; }
.page-header p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.page-status { min-height: 20px; margin: 15px 0 4px; color: var(--muted-light); font-size: 9px; }

.section-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 14px; gap: 12px; }
.section-toolbar h2 { margin: 0; font-size: 17px; }
.section-subtitle { margin-top: 5px; color: var(--muted-light); font-size: 9px; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.account-filters { display: grid; min-width: min(100%, 690px); flex: 1 1 690px; grid-template-columns: minmax(210px, 1.8fr) repeat(4, minmax(132px, 1fr)); gap: 8px; }
.account-filters .control { min-width: 0; }
.metric-grid { display: grid; margin-top: 20px; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.metric-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgba(37,46,75,0.035); }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: 9px; font-weight: 720; }
.metric-card strong { margin-top: 8px; overflow: hidden; font-size: 27px; text-overflow: ellipsis; }
.metric-card small { margin-top: 5px; color: var(--muted-light); font-size: 8px; line-height: 1.5; }
.metric-card[data-tone="warning"] { border-color: #f0dcc0; background: #fffdf9; }
.metric-card[data-tone="danger"] { border-color: #f0ccd2; background: #fffafb; }
.metric-card[data-tone="success"] { border-color: #cfe9e1; background: #fbfffd; }

.content-grid { display: grid; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 11px; }
.entity-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 5px 17px rgba(37,46,75,0.035); }
.entity-card.wide { grid-column: 1 / -1; }
.entity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.entity-title { min-width: 0; }
.entity-title h3 { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.entity-title p { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--muted-light); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.status-badge { display: inline-flex; min-height: 25px; flex: 0 0 auto; align-items: center; padding: 0 8px; color: #566176; border-radius: 999px; background: var(--soft); font-size: 8px; font-weight: 850; }
.status-badge[data-tone="success"] { color: #24755f; background: var(--mint-soft); }
.status-badge[data-tone="warning"] { color: #93601f; background: var(--amber-soft); }
.status-badge[data-tone="danger"] { color: #9f3d4d; background: var(--danger-soft); }
.detail-list { display: grid; margin: 14px 0 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-pair { min-width: 0; padding: 9px 10px; border-radius: 10px; background: var(--soft); }
.detail-pair span, .detail-pair strong { display: block; }
.detail-pair span { color: var(--muted-light); font-size: 8px; }
.detail-pair strong { margin-top: 4px; overflow-wrap: anywhere; color: #414b61; font-size: 9px; }
.card-actions { display: flex; flex-wrap: wrap; margin-top: 13px; gap: 6px; }

.panel-card { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.panel-card h2, .panel-card h3 { margin: 0; }
.panel-card > p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.empty-state { display: grid; min-height: 230px; place-items: center; margin-top: 16px; padding: 28px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 16px; background: rgba(255,255,255,0.6); text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: #485268; font-size: 13px; }
.empty-state span { margin-top: 6px; font-size: 10px; line-height: 1.6; }
.skeleton { position: relative; min-height: 130px; overflow: hidden; border-radius: 15px; background: #e9edf3; }
.skeleton::after { position: absolute; content: ""; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent); animation: shimmer 1.3s infinite; transform: translateX(-100%); }
@keyframes shimmer { to { transform: translateX(100%); } }

.model-form { margin-top: 13px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; margin-top: 16px; gap: 8px; }
.form-error { margin-top: 10px; color: var(--danger); font-size: 9px; }
.raw-cdk { display: block; width: 100%; margin-top: 12px; padding: 14px; overflow-wrap: anywhere; color: #313a50; border: 1px dashed #bfc2eb; border-radius: 12px; background: var(--accent-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.65; user-select: all; }
.warning-note { margin-top: 12px; padding: 11px 12px; color: #8f5d20; border: 1px solid #efd9bb; border-radius: 10px; background: var(--amber-soft); font-size: 9px; line-height: 1.6; }

.audit-list, .report-list, .import-items { display: grid; margin-top: 14px; gap: 8px; }
.audit-item, .report-item, .import-item { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.import-preview { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-muted); }
.import-preview[hidden] { display: none; }
.preview-summary, .import-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.audit-item summary { cursor: pointer; color: #3d475d; font-size: 10px; font-weight: 750; }
.audit-item pre, .safe-json { max-width: 100%; margin: 10px 0 0; padding: 10px; overflow: auto; color: #4d566b; border-radius: 9px; background: var(--soft); font: 9px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.report-head, .import-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.report-head h3, .import-head h3 { margin: 0; font-size: 11px; }
.report-head p, .import-head p { margin: 4px 0 0; color: var(--muted-light); font-size: 8px; }
.count-grid { display: grid; margin-top: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.count-grid > span { display: flex; min-width: 0; justify-content: space-between; padding: 7px 9px; color: var(--muted); border-radius: 8px; background: var(--soft); font-size: 8px; gap: 8px; }
.count-grid b { color: #414b60; }

.modal { width: min(720px, calc(100vw - 30px)); max-height: min(820px, calc(100vh - 30px)); padding: 0; overflow: auto; color: var(--ink); border: 1px solid var(--line); border-radius: 21px; background: #fff; box-shadow: 0 35px 100px rgba(28,35,58,0.24); }
.modal::backdrop { background: rgba(32,39,58,0.25); backdrop-filter: blur(5px); }
.modal-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.96); backdrop-filter: blur(12px); }
.modal-download-button { margin-left: auto; }
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 19px 22px 23px; }
.modal-copy { margin: 0 0 13px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.detail-panel { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.detail-panel h3, .detail-panel h4 { margin: 0; color: #414b60; font-size: 11px; }
.detail-panel p { margin: 8px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.submission-response-evidence { margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line); }
.submission-response-evidence h5 { margin: 0; color: #414b60; font-size: 11px; }
.submission-response-note, .submission-response-missing { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.submission-response-missing { padding: 10px 11px; border-radius: 9px; background: var(--amber-soft); color: #8f5d20; }
.submission-response-excerpt { margin: 10px 0 0; padding: 12px; color: #3e485d; border: 1px solid var(--line); border-radius: 10px; background: #f6f7fb; font: 10px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; user-select: text; }

.toast-region { position: fixed; z-index: 300; right: 18px; bottom: 18px; display: grid; width: min(370px, calc(100vw - 32px)); gap: 8px; }
.toast { padding: 12px 14px; color: #424b60; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; background: rgba(255,255,255,0.97); box-shadow: 0 18px 45px rgba(34,41,68,0.16); font-size: 10px; line-height: 1.6; }
.toast.is-error { border-left-color: var(--danger); }
.toast.is-success { border-left-color: var(--mint); }

/* Readability pass: the console previously used 8–10px text in most data views. */
body { font-size: 14px; }
.brand small { font-size: 11px; }
.eyebrow { font-size: 12px; }
.card-heading p { font-size: 12px; }
.field > span, .fieldset-label { font-size: 13px; }
.field input, .field select, .field textarea, .control { font-size: 14px; }
.check-line { font-size: 13px; }
.check-pill span { font-size: 12px; }
.primary-button, .secondary-button, .danger-button, .ghost-button { font-size: 13px; }
.ghost-button { font-size: 12px; }
.inline-alert, .security-note, .warning-note { font-size: 12px; }
.environment-chip { font-size: 11px; }
.nav-item > span { font-size: 11px; }
.nav-item b { font-size: 13px; }
.admin-identity strong { font-size: 12px; }
.admin-identity small { font-size: 11px; }
.icon-button { font-size: 13px; }
.page-header p:last-child { font-size: 14px; }
.page-status, .section-subtitle { font-size: 12px; }
.metric-card span { font-size: 12px; }
.metric-card small { font-size: 11px; }
.entity-title h3 { font-size: 15px; }
.entity-title p { font-size: 11px; }
.status-badge { font-size: 11px; }
.detail-pair span { font-size: 11px; }
.detail-pair strong { font-size: 12px; }
.panel-card > p { font-size: 13px; }
.empty-state strong { font-size: 15px; }
.empty-state span { font-size: 13px; }
.form-error { font-size: 12px; }
.audit-item summary { font-size: 13px; }
.audit-item pre, .safe-json { font-size: 11px; }
.report-head h3, .import-head h3 { font-size: 14px; }
.report-head p, .import-head p { font-size: 11px; }
.count-grid > span { font-size: 11px; }
.modal-copy { font-size: 13px; }
.detail-panel h3, .detail-panel h4 { font-size: 14px; }
.detail-panel p { font-size: 13px; }
.submission-response-evidence h5 { font-size: 14px; }
.submission-response-note, .submission-response-missing { font-size: 12px; }
.submission-response-excerpt { font-size: 12px; }
.toast { font-size: 13px; }

.proxy-paste-field textarea {
  min-height: 90px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.65;
}
.proxy-parse-status {
  margin-top: 10px;
  padding: 11px 12px;
  overflow-wrap: anywhere;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
  font-size: 12px;
  line-height: 1.6;
}
.proxy-parse-status[data-tone="success"] { color: #24755f; border-color: #cfe9e1; background: var(--mint-soft); }
.proxy-parse-status[data-tone="warning"] { color: #93601f; border-color: #f0dcc0; background: var(--amber-soft); }
.proxy-parse-status[data-tone="danger"] { color: #9f3d4d; border-color: #f0ccd2; background: var(--danger-soft); }
.proxy-advanced { margin-top: 13px; padding: 0 14px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe; }
.proxy-advanced summary { padding: 13px 0; color: #4d576d; cursor: pointer; font-size: 13px; font-weight: 750; }
.proxy-advanced[open] summary { border-bottom: 1px solid var(--line); }
.proxy-test-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.proxy-test-head h2 { margin: 0; }
.proxy-test-head p { max-width: 900px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.proxy-test-head .secondary-button { flex: 0 0 auto; }
.proxy-test-result-slot { margin-top: 16px; }
.proxy-test-result { padding: 16px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 14px; background: #fbfcff; }
.proxy-test-result[data-tone="success"] { border-left-color: var(--mint); background: var(--mint-soft); }
.proxy-test-result[data-tone="danger"] { border-left-color: var(--danger); background: var(--danger-soft); }
.proxy-test-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.proxy-test-result-head h3 { margin: 0; color: #3f4860; font-size: 16px; }
.proxy-test-result-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.proxy-test-result .detail-list { margin-top: 14px; }
.proxy-test-stages { display: grid; margin: 16px 0 0; padding: 0; gap: 8px; list-style: none; }
.proxy-test-stage { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.78); }
.proxy-test-stage-marker { display: grid; width: 27px; height: 27px; place-items: center; color: #778096; border: 1px solid #dce1ea; border-radius: 50%; background: #f4f6fa; font-size: 14px; font-weight: 800; }
.proxy-test-stage[data-status="passed"] .proxy-test-stage-marker { color: #24755f; border-color: #bfe2d8; background: #e5f5f0; }
.proxy-test-stage[data-status="failed"] .proxy-test-stage-marker { color: #a43e50; border-color: #edc4cc; background: #fbe8ec; }
.proxy-test-stage strong { display: block; color: #424b60; font-size: 13px; }
.proxy-test-stage div > span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.proxy-test-pending { display: grid; grid-template-columns: 24px auto; align-items: center; gap: 4px 10px; padding: 15px; color: #4d576d; border: 1px solid #d8dcf7; border-radius: 12px; background: var(--accent-soft); }
.proxy-test-pending > span:last-child { grid-column: 2; color: var(--muted); font-size: 12px; }
.proxy-test-spinner { width: 20px; height: 20px; grid-row: 1 / span 2; border: 2px solid #d1d4f5; border-top-color: var(--accent); border-radius: 50%; animation: proxy-test-spin 0.8s linear infinite; }
@keyframes proxy-test-spin { to { transform: rotate(360deg); } }

.task-card { display: flex; flex-direction: column; }
.task-progress { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff; }
.task-progress-copy { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-progress-copy strong { color: #3f4860; font-size: 13px; }
.task-progress-copy span { color: var(--muted); font-size: 12px; text-align: right; }
.task-progress-track { height: 9px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #e9edf4; }
.task-progress-bar { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #797ee3, var(--accent)); transition: width 240ms ease; }
.task-progress-track[data-tone="success"] .task-progress-bar { background: linear-gradient(90deg, #61b69e, var(--mint)); }
.task-progress-track[data-tone="warning"] .task-progress-bar { background: linear-gradient(90deg, #e1a85d, #bd7826); }
.task-progress-track[data-tone="danger"] .task-progress-bar { background: linear-gradient(90deg, #dc7888, var(--danger)); }
.task-card .card-actions { margin-top: auto; padding-top: 13px; }

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

@media (max-width: 900px) {
  .admin-shell { display: block; }
  .sidebar { position: sticky; z-index: 50; height: auto; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-top { display: none; }
  .admin-nav { display: flex; margin: 0; padding: 3px 1px 7px; overflow-x: auto; gap: 5px; scrollbar-width: thin; }
  .nav-item { min-width: max-content; min-height: 38px; padding: 0 10px; }
  .nav-item > span { width: 23px; height: 23px; }
  .admin-identity { position: static; display: grid; width: 100%; margin-top: 0; padding: 8px 10px; }
  .main-panel { padding-top: 27px; }
  .account-filters { min-width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-filters .account-search { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .login-view { width: min(100% - 32px, 560px); min-height: auto; padding: 42px 0 58px; grid-template-columns: 1fr; gap: 35px; }
  .login-copy h1 { font-size: clamp(38px, 11vw, 54px); }
  .login-copy > p:last-child { font-size: 14px; }
  .page-header { align-items: stretch; flex-direction: column; }
  .page-header .secondary-button { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: flex-start; }
  .account-filters { grid-template-columns: 1fr; }
  .account-filters .account-search { grid-column: auto; }
  .detail-list { grid-template-columns: 1fr; }
  .task-progress-copy { flex-direction: column; gap: 5px; }
  .task-progress-copy span { text-align: left; }
  .proxy-test-head, .proxy-test-result-head { align-items: stretch; flex-direction: column; }
  .proxy-test-head .secondary-button { width: 100%; }
  .proxy-test-stage { grid-template-columns: 28px minmax(0, 1fr); }
  .proxy-test-stage > .status-badge { grid-column: 2; justify-self: start; }
}

@media (max-width: 430px) {
  .main-panel { padding-right: 15px; padding-left: 15px; }
  .login-card { padding: 23px; border-radius: 19px; }
  .metric-grid { grid-template-columns: 1fr; }
  .modal-header, .modal-body { padding-right: 17px; padding-left: 17px; }
}

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