:root {
  color-scheme: light;
  --bg: #f4f7f9;
  --panel: #ffffff;
  --ink: #18202a;
  --muted: #637080;
  --line: #d9e1e8;
  --accent: #087f8c;
  --accent-strong: #066674;
  --danger: #c2412d;
  --warning: #a86600;
  --ok: #28784b;
  --open-chain: #087f8c;
  --login-chain: #7c3aed;
  --shadow: 0 18px 45px rgba(24, 32, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: auto;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1480px, calc(100vw - 72px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.content-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.page-nav {
  position: sticky;
  top: 18px;
  max-height: var(--page-nav-max-height, calc(100vh - 36px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.page-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.page-nav-header strong {
  color: #344150;
  font-size: 14px;
}

.page-nav-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.page-nav-toggle:hover {
  border-color: var(--accent);
  background: #eefafa;
}

.page-nav-list,
.page-nav-sublist {
  display: grid;
  gap: 6px;
}

.page-nav-list {
  padding-top: 10px;
}

.page-nav-group {
  display: grid;
  gap: 6px;
}

.page-nav-link,
.page-nav-sublink {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4a5967;
  cursor: pointer;
  text-align: left;
}

.page-nav-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 8px 4px 4px;
  font-size: 14px;
  font-weight: 800;
}

.page-nav-link:hover,
.page-nav-sublink:hover {
  background: #f1f7f8;
  color: var(--accent-strong);
}

.page-nav-link.is-active,
.page-nav-sublink.is-active {
  background: #e8f6f5;
  color: var(--accent-strong);
}

.nav-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e5edf2;
  color: #53616c;
  font-size: 13px;
  font-weight: 900;
}

.page-nav-link.is-active .nav-mark {
  background: var(--accent);
  color: #ffffff;
}

.nav-text {
  min-width: 0;
  white-space: nowrap;
}

.page-nav-sublist {
  margin: 2px 0 4px 18px;
  padding: 6px 0 2px 14px;
  border-left: 1px solid #dbe5eb;
}

.page-nav-sublink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 700;
}

.page-nav-sublink.nav-result-parent {
  margin-top: 2px;
  padding-left: 9px;
  border-left: 3px solid transparent;
  color: #344150;
  font-size: 13.5px;
  font-weight: 900;
}

.page-nav-sublink.nav-result-child {
  position: relative;
  min-height: 26px;
  margin-left: 12px;
  padding: 4px 8px 4px 14px;
  color: #66737f;
  font-size: 12.5px;
  font-weight: 700;
}

.page-nav-sublink.nav-result-child::before {
  content: "";
  position: absolute;
  left: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b9c6cf;
}

.page-nav-sublink.nav-result-parent.is-active {
  border-left-color: #5fa8ae;
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #edf2f5;
  color: #64717d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.nav-count.is-clear {
  background: #eef8f2;
  color: var(--ok);
}

.nav-count.has-issues {
  background: #fff1ed;
  color: var(--danger);
}

.nav-group-label {
  padding: 8px 8px 2px;
  color: #7a8792;
  font-size: 12px;
  font-weight: 900;
}

.app-shell.nav-collapsed .content-layout {
  grid-template-columns: 56px minmax(0, 1fr);
}

.app-shell.nav-collapsed .page-nav {
  padding: 8px;
  overflow: visible;
}

.app-shell.nav-collapsed .page-nav-header {
  justify-content: center;
  padding-bottom: 8px;
}

.app-shell.nav-collapsed .page-nav-header strong,
.app-shell.nav-collapsed .nav-text,
.app-shell.nav-collapsed .page-nav-sublist,
.app-shell.nav-collapsed .nav-count {
  display: none;
}

.app-shell.nav-collapsed .page-nav-toggle {
  transform: rotate(180deg);
}

.app-shell.nav-collapsed .page-nav-link {
  grid-template-columns: 28px;
  justify-content: center;
  padding: 4px;
}

#uploadSettingsSection,
#projectSettingsSection,
#rulesGuideSection,
#manualReviewSection,
#validationResultsSection,
#resultOverviewSection,
#resultDetailSection,
#triggerTimingPanel,
.section-heading {
  scroll-margin-top: 18px;
}

.topbar > div:first-child {
  min-width: 220px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rule-reference-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid #d8e1e7;
  border-radius: 8px;
  background: #f7fafb;
}

.rule-reference-card {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 5px 7px 5px 9px;
  border: 1px solid #d8e1e7;
  border-radius: 8px;
  background: #ffffff;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.mapping-tool {
  border-style: dashed;
  cursor: pointer;
}

.mapping-tool:hover,
.mapping-tool.dragging {
  border-color: var(--accent);
  background: #eefafa;
}

.rule-reference-card-static:hover {
  border-color: #b8c7d0;
  background: #fbfcfd;
}

.rule-reference-copy {
  display: flex;
  align-items: center;
  min-width: 104px;
}

.rule-reference-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
}

.rule-scope-tooltip {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 50%;
  width: max-content;
  max-width: 300px;
  padding: 8px 10px;
  border: 1px solid #cdd8df;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.15);
  color: #344150;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  font-size: 12px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  white-space: normal;
}

.rule-reference-title:hover .rule-scope-tooltip,
.rule-reference-title:focus .rule-scope-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.rule-reference-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rule-reference-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #526372;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.upload-action {
  color: var(--accent-strong);
  background: #f2fbfa;
  pointer-events: none;
}

.rule-reference-action:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.ghost-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.header-action-tooltip {
  position: relative;
  display: inline-flex;
}

.header-action-tooltip-bubble {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border: 1px solid #ccd7de;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(26, 37, 48, 0.14);
  color: #4a5863;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  font-size: 12px;
  font-style: italic;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  white-space: normal;
}

.header-action-tooltip-bubble::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 10px;
  height: 10px;
  border-top: 1px solid #ccd7de;
  border-left: 1px solid #ccd7de;
  background: rgba(255, 255, 255, 0.98);
  transform: rotate(45deg);
}

.header-action-tooltip:hover .header-action-tooltip-bubble,
.header-action-tooltip:focus-within .header-action-tooltip-bubble {
  opacity: 1;
  transform: translateY(0);
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}

.primary-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 32, 42, 0.28);
}

.confirm-modal.hidden {
  display: none;
}

.confirm-modal-card {
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(24, 32, 42, 0.18);
}

.confirm-modal-heading h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 20px;
}

.confirm-modal-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.confirm-warning-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.confirm-warning-list li {
  position: relative;
  padding: 9px 10px 9px 28px;
  border: 1px solid #e7d8bb;
  border-radius: 8px;
  background: #fff8e9;
  color: #625038;
  font-size: 13px;
  font-weight: 700;
}

