:root {
  --page: #f5f2eb;
  --surface: #ffffff;
  --surface-muted: #ece9e1;
  --forest: #233a2d;
  --forest-soft: #3d5546;
  --terracotta: #b85c38;
  --terracotta-dark: #984727;
  --ink: #2c2a29;
  --muted: #6e716c;
  --line: #d8d4ca;
  --success: #2f6b45;
  --success-bg: #e8f1e9;
  --warning: #8c5a24;
  --warning-bg: #f8efe1;
  --danger: #9d3f32;
  --danger-bg: #f8e9e5;
  --radius: 12px;
  --container: 1180px;
  --shadow: 0 18px 48px rgba(35, 58, 45, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }
button, input, a { touch-action: manipulation; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: -100px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--forest);
  color: #fff;
  transition: top 120ms ease;
}

.skip-link:focus { top: 10px; }

.container {
  width: min(calc(100% - 48px), var(--container));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid rgba(35, 58, 45, 0.12);
  background: rgba(245, 242, 235, 0.96);
}

.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}

.brand-name {
  color: var(--forest);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
}

.brand-divider { color: #a4a49f; font-size: 20px; }
.brand-role, .header-label { color: var(--muted); font-size: 14px; }
.header-label { text-transform: uppercase; letter-spacing: 0.12em; }

.hero { padding: 88px 0 76px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr);
  align-items: center;
  gap: 72px;
}

