:root {
  --ink: #101b3b;
  --ink-soft: #4c5973;
  --muted: #5b677d;
  --canvas: #f4f7ff;
  --card: #ffffff;
  --line: #e3eaf6;
  --blue: #3e6ff2;
  --blue-deep: #2955d3;
  --blue-pale: #edf2ff;
  --teal: #0f7b72;
  --teal-pale: #e7f6f4;
  --green: #149e6b;
  --green-pale: #e7f8f1;
  --amber: #c97709;
  --amber-pale: #fff6e5;
  --amber-border: #f2cf99;
  --red: #d43f4a;
  --red-pale: #fff1f2;
  --slate: #475877;
  --slate-pale: #eef2f9;
  --shadow-sm: 0 2px 12px rgba(36, 60, 117, .06);
  --shadow-md: 0 10px 28px rgba(37, 67, 131, .09);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
}
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; background: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(62, 111, 242, .45);
  outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app-frame {
  width: min(100%, 1080px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 24px max(108px, calc(92px + env(safe-area-inset-bottom)));
  background: var(--canvas);
}

.app-header {
  min-height: 74px;
  padding: 12px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 4px 8px 4px 0;
  font-weight: 700;
  letter-spacing: -.02em;
}
.mini-brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3f75f5, #6c5ce7);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(63, 117, 245, .22);
}
.mini-brand-name { font-size: 17px; }

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  max-width: 100%;
}
.connection-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-pale);
}
.connection-pill.mode-approved {
  background: var(--green-pale);
  border-color: #bfe9d7;
  color: #106c4a;
}
.connection-pill.mode-approved .connection-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 158, 107, .18);
}
.connection-pill.mode-demo {
  background: var(--amber-pale);
  border-color: var(--amber-border);
  color: #8b5106;
}
.connection-pill.mode-demo .connection-dot {
  background: #e38c14;
  box-shadow: 0 0 0 3px rgba(227, 140, 20, .2);
}
.connection-pill.mode-error {
  background: var(--red-pale);
  border-color: #f8c6ca;
  color: #a42c35;
}
.connection-pill.mode-error .connection-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(212, 63, 74, .18);
}

.view { display: none; animation: view-in .24s ease both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

h1, h2, h3, p { margin-top: 0; }
.overline {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.home-intro { padding: 28px 0 22px; }
h1 {
  margin-bottom: 14px;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.12;
  letter-spacing: -.04em;
}
.home-subtitle {
  max-width: 680px;
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 720px);
  min-height: 60px;
  padding: 7px 8px 7px 16px;
  border: 1.5px solid #d5e0f5;
  border-radius: 17px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(62, 111, 242, .12), var(--shadow-sm);
}
.icon-search { width: 21px; height: 21px; color: #7f8ca4; }
.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}
.search-box input::placeholder { color: #8c98ad; }
.search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 72px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(62, 111, 242, .22);
  transition: background .2s, transform .2s;
}
.search-submit:hover { background: var(--blue-deep); transform: translateY(-1px); }
.search-submit .icon { width: 17px; height: 17px; }

.home-section { margin-top: 32px; }
.section-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title-row h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.section-title-row .overline { margin-bottom: 3px; }
.section-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--green-pale);
  color: #106c4a;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.section-tag.warm {
  background: var(--amber-pale);
  color: #8b5106;
}