.confirm-warning-list li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c39a52;
  transform: translateY(-50%);
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-modal-actions .ghost-button,
.confirm-modal-actions .primary-button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-auth-field {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}

.dashboard-auth-field span {
  color: #53616c;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-auth-field input {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.dashboard-auth-field input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 139, 146, 0.16);
}

.dashboard-auth-field em {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.export-mode-options {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.export-mode-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
  background: #f8fafb;
  cursor: pointer;
}

.export-mode-option:has(input:checked) {
  border-color: #6f9e99;
  background: #eff8f6;
  box-shadow: inset 0 0 0 1px rgba(111, 158, 153, 0.18);
}

.export-mode-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.export-mode-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.export-mode-option strong {
  color: var(--ink);
  font-size: 14px;
}

.export-mode-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.workspace {
  display: grid;
  gap: 18px;
  align-items: start;
}

.control-panel,
.rules-panel,
.manual-panel,
.result-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.control-panel,
.rules-panel,
.manual-panel {
  min-width: 0;
  padding: 16px;
}

.control-panel .block-heading,
.rules-panel .block-heading,
.manual-panel .block-heading {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
}

.control-panel > .block-heading,
.rules-panel > .block-heading,
.manual-panel > .block-heading,
.result-panel > .block-heading {
  min-height: 43px;
}

.section-collapse-toggle,
.rules-guide-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: #53616c;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  pointer-events: auto;
}

.section-collapse-toggle::after,
.rules-guide-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(2px) rotate(225deg);
}

.section-collapse-toggle[aria-expanded="false"]::after,
.rules-guide-toggle[aria-expanded="false"]::after {
  transform: translateY(-2px) rotate(45deg);
}

.section-collapse-toggle:hover,
.rules-guide-toggle:hover {
  border-color: #bfd1d8;
  background: #f2faf9;
  color: var(--accent-strong);
}

.upload-settings-body,
.project-settings-body {
  display: grid;
  gap: 16px;
}

.data-source-panel,
.dashboard-query-panel,
.supplement-config-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.source-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.source-mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  color: #53616c;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.source-mode-option:hover {
  border-color: #c5d5dd;
  background: #fbfdfd;
  color: #364754;
}

.source-mode-option:hover .source-mode-dot {
  border-color: #71818c;
}

.source-mode-option:focus-visible {
  outline: 3px solid rgba(31, 139, 146, 0.16);
  outline-offset: 2px;
}

.source-mode-option.is-active {
  border-color: #6f9e99;
  background: linear-gradient(180deg, #f1fbf9, #eaf7f5);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(111, 158, 153, 0.18), 0 5px 14px rgba(36, 95, 100, 0.08);
}

.source-mode-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1.8px solid #8d9aa3;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.source-mode-option.is-active .source-mode-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.source-mode-option.is-active:hover .source-mode-dot {
  border-color: var(--accent);
}

.dashboard-query-panel.is-disabled,
.upload-file-layout.is-disabled {
  opacity: 0.58;
  filter: grayscale(0.2);
}

.dashboard-query-panel.is-disabled {
  background: #f2f4f7;
}

.drop-zone.is-disabled {
  cursor: not-allowed;
  border-color: #d7dee5;
  background: #f1f3f5;
  transform: none;
}

.query-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.query-admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.query-admin-actions[hidden] {
  display: none;
}

.query-admin-actions button,
.query-admin-panel-head button {
  min-height: 34px;
  border: 1px solid rgba(128, 143, 156, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #425463;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0 12px;
}

.query-admin-actions button:hover,
.query-admin-panel-head button:hover {
  border-color: rgba(31, 139, 146, 0.34);
  background: #f7fbfb;
  color: #2f676a;
}

.query-admin-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(111, 158, 153, 0.2);
  border-radius: 8px;
  background: #fbfefd;
}

.query-admin-panel[hidden] {
  display: none;
}

.query-admin-panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.query-admin-panel-head div {
  display: grid;
  gap: 3px;
}

.query-admin-panel-head strong {
  color: #223944;
  font-size: 14px;
}

.query-admin-panel-head span {
  color: #667987;
  font-size: 12px;
  font-weight: 800;
}

.query-admin-table-wrap {
  max-height: min(560px, 58vh);
  overflow: auto;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
}

.query-admin-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.query-admin-table th,
.query-admin-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #edf3f6;
  color: #263b4a;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.query-admin-table th {
  background: #f1f8f7;
  color: #2f676a;
  font-size: 12px;
  font-weight: 900;
}

.query-admin-code {
  max-width: 260px;
  font-family: "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: normal;
}

.query-admin-code.is-compact {
  display: inline-block;
  max-width: 128px;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
  overflow-wrap: normal;
}

.query-admin-code.is-log-device {
  max-width: none;
  overflow-wrap: normal;
  white-space: nowrap;
}

.query-admin-cell-ellipsis {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.query-admin-empty {
  padding: 12px;
  border-radius: 8px;
  background: #f6fbfa;
  color: #667987;
  font-size: 13px;
  font-weight: 800;
}

.query-admin-empty code {
  display: block;
  max-width: none;
  color: #263b4a;
}

.query-admin-empty.is-error {
  background: #fff2f1;
  color: #b44842;
}

.query-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
  background: #ffffff;
}

.query-field.required > span::after {
  content: " *";
  color: var(--danger);
}

.query-field > span {
  color: #53616c;
  font-size: 13px;
  font-weight: 900;
}

.query-field-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.query-field input,
.query-field select,
.query-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.query-field input,
.query-field select {
  min-height: 36px;
  padding: 0 10px;
}

.query-field .select-wrap {
  width: 100%;
}

.query-field .custom-select-button {
  min-height: 38px;
  background: #fbfcfd;
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.query-field .custom-select-menu {
  top: calc(100% + 6px);
  max-height: 230px;
  overflow-y: auto;
}

.query-field #queryGameKeySelect + .custom-select-button + .custom-select-menu {
  max-height: 286px;
  overflow: hidden;
  padding: 6px;
}

.custom-select-search {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0 0 6px;
  background: #ffffff;
}

.custom-select-search input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d5e1e7;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.custom-select-search input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 139, 146, 0.12);
}

.custom-select-option-list {
  display: grid;
  gap: 2px;
  max-height: 232px;
  overflow-y: auto;
}

.custom-select-empty {
  padding: 8px;
  color: #768894;
  font-size: 12px;
  font-weight: 800;
}

.query-field .custom-select-option {
  min-height: 34px;
  font-size: 14px;
  font-weight: 800;
}

.query-field [data-multi-select] .custom-select-option {
  position: relative;
  padding-left: 30px;
}

