:root {
  --ink: #1f2933;
  --muted: #616e7c;
  --line: #cbd2d9;
  --band: #f5f7fa;
  --accent: #1f6feb;
}

* { box-sizing: border-box; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  margin: 0 auto;
  padding: 24px;
  max-width: 1100px;
  line-height: 1.4;
}

h1 { margin: 0 0 4px; font-size: 1.8rem; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }

.crumbs { font-size: 0.85rem; margin-bottom: 16px; color: var(--muted); }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { margin: 0 6px; color: var(--line); }
.crumbs .current { color: var(--ink); font-weight: 600; }

header { margin-bottom: 16px; }
.back { font-size: 0.85rem; color: var(--accent); text-decoration: none; }
.back:hover { text-decoration: underline; }

.warnings {
  border: 1px solid #f0b429;
  background: #fffbea;
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
}
.warnings ul { margin: 0; padding-left: 20px; }
.warnings li { font-size: 0.85rem; }

.description { margin-bottom: 20px; }
.description p { margin: 0 0 6px; }
.description .source {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
}

.company-info { margin-bottom: 20px; }
.company-card {
  border: 1px solid var(--line);
  background: var(--band);
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 8px;
}
.company-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 4px;
  color: var(--accent);
}
.company-detail {
  font-size: 0.85rem;
  margin: 2px 0;
  color: var(--muted);
}
.company-detail a { color: var(--accent); text-decoration: none; }
.company-detail a:hover { text-decoration: underline; }
.company-desc {
  font-size: 0.82rem;
  margin: 6px 0 0;
  font-style: italic;
  color: var(--muted);
}
.company-fictitious {
  font-size: 0.82rem;
  color: #b91c1c;
  font-weight: 600;
  margin: 0 0 10px;
}

table.estimate {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.92rem;
}

table.estimate th,
table.estimate td {
  border: 1px solid var(--line);
  padding: 7px 9px;
  vertical-align: top;
}

table.estimate thead th {
  background: var(--band);
  font-weight: 600;
  text-align: left;
}

table.estimate th.num,
table.estimate td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  width: 1%;
}

.description-col { width: 40%; }
.time-col { width: 1%; white-space: nowrap; font-size: 0.82rem; color: var(--muted); }
.detail { display: block; font-size: 0.78rem; color: var(--muted); }

.timeline { margin-bottom: 24px; }
.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.timeline-row {
  display: grid;
  grid-template-columns: minmax(220px, 38%) 1fr;
  gap: 12px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-label { font-size: 0.85rem; }
.timeline-label a { color: var(--accent); text-decoration: none; }
.timeline-label a:hover { text-decoration: underline; }
.timeline-track {
  position: relative;
  height: 18px;
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.timeline-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  background: var(--accent);
  border-radius: 2px;
  min-width: 3px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

tr.child td { background: var(--band); font-weight: 600; }
tr.child a { color: var(--accent); text-decoration: none; }
tr.child a:hover { text-decoration: underline; }
tr.child .detail { font-weight: 400; }

.summary { border-top: 2px solid var(--ink); padding-top: 12px; max-width: 420px; margin-left: auto; }
.summary dl { margin: 0; }
.summary .line { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-variant-numeric: tabular-nums; }
.summary .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; }
.summary .grand dt { color: var(--ink); }

.empty { color: var(--muted); font-style: italic; }

footer { margin-top: 32px; font-size: 0.75rem; color: var(--muted); }

@media print {
  body { max-width: none; padding: 0; font-size: 11px; }
  .no-print { display: none !important; }
  table.estimate { font-size: 10px; }
  table.estimate th, table.estimate td { padding: 4px 6px; }
  .timeline { page-break-inside: avoid; }
  .timeline-row { grid-template-columns: minmax(160px, 34%) 1fr; }
  tr.child td { background: #eee; }
  .summary { max-width: none; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 16mm; }
}