.popular-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.popular-card {
  min-width: 0;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px 15px 14px;
  border: 1px solid #e1e9f7;
  border-radius: var(--radius-md);
  background: var(--card);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.popular-card:hover {
  transform: translateY(-2px);
  border-color: #c2d4fa;
  box-shadow: var(--shadow-md);
}
.popular-no {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--blue-pale);
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 700;
}
.popular-card strong {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.3;
}
.popular-card small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.official-note {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 28px 0 8px;
  padding: 16px 18px;
  border: 1px solid #d7e4ff;
  border-radius: 16px;
  background: #ebf1ff;
  color: #2046b0;
}
.note-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .82);
}
.note-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.official-note strong { display: block; font-size: 14px; }
.official-note small { display: block; margin-top: 4px; color: #4a5e8c; font-size: 12px; line-height: 1.6; }

.subpage-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 20px;
}
.subpage-head.simple { padding-top: 24px; }
.subpage-title-wrap { min-width: 0; flex: 1; }
.subpage-head h1 {
  margin: 0;
  font-size: clamp(22px, 4.5vw, 30px);
  line-height: 1.25;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.subpage-head .overline { margin: 0 0 4px; font-size: 10px; }

.back-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.back-button .icon { width: 22px; height: 22px; }
.count-pill {
  flex: none;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--blue-pale);
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.circle-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: #7c89a0;
  box-shadow: var(--shadow-sm);
  transition: background .2s, color .2s, border-color .2s;
}
.circle-button.saved {
  color: #c97709;
  border-color: #f4cc8a;
  background: var(--amber-pale);
}
.circle-button.saved .icon { fill: currentColor; }
.circle-button .icon { width: 20px; height: 20px; }

.notice {
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid #d5e2ff;
  border-radius: 13px;
  background: #edf3ff;
  color: #3e527c;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.notice.warning {
  border-color: #f5c39c;
  background: #fff5ec;
  color: #934214;
}
.notice.error {
  border-color: #ffd0d5;
  background: var(--red-pale);
  color: #a92d38;
}

/* Disambiguation guide card */
.disambiguation-card {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1.5px solid #c5d7ff;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f6f9ff 0%, #ffffff 100%);
  box-shadow: var(--shadow-sm);
}
.disambiguation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.disambiguation-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.disambiguation-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}
.disambiguation-summary {
  margin: 8px 0 14px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}
.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}
.branch-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dde6f8;
  border-radius: 14px;
  background: #fff;
}
.branch-card strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
}
.branch-spot {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.branch-spot-label {
  font-weight: 700;
  color: var(--blue-deep);
}
.branch-query-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #c9d9fd;
  background: var(--blue-pale);
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 700;
  transition: background .2s, border-color .2s;
}
.branch-query-btn:hover {
  background: #dfe9ff;
  border-color: var(--blue);
}

/* Search Result Cards */
.results-list { display: grid; gap: 14px; padding-bottom: 16px; }
.result-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid #e1e8f5;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.result-card.is-scope-warning {
  border-color: #f3c1b2;
  border-left: 5px solid #dc5a38;
  background: #fffaf8;
}
.result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.standard-no-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.standard-no {
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.registry-status-pill {
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f4fa;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.result-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  max-width: 100%;
}
.result-status.badge-verified {
  background: var(--green-pale);
  border: 1px solid #bcead6;
  color: #0e6c49;
}
.result-status.badge-pending {
  background: var(--amber-pale);
  border: 1px solid var(--amber-border);
  color: #885006;
}
.result-status.badge-related {
  background: var(--slate-pale);
  border: 1px solid #d5dfef;
  color: var(--slate);
}
.result-status.badge-warning {
  background: #ffefe9;
  border: 1px solid #f7c2b0;
  color: #b7371b;
}

.result-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.result-scope {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.clue-callout {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #dce6fb;
  background: #f5f8ff;
  color: #2f436f;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.clue-callout strong { color: var(--blue-deep); }

/* Result compact preview checks */
.result-preview-checks {
  padding: 12px 14px;
  border: 1px solid #e4ebf8;
  border-radius: 13px;
  background: #fbfcff;
}
.preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.preview-head h3 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}
.preview-head span {
  color: var(--muted);
  font-size: 12px;
}
.preview-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.preview-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed #e1e8f5;
  font-size: 13px;
}
.preview-item:first-child { padding-top: 0; border-top: 0; }
.preview-item-main { min-width: 0; overflow-wrap: anywhere; }
.preview-item-main strong { color: var(--ink); margin-right: 6px; }
.preview-item-val { color: var(--blue-deep); font-weight: 700; }
.preview-item-sub {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.stage-pill.stage-pkg { background: var(--teal-pale); color: var(--teal); }
.stage-pill.stage-lab { background: var(--blue-pale); color: var(--blue-deep); }
.stage-pill.stage-archive { background: var(--slate-pale); color: var(--slate); }

/* Result inline advisory strip */
.result-advisory-strip {
  padding: 12px 14px;
  border: 1px solid var(--amber-border);
  border-left: 4px solid #e38c14;
  border-radius: 12px;
  background: #fffaf1;
}
.strip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.strip-kind-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fce4be;
  color: #7d4704;
  font-size: 11px;
  font-weight: 700;
}
.strip-count {
  font-size: 11px;
  color: #82571c;
  font-weight: 600;
}
.strip-item + .strip-item {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #eed1a3;
}
.strip-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.strip-item-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #5b3304;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.strip-item-step {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b4e2b;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 11px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: background .2s;
}
.detail-link:hover { background: var(--blue-deep); }
.official-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 6px 4px;
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.library-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px 0;
}
.library-pages:empty { display: none; }
.library-pages button:disabled { opacity: .45; cursor: default; }