.query-field [data-multi-select] .custom-select-option::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 1.5px solid #b8c4cf;
  border-radius: 4px;
  background: #ffffff;
  transform: translateY(-50%);
}

.query-field [data-multi-select] .custom-select-option.is-selected::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.query-field textarea {
  padding: 8px 10px;
  resize: vertical;
}

.query-checkbox-row,
.query-radio-row,
.query-date-inputs,
.query-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.query-checkbox-row label,
.query-radio-row label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  min-width: 56px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: #53616c;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.query-checkbox-row input,
.query-radio-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  accent-color: var(--accent);
}

.query-checkbox-row label:has(input:checked),
.query-radio-row label:has(input:checked) {
  border-color: #6f9e99;
  background: #eff8f6;
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(111, 158, 153, 0.18);
}

.number-stepper {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.number-stepper input {
  padding-right: 38px;
  appearance: textfield;
}

.number-stepper input::-webkit-outer-spin-button,
.number-stepper input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.number-stepper-buttons {
  position: absolute;
  top: 5px;
  right: 6px;
  bottom: 5px;
  display: grid;
  gap: 4px;
  width: 24px;
}

.number-stepper-buttons button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid #d4dee7;
  border-radius: 6px;
  background: #f8fafb;
  color: #53616c;
  cursor: pointer;
  font: inherit;
  font-size: 0;
  font-weight: 900;
  line-height: 1;
}

.number-stepper-buttons button::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.number-stepper-buttons button[data-stepper-delta="1"]::before {
  border-bottom: 5px solid currentColor;
}

.number-stepper-buttons button[data-stepper-delta="-1"]::before {
  border-top: 5px solid currentColor;
}

.number-stepper-buttons button:hover {
  border-color: #9fc7c4;
  background: #eefafa;
  color: var(--accent-strong);
}

.number-stepper input:disabled + .number-stepper-buttons button {
  cursor: not-allowed;
  opacity: 0.5;
}

.query-inline-warning,
.query-range-error,
.query-device-count-hint {
  color: var(--danger);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.35;
  white-space: nowrap;
}

.query-field-title .query-inline-warning {
  margin-left: auto;
}

.query-inline-warning.hidden {
  display: none;
}

.query-range-error {
  display: none;
  margin-top: -1px;
}

.query-range-field.has-range-error .query-range-error {
  display: block;
}

.query-device-count-hint {
  display: none;
  margin-top: -1px;
}

.query-device-count-field.has-count-error .query-device-count-hint {
  display: block;
}

.query-specified-field {
  grid-column: 1;
}

.query-date-inputs input,
.query-range-inputs > input {
  flex: 1 1 0;
}

.date-picker-field {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
}

.custom-date-input {
  cursor: pointer;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding-right: 22px;
  padding-left: 9px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent-strong) 50%),
    linear-gradient(135deg, var(--accent-strong) 50%, transparent 50%);
  background-position:
    calc(100% - 12px) 50%,
    calc(100% - 7px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.custom-date-popover {
  position: absolute;
  z-index: 5000;
  width: 276px;
  padding: 10px;
  border: 1px solid #bfd1d8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(24, 32, 42, 0.16);
}

.custom-date-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.custom-date-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.custom-date-head button {
  position: relative;
  width: 32px;
  height: 30px;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
  background: #f8fafb;
  color: #53616c;
  cursor: pointer;
}

.custom-date-head button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.custom-date-head [data-date-prev]::before {
  transform: translate(-35%, -50%) rotate(45deg);
}

.custom-date-head [data-date-next]::before {
  transform: translate(-65%, -50%) rotate(225deg);
}

.custom-date-head button:hover {
  border-color: #9fc7c4;
  background: #eefafa;
  color: var(--accent-strong);
}

.custom-date-week,
.custom-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.custom-date-week {
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid #edf1f4;
}

.custom-date-week span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.custom-date-day {
  display: grid;
  place-items: center;
  width: 100%;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.custom-date-day:hover {
  background: #eef7f8;
  color: var(--accent-strong);
}

.custom-date-day.is-muted {
  color: #b6c0c9;
}

.custom-date-day.is-today {
  border-color: #bfd1d8;
}

.custom-date-day.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(47, 125, 125, 0.22);
}

.query-device-id-field {
  grid-column: 2 / -1;
}

.query-field.is-filter-disabled {
  background: #f2f4f7;
  color: var(--muted);
}

.query-field.is-filter-disabled input {
  background: #edf1f4;
  color: #87929c;
  cursor: not-allowed;
}

.query-mode-notice {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #e7d8bb;
  border-radius: 8px;
  background: #fff8e9;
  color: #72552c;
  font-size: 13px;
  font-weight: 800;
}

.query-device-card {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(33, 133, 146, 0.18);
  border-radius: 8px;
  background: #f1fbfc;
  color: #426b71;
  font-size: 12px;
  font-weight: 800;
}

.query-device-card code {
  overflow-wrap: anywhere;
  color: #1f5961;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 800;
}

.query-device-card button {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(33, 133, 146, 0.24);
  border-radius: 7px;
  background: #fff;
  color: #217988;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.query-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.query-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.query-result-card {
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.query-result-card strong {
  color: var(--ink);
  font-size: 14px;
}

.query-result-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.query-result-card code {
  display: block;
  max-height: 150px;
  overflow: auto;
  padding: 8px;
  border-radius: 8px;
  background: #f5f7f9;
  color: #344150;
  font-size: 12px;
  white-space: pre-wrap;
}

.query-request-details {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.query-request-details summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 9px;
  border: 1px solid #d5e2e8;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #53616c;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.query-request-details summary::-webkit-details-marker {
  display: none;
}

.query-request-details summary::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.25px solid currentColor;
  border-bottom: 1.25px solid currentColor;
  color: #7d8b96;
  transform: translateY(-1px) rotate(45deg);
}

.query-request-details[open] summary::after {
  transform: translateY(1px) rotate(225deg);
}

.query-result-card.is-loading {
  border-color: #bed7f4;
  background: #f3f8ff;
}

.query-result-card.is-success {
  border-color: #b8ddc9;
  background: #f7fcf9;
}

.query-result-card.is-empty {
  border-color: #e7d8bb;
  background: #fff8e9;
}

.query-result-card.is-failure {
  border-color: #efc0c0;
  background: #fff5f5;
}

.query-progress {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.query-progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(126, 178, 226, 0.32);
  background: rgba(226, 239, 250, 0.72);
}

.query-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(122, 184, 238, 0.66), rgba(83, 155, 224, 0.78));
  box-shadow: 0 0 0 1px rgba(91, 154, 220, 0.1), 0 4px 12px rgba(91, 154, 220, 0.16);
  transition: width 0.28s ease;
}

