:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --paper: #ffffff;
  --panel: #ffffff;
  --surface-secondary: #f9f9fb;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --accent: #007aff;
  --accent-soft: #e5f1ff;
  --info-bg: rgba(0, 122, 255, 0.055);
  --info-border: rgba(0, 122, 255, 0.18);
  --info-separator: rgba(0, 122, 255, 0.12);
  --green: #34c759;
  --green-soft: #e8f8ee;
  --amber: #ff9500;
  --amber-soft: #fff4e5;
  --danger: #ff3b30;
  --danger-soft: #fff1f0;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.path-nav {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.path-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 11px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.path-nav a.active {
  color: #fff;
  background: var(--accent);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}

[hidden] {
  display: none !important;
}

.setup-page {
  padding: 40px;
}

.setup-shell {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  gap: 36px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}

.setup-copy {
  max-width: 560px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: 0;
  font-weight: 760;
}

h2 {
  margin-bottom: 0;
  font-size: 26px;
  letter-spacing: 0;
  font-weight: 720;
}

h3 {
  margin-bottom: 10px;
  font-size: 21px;
  font-weight: 720;
}

.lead {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.58;
  margin-bottom: 0;
}

.setup-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.setup-help-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
  backdrop-filter: blur(18px);
}

.setup-help-panel h2 {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.setup-help-panel p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.help-actions {
  display: grid;
  gap: 8px;
}

.help-action {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 12px 38px 12px 12px;
  text-align: left;
}

.help-action::after {
  content: ">";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.help-action:hover {
  border-color: rgba(0, 122, 255, 0.32);
  background: #fff;
}

.help-action span {
  font-size: 14px;
  font-weight: 760;
  line-height: 1.25;
}

.help-action small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.setup-card,
.status-card,
.document,
.summary-band,
.report-index {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.setup-card {
  padding: 24px;
}

.page-explainer {
  position: relative;
  max-width: 1380px;
  margin: 0 auto 18px;
  border: 1px solid var(--info-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--info-bg);
  box-shadow: none;
  padding: 34px 16px 16px 52px;
}

.page-explainer.compact {
  max-width: none;
  margin: 20px 0 0;
  background: var(--info-bg);
}

.setup-card .page-explainer.compact {
  margin: 0 0 20px;
}

.page-explainer::before {
  content: "i";
  position: absolute;
  top: 14px;
  left: 16px;
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 780;
  line-height: 1;
}

.page-explainer::after {
  content: "Informasi";
  position: absolute;
  top: 15px;
  left: 52px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.page-explainer p {
  color: #3a3a3c;
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.definition-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border-top: 1px solid var(--info-separator);
}

.definition-list span {
  display: block;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  color: #3a3a3c;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.definition-list span + span {
  border-top: 1px solid var(--info-separator);
}

.page-explainer.compact .definition-list span {
  background: transparent;
}

.definition-list strong {
  color: var(--ink);
  margin-right: 4px;
}

.admin-shell {
  grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.05fr);
}

.admin-upload-card {
  align-self: center;
}

.admin-template-grid {
  margin-bottom: 14px;
}

.template-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  padding: 14px;
  margin-bottom: 16px;
}

.template-preview strong,
.template-preview span {
  display: block;
}

.template-preview strong {
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 5px;
}

.template-preview span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.card-header,
.report-topbar,
.topbar-actions {
  display: flex;
  align-items: center;
}

.card-header,
.report-topbar {
  justify-content: space-between;
  gap: 18px;
}

.card-header {
  margin-bottom: 22px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.neutral {
  color: var(--muted);
  background: var(--surface-secondary);
}

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

label,
fieldset {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

legend {
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.helper {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 118px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: #fff;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}

.guide-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: #fff;
}

.guide-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  padding: 14px;
}

.guide-panel.guide-wide {
  grid-column: 1 / -1;
}

.guide-panel h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.guide-panel p,
.guide-panel li {
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.guide-panel p {
  margin-bottom: 10px;
}

.guide-panel ul {
  margin: 0;
  padding-left: 18px;
}

.guide-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-chip-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 760;
}

.guide-table {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.guide-table div {
  min-height: 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  color: #3a3a3c;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
}

.guide-table div:nth-child(4n) {
  border-right: 0;
}

.guide-table div:nth-child(-n + 4) {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 760;
}

.guide-table div:nth-last-child(-n + 4) {
  border-bottom: 0;
}

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

.source-card {
  position: relative;
  display: block;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-secondary);
}

.source-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.source-card span {
  display: block;
  color: var(--ink);
  font-size: 22px;
  font-weight: 760;
  margin-bottom: 5px;
}

.source-card small {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.source-card span,
.source-card small,
.source-card .selected-state {
  position: relative;
  z-index: 1;
}

.source-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px rgba(0, 122, 255, 0.18);
}

.source-card:has(input:checked) span,
.source-card:has(input:checked) small {
  color: #fff;
}

.selected-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  margin-bottom: 12px;
  color: transparent;
  background: transparent;
  font-size: 11px;
  font-weight: 760;
}

.source-card:has(input:checked) .selected-state {
  color: var(--accent);
  background: #fff;
}

.upload-zone {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  place-items: center;
  text-align: center;
  border: 1px dashed #b9b9c0;
  border-radius: var(--radius);
  background: var(--surface-secondary);
  margin-bottom: 14px;
  cursor: pointer;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-zone strong {
  color: var(--ink);
  font-size: 16px;
}

.upload-zone span {
  color: var(--muted);
  font-size: 13px;
}

.admin-upload-zone {
  min-height: 150px;
}

.file-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  margin: -4px 0 14px;
  display: grid;
  gap: 6px;
}

.file-list.empty {
  color: var(--muted);
  font-size: 13px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  border-radius: 6px;
  background: var(--surface-secondary);
  padding: 6px 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.file-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item small {
  color: var(--muted);
  flex: 0 0 auto;
  font-weight: 700;
}

.generate-button,
.primary-button,
.secondary-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 44px;
  padding: 0 16px;
  font-weight: 700;
}

.generate-button {
  width: 100%;
  min-height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  background: var(--accent);
  color: #fff;
}

.generate-button strong {
  font-size: 12px;
  opacity: 0.82;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.primary-button:disabled,
.secondary-button:disabled,
.generate-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.status-page {
  display: none;
  place-items: center;
  padding: 30px;
}

.status-page.active {
  display: grid;
}

.status-card {
  width: min(520px, 100%);
  padding: 42px;
  text-align: center;
}

.loader {
  width: 70px;
  height: 70px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 8px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.review-page,
.report-page {
  padding: 86px 28px 28px;
}

.report-topbar {
  max-width: 1380px;
  margin: 0 auto 16px;
}

.review-page .review-summary,
.review-panel,
.review-note {
  max-width: 1380px;
  margin-left: auto;
  margin-right: auto;
}

.review-page .review-summary {
  margin-bottom: 18px;
}

.review-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.review-panel > div,
.review-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.reference-catalog-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(150px, 0.9fr);
  gap: 10px;
}

.reference-catalog-controls label {
  min-width: 0;
}

.reference-catalog-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.reference-catalog-summary article,
.reference-catalog-summary > span {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  padding: 14px;
}

.reference-catalog-summary > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  border-left: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface-secondary);
  font-size: 12px;
  font-weight: 650;
}

.reference-catalog-summary span,
.reference-catalog-list span,
.reference-catalog-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.reference-catalog-summary strong {
  display: block;
  margin: 5px 0;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.18;
}

.reference-catalog-summary > span strong {
  display: inline;
  margin: 0;
  font-size: 12px;
  line-height: 1;
}

.reference-catalog-summary p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 0;
}

.reference-catalog-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.reference-catalog-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  padding: 12px;
}

