:root {
  --bg: #f4f7fb;
  --bg-accent: #edf5fb;
  --panel: #ffffff;
  --panel-soft: #f8fbfe;
  --panel-contrast: #eef4f9;
  --border: rgba(13, 36, 64, 0.1);
  --text: #132238;
  --muted: #5d7088;
  --primary: #0d5e93;
  --primary-strong: #09456b;
  --primary-soft: #dff0fb;
  --accent: #1aa0d7;
  --ok: #1ba97f;
  --ok-soft: #eaf9f3;
  --warn: #f0a638;
  --warn-soft: #fff5e6;
  --danger: #e14f4f;
  --danger-soft: #fff0f0;
  --info: #3d89d7;
  --info-soft: #ecf5ff;
  --shadow: 0 20px 40px rgba(13, 36, 64, 0.08);
  --shadow-soft: 0 12px 24px rgba(13, 36, 64, 0.06);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(26, 160, 215, 0.12), transparent 25%),
    linear-gradient(180deg, #f9fbfd 0%, var(--bg) 100%);
}
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

input, select, textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(123, 147, 173, 0.32);
  background: #fff;
  border-radius: 16px;
  padding: 14px 15px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .08s ease;
}
textarea { resize: vertical; }
label {
  display: block;
  font-weight: 700;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(13, 94, 147, 0.65);
  box-shadow: 0 0 0 4px rgba(13, 94, 147, 0.11);
}
button {
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .18s ease, background-color .18s ease, opacity .18s ease;
}
button:active { transform: translateY(1px); }

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.brand-lockup {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.topbar-logo {
  width: 110px;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  padding: 6px;
  border: 1px solid rgba(13, 36, 64, 0.08);
  box-shadow: var(--shadow-soft);
}
.eyebrow {
  color: var(--primary);
  font-weight: 800;
  font-size: .86rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.topbar-copy { margin-top: 8px; }
h1 {
  margin-top: 4px;
  font-size: clamp(2rem, 4vw, 2.45rem);
  letter-spacing: -0.03em;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 18px;
}
.tab, .form-tab {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 800;
  border: 1px solid rgba(123, 147, 173, 0.18);
  backdrop-filter: blur(14px);
}
.tab:hover, .form-tab:hover, .secondary:hover, .primary:hover { box-shadow: var(--shadow-soft); }
.tab.active, .form-tab.active {
  background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
  color: var(--primary-strong);
  border-color: rgba(13, 94, 147, 0.18);
  box-shadow: var(--shadow-soft);
}
.tab-panel, .form-panel { display: none; }
.tab-panel.active, .form-panel.active { display: block; }

.card, .hero-card, .metric, .analysis-card, .dialog-card, .result-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.card, .hero-card, .result-block { padding: 22px; margin-bottom: 16px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.hero-card {
  display: grid;
  grid-template-columns: 1.4fr .95fr;
  gap: 18px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(13, 94, 147, 0.98), rgba(29, 131, 189, 0.92)),
    linear-gradient(180deg, #0d5e93 0%, #1aa0d7 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}
.hero-copy { position: relative; z-index: 1; }
.hero-copy h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
  margin: 10px 0 12px;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 800;
  letter-spacing: .02em;
}
.hero-points {
  display: grid;
  gap: 12px;
  align-content: start;
  position: relative;
  z-index: 1;
}
.hero-point {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 14px 16px;
}
.hero-point strong {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.metric {
  padding: 18px;
  background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
}
.metric .label {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}
.metric .value {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary-strong);
}
.metric .note {
  margin-top: 8px;
  color: var(--muted);
  font-size: .9rem;
}

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full-row { grid-column: 1 / -1; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.checkbox-row input { width: auto; margin: 0; }
.inline-note {
  background: linear-gradient(180deg, #f9fcff 0%, #f4f9fd 100%);
  border: 1px solid rgba(13, 94, 147, 0.12);
  border-radius: 18px;
  padding: 16px;
  color: var(--muted);
}
.inline-note strong {
  color: var(--primary-strong);
  display: block;
  margin-bottom: 8px;
}
.inline-note p { margin: 0; }
.inline-note .grid { margin-top: 12px; }
.inline-note label { color: var(--text); }
.notice {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.55;
  border: 1px solid transparent;
}
.notice.warn { background: var(--warn-soft); border-color: rgba(240, 166, 56, 0.25); color: #9a6000; }
.notice.info { background: var(--info-soft); border-color: rgba(61, 137, 215, 0.22); color: #205ea7; }
.notice.danger { background: var(--danger-soft); border-color: rgba(225, 79, 79, 0.2); color: #a53434; }
.notice ul { margin: 10px 0 0; }

.primary {
  background: linear-gradient(180deg, #1270ad 0%, #0d5e93 100%);
  color: #fff;
  padding: 14px 18px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(13, 94, 147, 0.18);
}
.secondary {
  background: #fff;
  color: var(--text);
  padding: 14px 18px;
  border: 1px solid rgba(123, 147, 173, 0.22);
}
.icon-btn {
  background: transparent;
  padding: 8px 10px;
  color: var(--muted);
}
.sticky-actions {
  position: sticky;
  bottom: 12px;
  z-index: 3;
  display: flex;
  gap: 10px;
  background: rgba(244, 247, 251, 0.92);
  backdrop-filter: blur(16px);
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(123, 147, 173, 0.12);
}
.form-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  position: sticky;
  top: 8px;
  z-index: 2;
  background: rgba(244, 247, 251, 0.92);
  backdrop-filter: blur(16px);
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(123, 147, 173, 0.12);
}

.status-badge, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-ok { background: var(--ok-soft); color: #127858; border-color: rgba(27, 169, 127, 0.18); }
.status-watch { background: var(--warn-soft); color: #9f6500; border-color: rgba(240, 166, 56, 0.18); }
.status-action { background: var(--danger-soft); color: #aa3535; border-color: rgba(225, 79, 79, 0.18); }
.status-info { background: var(--info-soft); color: #205ea7; border-color: rgba(61, 137, 215, 0.18); }
.drop-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 16px;
}
.drop-icon path { stroke: none; }
.drop-icon-ok path { fill: var(--ok); }
.drop-icon-watch path { fill: var(--warn); }
.drop-icon-action path { fill: var(--danger); }
.drop-icon-info path { fill: var(--info); }
.drop-icon text {
  fill: #fff;
  font-weight: 800;
  font-family: Arial, sans-serif;
}

.result-layout {
  display: grid;
  grid-template-columns: 1.15fr .95fr;
  gap: 16px;
}
.result-block h3 { margin-bottom: 12px; }
.result-grid-compact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.summary-card {
  background: var(--panel-soft);
  border: 1px solid rgba(13, 94, 147, 0.1);
  border-radius: 18px;
  padding: 14px;
}
.summary-card strong {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 6px;
}
.summary-card span {
  font-weight: 800;
  color: var(--primary-strong);
}
.analysis-card {
  padding: 16px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #fff 0%, #f9fbfe 100%);
}
.analysis-card h4 { margin: 0 0 8px; }
.analysis-meta { color: var(--muted); font-size: .92rem; }
.history-list { margin-top: 14px; }
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
}
.history-row .left { min-width: 0; }
.history-row .title { font-weight: 800; }
.history-row .subtitle { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.history-row .right { display: flex; gap: 8px; align-items: center; }
.empty-state { color: var(--muted); padding: 8px 0; }

.parameter-list, .action-list, .bullet-list, .help-list { margin: 0; padding-left: 20px; }
.parameter-list li, .action-list li, .bullet-list li, .help-list li { margin-bottom: 10px; }

dialog {
  width: min(1080px, calc(100vw - 18px));
  border: none;
  padding: 0;
  background: transparent;
}
dialog::backdrop { background: rgba(10, 24, 40, 0.48); }
.dialog-card {
  padding: 0;
  overflow: hidden;
  background: #fff;
}
.dialog-head, .dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}
.dialog-head {
  border-bottom: 1px solid rgba(123, 147, 173, 0.16);
  background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
}
.dialog-actions {
  border-top: 1px solid rgba(123, 147, 173, 0.16);
  flex-wrap: wrap;
  background: #fff;
}
#reportContent {
  padding: 0 18px 18px;
  max-height: 72vh;
  overflow: auto;
  background: var(--bg-accent);
}
.report-kicker {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}

.report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .94rem;
}
.report-table th,
.report-table td {
  border-bottom: 1px solid rgba(123, 147, 173, 0.16);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}
.report-table thead th {
  background: #f4f8fc;
  color: var(--primary-strong);
  font-size: .84rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table td strong { display: block; margin-bottom: 4px; }

.taylor-card { padding: 0; }
.taylor-head { margin-bottom: 12px; }
.taylor-gauge {
  position: relative;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #eaf0f6;
  margin-bottom: 10px;
}
.taylor-zone.aggressive { background: rgba(225, 79, 79, 0.35); }
.taylor-zone.balanced { background: rgba(27, 169, 127, 0.34); }
.taylor-zone.scale { background: rgba(240, 166, 56, 0.35); }
.taylor-marker {
  position: absolute;
  top: -5px;
  width: 12px;
  height: 28px;
  border-radius: 999px;
  transform: translateX(-50%);
  box-shadow: 0 2px 10px rgba(13, 36, 64, 0.18);
}
.taylor-marker.current { background: rgba(13, 36, 64, 0.28); height: 22px; top: -2px; }
.taylor-marker.target { background: var(--primary-strong); }
.taylor-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.taylor-legend span:nth-child(2) { text-align: center; }
.taylor-legend span:nth-child(3) { text-align: right; }
.taylor-marker-legend {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  font-size: .92rem;
}
.taylor-summary-grid,
.taylor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.taylor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.taylor-summary-grid div,
.taylor-grid div {
  background: #f8fbfe;
  border: 1px solid rgba(13, 94, 147, 0.1);
  border-radius: 16px;
  padding: 12px;
}
.taylor-summary-grid strong,
.taylor-grid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.report-print-root {
  padding: 14px 0 18px;
  color: #17304a;
}
.report-hero {
  display: grid;
  grid-template-columns: 1.35fr .85fr;
  gap: 14px;
  margin-bottom: 14px;
}
.report-panel,
.report-brand-card,
.report-highlight-card,
.report-note-card,
.report-table-block {
  background: #fff;
  border: 1px solid rgba(123, 147, 173, 0.18);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.report-panel + .report-panel,
.report-brand-card,
.report-highlight-card,
.report-note-card,
.report-table-block { margin-bottom: 14px; }
.report-brand-line {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.report-logo {
  width: min(190px, 36vw);
  max-width: 190px;
  height: auto;
  object-fit: contain;
}
.report-title-copy h2,
.report-title-copy h1 {
  font-size: clamp(1.5rem, 2vw, 1.85rem);
  margin: 5px 0 8px;
}
.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.report-meta-card {
  background: #f7fbfe;
  border: 1px solid rgba(13, 94, 147, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
}
.report-meta-card strong,
.report-subtitle {
  display: block;
  margin-bottom: 6px;
}
.report-subtitle {
  color: var(--primary-strong);
  font-size: .94rem;
  font-weight: 800;
}
.report-global-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}
.report-global-card .status-badge { margin-top: 6px; }
.report-actions-layout {
  display: grid;
  grid-template-columns: .78fr 1.22fr;
  gap: 14px;
  margin-bottom: 14px;
}
.report-priority-card {
  background: linear-gradient(180deg, #fff 0%, #fff6f6 100%);
  border-color: rgba(225, 79, 79, 0.22);
}
.report-priority-card.ok {
  background: linear-gradient(180deg, #fff 0%, #f3fbf7 100%);
  border-color: rgba(27, 169, 127, 0.22);
}
.report-priority-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  background: rgba(225, 79, 79, 0.08);
  color: #a53434;
  font-weight: 800;
  padding: 8px 14px;
  margin-bottom: 12px;
}
.report-priority-card.ok .report-priority-head {
  background: rgba(27, 169, 127, 0.08);
  color: #127858;
}
.report-priority-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: report-priority;
}
.report-priority-list li {
  counter-increment: report-priority;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(123, 147, 173, 0.14);
}
.report-priority-list li:last-child { border-bottom: none; }
.report-priority-list li::before {
  content: counter(report-priority);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
}
.report-priority-card.ok .report-priority-list li::before { background: var(--ok); }
.report-priority-title { font-weight: 800; margin-bottom: 4px; }
.report-priority-details { color: var(--muted); font-size: .93rem; }
.report-measures-card .report-table thead th:first-child { border-top-left-radius: 14px; }
.report-measures-card .report-table thead th:last-child { border-top-right-radius: 14px; }
.report-status-cell,
.report-action-cell { min-width: 140px; }
.report-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.report-note-card ul { margin: 0; }
.report-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(123, 147, 173, 0.18);
  color: var(--muted);
  font-size: .9rem;
}
.print-only { display: none; }

@media (max-width: 900px) {
  .hero-card,
  .result-layout,
  .report-hero,
  .report-actions-layout,
  .report-sections-grid,
  .report-meta-grid,
  .report-brand-line,
  .taylor-summary-grid,
  .taylor-grid,
  .result-grid-compact,
  .metrics,
  .grid.two,
  .grid.three,
  .tabs,
  .form-tabs { grid-template-columns: 1fr; }
  .brand-lockup { flex-direction: column; }
  .history-row { flex-direction: column; align-items: flex-start; }
  .history-row .right { width: 100%; }
  .history-row .right button { flex: 1; }
  .sticky-actions { flex-direction: column; }
}

@page { size: A4; margin: 10mm; }
@media print {
  html, body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .app-shell { max-width: none; padding: 0; }
  .app-shell > header,
  .tabs,
  #analysisForm,
  #dashboard,
  #history,
  #help,
  .sticky-actions,
  dialog,
  .no-print {
    display: none !important;
  }
  .print-only { display: block; }
  #reportContent {
    max-height: none;
    overflow: visible;
    padding: 0;
    background: #fff;
  }
  .result-block,
  .card,
  .dialog-card,
  .report-panel,
  .report-brand-card,
  .report-highlight-card,
  .report-note-card,
  .report-table-block {
    box-shadow: none;
    border-color: rgba(123, 147, 173, 0.22);
  }
  .report-print-root,
  .report-panel,
  .report-brand-card,
  .report-note-card,
  .report-table-block,
  .taylor-card,
  .report-priority-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}


/* v5.2 compact report */
.report-compact-root {
  font-size: 0.96rem;
}
.report-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-page + .report-page {
  margin-top: 16px;
}
.report-hero.compact {
  grid-template-columns: 1.35fr .85fr;
  gap: 10px;
  margin-bottom: 10px;
}
.report-main-header,
.report-global-card.compact,
.report-measures-card.compact,
.report-followup-panel,
.report-taylor-panel,
.report-note-card.wide {
  min-height: 0;
}
.report-brand-line.compact {
  margin-bottom: 10px;
  gap: 12px;
}
.report-meta-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.report-meta-grid.compact .report-meta-card {
  padding: 10px 12px;
  border-radius: 14px;
}
.report-quick-list {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-size: .92rem;
}
.report-actions-layout.compact {
  grid-template-columns: .78fr 1.22fr;
  gap: 10px;
  margin-bottom: 10px;
}
.report-priority-list.compact li {
  padding: 8px 0;
}
.report-priority-list.compact li::before {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  font-size: .9rem;
}
.report-mini-line {
  margin-top: 3px;
  font-size: .84rem;
}
.report-table.compact th,
.report-table.compact td {
  padding: 8px 10px;
  font-size: .87rem;
  vertical-align: middle;
}
.report-table.compact td strong {
  margin-bottom: 2px;
}
.report-table.compact .status-badge {
  transform: scale(.92);
  transform-origin: left center;
}
.report-status-cell,
.report-action-cell {
  min-width: 108px;
}
.report-bottom-grid.compact {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 10px;
}
.report-compact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.report-compact-head h3 {
  margin: 4px 0 0;
}
.taylor-gauge.compact {
  margin-top: 8px;
  height: 22px;
}
.taylor-legend.compact {
  margin-top: 6px;
  font-size: .85rem;
}
.report-compact-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.report-compact-stats div,
.report-inline-note {
  background: #f7fbfe;
  border: 1px solid rgba(13, 94, 147, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
}
.report-compact-stats strong,
.report-inline-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}
.report-compact-note {
  margin: 8px 0 0;
  font-size: .88rem;
}
.report-sections-grid.compact {
  gap: 10px;
  margin-bottom: 10px;
}
.report-sections-grid.compact.issues-only {
  grid-template-columns: 1fr;
}
.report-sections-grid.compact.lower {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.report-note-card.wide h4,
.report-issue-group h4 {
  margin: 0 0 8px;
}
.report-issue-group + .report-issue-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(123, 147, 173, 0.14);
}
.bullet-list.compact {
  padding-left: 18px;
}
.bullet-list.compact li {
  margin-bottom: 6px;
}
.report-footer.compact {
  margin-top: auto;
}
@page { size: A4; margin: 8mm; }
@media print {
  .report-print-root {
    padding: 0;
    color: #16324a;
    font-size: 11.2pt;
  }
  .report-page {
    min-height: calc(297mm - 16mm);
    page-break-after: always;
    break-after: page;
  }
  .report-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  .report-page,
  .report-panel,
  .report-note-card,
  .report-taylor-panel,
  .report-followup-panel,
  .report-priority-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-panel,
  .report-note-card {
    border-radius: 16px;
    padding: 12px;
  }
  .report-brand-line.compact {
    margin-bottom: 8px;
  }
  .report-logo {
    max-width: 150px;
  }
  .report-title-copy h2 {
    font-size: 1.35rem;
    margin: 4px 0 6px;
  }
  .report-meta-grid.compact {
    gap: 6px;
  }
  .report-meta-grid.compact .report-meta-card {
    padding: 8px 10px;
    font-size: .84rem;
  }
  .report-actions-layout.compact,
  .report-bottom-grid.compact,
  .report-hero.compact,
  .report-sections-grid.compact.lower {
    gap: 8px;
  }
  .report-table.compact th,
  .report-table.compact td {
    padding: 6px 8px;
    font-size: .78rem;
  }
  .report-table.compact .status-badge {
    transform: scale(.82);
  }
  .report-status-cell,
  .report-action-cell {
    min-width: 90px;
  }
  .report-priority-title {
    font-size: .92rem;
  }
  .report-priority-details,
  .report-compact-note,
  .bullet-list.compact li,
  .report-quick-list,
  .report-inline-note {
    font-size: .8rem;
  }
  .report-compact-stats div,
  .report-inline-note {
    padding: 8px 10px;
  }
}
@media (max-width: 900px) {
  .report-bottom-grid.compact,
  .report-sections-grid.compact.lower {
    grid-template-columns: 1fr;
  }
}


/* v5.2 compact report overrides 2 pages */
.report-actions-layout.compact.single-page {
  grid-template-columns: .62fr 1.38fr;
}
.report-priority-list.compact.short li {
  padding: 7px 0;
}
.report-table.compact.recap-only th,
.report-table.compact.recap-only td {
  padding: 7px 8px;
  font-size: .84rem;
}
.report-table.compact.recap-only .status-badge {
  transform: scale(.88);
  transform-origin: left center;
}
.report-second-top {
  margin-bottom: 10px;
}
.report-sections-grid.compact.lower.dense {
  grid-template-columns: 1.08fr .92fr;
  align-items: start;
}
.report-note-stack {
  display: grid;
  gap: 10px;
}
.bullet-list.compact.dense li {
  margin-bottom: 4px;
}
.report-issue-group h4 {
  font-size: 1rem;
}
@media print {
  .report-page {
    page-break-after: always;
    break-after: page;
    min-height: auto;
  }
  .report-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  .report-actions-layout.compact.single-page,
  .report-sections-grid.compact.lower.dense {
    gap: 6px;
  }
  .report-actions-layout.compact.single-page {
    grid-template-columns: .56fr 1.44fr;
  }
  .report-table.compact.recap-only th,
  .report-table.compact.recap-only td {
    padding: 5px 6px;
    font-size: .74rem;
  }
  .report-table.compact.recap-only .status-badge {
    transform: scale(.75);
  }
  .report-priority-list.compact.short li {
    padding: 5px 0;
  }
  .report-priority-title {
    font-size: .88rem;
  }
  .report-priority-details,
  .bullet-list.compact.dense li,
  .report-compact-note,
  .report-inline-note,
  .report-quick-list {
    font-size: .76rem;
  }
  .report-compact-stats div,
  .report-inline-note {
    padding: 6px 8px;
  }
  .report-note-card,
  .report-panel {
    padding: 10px;
  }
  .report-sections-grid.compact.lower.dense {
    grid-template-columns: 1.02fr .98fr;
  }
}

.report-page { display: block !important; }
.report-footer.compact { margin-top: 10px; }
@media print { .report-page { display:block !important; } .report-footer.compact { margin-top: 8px; } }



.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.product-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
  box-shadow: var(--shadow-soft);
}
.product-card.compact {
  border-radius: 14px;
  box-shadow: none;
}
.product-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.product-card-body { padding: 14px; }
.product-card-topline {
  color: var(--primary);
  font-weight: 800;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.product-card h4 { font-size: 1rem; margin: 0 0 4px; }
.product-card-subtitle {
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 10px;
}
.product-chip {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--panel-contrast);
  color: var(--primary-strong);
  font-size: .84rem;
  margin: 0 8px 8px 0;
}
.product-card p {
  color: var(--muted);
  font-size: .93rem;
  margin: 6px 0 0;
  line-height: 1.45;
}
.product-links {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  color: var(--primary);
  font-weight: 700;
  font-size: .84rem;
}
.product-links a {
  text-decoration: none;
}
.product-list-compact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.product-list-compact li {
  border: 1px solid rgba(13, 36, 64, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.product-list-compact span,
.product-list-compact small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.report-note-card .product-list-compact li {
  padding: 8px 10px;
  font-size: .92rem;
}
@media print {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-card {
    break-inside: avoid;
    box-shadow: none;
  }
  .product-card-image {
    max-height: 120px;
  }
}


.procedure-list,
.report-procedure-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.procedure-list li,
.report-procedure-list li {
  border: 1px solid rgba(13, 36, 64, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
  padding: 12px 14px;
}
.report-procedure-list li {
  padding: 10px 12px;
}
.procedure-list strong,
.report-procedure-list strong {
  display: block;
  margin-bottom: 4px;
}
.procedure-list span,
.procedure-list small,
.report-procedure-list span,
.report-procedure-list small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
@media print {
  .report-procedure-list {
    gap: 6px;
  }
  .report-procedure-list li {
    padding: 8px 10px;
  }
  .report-procedure-list span,
  .report-procedure-list small {
    font-size: .76rem;
  }
}

/* v5.6 responsive + premium pdf overrides */
.app-shell {
  max-width: 1360px;
}

.analysis-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, .96fr);
  gap: 18px;
  align-items: start;
}

.result-sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
}

#analysisForm {
  min-width: 0;
}

#resultSection {
  min-width: 0;
}

.report-preview-empty {
  padding: 28px;
  border: 1px dashed rgba(13, 94, 147, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
}

.report-preview-empty h3 {
  margin-bottom: 8px;
}

.tabs,
.form-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar,
.form-tabs::-webkit-scrollbar { display: none; }

.form-tabs {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.tabs {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.tab,
.form-tab {
  min-width: 0;
}

.report-table tbody tr:nth-child(even) td {
  background: rgba(13, 94, 147, 0.02);
}

.report-client-sentence {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f6fbff 0%, #f1f8fd 100%);
  border: 1px solid rgba(13, 94, 147, 0.1);
  line-height: 1.5;
}

.report-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.report-summary-card {
  border: 1px solid rgba(13, 36, 64, 0.08);
  border-radius: 18px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfe 100%);
}

.report-summary-card strong {
  display: block;
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.report-summary-card span {
  display: block;
  font-weight: 800;
  color: var(--primary-strong);
  line-height: 1.25;
}

.report-summary-card small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}

.report-global-card.compact {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.report-phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 94, 147, 0.08);
  color: var(--primary-strong);
  font-weight: 800;
  font-size: .78rem;
}

.report-measures-card.compact h3,
.report-main-header h2 {
  letter-spacing: -0.02em;
}

.report-priority-card {
  background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
}

.report-priority-list.compact.short li {
  align-items: flex-start;
}

.report-priority-title {
  line-height: 1.25;
}

.report-side-stack.compact {
  display: grid;
  gap: 10px;
}

.report-keypoints-list,
.report-timing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.report-keypoints-list li,
.report-timing-list li {
  border: 1px solid rgba(13, 36, 64, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}

.report-keypoints-list strong,
.report-timing-list strong {
  display: block;
  margin-bottom: 4px;
}

.report-keypoints-list span,
.report-timing-list span {
  color: var(--muted);
  display: block;
  line-height: 1.4;
}

.report-note-card .report-inline-note {
  margin-top: 10px;
}

@media (min-width: 1180px) {
  .result-sidebar .result-block:first-child {
    margin-top: 0;
  }

  .result-sidebar .result-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 1120px) {
  .analysis-workspace {
    grid-template-columns: 1fr;
  }

  .result-sidebar {
    position: static;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

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

  .brand-lockup {
    align-items: center;
  }

  .topbar-logo {
    width: 88px;
  }

  .tabs,
  .form-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 1fr);
    padding-bottom: 2px;
  }

  .metrics,
  .result-grid-compact,
  .report-summary-strip,
  .report-meta-grid.compact,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .sticky-actions {
    position: sticky;
    bottom: 8px;
    flex-wrap: wrap;
  }

  .sticky-actions > * {
    flex: 1 1 100%;
  }

  dialog {
    width: calc(100vw - 12px);
  }

  #reportContent {
    padding: 0 12px 12px;
    max-height: 76vh;
  }

  .report-page + .report-page {
    margin-top: 12px;
  }

  .report-actions-layout.compact.single-page,
  .report-sections-grid.compact.lower.dense,
  .report-hero.compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-card,
  .card,
  .result-block,
  .dialog-card {
    border-radius: 18px;
  }

  .hero-card,
  .card,
  .result-block {
    padding: 18px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  h1 {
    font-size: 1.85rem;
  }

  .report-title-copy h2 {
    font-size: 1.25rem;
  }

  .report-table.compact.recap-only th,
  .report-table.compact.recap-only td {
    padding: 6px;
    font-size: .78rem;
  }

  .report-status-cell .status-badge {
    transform: scale(.84);
    transform-origin: left center;
  }
}

@media print {
  .report-client-sentence {
    padding: 9px 10px;
    font-size: .82rem;
  }

  .report-summary-strip {
    gap: 6px;
    margin-bottom: 8px;
  }

  .report-summary-card {
    padding: 8px 10px;
    border-radius: 14px;
  }

  .report-summary-card strong {
    font-size: .68rem;
    margin-bottom: 4px;
  }

  .report-summary-card span {
    font-size: .83rem;
    line-height: 1.2;
  }

  .report-summary-card small {
    font-size: .7rem;
    margin-top: 4px;
  }

  .report-keypoints-list,
  .report-timing-list,
  .report-note-stack,
  .report-side-stack.compact {
    gap: 6px;
  }

  .report-keypoints-list li,
  .report-timing-list li,
  .report-note-card .product-list-compact li {
    padding: 7px 8px;
  }

  .report-keypoints-list span,
  .report-timing-list span,
  .report-procedure-list span,
  .report-procedure-list small,
  .product-list-compact span,
  .product-list-compact small {
    font-size: .72rem;
    line-height: 1.3;
  }

  .report-table tbody tr:nth-child(even) td {
    background: rgba(13, 94, 147, 0.018) !important;
  }
}


/* v5.7 report adjustments */
.report-v57-root .report-page + .report-page {
  margin-top: 14px;
}
.report-grid-v57 {
  grid-template-columns: 1.08fr .92fr;
}
.report-sections-grid.compact.lower.tertiary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.report-long-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.report-followup-list {
  margin: 0;
}
.report-followup-list li {
  margin-bottom: 5px;
}
.report-followup-list li:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .report-grid-v57,
  .report-sections-grid.compact.lower.tertiary {
    grid-template-columns: 1fr;
  }
}

@media print {
  .report-v57-root {
    font-size: 10.8pt;
  }
  .report-grid-v57,
  .report-sections-grid.compact.lower.tertiary {
    gap: 8px;
  }
  .report-page-3 .report-note-card,
  .report-page-4 .report-note-card {
    padding: 10px;
  }
  .report-page-3 .bullet-list.compact.dense li,
  .report-page-4 .bullet-list.compact.dense li,
  .report-followup-list li,
  .report-long-note {
    font-size: .78rem;
  }
}

/* v6.0 rapport validé */
.report-v60-root .report-page + .report-page {
  margin-top: 14px;
}
.report-first-page-grid {
  grid-template-columns: 1.05fr 0.95fr;
  margin-top: 10px;
}
.report-inline-facts {
  align-self: stretch;
}
.report-inline-facts .bullet-list {
  margin-top: 10px;
}
.report-table-five-cols th:nth-child(1),
.report-table-five-cols td:nth-child(1) { width: 18%; }
.report-table-five-cols th:nth-child(2),
.report-table-five-cols td:nth-child(2) { width: 13%; }
.report-table-five-cols th:nth-child(3),
.report-table-five-cols td:nth-child(3) { width: 19%; }
.report-table-five-cols th:nth-child(4),
.report-table-five-cols td:nth-child(4) { width: 16%; }
.report-table-five-cols th:nth-child(5),
.report-table-five-cols td:nth-child(5) { width: 34%; }
.report-understand-card {
  margin-top: 10px;
}
.report-grid-v60 {
  grid-template-columns: 1.08fr 0.92fr;
}
.report-taylor-full {
  margin-top: 10px;
}
.report-product-focus {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(13, 36, 64, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
  margin-bottom: 8px;
}
.report-product-focus:last-child {
  margin-bottom: 0;
}
.report-product-focus span,
.report-product-focus small,
.report-product-focus p {
  color: var(--muted);
  margin: 0;
}
.report-grid-page4-v60 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
@media (max-width: 900px) {
  .report-first-page-grid,
  .report-grid-v60,
  .report-grid-page4-v60 {
    grid-template-columns: 1fr;
  }
}
@media print {
  .report-v60-root {
    font-size: 10.8pt;
  }
  .report-first-page-grid,
  .report-grid-v60,
  .report-grid-page4-v60 {
    gap: 8px;
  }
  .report-table-five-cols th,
  .report-table-five-cols td {
    padding: 6px 7px;
    font-size: .77rem;
  }
  .report-inline-facts,
  .report-understand-card,
  .report-page-4 .report-note-card,
  .report-product-focus {
    padding: 10px;
  }
  .report-product-focus span,
  .report-product-focus small,
  .report-product-focus p,
  .report-page-4 .bullet-list.compact.dense li,
  .report-understand-card .bullet-list.compact.dense li,
  .report-inline-facts .bullet-list.compact.dense li {
    font-size: .78rem;
  }
}

.report-client-plan-list {
  display: grid;
  gap: 8px;
}

.report-client-plan-item {
  border: 1px solid rgba(13, 36, 64, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
  display: grid;
  gap: 4px;
}

.report-client-plan-step {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
}

.report-client-plan-item strong {
  font-size: .94rem;
}

.report-client-plan-item div {
  color: var(--muted);
  line-height: 1.4;
}

.report-client-plan-item span {
  color: var(--ink);
  font-weight: 700;
}

@media print {
  .report-client-plan-card {
    padding: 10px;
  }

  .report-client-plan-list {
    gap: 6px;
  }

  .report-client-plan-item {
    padding: 8px 9px;
  }

  .report-client-plan-step {
    font-size: .62rem;
  }

  .report-client-plan-item strong {
    font-size: .82rem;
  }

  .report-client-plan-item div {
    font-size: .74rem;
    line-height: 1.3;
  }
}