.query-result-card.is-loading .query-progress-bar {
  position: relative;
}

.query-result-card.is-success .query-progress-track {
  border-color: rgba(77, 168, 122, 0.2);
  background: rgba(236, 248, 242, 0.78);
}

.query-result-card.is-success .query-progress-bar {
  background: linear-gradient(90deg, rgba(97, 190, 136, 0.62), rgba(61, 158, 105, 0.72));
  box-shadow: 0 0 0 1px rgba(61, 158, 105, 0.07), 0 3px 10px rgba(61, 158, 105, 0.1);
}

.query-result-card.is-success .query-progress-percent {
  color: #3f8a62;
}

.query-result-card.is-loading .query-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  animation: query-progress-shine 1.2s linear infinite;
}

@keyframes query-progress-shine {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

.query-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.query-progress-percent {
  color: var(--primary);
}

.manual-review-body {
  display: grid;
  gap: 0;
}

.control-panel.upload-settings-collapsed .upload-settings-body,
.control-panel.project-settings-collapsed .project-settings-body,
.manual-panel.manual-review-collapsed .manual-review-body,
.rules-panel.rules-collapsed .rules-guide-body {
  display: none;
}

.control-panel.upload-settings-collapsed .block-heading,
.control-panel.project-settings-collapsed .block-heading,
.manual-panel.manual-review-collapsed .block-heading,
.rules-panel.rules-collapsed .block-heading {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.block-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.block-heading > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.block-heading h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.block-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.rules-panel .block-heading p {
  margin: 0;
  color: var(--muted);
  line-height: normal;
}

.trigger-timing-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.trigger-timing-panel .section-heading {
  align-items: center;
}

.manual-extra-heading {
  position: relative;
  margin: 20px 0 12px;
  padding-top: 28px;
  border-top: 0;
}

.manual-extra-heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #dbe5eb;
}

.manual-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 12px;
  align-items: stretch;
}

.log-source-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
  background: #ffffff;
}

.log-source-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.65fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 10px;
  align-items: stretch;
}

.log-source-grid label {
  display: grid;
  grid-template-rows: auto minmax(36px, 1fr);
  gap: 6px;
  min-width: 0;
}

.log-source-grid span {
  color: #6a7782;
  font-size: 12px;
  font-weight: 800;
}

.log-source-grid textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.log-source-grid textarea {
  resize: vertical;
  line-height: 1.4;
}

.log-source-grid textarea.single-device {
  height: 36px;
  min-height: 36px;
  resize: none;
  line-height: 18px;
  overflow: hidden;
}

.log-source-grid textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.log-source-grid textarea:disabled {
  background: #eef2f5;
  color: #8a96a1;
  cursor: not-allowed;
  resize: none;
}

.log-source-grid .select-wrap {
  align-self: start;
  height: auto;
}

.log-source-grid .select-wrap select {
  min-height: 36px;
}

.trigger-timing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.manual-operation-log {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
  background: #ffffff;
}

.manual-operation-log-heading {
  display: grid;
  gap: 4px;
}

.manual-operation-log-heading.has-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.manual-operation-log-heading.has-actions > div {
  min-width: 0;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  color: #344150;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.compact-button:hover {
  color: var(--accent-strong);
}

.manual-operation-log-heading h3 {
  margin: 0;
  color: #344150;
  font-size: 14px;
}

.manual-operation-log-heading span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.manual-operation-log-input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.manual-operation-log-input:focus {
  border-color: var(--accent);
  outline: none;
}

.manual-subject-grid {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
  background: #f4f8fa;
}

.manual-subject-grid label {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr);
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 10px;
  border-left: 1px solid #dbe5eb;
  background: #ffffff;
}

.manual-subject-title {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 12px;
  color: #53616c;
  font-size: 12px;
  font-weight: 800;
  background: #edf4f7;
}

.manual-subject-grid span {
  color: #6a7782;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.manual-subject-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #cbd8df;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.manual-subject-input:focus {
  outline: none;
  border-color: #7fa8ac;
}

@media (max-width: 720px) {
  .section-heading {
    flex-wrap: wrap;
  }

  .identifier-rate-badge {
    order: 2;
    max-width: 100%;
  }

  .manual-review-layout {
    grid-template-columns: 1fr;
  }

  .trigger-timing-grid {
    grid-template-columns: 1fr;
  }

  .log-source-grid {
    grid-template-columns: 1fr;
  }

  .manual-subject-grid {
    display: grid;
  }

  .manual-subject-title {
    min-height: 32px;
  }

  .manual-subject-grid label {
    border-left: 0;
    border-top: 1px solid #dbe5eb;
  }
}

.trigger-timing-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.trigger-timing-card[data-timing-id] {
  grid-template-columns: minmax(0, 1fr) auto;
}

.trigger-timing-card[data-timing-id] .trigger-timing-header {
  grid-column: 1;
}

.trigger-timing-card[data-timing-id] .timing-exempt-toggle {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
}

.trigger-timing-card[data-timing-id] .timing-note {
  grid-column: 1 / -1;
}

.trigger-timing-card[data-timing-id]:has(.timing-exempt-toggle[aria-pressed="true"]) {
  border-color: #b8c4cf;
  background: #f2f4f7;
}

.trigger-timing-card[data-timing-id]:has(input[value="pass"]:checked) {
  border-color: #6f9e99;
  background: #eff8f6;
  box-shadow: inset 0 0 0 1px rgba(111, 158, 153, 0.18);
}

.trigger-timing-card[data-timing-id]:has(input[value="fail"]:checked) {
  border-color: #e2a5a5;
  background: #fff5f5;
}

.trigger-timing-header {
  display: grid;
  gap: 8px;
}

.trigger-timing-card h3 {
  margin: 0;
  color: #344150;
  font-size: 14px;
}

.trigger-timing-card[data-special-manual-id] {
  grid-column: 1 / -1;
}

