/* Shared PC / phone layout. Full KRW amounts remain readable and unabridged. */
:root {
  --ink: #203336;
  --muted: #637578;
  --line: #e1e9e8;
  --paper: #f3f6f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}
body { -webkit-font-smoothing: antialiased; }
h1, h2, h3, button, label { word-break: keep-all; }
h1 { font-size: 1.8rem; letter-spacing: -.045em; font-weight: 750; }
h2 { font-size: 1.12rem; letter-spacing: -.025em; }
h3 { letter-spacing: -.02em; }
.muted, .sub, p { word-break: keep-all; overflow-wrap: break-word; }
header { height: 76px; padding-inline: 32px; }
.shell { max-width: 1680px; grid-template-columns: 200px minmax(0, 1fr); }
aside { background: #edf3f1; padding: 28px 14px; }
nav { position: sticky; top: 24px; }
nav button { border-radius: 10px; }
main { padding: 32px clamp(20px, 3vw, 44px) 64px; }
.heading { margin-bottom: 24px; }
.heading .muted { font-size: .92rem; }
.eyebrow { font-size: .7rem; letter-spacing: .18em; }
button { font-size: .9rem; border-radius: 9px; }
.panel { border-radius: 16px; padding: 26px; margin-bottom: 24px; box-shadow: 0 3px 14px #193c3210; }
.panel-head { gap: 16px; }
.notice { border-radius: 10px; line-height: 1.8; }

/* One headline and four supporting amounts, instead of five narrow cards. */
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.metric { padding: 20px; border-radius: 13px; container-type: inline-size; }
.metric strong { font-size: clamp(1rem, 8cqi, 1.6rem); letter-spacing: -.035em; line-height: 1.35; margin-top: 12px; white-space: nowrap; overflow-wrap: normal; word-break: normal; font-variant-numeric: tabular-nums lining-nums; }
.metric em { font-size: .72rem; margin-left: 6px; }
.metric.highlight { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 24px 26px; background: #173f3e; }
.metric.highlight span { font-size: .94rem; }
.metric.highlight strong { font-size: clamp(1.65rem, 3vw, 2.2rem); margin: 0; }
.metric.highlight em { font-size: .9rem; }
.company-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; padding: 4px 0 16px; }
.company-metrics > div { min-width: 0; padding: 16px 0; container-type: inline-size; }
.company-metrics strong { font-size: clamp(1rem, 7cqi, 1.65rem); line-height: 1.4; margin-top: 6px; white-space: nowrap; overflow-wrap: normal; letter-spacing: -.03em; }
.num, .amount, .money, .trade-amounts > span, .expense-summary strong { white-space: nowrap; overflow-wrap: normal; word-break: normal; font-variant-numeric: tabular-nums lining-nums; }
.table-wrap { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; overflow: auto; overscroll-behavior-x: contain; }
table { font-size: .88rem; }
th { font-size: .79rem; font-weight: 600; color: #607371; background: #f3f7f5; }
th, td { padding: 14px 16px; }
td.num { font-weight: 550; letter-spacing: -.02em; }
tbody tr:hover { background: #f8fbfa; }
.table-wrap:focus-visible, .chart-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.list-row { gap: 16px; }
.list-row > :first-child { min-width: 0; }
.list-row .amount { flex-shrink: 0; font-weight: 650; font-size: .92rem; }
.list-row .sub { font-weight: 400; }
.chart-readout { min-width: 0; overflow-x: auto; }
.chart-readout > strong, .chart-readout > span { white-space: nowrap; }
.chart-readout strong { font-size: 1.08rem; letter-spacing: -.025em; }
.chart-unknown, .expense-label { overflow-wrap: normal; word-break: normal; }
.expense-label > span { font-variant-numeric: tabular-nums; }
.expense-summary > span { min-width: 190px; }
.trade-amounts > span { display: inline-block; }
.annual-chart { background: #fbfdfc; border-radius: 12px; padding: 20px 16px; }
.chart-year-controls { gap: 6px; }
.chart-year-controls button { font-size: .82rem; }
details > summary { padding: 12px 0; font-size: .9rem; font-weight: 600; }
.construction-filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 14px; padding: 16px; border-radius: 10px; background: #f5f8f7; }
.construction-filters label { flex: 1 1 160px; margin: 0; max-width: 240px; font-size: .8rem; }
.construction-filters input { margin-top: 6px; }
.construction-bars { display: grid; gap: 16px; margin: 24px 0; }
.construction-row { display: grid; grid-template-columns: 62px minmax(30px, 1fr) max-content; gap: 16px; align-items: center; font-size: .88rem; }
.construction-track { height: 10px; border-radius: 6px; background: #eaf1ee; overflow: hidden; }
.construction-track i { display: block; height: 100%; background: #258677; border-radius: inherit; }
.construction-row .num { font-weight: 600; }
.preview-page { background: #eaf0ee; }
.site-picker-fields { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(240px, 2fr); gap: 16px; }
.site-picker-fields label { margin-top: 0; font-size: .82rem; }
.site-picker-fields select { min-height: 48px; font-weight: 600; }
.outstanding-panels { align-items: start; }
.outstanding-total { background: #f0f6f3; border-radius: 10px; padding: 16px; margin-bottom: 12px; container-type: inline-size; }
.outstanding-total > span { display: block; color: var(--muted); font-size: .8rem; }
.outstanding-total > strong { display: block; margin-top: 5px; font-size: clamp(1.1rem, 7cqi, 1.65rem); letter-spacing: -.03em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.outstanding-list { max-height: 380px; overflow: auto; overscroll-behavior: contain; padding-right: 5px; }
.outstanding-list:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.payable-group { margin: 0; border-bottom: 1px solid var(--line); }
.payable-group:last-child { border-bottom: 0; }
.payable-group > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 16px 0; color: var(--ink); }
.payable-group > summary::before { content: '+'; color: var(--accent); width: 12px; font-size: 1.1rem; }
.payable-group[open] > summary::before { content: '−'; }
.payable-group > summary > span { flex: 1; min-width: 100px; }
.payable-group small { display: block; font-size: .76rem; color: var(--muted); font-weight: 400; }
.payable-group .amount { font-size: .92rem; margin-left: auto; }
.payable-items { padding: 0 10px 8px; background: #f8faf9; border-radius: 8px; }
.phone-frame { box-shadow: 0 14px 50px #173f3e1a; border: 6px solid #233f3d; border-radius: 24px; }

@media (max-width: 1200px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric strong { font-size: clamp(1.1rem, 7cqi, 1.6rem); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 168px minmax(0, 1fr); }
  main { padding: 26px 20px 50px; }
  aside { padding-inline: 9px; }
  nav button { padding-inline: 12px; font-size: .86rem; }
  .panel { padding: 20px; }
}
@media (max-width: 720px) {
  header { height: 66px; padding-inline: 18px; }
  .shell { display: block; }
  aside { padding: 8px 12px; background: #f3f7f5; border-bottom: 1px solid var(--line); }
  nav { position: static; }
  .shell aside nav { gap: 4px; }
  .shell aside nav button { text-align: center; font-size: .82rem; padding: 9px 6px; }
  main { padding: 24px 16px 48px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.04rem; }
  .heading { gap: 16px; }
  .heading .muted { font-size: .86rem; }
  .metrics { grid-template-columns: 1fr; gap: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
  .metric, .metric.highlight { grid-column: auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; padding: 16px 18px; border: 0; border-radius: 0; }
  .metric + .metric { border-top: 1px solid #e8eeec; }
  .metric span { font-size: .8rem; }
  .metric strong, .metric:first-child strong { font-size: clamp(1rem, 5.1vw, 1.35rem); margin: 0; white-space: nowrap; }
  .metric.highlight { display: block; padding-block: 20px; }
  .metric.highlight span { font-size: .84rem; }
  .metric.highlight strong { font-size: clamp(1.45rem, 7vw, 1.9rem); margin-top: 8px; }
  .company-metrics { grid-template-columns: 1fr; padding-bottom: 10px; }
  .company-metrics > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 13px 0; border-bottom: 1px solid #eef2f0; }
  .company-metrics > div:last-child { border: 0; }
  .company-metrics span { font-size: .84rem; }
  .company-metrics strong { font-size: clamp(1rem, 5vw, 1.3rem); margin: 0; }
  .panel { padding: 19px 16px; border-radius: 14px; margin-bottom: 18px; }
  .panel-head { gap: 12px; }
  .company-panel .panel-head > .actions { width: 100%; }
  .company-panel .actions select { flex: 1; }
  .notice { font-size: .8rem; }
  .sub { font-size: .77rem; line-height: 1.8; }
  .table-wrap { border-radius: 8px; }
  th, td { padding: 12px; }
  .construction-filters { padding: 12px; gap: 10px; }
  .construction-filters label { flex-basis: 100%; max-width: none; }
  .construction-row { grid-template-columns: auto 1fr; gap: 7px 12px; }
  .construction-row .num { grid-column: 2; grid-row: 1; font-size: .85rem; }
  .construction-track { grid-column: 1 / -1; grid-row: 2; height: 7px; }
  .construction-bars { gap: 20px; }
  .annual-chart { padding: 16px 12px; }
  .expense-summary { gap: 12px; }
  .expense-summary > span { flex: 1 1 100%; }
  .expense-label { row-gap: 4px; font-size: .85rem; }
  .list-row { flex-wrap: wrap; gap: 8px 14px; }
  .list-row > :first-child { flex: 1 1 130px; }
  .list-row .amount { margin-left: auto; font-size: .88rem; }
  .dialog-head h2 { font-size: 1rem; }
  .preview-page { padding: 20px 10px; }
  .site-picker-fields { grid-template-columns: 1fr; gap: 14px; }
}
