:root {
  --bg: #f7f2e8;
  --bg-soft: #fbf7ef;
  --surface: #fffaf2;
  --surface-muted: #efe7da;
  --border: #d9ccba;
  --border-soft: #e8ded0;
  --text: #2d2924;
  --text-muted: #6f675f;
  --text-soft: #9a9186;
  --accent: #6f563d;
  --accent-dark: #312a24;
  --accent-soft: #f1e8dc;
  --accent-quiet: #f7efe4;
  --warning: #9a5b13;
  --danger: #a63a36;
  --success: #5f6d45;
  --chart-safe: #6f7a55;
  --chart-warning: #b08345;
  --chart-danger: #a45a50;
  --chart-equity: #6f563d;
  --chart-target: #68764f;
  --chart-risk: #a45a50;
  --focus: rgba(111, 86, 61, 0.16);
  --shadow: 0 14px 36px rgba(45, 39, 31, 0.08);
  --radius-lg: 14px;
  --radius-md: 11px;
  --radius-sm: 9px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.76), rgba(246, 241, 232, 0.96) 280px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  appearance: none;
}

.app-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.content-shell {
  width: min(920px, calc(100% - 40px));
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 2px 20px;
}

.app-header h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
}

.app-header p {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 17px;
}

.app-header .hero-subtitle {
  max-width: 760px;
  color: var(--text);
  font-size: clamp(20px, 2.7vw, 28px);
  font-weight: 720;
  line-height: 1.25;
}

.app-header .hero-note {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 620;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  padding-top: 8px;
}

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

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.hero-pills span,
.header-list span,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 650;
}

.panel {
  margin-top: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow);
  padding: 26px;
}

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

.guide-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: inherit;
  padding: 18px;
  text-decoration: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.guide-card:hover,
.guide-card:focus-visible {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(48, 42, 34, 0.06), 0 0 0 4px rgba(111, 86, 61, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.guide-card span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 760;
}

.guide-card strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.guide-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.article-header {
  max-width: 820px;
  padding: 4px 2px 14px;
}

.article-header h1 {
  margin: 18px 0 0;
  color: var(--text);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.08;
}

.article-header p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 620;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--accent-dark);
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  border-color: var(--border);
  background: var(--accent-soft);
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.article-panel {
  max-width: 820px;
  padding: 30px;
}

.article-panel h2 {
  margin-top: 24px;
  font-size: 19px;
}

.article-panel h2:first-child {
  margin-top: 0;
}

.article-panel p,
.article-panel li {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.82;
}

.article-panel p {
  margin: 9px 0 0;
}

.disclaimer-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-left: 22px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text);
  text-decoration: underline;
  outline: none;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
}

.step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 720;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h2 {
  color: var(--text);
  font-size: 22px;
  font-weight: 730;
}