.payment-method-hint {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.payment-method-review-list {
  display: grid;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.payment-method-review-item {
  display: grid;
  grid-template-columns: minmax(310px, 1.15fr) 174px minmax(240px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  min-width: 800px;
  padding: 7px 8px;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
  background: #f6fafb;
}

.payment-method-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-row: 1;
  gap: 2px 8px;
  min-width: 0;
}

.payment-method-copy span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-row: 1 / span 2;
  width: 20px;
  min-height: 20px;
  border-radius: 50%;
  background: #dcefed;
  color: #24524f;
  font-size: 12px;
  font-weight: 900;
}

.payment-method-copy strong {
  color: #344150;
  font-size: 14px;
  line-height: 1.2;
}

.payment-method-copy em {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
}

.payment-method-review-item .timing-choice {
  grid-row: 1;
  width: 174px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-method-review-item .timing-choice label {
  min-width: 0;
  white-space: nowrap;
}

.payment-method-exempt-toggle {
  grid-row: 1;
  justify-self: end;
  align-self: center;
  grid-column: 4;
}

.manual-bulk-exempt-toggle,
.issue-bulk-exempt-toggle {
  justify-self: end;
  white-space: nowrap;
}

.payment-method-review-item .timing-note {
  grid-column: 3;
  grid-row: 1;
  min-height: 36px;
  height: 36px;
  padding: 7px 10px;
  font-size: 14px;
  resize: vertical;
}

.payment-method-review-item:has(.payment-method-exempt-toggle[aria-pressed="true"]) {
  border-color: #b8c4cf;
  background: #f2f4f7;
}

.payment-method-review-item:has(input[value="pass"]:checked) {
  border-color: #6f9e99;
  background: #eff8f6;
  box-shadow: inset 0 0 0 1px rgba(111, 158, 153, 0.18);
}

.payment-method-review-item:has(input[value="fail"]:checked) {
  border-color: #e2a5a5;
  background: #fff5f5;
}

.manual-review-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid #abc2f2;
  border-radius: 999px;
  background: #f3f7ff;
  color: #4b63a8;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  vertical-align: 2px;
}

.timing-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.timing-choice label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.timing-choice label:has(input:checked) {
  border-color: var(--accent);
  background: #eefafa;
  color: var(--accent-strong);
}

.timing-choice input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #087f8c;
}

.timing-note {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.timing-note:focus {
  border-color: var(--accent);
  outline: none;
}

.project-options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}

.setting-card {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  height: 48px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.setting-card label,
.setting-label {
  color: #344150;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.select-wrap select {
  width: 100%;
  min-width: 90px;
  height: 32px;
  appearance: none;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.select-wrap select:focus,
.setting-input:focus,
.switch-field:focus-within {
  border-color: var(--accent);
  outline: none;
}

.select-wrap.custom-select-ready::after {
  display: none;
}

.select-wrap.custom-select-ready select {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.custom-select-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.custom-select-button::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: translateY(-65%) rotate(45deg);
}

.select-wrap.is-open .custom-select-button {
  border-color: var(--accent);
}

.custom-select-button:disabled {
  cursor: not-allowed;
  background: #edf1f4;
  color: #87929c;
}

.select-wrap.is-open .custom-select-button::after {
  transform: translateY(-25%) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  display: none;
  padding: 4px;
  border: 1px solid #bfd1d8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.14);
}

.select-wrap.is-open .custom-select-menu {
  display: grid;
  gap: 2px;
}

.custom-select-option {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.custom-select-option:hover,
.custom-select-option.is-selected {
  background: #eef7f8;
  color: var(--accent-strong);
}

.custom-select-option.is-selected {
  font-weight: 900;
}

.log-source-select-wrap .custom-select-button,
.log-source-select-wrap .custom-select-option {
  font-size: 13.5px;
  font-weight: 800;
}

.log-source-select-wrap .custom-select-button {
  min-height: 36px;
  background: #fbfcfd;
  color: #344150;
}

.channel-setting-card {
  padding-right: 10px;
}

.sim-setting-card {
  grid-template-columns: auto auto;
  position: relative;
  padding-right: 30px;
}

.sim-setting-card .setting-label {
  white-space: nowrap;
}

.setting-help {
  display: inline-grid;
  place-items: center;
  position: absolute;
  top: 6px;
  right: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #eef4f5;
  color: #5f7477;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  cursor: default;
  opacity: 0.9;
}

.setting-help:hover,
.setting-help:focus-visible {
  background: #dcefed;
  color: var(--accent-strong);
  opacity: 1;
}

.setting-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: 238px;
  padding: 8px 10px;
  border: 1px solid #c8d5dc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.15);
  color: #344150;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  font-size: 12px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: auto;
  user-select: text;
  transform: translateY(4px);
  transition:
    opacity 140ms ease,
    visibility 140ms ease,
    transform 140ms ease;
}

.setting-help:hover .setting-tooltip,
.setting-help:focus-visible .setting-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.setting-help:focus-visible {
  outline: none;
}

.app-channel-setting-card {
  min-width: min(100%, 392px);
}

.setting-input {
  width: 116px;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  justify-self: start;
}

.setting-input:disabled {
  background: #eef2f5;
  color: var(--muted);
  cursor: not-allowed;
}

.optional-channel-controls {
  display: grid;
  grid-template-columns: 124px 134px;
  gap: 8px;
  align-items: center;
  justify-content: start;
  min-width: 0;
  max-width: 100%;
}

.optional-channel-controls .select-wrap {
  min-width: 0;
}

.optional-channel-controls .select-wrap select {
  width: 100%;
}

.optional-channel-controls .setting-input {
  width: 134px;
  min-width: 0;
}

@media (max-width: 740px) {
  .app-channel-setting-card {
    min-width: 0;
    width: 100%;
  }

  .setting-card,
  .channel-setting-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    height: auto;
    min-height: 48px;
  }

  .optional-channel-controls {
    grid-template-columns: 124px 134px;
  }
}

.switch-field {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 104px;
  min-height: 32px;
  padding: 4px 6px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.switch-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: #d9e1e8;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(24, 32, 42, 0.22);
  transition: transform 160ms ease;
}

.switch-field input:checked + .switch-track {
  background: var(--accent);
}

.switch-field input:checked + .switch-track::after {
  transform: translateX(22px);
}

.switch-field strong {
  min-width: 18px;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.switch-field input:checked ~ strong {
  color: var(--accent-strong);
}

.upload-file-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 76px;
  padding: 14px 18px;
  border: 2px dashed #a9bac8;
  border-radius: 8px;
  background: #f9fbfc;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.upload-file-layout .drop-zone,
.upload-file-layout .uploaded-files {
  min-height: 150px;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: #eefafa;
  transform: translateY(-1px);
}

.upload-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 24px;
  line-height: 1;
}

.drop-zone strong {
  flex: 0 0 auto;
  margin-bottom: 0;
  font-size: 17px;
}

.drop-zone small {
  max-width: 680px;
  text-align: left;
  overflow-wrap: anywhere;
}

.drop-zone em {
  flex: 0 1 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--warning);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.upload-file-layout .drop-zone em {
  width: 100%;
  max-width: 460px;
  border-radius: 8px;
  line-height: 1.45;
}

.drop-zone small,
.section-heading span,
.empty-state p {
  color: var(--muted);
}

.chain-category-hint {
  position: relative;
  flex: 0 0 auto;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid #e0d0aa;
  border-radius: 999px;
  background: #fff8e8;
  color: #8a5b09;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  cursor: default;
}

.chain-category-hint::after {
  content: "请尽量保证上传附件覆盖每个设备的完整打开/登录链路，否则这类校验结果可能不准确。";
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 50%;
  visibility: hidden;
  opacity: 0;
  box-sizing: border-box;
  width: 220px;
  max-width: calc(100vw - 48px);
  padding: 9px 11px;
  border: 1px solid #e2d4b8;
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.12);
  color: #5f3b08;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  white-space: normal;
  pointer-events: none;
  transform: translate(-50%, -2px);
  transition: opacity 80ms ease, transform 80ms ease, visibility 80ms ease;
}