/* Detail Hero & 4-Block Navigation */
.detail-hero {
  padding: 22px 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #4b7cf5, #2b59dc);
  color: #fff;
  box-shadow: 0 12px 26px rgba(45, 92, 222, .22);
}
.detail-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.detail-hero .detail-type {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.detail-hero .detail-type.hero-warn {
  background: rgba(255, 232, 214, .95);
  color: #9e2d15;
}
.detail-hero h2 {
  margin: 14px 0 6px;
  font-size: clamp(24px, 4.8vw, 36px);
  line-height: 1.18;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.detail-hero p {
  margin: 0;
  color: rgba(255, 255, 255, .9);
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.block-nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.block-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 12px;
  border: 1px solid #d5e0f6;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.block-pill-btn:hover { border-color: var(--blue); color: var(--blue-deep); }
.block-pill-btn.warm {
  border-color: var(--amber-border);
  background: var(--amber-pale);
  color: #8b5106;
}

/* 4-Block Detail Cards */
.detail-block {
  margin-top: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.block-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.block-index {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue-pale);
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 800;
}
.block-index.warm {
  background: #fce4be;
  color: #8b4c04;
}
.block-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.meta-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px 16px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  background: #f7f9fe;
  border: 1px solid #e6edf9;
}
.meta-kv-item { min-width: 0; }
.meta-kv-item dt {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 3px;
}
.meta-kv-item dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.scope-copy {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.check-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
}

/* Block 2: Stages & Tables */
.check-stage {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
}
.check-stage:first-of-type { margin-top: 10px; }
.check-stage.stage-packaging {
  border: 1px solid #cce7e4;
  background: #f4fbfa;
}
.check-stage.stage-lab {
  border: 1px solid #dce5f7;
  background: #f7f9fe;
}
.stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.stage-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}
.stage-intro {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.core-metrics {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}
.core-metrics th, .core-metrics td {
  padding: 10px 9px;
  border-bottom: 1px solid #dfe7f4;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.core-metrics th {
  background: #ebf1fc;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.core-metrics td:first-child { font-weight: 700; color: var(--ink); }
.core-metrics td:nth-child(2) { font-weight: 700; color: var(--blue-deep); }
.core-metrics tr[data-supplemental] td:nth-child(2) { color: #2b4a9a; }
.core-metrics .official-link {
  min-height: 36px;
  padding: 4px 0;
  font-size: 13px;
}
.core-metrics details { margin-top: 6px; color: var(--ink-soft); font-weight: 400; }
.core-metrics details summary { cursor: pointer; font-weight: 600; color: var(--blue-deep); }
.core-metrics details p, .core-metrics details pre {
  margin: 6px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.extracted-source + .extracted-source { margin-top: 8px; }
.source-table-scroll { max-width: 100%; overflow-x: auto; margin-top: 6px; border: 1px solid #e1e8f5; border-radius: 8px; background: #fff; }
.source-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.source-table th, .source-table td { padding: 5px 8px; border-bottom: 1px solid #edf1f8; white-space: normal; }

.core-metrics-archive { table-layout: fixed; }
.core-metrics-archive > thead > tr > th:nth-child(1) { width: 19%; }
.core-metrics-archive > thead > tr > th:nth-child(2) { width: 27%; }
.core-metrics-archive > thead > tr > th:nth-child(3) { width: 10%; }
.core-metrics-archive > thead > tr > th:nth-child(4) { width: 18%; }
.core-metrics-archive > thead > tr > th:nth-child(5) { width: 12%; }
.core-metrics-archive > thead > tr > th:nth-child(6) { width: 14%; }

.detail-subdetails {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #e0e7f5;
  border-radius: 13px;
  background: #fafcff;
}
.detail-subdetails summary {
  display: flex;
  align-items: center;
  min-height: 36px;
  cursor: pointer;
  font-weight: 700;
  color: var(--blue-deep);
}
.terms-dl { margin: 10px 0 0; }
.terms-dl dt { font-weight: 700; margin-top: 10px; color: var(--ink); }
.terms-dl dd { margin: 4px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.summary-article {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5ecf8;
  font-size: 13px;
  line-height: 1.6;
}
.summary-article p { margin: 4px 0; overflow-wrap: anywhere; }

/* Block 3: Consumer Advisories (Distinct Warm Palette) */
.advisory-block {
  border: 1.5px solid var(--amber-border);
  background: linear-gradient(180deg, #fffaf1 0%, #ffffff 130px);
}
.advisory-kind-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fce4be;
  color: #7d4704;
  font-size: 12px;
  font-weight: 700;
}
.advisory-disclaimer {
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px dashed #e9bc74;
  background: #fff5e3;
  color: #75490d;
  font-size: 13px;
  line-height: 1.6;
}
.advisory-list {
  display: grid;
  gap: 14px;
}
.advisory-card {
  padding: 16px 18px;
  border: 1px solid #f2d9b1;
  border-left: 4px solid #e38c14;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(173, 114, 24, .06);
}
.advisory-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.tactic-pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 7px;
  background: #ffe9d6;
  color: #9e4211;
  font-size: 12px;
  font-weight: 700;
}
.review-badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
}
.review-badge.review-clause { background: #e6f5f2; color: #0e6b60; }
.review-badge.review-case { background: #eaf0ff; color: #244db8; }
.review-badge.review-example { background: #fff2d6; color: #8b5106; }
.review-badge.review-pending { background: #f1f3f8; color: #546078; }

.advisory-title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.4;
  color: #362209;
  overflow-wrap: anywhere;
}
.advisory-condition {
  margin: 0 0 12px;
  font-size: 13px;
  color: #735a39;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.advisory-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f7ebd7;
}
.advisory-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 800;
  color: #8a5308;
}
.advisory-section p {
  margin: 0;
  font-size: 14px;
  color: #3f382e;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.verify-steps {
  margin: 4px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #2f2a23;
  line-height: 1.6;
}
.verify-steps li { overflow-wrap: anywhere; }
.chip-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.evidence-chip {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #edd4aa;
  background: #fff8eb;
  color: #6b430a;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.indicator-chip {
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid #dce6fb;
  background: #f3f7ff;
  color: #274ba8;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.basis-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.basis-item {
  padding: 9px 11px;
  border-radius: 10px;
  background: #fdf9f2;
  border: 1px solid #f2e2c7;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.basis-type-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f5e2c0;
  color: #704305;
  font-size: 11px;
  font-weight: 700;
}
.basis-note {
  display: block;
  margin-top: 3px;
  color: #736044;
  font-size: 12px;
}

/* Block 4: Evidence Legend, Comparison Forms & Gaps */
.evidence-legend {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #d5e1f7;
  background: #f6f9ff;
  margin-bottom: 16px;
}
.legend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.legend-chip.src-lab { background: #e7f6f4; color: #0e6b60; border: 1px solid #bfe5df; }
.legend-chip.src-pkg { background: #eaf0ff; color: #264fb5; border: 1px solid #c9d8fd; }
.legend-chip.src-ad { background: #ffefe9; color: #b53a1d; border: 1px solid #f7c7b7; }
.legend-chip.src-input { background: #fff5e3; color: #8a5106; border: 1px solid #f0d098; }
.legend-warning {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.assessment-card #assessment {
  padding: 16px;
  border: 1px solid #c7d2ee;
  border-radius: 12px;
  background: #f4f7ff;
}
.assessment-card #assessment[data-outcome="failed"] { border-color: #efc3c5; background: #fff2f2; }
.assessment-card #assessment[data-outcome="reviewed"] { border-color: #b7dbce; background: #eff9f5; }
.assessment-card #assessment h3, .assessment-card #assessment h4 { margin: 0 0 8px; }
.assessment-card #assessment p { margin: 8px 0 0; }
.assessment-card #assessment ul { margin: 0 0 8px; padding-left: 20px; }
.assessment-card #assessment li { padding: 2px 0; line-height: 1.55; overflow-wrap: anywhere; }

.evidence-form { display: grid; gap: 14px; margin-top: 16px; }
.evidence-form fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid #d6def3; border-radius: 13px; }
.evidence-form legend { padding: 0 6px; font-weight: 700; }
.evidence-confirm { display: flex; align-items: flex-start; gap: 8px; min-height: 44px; padding: 8px 0; line-height: 1.45; }
.evidence-confirm input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--blue-deep); }
.evidence-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: end;
  gap: 12px;
  margin-top: 12px;
}
.evidence-fields label { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 600; }
.evidence-fields[hidden], .evidence-fields label[hidden] { display: none; }
.evidence-fields select, .evidence-fields input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #c7d2ee;
  border-radius: 9px;
  background: #fff;
  color: inherit;
}

.release-summary {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #c7d2ee;
  border-radius: 13px;
  background: #f4f7ff;
}
.release-summary h3, .release-summary p { margin: 0; }
.release-summary p + p, .release-summary h3 + p { margin-top: 7px; }
.release-summary ul { margin: 8px 0 0; padding-left: 20px; }
.release-group { margin-top: 16px; }
.release-group h4 { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.release-rule { padding: 10px 0; border-top: 1px solid #d6def3; }
.release-rule summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.release-rule summary small { color: var(--ink-soft); font-weight: 600; }
.release-rule p { margin: 8px 0; overflow-wrap: anywhere; }
.release-comparison-form button { margin-top: 12px; }
.release-comparison-form output { display: block; margin-top: 10px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }

.gaps-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #e4e9f5;
  background: #fafbfe;
}
.gaps-panel h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.release-gaps {
  margin: 10px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.release-gaps li { overflow-wrap: anywhere; font-size: 14px; color: var(--ink-soft); }
.release-gaps li strong { color: var(--ink); }

/* Buttons */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 11px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.primary-button:hover { background: var(--blue-deep); }
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #d5dff2;
  background: #f8faff;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}
.ghost-button:hover { border-color: #b7c9f0; color: var(--ink); }
.danger-ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #f4cfd3;
  background: #fff7f8;
  color: #a9323c;
  font-size: 13px;
  font-weight: 700;
}

/* Favorites & Profile */
.empty-panel {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 36px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 19px;
  background: var(--blue-pale);
  color: var(--blue);
}
.empty-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-panel h2 { margin: 16px 0 6px; font-size: 20px; }
.empty-panel p { max-width: 340px; margin-bottom: 18px; color: var(--muted); font-size: 13px; }

.favorites-grid {
  display: grid;
  gap: 12px;
}
.favorite-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.favorite-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.favorite-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.favorite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #e9efff, #fff);
  border: 1px solid #dce5f9;
}
.profile-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4c7af3, #735ed8);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.profile-card strong { font-size: 17px; }
.profile-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

.record-section {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.record-section h2 { margin: 0 0 6px; font-size: 19px; }
.record-intro { margin: 0 0 14px; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.history-list { display: grid; gap: 8px; }
.history-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e7edf8;
  background: #fafcff;
  text-align: left;
  font-size: 14px;
}
.history-item-btn:hover { border-color: #c2d4fa; background: #f2f6ff; }
.history-item-btn strong { overflow-wrap: anywhere; }
.history-item-btn small { flex: none; color: var(--muted); font-size: 12px; }

.terms-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}
.term-card {
  padding: 13px 14px;
  border: 1px solid #f4d8c8;
  border-radius: 12px;
  background: #fff9f6;
}
.term-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.term-card-head strong { color: #9c3824; font-size: 15px; }
.term-meta-pill {
  padding: 2px 8px;
  border-radius: 6px;
  background: #ffe9df;
  color: #8f3b26;
  font-size: 11px;
  font-weight: 700;
}
.term-card p {
  margin: 0;
  color: #5a433d;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.advisories-directory {
  display: grid;
  gap: 12px;
}
.dir-card {
  padding: 14px 16px;
  border: 1px solid #eed6b0;
  border-left: 4px solid #e38c14;
  border-radius: 13px;
  background: #fffcf6;
}
.dir-card h3 { margin: 6px 0; font-size: 15px; color: #362209; line-height: 1.45; overflow-wrap: anywhere; }
.dir-card p { margin: 0 0 8px; font-size: 13px; color: #634d30; line-height: 1.55; overflow-wrap: anywhere; }
.dir-jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.dir-jump-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid #d5e1fb;
  background: #fff;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 700;
}
.dir-jump-btn:hover { background: var(--blue-pale); }

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: max(0px, calc((100vw - 1080px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 1080px) / 2));
  display: flex;
  justify-content: space-around;
  min-height: 72px;
  padding: 8px 14px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(220, 228, 244, .95);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -5px 20px rgba(43, 62, 102, .06);
  backdrop-filter: blur(14px);
}
.nav-item {
  display: flex;
  min-width: 64px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  padding: 4px 12px;
  border-radius: 12px;
  color: #7d889d;
  font-size: 11px;
  font-weight: 700;
}
.nav-item.active, .nav-item:hover { color: var(--blue-deep); background: #eff4ff; }
.nav-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.toast {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: 90px;
  max-width: min(90vw, 420px);
  padding: 11px 16px;
  border-radius: 10px;
  background: rgba(16, 27, 59, .95);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 8px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(50%, 0); }

@media (max-width: 700px) {
  .app-frame { padding-left: 16px; padding-right: 16px; }
  .popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .popular-card { min-height: 112px; padding: 13px 12px; }
  .detail-block { padding: 16px 15px; }
  .result-card { padding: 16px 15px; }
  .disambiguation-card { padding: 16px 15px; }
}

@media (max-width: 640px) {
  .core-metrics, .core-metrics > tbody { display: block; width: 100%; }
  .core-metrics-archive { table-layout: auto; }
  .core-metrics > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .core-metrics > tbody > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 12px 13px;
    margin-bottom: 10px;
    border: 1px solid #dde6f5;
    border-radius: 13px;
    background: #fff;
  }
  .core-metrics > tbody > tr > td {
    display: block;
    padding: 0;
    border: 0;
    width: auto !important;
  }
  .core-metrics > tbody > tr > td:nth-child(1) {
    font-size: 15px;
    font-weight: 800;
  }
  .core-metrics > tbody > tr > td:nth-child(2) {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue-deep);
  }
  .core-metrics > tbody > tr > td:nth-child(n+3) {
    font-size: 13px;
    color: var(--ink-soft);
  }
  .core-metrics > tbody > tr > td:nth-child(n+3)::before {
    content: attr(data-column) '：';
    font-weight: 700;
    color: #6b7892;
  }
}

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