.reference-catalog-list article > div {
  min-width: 0;
}

.reference-catalog-list strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.reference-catalog-list span {
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 8px;
}

.reference-catalog-list small {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff;
  padding: 5px 8px;
}

.review-panel h3,
.review-note h3 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.18;
}

.detected-source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.detected-source-list article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  padding: 12px;
}

.detected-source-list strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.detected-source-list span,
.detected-source-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.detected-source-list p,
.review-note p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 0;
}

.detected-source-list small {
  overflow-wrap: anywhere;
}

.topbar-actions {
  gap: 10px;
}

.summary-band {
  max-width: 1380px;
  margin: 0 auto 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-band article {
  border-right: 1px solid var(--line);
  padding-right: 14px;
}

.summary-band article:last-child {
  border-right: 0;
}

.summary-band span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.summary-band strong {
  display: block;
  font-size: 16px;
}

.admin-summary-band strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-overview {
  max-width: 1380px;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-overview article,
.criteria-regenerate-panel,
.report-dashboard-card,
.admin-dashboard-document,
.reference-source-card,
.strategy-comparison-card,
.criterion-regenerate-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dashboard-overview article {
  padding: 16px;
}

.dashboard-overview span,
.dashboard-card-meta span,
.dashboard-card-meta small,
.source-card-stats span,
.source-card-actions small,
.strategy-comparison-card span,
.strategy-comparison-card small,
.criterion-regenerate-card span,
.criterion-regenerate-card p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.dashboard-overview strong {
  display: block;
  margin: 6px 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.dashboard-overview p,
.report-dashboard-card p,
.reference-source-card p,
.strategy-comparison-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 0;
}

.report-dashboard-list,
.admin-dashboard-layout {
  max-width: 1380px;
  margin: 0 auto;
}

.report-dashboard-list,
.reference-source-list,
.strategy-comparison-list,
.criteria-regenerate-grid,
.criterion-detail-list {
  display: grid;
  gap: 12px;
}

.report-dashboard-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.35fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
}

.report-dashboard-card h3,
.reference-source-card h4,
.strategy-comparison-card h4,
.criterion-regenerate-card h4,
.criterion-detail-card h4 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.dashboard-card-meta {
  display: grid;
  gap: 5px;
}

.dashboard-card-meta strong {
  color: var(--ink);
  font-size: 15px;
}

.dashboard-card-actions,
.criterion-actions,
.source-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.criteria-regenerate-panel {
  max-width: 1380px;
  margin: 0 auto 18px;
  padding: 18px;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.criteria-regenerate-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.criterion-regenerate-card {
  display: grid;
  gap: 12px;
  border-left: 4px solid var(--green);
  padding: 14px;
  box-shadow: none;
}

.criterion-regenerate-card.warning {
  border-left-color: var(--amber);
}

.criterion-regenerate-card.danger {
  border-left-color: var(--danger);
}

.criterion-regenerate-card.updated {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.criterion-regenerate-card span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: var(--surface-secondary);
  padding: 5px 8px;
}

.output-switcher {
  max-width: 1380px;
  width: fit-content;
  margin: 0 auto 18px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.output-switcher button {
  border: 0;
  border-right: 1px solid var(--line);
  min-height: 44px;
  padding: 0 16px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.output-switcher button:last-child {
  border-right: 0;
}

.output-switcher button.active {
  background: var(--accent);
  color: #fff;
}

.output-view {
  display: none;
  max-width: 1380px;
  margin: 0 auto;
}

.output-view.active {
  display: block;
}

.pdf-toolbar {
  height: 46px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #2c2c2e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  font-size: 13px;
}

.pdf-toolbar strong {
  color: #d1d1d6;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.report-index {
  position: sticky;
  top: 18px;
  padding: 16px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.report-index nav {
  display: grid;
  gap: 4px;
}

.report-index a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 9px;
  border-radius: var(--radius);
}

.report-index a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.document {
  background: var(--paper);
  padding: clamp(24px, 5vw, 58px);
}

.pdf-document {
  min-height: 1120px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding: 0;
  overflow: hidden;
}

.pdf-document iframe {
  width: 100%;
  min-height: 1120px;
  display: block;
  border: 0;
  background: #fff;
}

.explanation-document {
  background: #fff;
}

.document-cover {
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
  margin-bottom: 30px;
}

.document-cover h1 {
  font-size: clamp(34px, 5vw, 56px);
  max-width: 850px;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}

.criteria-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.criteria-section:last-child {
  border-bottom: 0;
}

.criteria-section h2 {
  margin-bottom: 8px;
}

.phase-block {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
}

.phase-block h3 {
  margin-bottom: 10px;
}

.phase-block p {
  color: #3a3a3c;
  line-height: 1.72;
  margin-bottom: 14px;
}

.evidence-list {
  margin: 0;
  padding-left: 20px;
  color: #3a3a3c;
  line-height: 1.65;
}

.explanation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 22px;
}

.explanation-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface-secondary);
}

.explanation-card.warning-card {
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.explanation-card.danger-card {
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
}

.explanation-card h3 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.18;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.explanation-card .eyebrow {
  margin-bottom: 10px;
}

.explanation-card li {
  font-size: 16px;
  line-height: 1.62;
}

.explanation-card ul {
  margin: 0;
  padding-left: 20px;
  color: #3a3a3c;
  line-height: 1.65;
}

.nested-list {
  margin-top: 14px;
}

.nested-list:first-of-type {
  margin-top: 0;
}

.nested-list h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.criterion-detail-list {
  margin-top: 16px;
}

.criterion-detail-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
}

.criterion-detail-card.warning {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.criterion-detail-card.danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.criterion-detail-card.updated {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.criterion-detail-card span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: var(--surface-secondary);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 720;
}

.criterion-detail-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-result-layout {
  max-width: 960px;
  margin: 0 auto;
}

.admin-dashboard-layout {
  max-width: 1120px;
}

.admin-dashboard-document {
  display: grid;
  gap: 24px;
  padding: 26px;
}

.admin-section.no-border {
  border-top: 0;
  padding-top: 0;
}

.reference-source-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  border-left: 4px solid var(--green);
  padding: 16px;
}

.reference-source-card.inactive {
  border-left-color: var(--muted);
  opacity: 0.78;
}

.source-card-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.source-card-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-secondary);
}