.chain-category-hint:hover::after,
.chain-category-hint:focus-visible::after {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

.platform-abnormal-badge {
  position: relative;
  flex: 0 0 auto;
  width: max-content;
  max-width: none;
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid #ead0bd;
  border-radius: 999px;
  background: #fff9f3;
  color: #a86535;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  cursor: default;
}

.section-heading .platform-abnormal-badge,
.issue-side-actions .platform-abnormal-badge {
  color: #a86535;
}

.platform-abnormal-badge[hidden] {
  display: none;
}

.platform-abnormal-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  right: 0;
  visibility: hidden;
  opacity: 0;
  box-sizing: border-box;
  width: 240px;
  max-width: calc(100vw - 48px);
  padding: 9px 11px;
  border: 1px solid #ead0bd;
  border-radius: 8px;
  background: #fffbf7;
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.12);
  color: #7c4d28;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  white-space: normal;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 80ms ease, transform 80ms ease, visibility 80ms ease;
}

.platform-abnormal-badge:hover::after,
.platform-abnormal-badge:focus-visible::after {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.issue-side-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.issue-side-actions .platform-abnormal-badge {
  padding-inline: 9px;
}

.identifier-rate-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: min(560px, 50vw);
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f8fa;
  color: #53616c;
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
  cursor: default;
}

.identifier-rate-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 50%;
  visibility: hidden;
  opacity: 0;
  box-sizing: border-box;
  width: 220px;
  max-width: calc(100vw - 48px);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.12);
  color: #344150;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  white-space: pre-line;
  pointer-events: none;
  transform: translate(-50%, -2px);
  transition: opacity 80ms ease, transform 80ms ease, visibility 80ms ease;
}

.identifier-rate-badge:hover::after,
.identifier-rate-badge:focus-visible::after {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

.identifier-rate-badge.identifier-rate-ok {
  border-color: #b8ddc9;
  background: #eefbf3;
  color: var(--ok);
}

.identifier-rate-badge.identifier-rate-bad {
  border-color: #efc9c1;
  background: #fff5f2;
  color: var(--danger);
}

.identifier-rate-badge.identifier-rate-pending {
  border-color: #d9e1e8;
  background: #f6f8fa;
  color: var(--muted);
}

.uploaded-files {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #b8ddc9;
  border-radius: 8px;
  background: #f7fcf9;
}

.uploaded-files.is-empty {
  border-color: var(--line);
  background: #f6f8fa;
}

.uploaded-files-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.uploaded-files-heading strong {
  color: var(--ok);
  font-size: 15px;
}

.uploaded-files.is-empty .uploaded-files-heading strong {
  color: var(--muted);
}

.uploaded-files-heading span {
  color: var(--muted);
  font-size: 13px;
}

.uploaded-file-list {
  display: grid;
  gap: 8px;
}

.uploaded-file-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.uploaded-file-item.has-missing-checklist {
  border-color: #d6d9de;
  background: #f3f4f6;
}

.file-type-pill {
  min-width: 58px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eefafa;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.uploaded-file-name {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-file-detail {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.uploaded-file-detail.warning {
  color: var(--warning);
  font-weight: 700;
}

.chain-coverage-status {
  display: inline-block;
  margin-top: 4px;
  line-height: 1.5;
}

.chain-coverage-status.ok {
  color: var(--muted);
}

.chain-coverage-status.warning {
  color: var(--warning);
  font-weight: 700;
}

.chain-coverage-status.error {
  color: var(--danger);
  font-weight: 800;
}

.empty-upload-card {
  border-style: dashed;
  background: #f7f8fa;
}

.checklist-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  white-space: nowrap;
}

.checklist-status.present {
  color: var(--ok);
}

.checklist-status.missing {
  color: var(--danger);
}

@media (max-width: 640px) {
  .uploaded-file-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .uploaded-file-detail {
    grid-column: 1 / -1;
    text-align: left;
    white-space: normal;
  }
}

.section-heading.compact {
  margin: 0 0 10px;
}

.section-heading.compact.manual-extra-heading {
  margin: 28px 0 12px;
}

.subsection-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 16px 0 8px;
}

.subsection-title h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 15px;
}

.subsection-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.chain-definitions,
.rule-groups {
  display: grid;
  gap: 10px;
}

.chain-definitions {
  margin-bottom: 10px;
}

.rule-groups {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 10px;
}

.rule-group {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.chain-definition-card {
  border-left: 4px solid var(--accent);
  background: #f8fbfc;
}

.manual-rule-note {
  margin: 2px 0 8px;
  padding: 8px 10px;
  border: 1px solid #d7e2ff;
  border-left: 3px solid #6f8fe5;
  border-radius: 8px;
  background: #f5f8ff;
  box-shadow: 0 1px 4px rgba(80, 103, 150, 0.04);
}

.manual-rule-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-right: 8px;
  padding: 0 7px;
  border: 1px solid #c1cff8;
  border-radius: 999px;
  background: #eef4ff;
  color: #4f68b0;
  font-size: 12px;
  font-weight: 800;
  vertical-align: 1px;
}

.rule-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.rules-panel p {
  margin: 0 0 6px;
  color: #344150;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.rule-detail {
  display: grid;
  gap: 4px;
  margin: 0 0 6px;
}

.rule-number-list {
  list-style: none;
  counter-reset: rule-item;
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 0;
  color: #344150;
  font-size: 13px;
  line-height: 1.45;
}

.rule-number-list li {
  counter-increment: rule-item;
  position: relative;
  padding-left: 17px;
  overflow-wrap: anywhere;
}

.rule-number-list li::before {
  content: counter(rule-item) "）";
  position: absolute;
  left: 0;
  color: #53616c;
  font-weight: 800;
}

.chain-badge,
.chain-text {
  font-weight: 700;
}

.chain-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  color: #ffffff;
  line-height: 1.35;
}

.chain-open {
  color: var(--open-chain);
}

.chain-login {
  color: var(--login-chain);
}

.chain-badge.chain-open,
.chain-badge.chain-login {
  color: #ffffff;
}

.chain-badge.chain-open {
  background: var(--open-chain);
}