.eyebrow, .section-kicker {
  margin: 0 0 14px;
  color: var(--terracotta);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

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

h1, h2 {
  color: var(--forest);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
}

h1 {
  max-width: 650px;
  margin-bottom: 24px;
  font-size: clamp(48px, 5.2vw, 72px);
  letter-spacing: -0.035em;
  line-height: 0.98;
}

h2 { margin-bottom: 16px; font-size: clamp(34px, 4vw, 48px); line-height: 1.05; }
h3 { margin-bottom: 8px; color: var(--forest); font-size: 18px; line-height: 1.3; }

.hero-text {
  max-width: 590px;
  margin-bottom: 0;
  color: #555650;
  font-size: 18px;
}

.search-panel {
  padding: 34px;
  border: 1px solid rgba(35, 58, 45, 0.13);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

label { display: block; margin-bottom: 10px; color: var(--forest); font-size: 14px; font-weight: 600; }

.input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

input {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid #b9b9b1;
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 17px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input::placeholder { color: #969890; }
input:hover { border-color: var(--forest-soft); }
input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(35, 58, 45, 0.16); }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(157, 63, 50, 0.12); }

button {
  min-height: 56px;
  min-width: 156px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: var(--terracotta);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, box-shadow 180ms ease;
}

button:hover { background: var(--terracotta-dark); box-shadow: 0 8px 24px rgba(184, 92, 56, 0.2); }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(184, 92, 56, 0.42); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: 0.68; box-shadow: none; }
.button-arrow { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.field-hint, .field-error { margin: 9px 0 0; font-size: 13px; }
.field-hint { color: var(--muted); }
.field-error { color: var(--danger); font-weight: 500; }

.info-icon svg, .empty-mark svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.result-section { padding: 0 0 96px; }

.empty-state, .loading-card {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 44px;
  border: 1px dashed #bbb8ae;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

.empty-state h2 { margin-bottom: 8px; font-size: 32px; }
.empty-state p { max-width: 680px; margin-bottom: 0; color: var(--muted); }
.empty-mark { flex: 0 0 auto; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-muted); color: var(--forest); }
.empty-mark svg { width: 30px; }

.loading-card { min-height: 180px; color: var(--forest); font-weight: 500; }
.spinner { width: 24px; height: 24px; border: 2px solid rgba(35, 58, 45, 0.18); border-top-color: var(--forest); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.company-card {
  overflow: hidden;
  border: 1px solid rgba(35, 58, 45, 0.13);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.company-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; padding: 38px 40px 30px; }
.company-heading h2 { max-width: 800px; margin-bottom: 8px; font-size: clamp(32px, 4vw, 46px); }
.company-full-name { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 13px; }

.status-badge { flex: 0 0 auto; padding: 8px 13px; border-radius: 999px; background: var(--success-bg); color: var(--success); font-size: 13px; font-weight: 600; }
.status-badge.is-warning { background: var(--warning-bg); color: var(--warning); }

.details-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.detail-item { min-height: 104px; display: flex; flex-direction: column; justify-content: center; padding: 24px 40px; border-right: 1px solid var(--line); }
.detail-item:last-child { border-right: 0; }
.detail-label { margin-bottom: 6px; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.detail-item strong { color: var(--forest); font-size: 18px; }

.info-columns { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.info-block { display: grid; grid-template-columns: auto 1fr; gap: 18px; min-height: 150px; padding: 32px 40px; }
.info-block:first-child { border-right: 1px solid var(--line); }
.info-block p { margin-bottom: 0; color: #53554f; }
.info-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-muted); color: var(--forest); }
.info-icon svg { width: 22px; }
.leader + .leader { margin-top: 12px; }
.leader-name { margin: 0; color: var(--ink); font-weight: 600; }
.leader-role { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.data-section {
  padding: 34px 40px 38px;
  border-bottom: 1px solid var(--line);
}

.section-muted { background: #faf9f5; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading .section-kicker { margin-bottom: 7px; }
.section-heading h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  font-weight: 600;
}

.period-badge, .tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--forest);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

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

.metric-card, .compact-stat, .signal-card {
  min-width: 0;
  border: 1px solid #dedbd2;
  border-radius: 9px;
  background: var(--surface);
}

.metric-card {
  display: flex;
  flex-direction: column;
  min-height: 126px;
  padding: 18px;
}

.metric-label, .signal-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.metric-value {
  margin: 13px 0 4px;
  color: var(--forest);
  font-size: clamp(19px, 2vw, 25px);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.metric-value.is-negative { color: var(--danger); }
.metric-delta { margin-top: auto; color: var(--muted); font-size: 11px; }
.section-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.data-empty { margin: 0; padding: 16px 18px; border-radius: 8px; background: var(--surface-muted); color: var(--muted); font-size: 13px; }

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

.compact-stat {
  display: grid;
  gap: 5px;
  padding: 18px 20px;
}

.compact-stat strong {
  color: var(--forest);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.compact-stat.is-alert { border-color: #eccdc5; background: var(--danger-bg); }
.compact-stat.is-alert strong { color: var(--danger); }
.regime-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.regime-label { color: var(--muted); font-size: 13px; }

.disclosure {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.disclosure summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--forest);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}

.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: "+"; margin-left: auto; font-size: 20px; font-weight: 400; }
.disclosure[open] summary::after { content: "−"; }
.disclosure summary:focus-visible { outline: 3px solid rgba(184, 92, 56, .35); outline-offset: 3px; border-radius: 3px; }
.rows-list, .event-list, .relation-list { display: grid; gap: 1px; background: var(--line); }
.data-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 11px 12px; background: var(--surface); font-size: 12px; }
.data-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }

.signal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.signal-card { padding: 20px; }
.signal-value { display: block; margin: 8px 0 3px; color: var(--forest); font-family: "Cormorant Garamond", Georgia, serif; font-size: 40px; line-height: 1; }
.signal-caption { min-height: 40px; margin: 0; color: var(--muted); font-size: 12px; }
.signal-disclosure { margin-bottom: -8px; }
.event-list { background: transparent; }
.event-item { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.event-link { color: var(--forest); font-size: 12px; font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }

.relation-stats { display: flex; gap: 10px; }
.relation-stat { min-width: 126px; display: flex; align-items: baseline; gap: 8px; padding: 13px 16px; border: 1px solid #dedbd2; border-radius: 8px; background: var(--surface); }
.relation-stat strong { color: var(--forest); font-size: 22px; font-variant-numeric: tabular-nums; }
.relation-stat span { color: var(--muted); font-size: 12px; }
.relation-item { padding: 13px 14px; background: var(--surface); }
.relation-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.relation-top strong { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.relation-meta { display: block; margin: 4px 0 0 74px; color: var(--muted); font-size: 11px; }

.risk-section { padding: 36px 40px 40px; background: #faf9f5; }
.risk-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.risk-heading h3 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 32px; font-weight: 600; }
.risk-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.summary-item { padding: 6px 10px; border-radius: 999px; background: #efeee9; color: var(--muted); font-size: 12px; font-weight: 600; }
.summary-item.is-danger { background: var(--danger-bg); color: var(--danger); }
.summary-item.is-clear { background: var(--success-bg); color: var(--success); }
.risk-list { display: grid; gap: 10px; }
.risk-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 13px; padding: 16px 18px; border: 1px solid #dedcd5; border-radius: 8px; background: #f3f2ee; }
.risk-item.is-danger { border-color: #eccdc5; background: var(--danger-bg); }
.risk-item.is-clear { border-color: #cadfce; background: var(--success-bg); }
.risk-symbol { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; color: var(--muted); font-size: 14px; font-weight: 600; }
.risk-item.is-danger .risk-symbol { color: var(--danger); }
.risk-item.is-clear .risk-symbol { color: var(--success); }
.risk-item strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 14px; }
.risk-item p { margin: 0; color: #5d5d57; font-size: 13px; }
.factor-status { padding: 4px 8px; border-radius: 5px; color: var(--muted); background: rgba(255,255,255,.62); font-size: 11px; font-weight: 600; white-space: nowrap; }
.risk-item.is-danger .factor-status { color: var(--danger); }
.risk-item.is-clear .factor-status { color: var(--success); }
.risk-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; }

.process-section { padding: 88px 0 96px; background: var(--forest); color: #e5e8e4; }
.process-section .section-kicker { color: #d38361; }
.process-section h2 { max-width: 640px; color: #fff; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 42px; background: rgba(255,255,255,.18); }
.step { padding: 30px; background: var(--forest); }
.step > span { color: #d38361; font-family: "Cormorant Garamond", Georgia, serif; font-size: 30px; }
.step h3 { margin-top: 22px; color: #fff; }
.step p { margin-bottom: 0; color: #bac3bc; font-size: 14px; }

.site-footer { padding: 34px 0; background: var(--forest); color: #b8c2ba; border-top: 1px solid rgba(255,255,255,.12); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 48px; }
.footer-inner p { margin: 0; }
.footer-inner a { color: #fff; text-underline-offset: 3px; }
.disclaimer { max-width: 680px; text-align: right; font-size: 11px; color: #96a298; }

@media (max-width: 900px) {
  .hero { padding-top: 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .details-grid { grid-template-columns: 1fr 1fr; }
  .detail-item:nth-child(2) { border-right: 0; }
  .detail-item:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .info-columns, .steps { grid-template-columns: 1fr; }
  .info-block:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .signal-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; gap: 12px; }
  .disclaimer { text-align: left; }
}

@media (max-width: 600px) {
  .container { width: min(calc(100% - 32px), var(--container)); }
  .header-inner { min-height: 72px; }
  .brand-role, .brand-divider, .header-label { display: none; }
  .brand-name { font-size: 25px; }
  .hero { padding: 56px 0 52px; }
  h1 { font-size: 48px; }
  .hero-text { font-size: 16px; }
  .search-panel { padding: 24px 20px; }
  .input-row { grid-template-columns: 1fr; }
  button { width: 100%; }
  .result-section { padding-bottom: 64px; }
  .empty-state { min-height: 260px; align-items: flex-start; flex-direction: column; padding: 28px 24px; }
  .empty-state h2 { font-size: 29px; }
  .company-heading { flex-direction: column; padding: 28px 24px 24px; }
  .details-grid { grid-template-columns: 1fr; }
  .detail-item, .detail-item:nth-child(2), .detail-item:last-child { grid-column: auto; min-height: 88px; padding: 20px 24px; border-right: 0; border-top: 1px solid var(--line); }
  .detail-item:first-child { border-top: 0; }
  .info-block { padding: 26px 24px; }
  .data-section { padding: 28px 24px 30px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .metric-grid, .tax-summary, .signal-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .relation-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .relation-stat { min-width: 0; }
  .data-row { grid-template-columns: 1fr; gap: 4px; }
  .data-row strong { white-space: normal; }
  .relation-top { align-items: flex-start; flex-direction: column; }
  .relation-meta { margin-left: 0; }
  .risk-section { padding: 28px 24px 30px; }
  .risk-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .risk-summary { justify-content: flex-start; }
  .risk-item { grid-template-columns: auto minmax(0, 1fr); }
  .factor-status { grid-column: 2; justify-self: start; }
  .process-section { padding: 64px 0 72px; }
  .steps { margin-top: 30px; }
  .step { padding: 28px 8px 28px 0; }
}

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