.source-card-actions {
  align-items: center;
}

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

.strategy-comparison-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  padding: 14px;
  box-shadow: none;
}

.strategy-comparison-card span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.strategy-comparison-card strong,
.strategy-comparison-card small {
  align-self: center;
}

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

.strategy-comparison-card.combined {
  border-left: 4px solid var(--accent);
}

.admin-result-document {
  display: grid;
  gap: 24px;
}

.result-banner {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface-secondary);
}

.result-banner.success {
  border-left: 4px solid var(--green);
  background: var(--green-soft);
}

.result-banner.warning {
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.result-banner.failed {
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
}

.result-banner h3 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.12;
  margin-bottom: 10px;
}

.result-banner p:last-child {
  color: #3a3a3c;
  font-size: 16px;
  line-height: 1.58;
  margin-bottom: 0;
}

.admin-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.admin-section h3 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.18;
}

.section-helper {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 8px 0 0;
}

.review-summary,
.phase-reference-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.review-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.review-summary article,
.phase-reference-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
}

.review-summary article {
  padding: 14px;
}

.review-summary article {
  border-left: 4px solid var(--muted);
}

.review-summary article.success {
  border-left-color: var(--green);
}

.review-summary article.warning {
  border-left-color: var(--amber);
}

.review-summary article.failed {
  border-left-color: var(--danger);
}

