:root {
  --canvas: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #edf3f1;
  --ink: #142b3a;
  --ink-soft: #5d6e78;
  --line: #dce5e2;
  --primary: #0c7475;
  --primary-dark: #07585b;
  --primary-soft: #dff1ee;
  --blue: #3173b8;
  --blue-soft: #e8f1fb;
  --amber: #b97812;
  --amber-soft: #fff3dc;
  --red: #bd4b52;
  --red-soft: #fbe9ea;
  --purple: #7057b3;
  --purple-soft: #eee9fb;
  --shadow: 0 10px 34px rgba(20, 43, 58, 0.07);
  --radius: 17px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(12, 116, 117, 0.25);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.site-header {
  color: #fff;
  background: linear-gradient(135deg, #07585b 0%, #0b6a6b 100%);
}

.site-header__inner,
.primary-nav,
.page-frame,
.site-footer {
  width: min(calc(100% - 28px), 1180px);
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.method-link,
.print-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.print-button svg {
  font-size: 17px;
}

.primary-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  overflow-x: auto;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  scrollbar-width: none;
  backdrop-filter: blur(14px);
}

.primary-nav::-webkit-scrollbar {
  display: none;
}

.primary-nav a {
  display: flex;
  min-width: max-content;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.primary-nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  font-size: 18px;
}

.page-frame {
  min-height: calc(100vh - 230px);
  padding: 27px 0 104px;
}

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

.page-heading > div:first-child > span,
.section-title > div > span,
.privacy-panel span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.page-heading h1 {
  margin: 5px 0 6px;
  font-size: clamp(27px, 7vw, 38px);
  letter-spacing: -0.04em;
}

.page-heading p,
.section-title p,
.panel-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.page-heading__meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 11px;
}

.status-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.status-badge--neutral {
  background: #edf1f3;
  color: #53636c;
}

.status-badge--warning {
  background: var(--amber-soft);
  color: #915e0c;
}

.status-badge--danger {
  background: var(--red-soft);
  color: #9d3f45;
}

.status-badge--light {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero-panel,
.debt-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(210px, 0.55fr);
  gap: 22px;
  overflow: hidden;
  padding: 28px;
  border-radius: 22px;
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 18px 48px rgba(7, 88, 91, 0.16);
}

.hero-panel > div > span,
.debt-hero > div > span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.hero-panel > div > strong,
.debt-hero > div > strong {
  display: block;
  margin: 9px 0;
  font-size: clamp(34px, 8vw, 54px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.hero-panel > div > p,
.debt-hero > div > p,
.hero-panel aside p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.65;
}

.hero-panel aside {
  align-self: stretch;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.hero-panel aside p {
  margin-top: 13px;
}

.hero-panel--light {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.hero-panel--light > div > span,
.hero-panel--light > div > p,
.hero-panel--light aside p {
  color: var(--ink-soft);
}

.hero-panel--light > div > strong {
  color: var(--primary-dark);
}

.hero-panel--light aside {
  border-color: var(--line);
  background: var(--surface-soft);
}

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

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

.metric-card {
  min-width: 0;
  min-height: 145px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card > span,
.metric-card > p {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.metric-card > strong {
  display: block;
  overflow: hidden;
  margin: 12px 0 10px;
  color: var(--primary-dark);
  font-size: clamp(20px, 4vw, 28px);
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card > p {
  margin: 0;
}

.metric-card--warning {
  border-top-color: var(--amber);
}

.metric-card--warning > strong {
  color: var(--amber);
}

.metric-card--neutral {
  border-top-color: #80909a;
}

.metric-card--neutral > strong {
  color: #4c606b;
}

.metric-card--debt {
  border-top-color: var(--red);
}

.metric-card--debt > strong {
  color: var(--red);
}

.metric-card--info {
  border-top-color: var(--blue);
}

.metric-card--info > strong {
  color: var(--blue);
}

.metric-card--count > strong {
  color: var(--primary-dark);
}

.metric-card__period {
  font-size: clamp(25px, 5vw, 34px) !important;
}

.section-block {
  margin-top: 30px;
}

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

.section-title h2,
.panel-heading h2 {
  margin: 4px 0 4px;
  font-size: 19px;
  letter-spacing: -0.025em;
}

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

.entry-card {
  display: grid;
  min-width: 0;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.entry-card:hover {
  border-color: #b4d2ce;
  transform: translateY(-1px);
}

.entry-card__icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 22px;
}

.entry-card strong,
.entry-card b,
.entry-card p {
  display: block;
}

.entry-card p {
  margin: 4px 0 7px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.entry-card b {
  color: var(--primary-dark);
  font-size: 15px;
}

.entry-card__arrow {
  color: var(--ink-soft);
  font-size: 20px;
}

.equation-row,
.flow-chain,
.vehicle-equation {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.equation-row > div,
.flow-chain > div,
.vehicle-equation > div {
  display: flex;
  min-width: 0;
  flex: 1;
  justify-content: center;
  flex-direction: column;
  padding: 13px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.equation-row > b,
.flow-chain > b,
.vehicle-equation > b {
  display: flex;
  align-items: center;
  color: var(--ink-soft);
}

.equation-row span,
.flow-chain span,
.vehicle-equation span {
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.equation-row strong,
.flow-chain strong,
.vehicle-equation strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equation-row__result,
.flow-chain__result,
.vehicle-equation__result {
  background: var(--primary-soft) !important;
}

.equation-row__result strong,
.flow-chain__result strong,
.vehicle-equation__result strong {
  color: var(--primary-dark);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 13px;
}

.panel {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.analytics-grid .panel:last-child {
  grid-column: 1 / -1;
}

.panel--amber {
  border-color: #ecd7b5;
  background: #fffcf6;
}

.panel--child {
  border-color: #dcd3f1;
  background: #fdfcff;
}

.summary-bars {
  display: grid;
  gap: 11px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.summary-bars li > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.summary-bars strong {
  font-size: 12px;
}

.summary-bars span {
  color: var(--ink-soft);
  font-size: 10px;
  text-align: right;
}

.summary-bars i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-soft);
}

.summary-bars i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.explorer {
  padding-top: 4px;
}

.reset-button,
.pagination button,
.state-card button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 800;
}

.search-row,
.filter-details,
.result-summary,
.record-panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.search-row {
  padding: 15px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.search-field {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-soft);
}

.search-field svg {
  flex: 0 0 auto;
  font-size: 18px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.filter-details {
  border-top: 0;
}

.filter-details summary {
  min-height: 44px;
  padding: 14px 16px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

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

.filter-grid label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.filter-grid label > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.filter-grid input,
.filter-grid select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.filter-error {
  margin: 0;
  padding: 11px 15px;
  border: 1px solid #eec6c9;
  border-top: 0;
  background: var(--red-soft);
  color: #963f45;
  font-size: 12px;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-top: 0;
  background: var(--line);
}

.result-summary > div {
  padding: 14px 16px;
  background: var(--surface-soft);
}

.result-summary span,
.result-summary strong {
  display: block;
}

.result-summary span {
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.result-summary strong {
  font-size: 17px;
}

.record-panel {
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.record-list {
  padding: 0 16px;
}

.record-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.record-row > div {
  min-width: 0;
}

.record-row > div > strong,
.record-row > div > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-row > div > strong {
  font-size: 12px;
}

.record-row > div > span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.record-row__amount {
  color: var(--primary-dark);
  font-size: 16px;
  text-align: right;
  white-space: nowrap;
}

.record-row--transfer {
  grid-template-columns: minmax(130px, 0.8fr) minmax(150px, 1fr) minmax(140px, 0.8fr) auto;
}

.record-row--rent {
  grid-template-columns: minmax(120px, 0.65fr) minmax(150px, 0.9fr) minmax(200px, 1.2fr) minmax(100px, 0.6fr) auto;
}

.rent-amounts {
  display: flex;
  gap: 14px;
}

.rent-amounts span {
  white-space: nowrap !important;
}

.rent-amounts b {
  color: var(--ink);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
}

.pagination button {
  min-width: 82px;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.pagination span {
  color: var(--ink-soft);
  font-size: 11px;
}

.empty-state {
  padding: 35px 16px;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.flow-chain {
  overflow-x: auto;
}

.flow-chain > div {
  min-width: 150px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 13px;
}

.money-list {
  margin: 15px 0 0;
}

.money-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.money-list > div:last-child {
  border-bottom: 0;
}

.money-list dt {
  color: var(--ink-soft);
  font-size: 12px;
}

.money-list dt small {
  display: block;
  margin-top: 3px;
  color: #8a979e;
  font-size: 9px;
}

.money-list dd {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.money-list__total {
  margin-top: 5px;
  padding: 12px !important;
  border: 0 !important;
  border-radius: 10px;
  background: var(--surface-soft);
}

.notice {
  margin-top: 14px;
  padding: 12px 13px;
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  background: var(--amber-soft);
  color: #6f511e;
  font-size: 11px;
  line-height: 1.6;
}

.notice--danger {
  border-left-color: var(--red);
  background: var(--red-soft);
  color: #78363b;
}

.rent-path {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rent-path > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: 14px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.rent-path > div > span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
}

.rent-path > div > strong {
  margin: 5px 0;
  font-size: 14px;
}

.rent-path > div > small {
  color: var(--ink-soft);
  font-size: 10px;
}

.rent-path > b {
  display: flex;
  align-items: center;
  color: var(--primary);
}

.status-summary {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.status-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.status-summary strong {
  font-size: 14px;
}

.year-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.year-table > div {
  display: grid;
  grid-template-columns: 0.7fr 0.7fr 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.year-table > div:last-child {
  border-bottom: 0;
}

.year-table__header {
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.year-table > div:not(.year-table__header) {
  font-size: 12px;
}

.year-table > div span:nth-child(n + 3) {
  text-align: right;
}

.sub-nav {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 13px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.sub-nav a {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.sub-nav a[aria-current="page"] {
  background: var(--primary);
  color: #fff;
}

.vehicle-equation {
  margin-top: 17px;
  box-shadow: none;
}

.property-list {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.property-list article {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.property-list article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.property-list strong {
  font-size: 12px;
}

.property-list p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.debt-hero {
  align-items: center;
  background: #8e3e44;
  box-shadow: 0 18px 48px rgba(142, 62, 68, 0.15);
}

.debt-hero .status-badge {
  justify-self: end;
}

.flow-chain--debt .flow-chain__result {
  background: var(--red-soft) !important;
}

.flow-chain--debt .flow-chain__result strong {
  color: var(--red);
}

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

.status-legend article {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.status-legend p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

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

.method-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.method-card > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 900;
}

.method-card h2 {
  margin: 13px 0 6px;
  font-size: 15px;
}

.method-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.privacy-panel {
  display: grid;
  grid-template-columns: minmax(210px, 0.45fr) 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 13px;
  padding: 21px;
  border-radius: var(--radius);
  background: var(--primary-dark);
  color: #fff;
}

.privacy-panel span {
  color: #9fdcd5;
}

.privacy-panel h2 {
  margin: 6px 0 0;
  font-size: 19px;
}

.privacy-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.65;
}

.page-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.page-map a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.page-map a > svg {
  color: var(--ink-soft);
}

.page-map strong {
  font-size: 12px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 0 35px;
  color: var(--ink-soft);
  font-size: 11px;
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer span {
  margin-top: 3px;
}

.site-footer a {
  color: var(--primary-dark);
  font-weight: 800;
}

.mobile-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -10px 28px rgba(20, 43, 58, 0.08);
  backdrop-filter: blur(14px);
}

.mobile-nav a {
  display: flex;
  min-width: 0;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  border-radius: 10px;
  color: var(--ink-soft);
}

.mobile-nav small {
  overflow: hidden;
  max-width: 100%;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.state-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background: var(--canvas);
}

.state-card {
  width: min(100%, 420px);
  padding: 34px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.state-card__icon,
.loading-dot {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.loading-dot::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  content: "";
  animation: pulse 1.1s ease-in-out infinite;
}

.state-card h1 {
  margin: 17px 0 7px;
  font-size: 21px;
}

.state-card p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

@media (max-width: 767px) {
  .site-header__inner,
  .primary-nav,
  .page-frame,
  .site-footer {
    width: min(calc(100% - 24px), 100%);
  }

  .site-header__inner {
    min-height: 70px;
  }

  .brand small,
  .method-link,
  .print-button span {
    display: none;
  }

  .print-button {
    width: 42px;
    padding: 0;
  }

  .primary-nav {
    display: none;
  }

  .page-frame {
    padding-top: 22px;
    padding-bottom: 94px;
  }

  .page-heading {
    display: block;
    margin-bottom: 17px;
  }

  .page-heading__meta {
    margin-top: 11px;
  }

  .hero-panel,
  .debt-hero {
    grid-template-columns: 1fr;
    padding: 21px;
  }

  .hero-panel > div > strong,
  .debt-hero > div > strong {
    font-size: clamp(31px, 9vw, 42px);
  }

  .hero-panel aside {
    padding: 13px;
  }

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

  .metric-card {
    min-height: 134px;
    padding: 15px;
  }

  .metric-card > strong {
    font-size: clamp(18px, 5vw, 23px);
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .entry-grid,
  .analytics-grid,
  .two-column,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid .panel:last-child {
    grid-column: auto;
  }

  .entry-card {
    padding: 15px;
  }

  .equation-row,
  .flow-chain,
  .vehicle-equation {
    display: grid;
    grid-template-columns: 1fr;
  }

  .equation-row > b,
  .flow-chain > b,
  .vehicle-equation > b {
    display: none;
  }

  .flow-chain {
    overflow: visible;
  }

  .flow-chain > div {
    min-width: 0;
  }

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

  .record-row,
  .record-row--transfer,
  .record-row--rent {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
  }

  .record-row > div:nth-child(2),
  .record-row--transfer .record-row__status,
  .record-row--rent .record-row__status,
  .record-row--rent .rent-amounts {
    grid-column: 1 / -1;
  }

  .record-row__amount {
    grid-column: 2;
    grid-row: 1;
  }

  .rent-amounts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 9px;
    border-radius: 8px;
    background: var(--surface-soft);
  }

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

  .rent-path > b {
    display: none;
  }

  .year-table > div {
    grid-template-columns: 0.55fr 0.55fr 1fr 1fr;
    padding: 11px 10px;
  }

  .year-table > div:not(.year-table__header) {
    font-size: 10px;
  }

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

  .privacy-panel {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .site-footer {
    padding-bottom: 91px;
  }

  .site-footer a {
    display: none;
  }

  .mobile-nav {
    display: grid;
  }
}

@media (max-width: 359px) {
  .metric-grid,
  .metric-grid--three,
  .filter-grid,
  .rent-path,
  .status-legend,
  .page-map {
    grid-template-columns: 1fr;
  }

  .site-header__inner,
  .page-frame,
  .site-footer {
    width: calc(100% - 20px);
  }

  .brand strong {
    font-size: 16px;
  }
}

@media (min-width: 960px) {
  .analytics-grid {
    grid-template-columns: 1fr 1fr 0.8fr;
  }

  .analytics-grid .panel:last-child {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 11mm;
  }

  :root {
    --canvas: #fff;
    --surface: #fff;
    --surface-soft: #f1f1f1;
    --ink: #000;
    --ink-soft: #444;
    --line: #aaa;
  }

  body {
    background: #fff;
    font-size: 9pt;
    print-color-adjust: exact;
  }

  .site-header,
  .primary-nav,
  .mobile-nav,
  .site-footer,
  .reset-button,
  .search-row,
  .filter-details,
  .pagination {
    display: none !important;
  }

  .page-frame {
    width: 100%;
    min-height: 0;
    padding: 0;
  }

  .page-heading {
    margin-bottom: 6mm;
    padding-bottom: 4mm;
    border-bottom: 1px solid #777;
  }

  .hero-panel,
  .debt-hero,
  .metric-card,
  .panel,
  .section-block,
  .record-row,
  .method-card,
  .privacy-panel,
  .rent-path,
  .year-table {
    break-inside: avoid;
    box-shadow: none;
  }

  .hero-panel,
  .debt-hero,
  .privacy-panel {
    border: 1px solid #777;
    background: #fff;
    color: #000;
  }

  .hero-panel *,
  .debt-hero *,
  .privacy-panel * {
    color: #000 !important;
  }

  .metric-grid,
  .metric-grid--three,
  .entry-grid,
  .two-column,
  .analytics-grid,
  .method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid .panel:last-child {
    grid-column: 1 / -1;
  }

  .result-summary {
    border-radius: 10px 10px 0 0;
  }

  .record-panel {
    border-radius: 0 0 10px 10px;
  }
}
