:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1d2530;
  background: #f5f7fa;
  --ink-soft: #536274;
  --line: #d9e0e8;
  --blue: #315d93;
  --blue-soft: #edf3fb;
  --gold: #f2b134;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { max-width: 100%; }

.app-shell { width: min(calc(100% - 32px), 760px); margin: 0 auto; padding: 24px 0 64px; }
.app-header { margin-bottom: 24px; }
.eyebrow { margin: 0; color: #516b91; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.3; }
h1 { margin-top: 8px; }
h2 { margin-top: 28px; }
.screen { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 4px 18px rgba(24, 45, 70, .06); }
form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 600; }
input, select, textarea { border: 1px solid #aebccc; border-radius: 8px; padding: 10px 12px; background: #fff; }
button { border: 0; border-radius: 8px; min-height: 44px; padding: 11px 16px; background: var(--blue); color: #fff; cursor: pointer; font-weight: 700; }
button.secondary { background: #60758e; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.consent-row { display: flex; align-items: flex-start; font-weight: 400; }
.consent-row input { flex: 0 0 auto; margin: 6px 8px 0 0; }
.note, .muted { color: var(--ink-soft); font-size: .92rem; }
.public-status { border-radius: 10px; margin: 12px 0 20px; padding: 12px 14px; font-weight: 700; }
.public-status.positive { background: #eaf5ef; color: #235d3c; }
.public-status.attention { background: #fff5df; color: #71520b; }
.public-status.error { background: #fde7e7; color: #8a2020; }
.public-status.quiet { background: var(--blue-soft); color: #294a72; }

.first-view-zero { margin-top: 12px; }
.soul-card { border: 1px solid #c5d6ea; border-radius: 14px; background: linear-gradient(135deg, #f4f8fd, #fff); padding: 20px; }
.metric-label { margin: 0; color: var(--ink-soft); font-size: .88rem; font-weight: 700; letter-spacing: .06em; }
.soul-type { margin: 3px 0 0; color: #1d456f; font-size: clamp(1.8rem, 6vw, 2.8rem); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.zero-grid, .zero-secondary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.zero-secondary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { min-width: 0; border: 1px solid #e0e6ed; border-radius: 8px; padding: 10px; background: #fff; }
.metric dt { color: #59697c; font-size: .82rem; }
.metric dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.secondary-details { margin-top: 12px; }

.key-observations { border-left: 4px solid #7c9bc0; margin-top: 22px; padding: 2px 0 2px 14px; }
.key-observations h2 { margin-top: 0; }
.key-observations ul { margin-bottom: 0; padding-left: 22px; }
.key-observations li { margin: 6px 0; }

.evaluation-block { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 4px; }
.evaluation-block > h2 { margin-bottom: 6px; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
legend, .rating-label { font-weight: 700; }
.overall-fit { border: 1px solid #c5d6ea; border-radius: 12px; background: #f7faff; padding: 14px; }
.overall-fit > legend { padding: 0 5px; color: #294a72; }
.rating-options { margin-top: 4px; }
.rating-buttons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.rating-button { position: relative; display: block; min-width: 0; cursor: pointer; font-weight: 600; }
.rating-button input { position: absolute; opacity: 0; pointer-events: none; }
.rating-button span { display: flex; min-height: 48px; align-items: center; justify-content: center; border: 1px solid #aebccc; border-radius: 8px; background: #fff; padding: 6px; color: #294a72; text-align: center; font-size: .84rem; line-height: 1.25; }
.rating-button input:checked + span { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 0 0 2px #c5d6ea; }
.rating-button input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.themes-section { margin-top: 24px; }
.themes-section > h2 { margin-bottom: 6px; }
.theme-accordion { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 0; overflow: hidden; background: #fff; }
.theme-accordion summary { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; font-weight: 800; list-style-position: inside; }
.theme-accordion[open] summary { border-bottom: 1px solid var(--line); background: var(--blue-soft); }
.theme-title { min-width: 0; overflow-wrap: anywhere; }
.theme-status { color: var(--ink-soft); font-size: .8rem; font-weight: 500; text-align: right; }
.theme-body, .theme-rating { padding: 0 14px 14px; }
.theme-body { padding-top: 12px; }
.fragment-list { margin: 0; padding-left: 22px; }
.fragment-list li { margin: 6px 0; }
.public-support { border-left: 4px solid #7899bd; margin: 14px 0 0; padding: 8px 10px; background: #f4f8fd; color: #294a72; font-weight: 700; }
.theme-rating { border-top: 1px solid #e5eaf0; padding-top: 12px; }
.theme-rating .rating-label { margin: 0 0 6px; font-size: .9rem; }

.observations-details, .uncertainty-details { border: 1px solid var(--line); border-radius: 10px; margin-top: 18px; padding: 0; overflow: hidden; }
.observations-details summary, .uncertainty-details summary, .secondary-details summary { padding: 12px 14px; cursor: pointer; font-weight: 800; }
.observations-details[open] summary, .uncertainty-details[open] summary, .secondary-details[open] summary { border-bottom: 1px solid var(--line); background: #fafbfd; }
.observations-details > .note, .observation-list, .uncertainty-details > p { margin-left: 14px; margin-right: 14px; }
.observation-list { padding-left: 24px; }
.observation-card { border: 1px solid #e0e6ed; border-radius: 8px; margin: 10px 0; padding: 10px; }
.observation-card p { margin-bottom: 0; }
.observation-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.observation-header select { width: min(100%, 160px); }
.observation-category { color: #516b91; font-size: .86rem; font-weight: 700; }
.uncertainty-details { margin-top: 24px; }
.uncertainty-details > p { color: var(--ink-soft); }
.warning { border-left: 4px solid #d59a17; padding: 10px 12px; background: #fff8e8; }
.error-box { border-left: 4px solid #b32d2d; padding: 10px 12px; background: #fff0f0; }
.admin-link { color: var(--blue); font-weight: 700; }
.inspector-shell { max-width: 1180px; }
.inspector-output { margin-top: 24px; }
.inspector-inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inspector-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.inspector-metric { min-width: 0; border: 1px solid #e0e6ed; border-radius: 8px; padding: 10px; background: #fff; }
.inspector-metric dt { color: #59697c; font-size: .82rem; }
.inspector-metric dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.status-chip { display: inline-flex; align-items: center; margin-left: 8px; border: 1px solid #aebccc; border-radius: 999px; padding: 2px 8px; background: #f6f8fb; color: #294a72; font-size: .75rem; font-weight: 700; vertical-align: middle; overflow-wrap: anywhere; }
.source-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 14px; }
.source-tab { min-height: 42px; background: #60758e; }
.source-tab.active { background: var(--blue); box-shadow: 0 0 0 3px #c5d6ea; }
.source-panel h2 { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.inspector-block, .inspector-subblock { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; overflow: hidden; background: #fff; }
.inspector-block > summary, .inspector-subblock > summary { padding: 12px 14px; cursor: pointer; font-weight: 800; }
.inspector-block[open] > summary, .inspector-subblock[open] > summary { border-bottom: 1px solid var(--line); background: #fafbfd; }
.inspector-subblock > .inspector-json, .inspector-block > .inspector-json { margin: 0; }
.inspector-json { max-height: 480px; overflow: auto; padding: 14px; background: #fbfcfe; color: #26374d; font: .78rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.inspector-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.inspector-table th, .inspector-table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.inspector-table th { background: #f5f7fa; }
.inspector-table small { display: block; margin-top: 4px; color: var(--ink-soft); }
.matrix-table { display: block; overflow-x: auto; }
@media (max-width: 720px) {
  .inspector-metrics, .inspector-inline-fields { grid-template-columns: 1fr; }
  .source-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-tab { width: 100%; min-height: 48px; padding: 8px; font-size: .84rem; }
}

@media (max-width: 560px) {
  .app-shell { width: min(calc(100% - 20px), 760px); padding-top: 16px; }
  .screen { padding: 16px; }
  .zero-grid, .zero-secondary-grid { grid-template-columns: 1fr; }
  .rating-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rating-button span { min-height: 48px; }
  .observation-header { align-items: stretch; flex-direction: column; }
  .observation-header select { width: 100%; }
  .theme-accordion summary { align-items: flex-start; }
  .theme-status { max-width: 48%; }
}

@media (max-width: 360px) {
  .app-shell { width: calc(100% - 16px); }
  .screen { padding: 12px; }
  .rating-button span { font-size: .78rem; }
}

/* CVD-ADMIN-INSPECTOR-001D: Japanese human-audit presentation layer */
.inspector-level { margin-top: 22px; }
.level-heading { border-left: 4px solid var(--blue); padding-left: 14px; }
.level-heading h2 { margin: 0; }
.level-kicker { display: block; margin: 0 0 3px; color: #60758e; font-size: .78rem; font-weight: 800; letter-spacing: .06em; }
.level-summary-title { display: inline-block; margin-right: 12px; font-size: 1.05rem; font-weight: 800; }
.level-summary-note { color: var(--ink-soft); font-size: .88rem; font-weight: 400; }
.inspector-level-details { border: 1px solid #cbd6e2; border-radius: 12px; background: #fff; overflow: hidden; }
.inspector-level-details > summary { display: block; padding: 15px 16px; cursor: pointer; }
.inspector-level-details[open] > summary { border-bottom: 1px solid var(--line); background: #f8fbff; }
.level-content { padding: 0 16px 16px; }
.summary-intro { border-left: 4px solid #7899bd; margin: 10px 0 16px; padding: 8px 12px; background: #f4f8fd; color: #294a72; }
.summary-why { margin: 14px 0; border: 1px solid #e0e6ed; border-radius: 10px; background: #fff; }
.summary-why summary { padding: 11px 14px; cursor: pointer; font-weight: 800; }
.summary-why[open] summary { border-bottom: 1px solid var(--line); background: #fffaf0; }
.summary-why h3, .summary-why ul { margin-left: 14px; margin-right: 14px; }
.source-card-metrics { margin-top: 12px; }
.source-reason { border-left: 4px solid #d59a17; margin: 10px 0; padding: 8px 12px; background: #fff8e8; }
.source-card-section { margin: 18px 0; border-top: 1px solid #e5eaf0; padding-top: 12px; }
.source-card-section h3 { margin: 0 0 7px; font-size: 1rem; }
.human-record-list, .human-reason-list { margin: 6px 0 0; padding-left: 22px; }
.human-record-list li, .human-reason-list li { margin: 5px 0; }
.inspector-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.inspector-highlight { min-width: 0; border: 1px solid #e0e6ed; border-radius: 8px; padding: 9px; background: #fbfcfe; }
.inspector-highlight dt { color: #59697c; font-size: .82rem; }
.inspector-highlight dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.source-detail-disclosure { margin-top: 18px; border-top: 1px solid #dfe6ee; padding-top: 10px; }
.source-detail-disclosure > summary { cursor: pointer; color: var(--blue); font-weight: 800; }
.source-detail-disclosure .inspector-subblock { margin: 9px 0; }
.status-chip-technical { background: #eef1f5; color: #405269; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .7rem; }
.matrix-cell-details { min-width: 118px; }
.matrix-cell-details > summary { cursor: pointer; list-style: none; }
.matrix-cell-details > summary::-webkit-details-marker { display: none; }
.matrix-cell-details > summary small { display: block; margin-top: 5px; color: var(--ink-soft); }
.matrix-cell-details > p { font-size: .83rem; }
.matrix-cell-details > .inspector-json { max-height: 220px; padding: 8px; font-size: .7rem; }
.relation-list, .trace-list { margin: 12px 0; padding-left: 24px; }
.relation-list li, .trace-list li { margin: 9px 0; }
.relation-list li > small, .trace-list li > small { display: block; color: var(--ink-soft); }
.trace-list li > .inspector-json { max-height: 220px; margin-top: 7px; }
.technical-source { margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.technical-source > summary { padding: 12px 14px; cursor: pointer; font-weight: 800; }
.technical-source[open] > summary { border-bottom: 1px solid var(--line); background: #fafbfd; }
.technical-source > .inspector-subblock { margin: 10px 14px; }
.technical-subblock > summary { font-size: .92rem; }

@media (max-width: 720px) {
  .inspector-highlights { grid-template-columns: 1fr; }
  .level-summary-note { display: block; margin-top: 4px; }
}