.review-summary span,
.phase-reference-row span,
.phase-reference-row small,
.sheet-evidence-list span,
.sheet-evidence-list a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.review-summary strong {
  display: block;
  margin: 5px 0;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.18;
}

.review-summary p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 0;
}

.phase-reference-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.phase-reference-row:hover {
  background: #fff;
  border-color: rgba(0, 122, 255, 0.3);
}

.phase-reference-row span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 8px;
  white-space: nowrap;
}

.phase-reference-row strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.phase-reference-row small {
  text-align: right;
  white-space: nowrap;
}

.evaluation-distribution {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.evaluation-distribution article {
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  padding: 14px;
}

.evaluation-distribution article.success {
  border-left-color: var(--green);
}

.evaluation-distribution article.warning {
  border-left-color: var(--amber);
}

.evaluation-distribution article.failed {
  border-left-color: var(--danger);
}

.evaluation-distribution span,
.evaluation-distribution small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.evaluation-distribution strong {
  display: block;
  margin: 6px 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
}

.metric-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.empty-detection {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  color: var(--muted);
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.admin-issue-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #3a3a3c;
}

.admin-issue-list li {
  font-size: 16px;
  line-height: 1.62;
}

.admin-approval-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  padding: 20px;
}

.admin-approval-panel.success,
.admin-approval-panel.approved {
  border-color: rgba(52, 199, 89, 0.28);
  background: var(--green-soft);
}

.admin-approval-panel.warning {
  border-color: rgba(255, 149, 0, 0.32);
  background: var(--amber-soft);
}

.admin-approval-panel.failed {
  border-color: rgba(255, 59, 48, 0.3);
  background: var(--danger-soft);
}

.admin-approval-panel h3 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.18;
  margin-bottom: 8px;
}

.admin-approval-panel p:not(.eyebrow) {
  color: #3a3a3c;
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 16px;
}

.approval-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.approval-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.admin-approval-panel small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.sheet-open {
  overflow: hidden;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.sheet-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.review-sheet {
  width: min(880px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 48px));
  margin: 0 auto 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
  padding: 18px;
  transform: translateY(20px);
  transition: transform 0.18s ease;
}

