:root {
  color-scheme: light;
  --bg: #fff;
  --panel: #fff;
  --soft: #f5f7fb;
  --soft-blue: #eef3ff;
  --ink: #17243b;
  --muted: #617188;
  --line: #e6ebf2;
  --accent: #315efb;
  --accent-dark: #244aca;
  --teal: #299c9a;
  --red: #c74859;
  --green: #315efb;
  --shadow: 0 8px 30px #162b5508;
  --bar: #becbe7;
  --overlay: #0b142977;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #080c13;
  --panel: #111925;
  --soft: #182231;
  --soft-blue: #1c2c50;
  --ink: #edf2ff;
  --muted: #a3b0c6;
  --line: #2a374a;
  --accent: #92adff;
  --accent-dark: #b3c6ff;
  --teal: #60cbc4;
  --red: #ffa0af;
  --green: #92adff;
  --shadow: none;
  --bar: #455a80;
  --overlay: #000a;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.6 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'Malgun Gothic',
    sans-serif;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
select {
  font: inherit;
  color: var(--ink);
}
button,
select,
input {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  padding: 9px 12px;
}
button {
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: var(--soft);
  border-color: var(--bar);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
button.active {
  color: var(--accent);
  background: var(--soft-blue);
  border-color: var(--accent);
}
[hidden] {
  display: none !important;
}
p {
  margin: 8px 0;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 750;
}
h1 {
  font-size: 32px;
  letter-spacing: -1.5px;
  line-height: 1.4;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 17px;
}
small {
  font-size: 14px;
}
.muted,
.table-note {
  color: var(--muted);
  font-size: 14px;
}
.table-note {
  line-height: 1.8;
  margin-top: 16px;
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 750;
  margin: 0 0 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  background: var(--panel);
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
.topbar {
  height: 76px;
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 40px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--accent);
  min-width: 182px;
  letter-spacing: -0.6px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}
.brand svg {
  width: 33px;
  height: 33px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 500;
  margin-top: 4px;
}
.header-caption {
  font-size: 14px;
  color: var(--muted);
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 22px;
  align-items: center;
}
.source-link {
  font-size: 14px;
  text-decoration: none;
  color: var(--muted);
}
.theme-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}
.theme-label select {
  border: 0;
  background: var(--soft);
  font-size: 14px;
  padding: 7px 9px;
}
.sidebar {
  position: fixed;
  left: 0;
  top: 76px;
  bottom: 0;
  width: 218px;
  z-index: 20;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 32px 18px;
  display: flex;
  flex-direction: column;
}
.nav-caption {
  font-size: 12px;
  letter-spacing: 1.8px;
  color: var(--muted);
  padding-left: 14px;
  margin-bottom: 16px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 9px;
  color: var(--muted);
}
.sidebar nav a span {
  font-size: 20px;
  width: 21px;
}
.sidebar nav a.active {
  background: var(--accent);
  color: var(--panel);
  font-weight: 750;
}
.sidebar nav a:hover {
  background: var(--soft-blue);
  color: var(--accent);
}
.nav-divider {
  border-top: 1px solid var(--line);
  margin: 15px 10px;
}
.sidebar-note {
  margin-top: auto;
  padding: 25px 12px 0;
  font-size: 13px;
  color: var(--muted);
}
.sidebar-note p {
  font-size: 14px;
  margin: 12px 0 20px;
}
.sidebar-note small {
  font-size: 13px;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 6px;
}
.mobile-nav,
.mobile-break {
  display: none;
}
main {
  max-width: 1660px;
  margin: 76px auto 0;
  padding: 28px 38px 50px 256px;
  min-width: 0;
}
footer {
  margin-left: 256px;
  margin-right: 38px;
  border-top: 1px solid var(--line);
  padding: 25px 0 40px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  gap: 20px;
}
footer small {
  margin-left: auto;
  font-size: 13px;
}
.breadcrumb {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}
.breadcrumb span {
  margin: 0 10px;
  color: var(--bar);
}
.intro-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px 16px;
  background: var(--panel);
}
.intro-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 22px;
}
.intro-top a {
  text-decoration: none;
}
.source-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  background: var(--soft);
}
.heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.heading .muted {
  margin: 10px 0;
}
.dot {
  margin: 0 6px;
  color: var(--bar);
}
.period {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.period button {
  font-size: 24px;
  line-height: 1;
  padding: 7px 10px;
}
.period input,
.period select {
  font-size: 16px;
  font-weight: 600;
  max-width: 155px;
}
.month-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 14px 0 8px;
  scrollbar-width: thin;
  margin-top: 8px;
}
.month-chips button {
  white-space: nowrap;
  font-size: 14px;
  min-width: 63px;
  padding: 6px 10px;
}
.month-chips button.active {
  background: var(--ink);
  color: var(--panel);
  border-color: var(--ink);
}
.month-chips button small {
  display: block;
  font-size: 12px;
}
.intro-hint {
  font-size: 14px;
  color: var(--accent);
  border-top: 1px solid var(--line);
  padding-top: 13px;
  margin-top: 12px;
}
.intro-hint span {
  color: var(--muted);
  margin-left: 14px;
  font-size: 14px;
}
.tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 2px 0;
  color: var(--muted);
  font-size: 14px;
}
.mode-tools {
  flex-shrink: 0;
}
.mode-tools button {
  font-size: 14px;
}
.notice {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  background: var(--soft);
  line-height: 1.8;
  margin: 12px 0 20px;
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: start;
}
.main-column,
.aside-column {
  min-width: 0;
}
.card {
  padding: 23px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 22px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.section-heading {
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-heading button,
.actions button {
  font-size: 14px;
  white-space: nowrap;
}
.section-heading p {
  margin-bottom: 0;
}
.actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.actions select,
.actions label {
  font-size: 14px;
}
.statement-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
.search-field {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  min-width: 0;
}
.search-field input {
  padding: 9px 0;
  border: 0;
  background: transparent;
  width: 100%;
  font-size: 14px;
  outline-offset: 0;
}
.search-field span {
  font-size: 22px;
  color: var(--muted);
}
.statement-tools select {
  font-size: 14px;
}
.statement-head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 0.8fr 1fr;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.statement-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 0.8fr 1fr;
  gap: 12px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  width: 100%;
  align-items: center;
  background: transparent;
}
.statement-row:hover {
  background: var(--soft);
}
.item-title {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  min-width: 0;
}
.item-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--soft-blue);
  color: var(--accent);
  border-radius: 9px;
  font-size: 16px;
}
.item-title strong {
  display: block;
  font-size: 15px;
  line-height: 1.45;
  word-break: keep-all;
}
.item-title small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  word-break: keep-all;
}
.item-price {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.item-price small {
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0;
}
.item-comparison {
  font-size: 14px;
  display: grid;
  gap: 5px;
  justify-items: center;
}
.item-comparison small {
  font-size: 12px;
  color: var(--muted);
}
.mini-track {
  width: 90%;
  height: 4px;
  background: var(--soft);
  border-radius: 3px;
  position: relative;
}
.mini-track i {
  display: block;
  height: 100%;
  background: var(--bar);
  border-radius: 3px;
  max-width: 100%;
}
.mini-track:after {
  content: '';
  position: absolute;
  left: 50%;
  top: -2px;
  height: 8px;
  width: 1px;
  background: var(--muted);
}
.higher {
  color: var(--red);
}
.lower {
  color: var(--accent);
}
.neutral {
  color: var(--muted);
}
.empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.metric-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 0;
  text-align: inherit;
}
.metric-button:hover {
  color: var(--accent);
  background: var(--soft-blue);
}
.primary-value {
  display: block;
  margin: 16px 0 6px;
  width: 100%;
}
.primary-value strong {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.3;
  color: var(--accent);
  display: block;
  white-space: nowrap;
}
.primary-value > span {
  font-size: 14px;
  color: var(--muted);
  display: block;
  margin-top: 6px;
}
.pill,
.tag {
  font-size: 13px;
  border-radius: 5px;
  background: var(--soft-blue);
  color: var(--accent);
  padding: 3px 7px;
  white-space: nowrap;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  font-size: 14px;
}
.summary-row > span {
  color: var(--muted);
}
.summary-row button {
  border: 0;
  padding: 0;
  background: transparent;
  font-weight: 650;
  font-size: 14px;
  text-align: right;
}
.total-box {
  background: var(--soft);
  padding: 16px;
  border-radius: 9px;
  margin: 10px 0 16px;
}
.total-box p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 7px;
}
.total-box strong {
  font-size: 24px;
  letter-spacing: -0.5px;
}
.total-box strong small {
  font-size: 15px;
}
.total-box #change {
  margin: 7px 0 0;
}
.wide-button {
  width: 100%;
  font-size: 14px;
}
.breakdown {
  display: grid;
  gap: 0;
}
.breakdown button {
  border: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  text-align: left;
}
.breakdown button:last-child {
  border-bottom: 0;
}
.breakdown span {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.breakdown strong {
  font-size: 20px;
  display: block;
  margin: 5px 0 0 14px;
}
.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.blue {
  background: var(--accent);
}
.teal {
  background: var(--teal);
}
.gray {
  background: var(--muted);
}
.building-art {
  font-size: 32px;
  color: var(--accent);
}
.apartment-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 10px;
  margin: 0;
}
.apartment-facts div {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.apartment-facts dt {
  font-size: 13px;
  color: var(--muted);
}
.apartment-facts dd {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 650;
}
.types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 16px 0;
}
.type {
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 12px;
  text-align: left;
}
.type b {
  font-size: 14px;
}
.type small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 8px;
}
.type strong {
  display: block;
  font-size: 20px;
  letter-spacing: -0.7px;
  color: var(--accent);
}
.formula {
  font-size: 14px;
  color: var(--muted);
}
details {
  font-size: 14px;
  border-top: 1px solid var(--line);
  padding: 14px 0 0;
  margin-top: 16px;
}
summary {
  cursor: pointer;
  color: var(--muted);
  list-style-position: inside;
}
.mode-tools {
  border: 0;
  padding: 0;
  margin: 0;
}
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 14px;
}
th,
td {
  text-align: center;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
th {
  font-size: 13px;
  color: var(--muted);
  background: var(--soft);
  font-weight: 600;
}
tfoot td,
.sum td {
  font-weight: 750;
  background: var(--soft-blue);
}
td .cell-link {
  border: 0;
  padding: 3px 0;
  background: transparent;
  border-radius: 3px;
  color: inherit;
  font: inherit;
  white-space: inherit;
  max-width: 100%;
  text-align: inherit;
}
td .cell-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.chart {
  height: 190px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 22px 0 14px;
  border-bottom: 1px solid var(--line);
  padding: 0 5px;
  overflow-x: auto;
}
.bar-slot {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 4px 4px 0 0;
}
.bar-slot:hover {
  background: var(--soft-blue);
}
.bar {
  background: var(--bar);
  width: 65%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.bar.current {
  background: var(--accent);
}
.bar-slot small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  padding: 5px 0;
}
.bar-value {
  font-size: 12px;
  white-space: nowrap;
  margin-bottom: 6px;
  color: var(--muted);
}
.chart.all .bar-slot {
  flex: 0 0 52px;
  min-width: 52px;
}
.source {
  padding: 26px;
  margin-top: 25px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.9;
}
.source h2 {
  color: var(--ink);
}
.source a {
  color: var(--accent);
}
.source-notice {
  margin-top: 24px;
}
.source-notice strong {
  color: var(--ink);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.section-nav {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 16px 0 22px;
}
.section-nav a {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 14px;
  white-space: nowrap;
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
}
.section-nav a:hover {
  background: var(--soft-blue);
  color: var(--accent);
}
.back-home {
  display: inline-block;
  margin-top: 22px;
  color: var(--accent);
  font-size: 14px;
}
/* A focused comparison, opened by any monetary value. */
.compare-dialog {
  width: min(1000px, calc(100vw - 60px));
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 25px 100px #0003;
  overflow: auto;
}
.compare-dialog::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(3px);
}
.dialog-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
}
.dialog-header h2 {
  font-size: 22px;
}
.dialog-close {
  width: 36px;
  height: 36px;
  font-size: 23px;
  padding: 0;
  flex-shrink: 0;
}
.dialog-body {
  padding: 22px 28px 28px;
}
.dialog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.dialog-controls label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 140px;
}
.dialog-controls select {
  font-size: 14px;
  max-width: 100%;
}
.dialog-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.dialog-summary > div {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  font-size: 14px;
  color: var(--muted);
}
.dialog-summary strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.7px;
  line-height: 1.5;
  color: var(--ink);
  margin-top: 5px;
}
.dialog-summary > div:first-child {
  background: var(--soft-blue);
  border-color: var(--soft-blue);
}
.dialog-summary > div:first-child strong {
  color: var(--accent);
}
.dialog-note {
  font-size: 14px;
  line-height: 1.9;
  margin: 18px 0;
  color: var(--muted);
}
.focus-bars {
  display: grid;
  gap: 5px;
  margin: 20px 0;
}
.focus-row {
  display: grid;
  grid-template-columns: 24px minmax(160px, 1.3fr) 2fr 110px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid transparent;
}
.focus-row.home {
  background: var(--soft-blue);
  color: var(--accent);
  font-weight: 700;
}
.focus-row.focus {
  border-color: var(--accent);
}
.focus-name small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.focus-row > strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.focus-track {
  height: 10px;
  background: var(--soft);
  position: relative;
  border-radius: 3px;
  overflow: hidden;
}
.focus-track i {
  height: 100%;
  display: block;
  background: var(--bar);
  position: absolute;
  left: 0;
  min-width: 1px;
  border-radius: 3px;
}
.home .focus-track i {
  background: var(--accent);
}
.focus-track.bipolar:after {
  content: '';
  width: 1px;
  background: var(--muted);
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
}
.focus-track .negative {
  background: var(--teal);
}
.dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.dialog-footer button,
.dialog-footer a {
  font-size: 14px;
}
.dialog-footer a {
  color: var(--accent);
}
.dialog-status {
  font-size: 14px;
  color: var(--muted);
}
.dialog-loading {
  padding: 45px 10px;
  text-align: center;
  color: var(--muted);
}
.body-modal {
  overflow: hidden;
}
.dialog-table th {
  white-space: normal;
}
.dialog-table td:last-child {
  white-space: normal;
  min-width: 180px;
  color: var(--muted);
  font-size: 13px;
}
@media (min-width: 1700px) {
  main {
    padding-left: 38px;
    margin-left: 218px;
  }
  footer {
    margin-left: 256px;
  }
}
@media (max-width: 1280px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 275px;
    gap: 16px;
  }
  main {
    padding-left: 240px;
    padding-right: 22px;
  }
  .card {
    padding: 18px;
  }
  .statement-row,
  .statement-head {
    gap: 8px;
    grid-template-columns: minmax(0, 1.2fr) 0.9fr 1fr;
  }
  .item-icon {
    display: none;
  }
  .primary-value strong {
    font-size: 32px;
  }
  .header-caption {
    display: none;
  }
  .item-title strong {
    font-size: 14px;
  }
  .item-price {
    font-size: 16px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 185px;
    padding: 25px 12px;
  }
  .brand {
    min-width: 150px;
  }
  .topbar {
    padding: 0 22px;
  }
  main {
    padding: 25px 22px 40px 207px;
  }
  footer {
    margin-left: 207px;
  }
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .aside-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    order: -1;
  }
  .aside-column .card {
    margin: 0;
  }
  .average-card {
    grid-row: span 2;
  }
  .aside-column #types-section {
    grid-column: 1/-1;
  }
  .types {
    grid-template-columns: repeat(3, 1fr);
  }
  .intro-hint span {
    display: block;
    margin: 6px 0 0;
  }
  .item-icon {
    display: grid;
  }
  .item-title strong {
    font-size: 15px;
  }
  .main-column {
    margin-top: 6px;
  }
  .apartment-card .section-heading {
    margin-bottom: 10px;
  }
  .apartment-facts {
    gap: 10px;
  }
  .compare-dialog {
    width: calc(100vw - 35px);
  }
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  .topbar {
    height: 64px;
    padding: 0 16px;
  }
  .brand {
    font-size: 18px;
    min-width: auto;
  }
  .brand svg {
    width: 26px;
    height: 26px;
  }
  .brand small {
    font-size: 12px;
    letter-spacing: 1px;
  }
  .top-actions {
    gap: 8px;
  }
  .source-link {
    display: none;
  }
  .theme-label select {
    font-size: 14px;
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    z-index: 25;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  .mobile-nav a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 9px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--muted);
  }
  .mobile-nav a.active {
    background: var(--soft-blue);
    color: var(--accent);
    font-weight: 700;
  }
  main {
    margin-top: 64px;
    padding: 20px 16px 35px;
  }
  footer {
    margin: 0 16px;
    padding-bottom: 95px;
    flex-wrap: wrap;
    gap: 8px;
  }
  footer > span {
    font-size: 13px;
  }
  .breadcrumb {
    margin-bottom: 16px;
  }
  .intro-card {
    padding: 18px;
  }
  .intro-top {
    font-size: 12px;
    gap: 8px;
    margin-bottom: 16px;
  }
  .source-chip {
    padding: 4px 7px;
  }
  h1 {
    font-size: 27px;
    letter-spacing: -1.2px;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .heading .muted {
    font-size: 14px;
  }
  .period {
    align-self: flex-end;
  }
  .period input,
  .period select {
    font-size: 14px;
  }
  .month-chips {
    margin-top: 5px;
  }
  .intro-hint {
    font-size: 14px;
  }
  .intro-hint span {
    font-size: 13px;
  }
  .tools {
    align-items: flex-start;
    font-size: 13px;
  }
  #sync-state {
    overflow-wrap: anywhere;
  }
  .notice {
    font-size: 14px;
    padding: 10px 12px;
  }
  .aside-column {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .average-card {
    grid-column: 1/-1;
    grid-row: auto;
  }
  .primary-value strong {
    font-size: 39px;
  }
  .summary-row {
    padding: 12px 0;
  }
  .total-box {
    padding: 14px;
  }
  .aside-column #types-section {
    grid-column: 1/-1;
  }
  .apartment-facts {
    grid-template-columns: 1fr;
  }
  .apartment-facts div {
    padding-top: 8px;
  }
  .apartment-facts dd {
    font-size: 14px;
  }
  .building-art {
    display: none;
  }
  .apartment-card .muted {
    font-size: 13px;
  }
  .apartment-card .table-note {
    display: none;
  }
  h2 {
    font-size: 20px;
  }
  .aside-column .section-heading h2 {
    font-size: 17px;
  }
  .breakdown strong {
    font-size: 18px;
    margin-left: 0;
  }
  .breakdown span {
    font-size: 13px;
    flex-wrap: wrap;
  }
  .types {
    grid-template-columns: repeat(3, 1fr);
  }
  .type {
    padding: 10px 8px;
  }
  .type strong {
    font-size: 18px;
  }
  .type small {
    font-size: 12px;
  }
  .card {
    padding: 17px;
    border-radius: 12px;
    margin-bottom: 16px;
  }
  .section-heading {
    gap: 10px;
  }
  .section-heading button {
    font-size: 13px;
    padding: 7px 9px;
  }
  .section-heading .muted {
    font-size: 13px;
  }
  .statement-tools {
    gap: 6px;
    margin-top: 15px;
  }
  .statement-tools select {
    padding: 9px 6px;
    font-size: 13px;
  }
  .search-field input {
    font-size: 13px;
  }
  .statement-head {
    grid-template-columns: 1.15fr 0.8fr 0.8fr;
    font-size: 12px;
    gap: 8px;
  }
  .statement-head span:last-child {
    font-size: 12px;
  }
  .statement-row {
    grid-template-columns: 1.15fr 0.8fr 0.8fr;
    gap: 8px;
    padding: 16px 0;
  }
  .item-icon {
    display: none;
  }
  .item-title strong {
    font-size: 14px;
  }
  .item-title small {
    font-size: 12px;
  }
  .item-price {
    font-size: 15px;
  }
  .item-price small {
    font-size: 12px;
  }
  .item-comparison {
    font-size: 13px;
  }
  .item-comparison small {
    font-size: 12px;
  }
  .chart {
    gap: 6px;
  }
  .bar-slot {
    min-width: 22px;
  }
  .bar-value {
    display: none;
  }
  .source {
    padding: 18px;
    font-size: 14px;
  }
  .compare-dialog {
    width: 100%;
    max-width: 100%;
    height: 94dvh;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    box-sizing: border-box;
  }
  .dialog-header {
    padding: 17px 18px;
  }
  .dialog-header h2 {
    font-size: 22px;
  }
  .dialog-body {
    padding: 18px;
  }
  .dialog-controls {
    gap: 8px;
  }
  .dialog-controls label {
    min-width: 125px;
  }
  .dialog-summary {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dialog-summary > div:last-child {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .dialog-summary > div {
    padding: 13px;
    font-size: 13px;
  }
  .dialog-summary strong {
    font-size: 21px;
  }
  .dialog-summary > div:last-child strong {
    font-size: 20px;
    margin: 0;
  }
  .focus-row {
    grid-template-columns: 18px minmax(0, 1fr) 92px;
    gap: 8px;
    padding: 12px 8px;
  }
  .focus-track {
    grid-column: 2;
    grid-row: 2;
    height: 7px;
  }
  .focus-name {
    min-width: 0;
    font-size: 14px;
  }
  .focus-row > strong {
    font-size: 14px;
    grid-column: 3;
    grid-row: 1/3;
  }
  .focus-name small {
    font-size: 12px;
  }
  .dialog-note {
    font-size: 14px;
  }
  .dialog-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .table-note {
    font-size: 13px;
  }
  .mobile-break {
    display: block;
  }
  .dialog-table {
    min-width: 620px;
  }
  html {
    scroll-padding-top: 80px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .workspace-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .main-column,
  .aside-column {
    display: contents;
  }
  .workspace-grid .card {
    width: 100%;
    margin: 0 0 16px;
  }
  .average-card {
    order: -3;
  }
  .statement-card {
    order: -2;
  }
  #composition-section {
    order: 0;
  }
  #types-section {
    order: 1;
  }
  #history-section {
    order: 2;
  }
  #detail-section {
    order: 3;
  }
  .apartment-card {
    order: 4;
  }
  #reconciliation {
    order: 5;
  }
  .apartment-facts {
    grid-template-columns: 1fr 1fr;
  }
  .apartment-card .table-note {
    display: block;
  }
}

