.living-report {
  margin-block-start: clamp(34px, 5vw, 68px);
  padding-block-start: 23px;
  border-top: 2px solid var(--green);
  scroll-margin-block-start: 15px;
}

.living-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-block-end: 16px;
}

.living-heading h2 { font-size: clamp(24px, 4vw, 34px); font-weight: 740; letter-spacing: -.052em; }
.living-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.living-actions :is(button, a) {
  min-height: 42px;
  padding: 6px 13px;
  border: 1px solid #a8b6a6;
  border-radius: 4px;
  background: var(--white);
  font-weight: 730;
}
.living-actions a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.living-actions a:hover { background: #e9eee3; }
.living-actions #living-share { color: var(--white); border-color: var(--green); background: var(--green); }
.living-actions button:hover:not(:disabled) { background: #e9eee3; }
.living-actions #living-share:hover:not(:disabled) { background: var(--green-deep); }
.living-status { margin: 0; color: var(--muted); }

.living-tabs {
  display: flex;
  gap: 5px;
  margin-block-end: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #edeee4;
  width: fit-content;
  max-width: 100%;
}
.living-tabs button {
  min-height: 39px;
  padding: 5px clamp(9px, 2vw, 19px);
  border: 1px solid transparent;
  border-radius: 3px;
  font-weight: 700;
  line-height: 1.25;
  word-break: keep-all;
}
.living-tabs button[aria-pressed="true"] { color: var(--white); border-color: var(--green); background: var(--green); }
.living-tabs button[aria-pressed="false"]:hover { background: var(--white); }

.living-route-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, .92fr);
  gap: 16px;
  align-items: stretch;
}
.living-figure, .living-route-detail, .living-price-section {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--white);
}
.living-map-frame {
  display: grid;
  block-size: clamp(305px, 47vw, 510px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #e9e9dc;
}
#living-map { display: block; width: 100%; height: 100%; min-height: 0; }
.living-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px 13px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 11px;
}
.living-figure figcaption a { text-underline-offset: 3px; }
.living-legend, .living-sources { display: flex; flex-wrap: wrap; gap: 5px 13px; margin: 0; padding: 0; list-style: none; }
.living-legend li { display: flex; align-items: center; gap: 5px; color: var(--ink); font-weight: 650; }
.living-legend i, .living-legend-swatch {
  display: inline-block;
  flex: 0 0 15px;
  width: 15px;
  height: 3px;
  border-radius: 1.5px;
  background: var(--route-color, var(--green));
}

.living-route-detail, .living-price-section { padding: clamp(12px, 1.8vw, 24px); }
.living-route-detail h3, .living-price-section h3 {
  margin: 0;
  font-size: clamp(17px, 2.3vw, 21px);
  font-weight: 740;
  line-height: 1.35;
  letter-spacing: -.035em;
}
.living-data-note {
  color: var(--muted);
  font-size: 12px;
  word-break: keep-all;
  overflow-wrap: break-word;
  margin: 9px 0 12px;
}
.living-data-note:empty, .living-legend:empty, .living-sources:empty { display: none; }

.living-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.living-table th, .living-table td { padding: 10px 7px; border-bottom: 1px solid var(--line); vertical-align: top; }
.living-table :is(th, td):first-child { padding-inline-start: 0; }
.living-table :is(th, td):last-child { padding-inline-end: 0; }
.living-table thead th { font-size: 11px; font-weight: 660; color: var(--muted); }
.living-table tbody th { font-weight: 740; }
.living-table td { font-weight: 580; }
.living-table small { display: block; margin-top: 3px; color: var(--muted); font-weight: 560; }
.living-table tr.is-selected { background: #eef2e8; }
.living-route-detail .living-table { table-layout: fixed; }
.living-route-detail thead th:first-child { width: 31%; }
.living-route-detail thead th:nth-child(2), .living-route-detail thead th:nth-child(3) { width: 18%; }
.living-route-detail .living-table :is(th, td):is(:nth-child(2), :nth-child(3)) { white-space: nowrap; }
.living-route-detail td:last-child { word-break: keep-all; }
.living-route-detail th small { margin-inline-start: 14px; word-break: keep-all; }
.living-origin {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  padding: 0;
  font-weight: 740;
  text-align: left;
  word-break: keep-all;
}
.living-origin::before {
  content: '';
  flex: 0 0 8px;
  height: 8px;
  margin-top: .36em;
  border-radius: 50%;
  background: var(--route-color);
}
.living-origin:hover { text-decoration: underline; }
.living-sources { margin-top: 13px; font-size: 11px; color: var(--muted); }
.living-sources a { text-underline-offset: 3px; }
.living-route-note a { margin-left: 8px; text-underline-offset: 3px; }
.living-price-section { margin-top: 16px; }
.living-price-section .living-table { margin-top: 4px; }

.artis-share-close svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.artis-share-dialog { color: var(--ink); background: var(--white); border-color: #a8b6a6; }
.artis-share-dialog::backdrop { background: #1d2e26a8; }
.artis-share-copy, .artis-share-copy:hover { background: var(--green); }

@media (max-width: 840px) {
  .living-route-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .living-price-section { margin-top: 10px; }
}

@media (max-width: 540px) {
  .living-report { padding-block-start: 16px; }
  .living-heading { gap: 8px 9px; margin-block-end: 12px; align-items: center; }
  .living-actions :is(button, a) { padding-inline: 9px; font-size: 11px; }
  .living-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .living-tabs button { min-height: 40px; padding-inline: 4px; font-size: 12px; }
  .living-map-frame { block-size: clamp(230px, 76vw, 335px); }
  .living-table { font-size: 12px; }
  .living-table :is(th, td) { padding: 8px 5px; }
}

@media print {
  body:has(.living-report:target) { background: white; color: black; }
  body:has(.living-report:target) :is(.masthead, .page-heading, .workspace) { display: none; }
  body:has(.living-report:target) main { max-width: none; padding: 0; }
  .living-report:target { margin: 0; padding-top: 10px; }
  .living-report:target :is(.living-actions, .living-tabs) { display: none; }
  .living-route-grid { display: block; }
  .living-figure, .living-route-detail, .living-price-section { margin-bottom: 10px; break-inside: avoid; }
  .living-map-frame { block-size: 245px; }
  #living-map, .living-legend { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