h3 {
  margin-top: 18px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 720;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.form-grid,
.mapping-grid,
.data-summary {
  display: grid;
  gap: 16px;
}

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

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

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

.rule-fields {
  align-items: start;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

label {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 630;
}

.select-field {
  align-content: start;
}

.custom-input {
  margin-top: 2px;
}

.field-error {
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.field-error:empty {
  display: none;
}

.has-error input,
.has-error select {
  border-color: var(--danger);
  background: #fff8f7;
}

.label-with-tooltip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tooltip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1;
  cursor: help;
  outline: none;
}

.tooltip::after {
  content: attr(aria-label);
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: calc(100% + 10px);
  width: min(330px, 78vw);
  border: 1px solid rgba(38, 35, 31, 0.16);
  border-radius: var(--radius-md);
  background: #2d302b;
  box-shadow: 0 16px 34px rgba(38, 35, 31, 0.18);
  color: #fff;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

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

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
  padding: 10px 12px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

select {
  padding-right: 12px;
}

input:hover,
select:hover {
  border-color: var(--border);
  background-color: #fff;
}

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

.hidden {
  display: none !important;
}

.upload-row,
.report-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.upload-card {
  justify-content: space-between;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  padding: 14px 16px;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.upload-card:hover {
  border-color: var(--border);
  background: var(--surface);
}

.file-picker {
  display: inline-flex;
  width: auto;
  cursor: pointer;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

button,
.upload-trigger,
.secondary-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.primary-button,
.run-trigger {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.primary-button:hover,
.run-trigger:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

.secondary-button,
.upload-trigger {
  border-color: var(--border);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: none;
}

.secondary-button:hover,
.upload-trigger:hover {
  border-color: var(--border);
  background: #f4ecdf;
  color: var(--accent-dark);
}

button:active,
.upload-trigger:active {
  transform: translateY(1px);
}

button:disabled {
  border-color: var(--border-soft);
  background: var(--surface-muted);
  color: var(--text-soft);
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button:disabled:hover {
  border-color: var(--border-soft);
  background: var(--surface-muted);
  color: var(--text-soft);
}

button:focus-visible,
.file-picker input:focus-visible + .upload-trigger,
.detail-panel summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.status {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
}

.upload-row .status-pill {
  min-height: 28px;
  max-width: 100%;
  background: var(--surface);
  padding: 4px 10px;
  font-size: 12px;
}

.status.error,
.error-text {
  color: var(--danger);
  font-weight: 650;
}

.upload-row .status.error {
  border-color: #ebc7c4;
  background: #fff2f0;
  color: var(--danger);
}

.mapping-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}

.mapping-panel button {
  margin-top: 18px;
}

.notice {
  border: 1px solid #ead7bf;
  border-radius: var(--radius-md);
  background: #fff8ef;
  color: #674917;
  padding: 13px 15px;
  font-size: 14px;
}

.header-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-panel,
.data-detail-panel {
  margin-top: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.detail-panel summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--accent-dark);
  padding: 6px 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  list-style: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}

.detail-panel summary::-webkit-details-marker {
  display: none;
}

.detail-panel summary::before {
  content: ">";
  display: inline-block;
  margin-right: 7px;
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.14s ease;
}

.detail-panel[open] summary::before {
  transform: rotate(90deg);
}

.detail-panel summary:hover {
  border-color: var(--border);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.data-detail-panel summary {
  min-height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  padding: 3px 6px;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}

.data-detail-panel summary::before {
  margin-right: 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.data-detail-panel summary:hover {
  border: 0;
  background: var(--surface-muted);
  color: var(--accent-dark);
  box-shadow: none;
}

.data-summary {
  margin-top: 18px;
}

.data-summary div,
.metric {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  padding: 14px;
}

.data-summary span,
.metric span {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 640;
}

.data-summary strong,
.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 760;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.report-actions {
  align-items: end;
  margin-bottom: 16px;
}

.simulation-select {
  width: 164px;
  flex: 0 0 164px;
  gap: 6px;
}

.simulation-select select {
  min-height: 44px;
}

.report-output {
  min-height: 148px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  padding: 16px;
}

.report-output p {
  margin: 0;
  color: var(--text-muted);
}

.report-section {
  margin-bottom: 14px;
}

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

.compact-title {
  display: block;
}

.report-section h3 {
  margin-top: 0;
}

.report-section-title p {
  max-width: 680px;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
}

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

.health-metric {
  border-color: var(--border-soft);
  background: var(--surface);
}

.health-metric strong {
  font-size: 24px;
}

.health-metric em {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

.profile-card,
.rule-fit-grid > div {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 16px;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.profile-head strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
}

.profile-head span,
.profile-head em,
.profile-card p,
.text-list li {
  color: var(--text-muted);
}

.profile-head span {
  display: block;
  margin-top: 4px;
  font-weight: 650;
}

.profile-head em {
  flex: 0 0 auto;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg-soft);
  padding: 5px 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
}

.profile-card p {
  margin: 12px 0 0;
  font-weight: 600;
}

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

.text-list h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
}

.text-list ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.text-list li {
  font-size: 13px;
}

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

.risk-explanation-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 16px;
}

.share-verdict span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.risk-explanation-card p,
.path-risk-note,
.share-hero p,
.share-verdict p {
  color: var(--text-muted);
  font-weight: 600;
}

.risk-explanation-card strong {
  display: block;
  color: var(--text);
  font-size: 17px;
}

.risk-explanation-card p {
  margin: 8px 0 0;
}

.config-card,
.consistency-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

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

.summary-list div {
  min-width: 0;
}

.summary-list span {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
}

.summary-list strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 16px;
}

.consistency-note {
  margin-top: 14px;
  border: 1px solid #ead7bf;
  border-radius: var(--radius-md);
  background: #fff8ef;
  color: var(--text);
  padding: 13px 15px;
}

.path-section {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px;
}

.path-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 220px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.chart-baseline {
  stroke: #b8aea1;
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.chart-targetline {
  stroke: var(--chart-target);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.chart-lossline {
  stroke: var(--chart-risk);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.chart-drawdown-line {
  fill: none;
  stroke: var(--chart-risk);
  stroke-width: 2;
  stroke-dasharray: 7 4;
}

.chart-daily-loss-line {
  fill: none;
  stroke: var(--warning);
  stroke-width: 1.4;
  stroke-dasharray: 3 5;
  opacity: 0.76;
}

.chart-zone-safe {
  fill: #eef0e5;
  opacity: 0.72;
}

.chart-zone-warning {
  fill: #f4ead8;
  opacity: 0.78;
}

.chart-zone-danger {
  fill: #f1dfd9;
  opacity: 0.78;
}

.chart-line {
  fill: none;
  stroke: var(--chart-equity);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.path-segment-safe {
  stroke: var(--chart-safe);
}

.path-segment-warning {
  stroke: var(--chart-warning);
}

.path-segment-danger {
  stroke: var(--chart-danger);
}

.chart-dot {
  fill: #fff;
  stroke: var(--chart-equity);
  stroke-width: 2;
}

.chart-dot-end {
  fill: var(--chart-equity);
}

.chart-label {
  fill: var(--text-muted);
  font-size: 12px;
}

.chart-label-strong {
  fill: var(--text);
  font-weight: 700;
}

.path-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.path-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.path-legend i {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 3px solid var(--chart-equity);
}

.path-legend .legend-target {
  border-top-color: var(--chart-target);
  border-top-style: dashed;
}

.path-legend .legend-risk {
  border-top-color: var(--chart-risk);
  border-top-style: dashed;
}

.path-legend .legend-initial {
  border-top-color: #b8aea1;
  border-top-style: dashed;
}

.path-zone-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.path-zone-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.path-zone-legend i {
  display: inline-block;
  width: 18px;
  height: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
}

.path-zone-legend .zone-safe {
  background: #eef0e5;
}

.path-zone-legend .zone-warning {
  background: #f4ead8;
}

.path-zone-legend .zone-danger {
  background: #f1dfd9;
}

.path-risk-note {
  margin: 8px 0 0;
  font-size: 13px;
}

.path-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--text-muted);
}

.path-caption strong {
  color: var(--text);
}

.share-card {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 12px 26px rgba(45, 39, 31, 0.06);
}

.share-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.share-card-header span {
  color: var(--text);
  font-size: 21px;
  font-weight: 780;
}

.share-card-header strong {
  color: var(--text-muted);
  font-size: 14px;
}

.share-hero {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}

.share-hero strong {
  display: block;
  color: var(--text);
  font-size: 28px;
  line-height: 1.1;
}

.share-hero p {
  margin: 7px 0 10px;
}

.share-hero em {
  display: inline-flex;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  padding: 4px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.share-hero-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  padding: 11px 12px;
}

.share-hero-stats span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.share-hero-stats strong {
  margin-bottom: 6px;
  font-size: 22px;
}

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

.share-card-grid div {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  padding: 10px 11px;
}

.share-card-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.share-card-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.share-card-grid .share-metric-primary strong {
  font-size: 21px;
}

.share-rule-fit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.share-rule-fit div {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  padding: 11px 12px;
}

.share-rule-fit span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.share-rule-fit p {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.share-verdict {
  margin-top: 12px;
  border: 1px solid #ead7bf;
  border-radius: var(--radius-sm);
  background: #fff8ef;
  padding: 12px 13px;
}

.share-verdict p {
  margin: 5px 0 0;
  color: var(--text);
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 28px, 1120px);
    padding-top: 36px;
  }

  .content-shell {
    width: min(100% - 28px, 920px);
  }

  .app-header {
    display: block;
  }

  .site-nav {
    justify-content: flex-start;
    margin-top: 18px;
    padding-top: 0;
  }

  .form-grid,
  .mapping-grid,
  .data-summary,
  .summary-list,
  .health-grid,
  .rule-fit-grid,
  .share-hero,
  .share-card-grid,
  .share-rule-fit,
  .guide-index {
    grid-template-columns: 1fr;
  }

  .report-section-title {
    display: block;
  }

  .report-section-title p {
    max-width: none;
    margin-top: 8px;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 28px 0 46px;
  }

  .app-header h1 {
    font-size: 42px;
  }

  .app-header p {
    font-size: 16px;
  }

  .app-header .hero-subtitle {
    font-size: 22px;
  }

  .panel {
    padding: 20px;
  }

  .article-panel {
    padding: 22px;
  }

  .article-header h1 {
    font-size: 34px;
  }

  .section-heading {
    gap: 12px;
  }

  .upload-row,
  .report-actions {
    align-items: stretch;
  }

  .simulation-select,
  .file-picker,
  .upload-trigger,
  button {
    width: 100%;
    flex: 1 1 auto;
  }

  .site-nav .secondary-button {
    width: auto;
    flex: 0 0 auto;
  }

  .path-caption,
  .share-card-header {
    display: block;
  }

  .path-caption strong,
  .share-card-header strong {
    display: block;
    margin-top: 4px;
  }
}


/* Claude-style final layer: keep controls in the same warm neutral system. */
button,
.upload-trigger,
.secondary-button,
.primary-button {
  appearance: none !important;
  -webkit-appearance: none !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 1px 0 rgba(48, 42, 34, 0.05) !important;
}

.secondary-button,
.upload-trigger,
.file-picker > .upload-trigger {
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

.secondary-button:hover,
.upload-trigger:hover,
.file-picker:hover > .upload-trigger,
.file-picker:focus-within > .upload-trigger {
  border-color: #cbbba5 !important;
  background: #f4ecdf !important;
  color: var(--text) !important;
  box-shadow: 0 8px 20px rgba(48, 42, 34, 0.06), 0 0 0 4px rgba(111, 86, 61, 0.08) !important;
  transform: translateY(-1px);
}

.primary-button,
.run-trigger,
button#runReport {
  border: 1px solid #2d2924 !important;
  background: #2d2924 !important;
  color: #fffaf2 !important;
  box-shadow: 0 1px 0 rgba(48, 42, 34, 0.08), 0 10px 20px rgba(48, 42, 34, 0.08) !important;
}

.primary-button:hover,
.run-trigger:hover,
button#runReport:hover,
.primary-button:focus-visible,
.run-trigger:focus-visible,
button#runReport:focus-visible {
  border-color: #1f1b18 !important;
  background: #1f1b18 !important;
  color: #fffaf2 !important;
  box-shadow: 0 12px 24px rgba(48, 42, 34, 0.12), 0 0 0 4px rgba(111, 86, 61, 0.10) !important;
  transform: translateY(-1px);
}

button:disabled,
button:disabled:hover,
button:disabled:focus-visible {
  border-color: var(--border-soft) !important;
  background: var(--surface-muted) !important;
  color: var(--text-soft) !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: not-allowed !important;
}

details.data-detail-panel,
details.data-detail-panel:hover {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

details.data-detail-panel > summary,
details.data-detail-panel > summary:hover,
details.data-detail-panel > summary:focus-visible {
  border: 0 !important;
  box-shadow: none !important;
}

details.data-detail-panel > summary {
  background: transparent !important;
  color: var(--text-muted) !important;
}

details.data-detail-panel > summary:hover,
details.data-detail-panel > summary:focus-visible {
  background: #f4ecdf !important;
  color: var(--text) !important;
}