.chain-badge.chain-login {
  background: var(--login-chain);
}

.result-panel {
  min-height: 620px;
  padding: 16px;
  background: var(--panel);
  border-color: var(--line);
}

.result-panel > .block-heading {
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom-color: var(--line);
  background: transparent;
}

.result-panel > .block-heading > span {
  background: var(--accent);
}

.result-panel > .block-heading h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.result-panel > .block-heading p {
  color: var(--muted);
  font-size: 13px;
}

.result-section-title,
.result-intro {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 54px;
  margin: 18px 0 12px;
  padding: 12px 14px 12px 18px;
  border-radius: 8px;
  border: 1px solid #c2d4dc;
  background: #f2f8f9;
  box-shadow: 0 8px 18px rgba(24, 32, 42, 0.05);
  overflow: hidden;
}

.result-section-title::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #5fa8ae;
}

.result-section-title > div {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.result-section-title h3 {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border-left: 0;
  color: #253340;
  font-size: 16px;
  font-weight: 900;
}

.result-section-title span {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  color: #7a8792;
  font-size: 13.5px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.result-overview-toggle {
  flex: 0 0 auto;
  min-height: 30px;
}

.result-content.overview-collapsed .summary-grid {
  display: none;
}

.result-detail-title {
  margin-top: 24px;
}

.result-intro span {
  flex: 0 0 auto;
  padding: 0 0 0 9px;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  background: transparent;
  color: #1f3f3d;
  font-size: 15px;
  font-weight: 900;
}

.result-intro strong {
  min-width: 0;
  color: #344150;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  place-content: center;
  min-height: 580px;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.hidden {
  display: none;
}

.query-range-field:has(input:out-of-range) .query-range-error {
  display: block;
}

.query-range-field:has(input:out-of-range) input:out-of-range {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(189, 73, 73, 0.12);
}

.query-range-field.has-range-error input {
  border-color: var(--danger);
}

.summary-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

.result-detail-toolbar {
  display: none;
}

.result-detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344150;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.rule-reviewed {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: -1px 1px -1px 0;
  padding: 1px 8px;
  border: 1px solid #b8d3c7;
  border-radius: 999px;
  background: #e6f4ee;
  color: #2f3d46;
  font-weight: 800;
  line-height: 1.35;
  vertical-align: baseline;
  cursor: default;
}

.rule-reviewed::after {
  content: attr(data-review-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 220px;
  padding: 7px 9px;
  border: 1px solid #cbd7d1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(28, 39, 49, 0.14);
  color: #43515a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.rule-reviewed:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.result-detail-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.result-detail-toggle[aria-pressed="true"]::after {
  transform: translateY(2px) rotate(225deg);
}

.result-detail-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.result-detail-toggle[aria-pressed="true"] {
  border-color: #b7c4d0;
  background: #eef2f5;
  color: #344150;
}

.summary-category {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.summary-category-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #e4eceb;
  border-radius: 8px;
  background: linear-gradient(90deg, #f1f8f7 0%, #f8fbfa 54%, #ffffff 100%);
}

.summary-category-heading span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(67, 121, 116, 0.08);
  color: #55706d;
  font-size: 12px;
  font-weight: 900;
}

.summary-category-heading strong {
  min-width: 0;
  color: #435b58;
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.summary-category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, 132px);
  gap: 10px;
  justify-content: start;
}

.metric-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 42px 1fr;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.metric-card.clickable {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.metric-card.clickable:hover,
.metric-card.clickable:focus-visible {
  border-color: var(--accent);
  background: #f1fbfb;
  outline: none;
  transform: translateY(-1px);
}

.metric-card span {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 42px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.metric-card strong {
  position: relative;
  z-index: 1;
  display: block;
  align-self: end;
  margin-top: 0;
  font-size: 24px;
  line-height: 1;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 12px;
  scroll-margin-top: 16px;
}

.section-heading h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.section-heading.result-group-start {
  position: relative;
  margin-top: 48px;
  padding-top: 34px;
}

.section-heading.result-group-start::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(147, 197, 253, 0) 0%,
    rgba(147, 197, 253, 0.09) 4%,
    rgba(147, 197, 253, 0.18) 16%,
    rgba(45, 125, 125, 0.22) 50%,
    rgba(147, 197, 253, 0.18) 84%,
    rgba(147, 197, 253, 0.09) 96%,
    rgba(147, 197, 253, 0) 100%
  );
  pointer-events: none;
}

.result-detail-title + .section-heading.result-group-start {
  margin-top: 24px;
  padding-top: 0;
}

.result-detail-title + .section-heading.result-group-start::before {
  display: none;
}

.section-detail-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7b8a96;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.section-detail-toggle::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.section-detail-toggle[aria-expanded="true"]::before {
  transform: translateY(2px) rotate(225deg);
}

.section-detail-toggle:hover {
  color: var(--accent-strong);
}

.result-content.details-collapsed .section-heading {
  align-items: center;
  min-height: 42px;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease;
}

.result-content.details-collapsed .section-heading.result-group-start {
  margin-top: 40px;
  padding-top: 8px;
}

.result-content.details-collapsed .section-heading.result-group-start::before {
  top: -21px;
  height: 1px;
}

.result-content.details-collapsed .result-detail-title + .section-heading.result-group-start {
  margin-top: 12px;
  padding-top: 8px;
}

.result-content.details-collapsed .result-detail-title + .section-heading.result-group-start::before {
  display: none;
}

.result-content.details-collapsed .section-heading:hover {
  border-color: #bfd1d8;
  background: #f6fafb;
}

.result-content.details-collapsed .section-heading h2 {
  font-size: 15px;
}

.result-content.details-collapsed .section-detail-toggle {
  display: inline-flex;
}

.result-content.details-collapsed .issue-list,
.result-content.details-collapsed .event-grid,
.result-content.details-collapsed #previewSection,
.result-content.details-collapsed .table-wrap {
  display: none;
}

.result-content.details-collapsed .section-heading.detail-open + .issue-list,
.result-content.details-collapsed .section-heading.detail-open + .event-grid {
  display: grid;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.event-card {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.event-card.missing {
  border-color: #efc9c1;
  background: #fff8f6;
}

.event-card.present {
  border-color: #b8ddc9;
  background: #f7fcf9;
}

.event-card.exempted {
  border-color: #aebdca;
  background: #eef3f7;
}

.event-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
}

.event-title > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-name {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.status-pill {
  flex: 0 0 auto;
  width: max-content;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.present {
  background: var(--ok);
}

.status-pill.missing {
  background: var(--danger);
}

.status-pill.exempted {
  background: #637080;
}

.event-count {
  color: var(--muted);
  font-size: 12px;
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-exempt-toggle {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #cbd7e0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.event-exempt-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.event-exempt-toggle[aria-pressed="true"] {
  border-color: #aebbc8;
  background: #e6ebf0;
  color: #344150;
}

.issue-exempt-toggle {
  align-self: start;
  justify-self: end;
}

.field-summary-chip:has(.field-summary-exempt-toggle[aria-pressed="true"]) {
  border-color: #bcc8d2;
  background: #f3f6f8;
}

.field-summary-chip:has(.field-summary-exempt-toggle[aria-pressed="true"]) strong {
  color: #41505d;
}

.field-summary-chip:has(.field-summary-exempt-toggle[aria-pressed="true"]) .field-summary-event {
  border-color: #d1dae1;
  background: #fbfcfd;
  color: #667581;
}

.field-summary-chip:has(.field-summary-exempt-toggle[aria-pressed="true"]) .field-summary-more {
  border-color: #c7d1d8;
  background: #fbfcfd;
  color: #667581;
}

.issue-list {
  display: grid;
  gap: 8px;
  max-height: 244px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  margin-bottom: 30px;
}

.issue-list.has-field-summary {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.field-issue-scroll {
  display: grid;
  gap: 8px;
  max-height: 244px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.issue-item {
  display: grid;
  grid-template-columns: 96px 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.issue-item.is-detail-exempted {
  border-color: #c2ccd4;
  background: #f3f5f7;
}

.issue-item.is-detail-exempted .issue-line,
.issue-item.is-detail-exempted .issue-type,
.issue-item.is-detail-exempted .issue-message,
.issue-item.is-detail-exempted .issue-detail {
  color: #75818b;
}

.field-summary-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid #c8dff1;
  border-radius: 8px;
  background: #f7fbff;
  box-shadow: 0 8px 16px rgba(33, 57, 77, 0.08);
}

.field-summary-title {
  display: inline-flex;
  align-items: flex-start;
  gap: 5px;
  position: relative;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.field-summary-help {
  position: relative;
  top: -2px;
  right: auto;
  flex: 0 0 auto;
}

.field-summary-help .setting-tooltip {
  right: auto;
  left: 0;
  width: 280px;
}

.field-summary-help:hover .setting-tooltip,
.field-summary-help:focus-visible .setting-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.field-summary-tags {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-summary-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #b9d8ea;
  border-radius: 12px;
  background: #eaf6fd;
}

.field-summary-chip strong {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  min-width: 0;
}

.field-summary-chip i {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-style: normal;
  white-space: nowrap;
}

.field-summary-event-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.field-summary-event,
.field-summary-more {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.field-summary-event {
  border: 1px solid rgba(44, 102, 149, 0.18);
  background: rgba(255, 255, 255, 0.9);
  color: #2c6695;
}

.field-summary-more {
  position: relative;
  border: 1px dashed #b0c8dc;
  background: rgba(255, 255, 255, 0.72);
  color: #60798c;
  cursor: default;
}

.field-summary-more::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid #c8d5dc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.15);
  color: #344150;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
}

.field-summary-more:hover::after,
.field-summary-more:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.field-summary-exempt-toggle {
  justify-self: end;
  white-space: nowrap;
}

.field-summary-tags em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.8;
}

.field-dependency-notice {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid #f0d19a;
  border-left: 3px solid #c88416;
  border-radius: 8px;
  background: #fff8ed;
  color: #5f3b08;
  box-shadow: 0 6px 12px rgba(95, 59, 8, 0.08);
}

.field-dependency-title {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.field-dependency-message {
  font-size: 13px;
  line-height: 1.55;
}

.issue-line {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.issue-type {
  width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.issue-type.error {
  background: var(--danger);
}

.issue-type.warning {
  background: var(--warning);
}

.issue-type.info {
  background: var(--accent);
}

.issue-message {
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.issue-detail {
  display: block;
  margin-top: 4px;
}

.table-wrap {
  max-width: 100%;
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.preview-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.preview-table th,
.preview-table td {
  min-width: 130px;
  max-width: 260px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-table th:nth-child(1),
.preview-table td:nth-child(1) {
  min-width: 180px;
}

.preview-table th:nth-child(2),
.preview-table td:nth-child(2) {
  min-width: 72px;
}

.preview-table th:nth-child(4),
.preview-table td:nth-child(4) {
  min-width: 150px;
}

.preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf4f6;
  color: #263442;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100vw - 44px, 1240px);
    margin: 0 auto;
  }

  .content-layout,
  .app-shell.nav-collapsed .content-layout {
    grid-template-columns: 1fr;
  }

  .page-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    max-height: none;
  }

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

  .page-nav-group {
    display: contents;
    min-width: 0;
  }

  .page-nav-sublist {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    padding: 8px 0 0;
    border-top: 1px solid #dbe5eb;
    border-left: 0;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }

  .nav-group-label {
    display: none;
  }

  .app-shell.nav-collapsed .page-nav-list {
    display: none;
  }

  .app-shell.nav-collapsed .page-nav-header strong {
    display: block;
  }

  .app-shell.nav-collapsed .page-nav-header {
    justify-content: space-between;
    padding-bottom: 0;
    border-bottom: 0;
  }

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

  .project-options {
    display: flex;
  }

  .setting-card {
    grid-template-columns: auto auto;
  }

  .app-channel-setting-card {
    min-width: 0;
  }

  .optional-channel-controls {
    grid-template-columns: 124px 134px;
    align-items: center;
  }

  .optional-channel-controls .select-wrap {
    min-width: 0;
  }

  .optional-channel-controls .select-wrap select {
    width: 100%;
  }

  .rules-panel {
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .summary-category-cards {
    grid-template-columns: repeat(auto-fill, 132px);
  }

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

  .upload-file-layout {
    grid-template-columns: 1fr;
  }

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

  .rule-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 24px, 1180px);
    padding: 16px 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

	  .top-actions,
	  .rule-reference-tools,
	  .rule-reference-card {
	    width: 100%;
	  }

  .rule-reference-tools {
    align-items: stretch;
    flex-direction: column;
  }

	  .rule-reference-card {
	    justify-content: space-between;
	  }

  .page-nav-list {
    grid-template-columns: 1fr;
  }

  .source-mode-toggle,
  .query-filter-grid {
    grid-template-columns: 1fr;
  }

  .manual-operation-log-heading.has-actions {
    grid-template-columns: 1fr;
  }

  .manual-operation-log-heading.has-actions .compact-button {
    width: 100%;
  }

  .query-device-id-field {
    grid-column: 1;
  }

  .setting-card {
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .summary-category-cards {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .event-grid {
    grid-template-columns: 1fr;
  }

  .issue-item {
    grid-template-columns: 1fr;
  }
}