.detail-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--muted);
  margin: 15px 0 0;
}
.detail-toggle input {
  accent-color: var(--accent);
}
.item-comparison.higher .mini-track i {
  background: var(--red);
}
.item-comparison.lower .mini-track i {
  background: var(--accent);
}
.dialog-summary strong.higher {
  color: var(--red);
}
.dialog-summary strong.lower {
  color: var(--accent);
}

@media (max-width: 760px) {
  .item-title strong {
    font-size: 14px;
  }
  .item-title small {
    font-size: 13px;
  }
  .item-price {
    font-size: 16px;
  }
  .item-comparison small {
    font-size: 12px;
  }
  .focus-name {
    font-size: 14px;
  }
  .focus-name small {
    font-size: 12px;
  }
}

/* v0.7.1: shared apartment information, separate from historical fee data */
.profile-mobile {
  display: none;
}
.sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar nav,
.sidebar-note,
.profile-panel {
  flex-shrink: 0;
}
.profile-panel {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 22px;
}
.profile-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.profile-title h2 {
  font-size: 18px;
}
.profile-title .eyebrow {
  font-size: 12px;
  margin: 0 0 5px;
  letter-spacing: 1.4px;
}
.profile-title button {
  font-size: 13px;
  padding: 6px 8px;
  white-space: nowrap;
}
.profile-name {
  font-size: 14px;
  font-weight: 650;
  margin: 14px 0 7px;
  overflow-wrap: anywhere;
}
.profile-source {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-group {
  margin-top: 22px;
}
.profile-group h3 {
  font-size: 13px;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  margin: 0;
}
.profile-group dl {
  margin: 0;
}
.profile-group dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.5;
}
.profile-group dt {
  color: var(--muted);
}
.profile-group dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.profile-group dd.profile-pending {
  font-weight: 400;
  color: var(--muted);
}
.profile-existing {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.profile-group dl > .profile-wide {
  display: block;
}
.profile-wide dd {
  text-align: left;
  margin-top: 5px;
  line-height: 1.8;
  font-weight: 400;
}
.profile-date {
  font-size: 13px;
  color: var(--ink);
  margin-top: 20px;
}
.profile-help,
.profile-warning,
.profile-basis {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.profile-warning {
  padding: 10px;
  background: var(--soft);
  border-radius: 8px;
}
.profile-basis a {
  color: var(--accent);
}
.sidebar-note {
  margin-top: 26px;
  padding-top: 20px;
}
.profile-mobile > summary {
  font-weight: 650;
  color: var(--ink);
  padding: 2px 0;
}
.profile-mobile > summary span {
  float: right;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
}
@media (min-width: 761px) {
  .sidebar {
    width: 264px;
    padding: 25px 20px;
  }
  .brand {
    min-width: 226px;
  }
  main {
    margin-left: 0;
    padding-left: 290px;
  }
  footer {
    margin-left: 290px;
  }
}
@media (min-width: 1700px) {
  main {
    margin-left: 264px;
    padding-left: 38px;
  }
  footer {
    margin-left: 302px;
  }
}
@media (max-width: 760px) {
  .profile-mobile {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 15px 17px;
    background: var(--panel);
    margin: 14px 0;
  }
  .profile-mobile[open] > summary {
    margin-bottom: 15px;
  }
  .profile-mobile .profile-host {
    margin-top: 20px;
  }
  .profile-group dl > div {
    font-size: 14px;
  }
  .profile-mobile .profile-title h2 {
    font-size: 20px;
  }
  .profile-mobile .profile-source {
    font-size: 14px;
  }
  .profile-mobile .profile-help,
  .profile-mobile .profile-basis,
  .profile-mobile .profile-warning {
    font-size: 14px;
  }
  .profile-mobile .profile-name {
    font-size: 15px;
  }
  .profile-mobile .profile-group {
    margin-top: 20px;
  }
}
.sidebar nav a.reserve-menu > span:last-child {
  width: auto;
  flex: 1;
  display: block;
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
  white-space: normal;
  min-width: 0;
}
@media (max-width: 760px) {
  .mobile-nav a {
    font-size: 13px;
    padding: 9px 4px;
  }
}