.sheet-overlay.show .review-sheet {
  transform: translateY(0);
}

.admin-help-sheet,
.user-help-sheet {
  width: min(940px, calc(100vw - 28px));
}

.criterion-sheet {
  width: min(980px, calc(100vw - 28px));
}

.criterion-sheet-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.compact-file-input {
  margin-top: 10px;
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.user-sheet-view {
  display: none;
}

.user-sheet-view.active {
  display: block;
}

.sheet-guide-content {
  padding: 0;
  background: transparent;
}

.reference-sheet-intro {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  padding: 14px;
  margin-bottom: 14px;
}

.reference-sheet-intro p {
  color: #3a3a3c;
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 0;
}

.sheet-handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: #d1d1d6;
  margin: 0 auto 14px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.sheet-header h2 {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.14;
}

.sheet-close-button {
  flex: 0 0 auto;
}

.sheet-narrative {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  color: #3a3a3c;
  font-size: 15px;
  line-height: 1.58;
  padding: 14px;
}

.sheet-section {
  margin-top: 16px;
}

.sheet-section h3 {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.sheet-evidence-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet-evidence-list li {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.sheet-evidence-list strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.sheet-evidence-list a {
  overflow-wrap: anywhere;
  text-decoration: none;
}

.editable-evidence-list li {
  position: relative;
  padding-right: 96px;
}

.evidence-remove-button {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 28px;
  padding: 0 10px;
  background: #fff;
  color: var(--danger);
  font-size: 12px;
  font-weight: 760;
}

.empty-sheet-item {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  min-width: 250px;
  max-width: min(420px, calc(100vw - 44px));
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 13px 15px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  font-size: 13px;
  font-weight: 700;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1020px) {
  .setup-shell,
  .admin-shell,
  .report-layout {
    grid-template-columns: 1fr;
  }

  .setup-shell {
    align-items: start;
  }

  .report-index {
    position: static;
    max-height: none;
  }

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

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

  .dashboard-overview,
  .criteria-regenerate-grid,
  .strategy-comparison-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-dashboard-card,
  .reference-source-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dashboard-card-actions,
  .source-card-actions,
  .source-card-stats {
    justify-content: flex-start;
  }

  .criterion-sheet-layout {
    grid-template-columns: 1fr;
  }

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

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

  .reference-catalog-controls {
    grid-column: 1 / -1;
  }

  .guide-content {
    grid-template-columns: 1fr;
  }

  .guide-table {
    overflow-x: auto;
  }

  .guide-table div {
    min-width: 120px;
  }

  .summary-band article:nth-child(2) {
    border-right: 0;
  }

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

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

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

@media (max-width: 680px) {
  .setup-page,
  .review-page,
  .report-page {
    padding: 68px 18px 18px;
  }

  .path-nav {
    top: 12px;
    right: 12px;
    left: 12px;
    justify-content: center;
  }

  .setup-shell {
    min-height: auto;
  }

  .setup-card {
    padding: 18px;
  }

  .field-grid,
  .source-grid,
  .review-summary,
  .evaluation-distribution,
  .reference-catalog-summary,
  .reference-catalog-controls,
  .dashboard-overview,
  .criteria-regenerate-grid,
  .strategy-comparison-list,
  .summary-band,
  .report-index nav {
    grid-template-columns: 1fr;
  }

  .reference-catalog-list article {
    grid-template-columns: 1fr;
  }

  .reference-catalog-list article {
    display: grid;
    align-items: start;
  }

  .reference-catalog-list small {
    width: fit-content;
  }

  .phase-reference-row {
    grid-template-columns: 1fr;
  }

  .phase-reference-row small {
    text-align: left;
  }

  .review-sheet {
    width: 100%;
    max-height: calc(100vh - 18px);
    margin-bottom: 0;
    border-radius: 18px 18px 0 0;
  }

  .sheet-header {
    display: grid;
  }

  .approval-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .output-switcher {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .output-switcher button {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .output-switcher button:last-child {
    border-bottom: 0;
  }

  .summary-band article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 12px;
  }

  .summary-band article:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .card-header,
  .report-topbar,
  .generate-button {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .dashboard-card-actions,
  .criterion-actions,
  .source-card-actions,
  .sheet-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    flex: 1;
  }
}
