 *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  /* :root {
    --bg: #f5f3ef;
    --surface: #ffffff;
    --surface2: #f0ede8;
    --border: #e2ddd6;
    --text: #1a1714;
    --text-muted: #7a746c;
    --accent: #1a3a5c;
    --radius: 10px;
  } */
  
    :root {
    
    --surface: #ffffff;
    --surface2: #f0ede8;
    --border: #e2ddd6;
    --text: #1a1714;
    --text-muted: #7a746c;
    --accent: #1a3a5c;
    --radius: 10px;
  } 
/* 
  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 2rem 1.5rem;
  } */

  header {
    max-width: 1200px;
    margin: 0 auto 2rem;
  }

  header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text);
  }

  header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
  }

  .stats-row {
    display: flex;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    flex-wrap: wrap;
  }

  .stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    flex: 1;
    min-width: 160px;
  }

  .stat-card .label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
  }

  .stat-card .value {
    font-family: 'DM Mono', monospace;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text);
  }

  .main-layout {
    display: flex;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
  }

  /* TABLE PANEL */
  .table-panel {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .panel-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .table-scroll {
    max-height: 580px;
    overflow-y: auto;
  }

  .table-scroll::-webkit-scrollbar { width: 4px; }
  .table-scroll::-webkit-scrollbar-track { background: transparent; }
  .table-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

  table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

  thead th {
    position: sticky;
    top: 0;
    background: var(--surface2);
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
  }

  thead th:last-child { text-align: right; }

  tbody tr { cursor: pointer; transition: background 0.1s; }
  tbody tr:hover td { background: #eef4fb; }
  tbody tr.active td { background: #ddeaf8; font-weight: 500; }

  tbody td {
    padding: 6px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
  }

  tbody td:last-child {
    text-align: right;
    font-family: 'DM Mono', monospace;
    font-size: 11.5px;
  }

  .year-cell {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .color-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
  }

  .total-row td {
    background: var(--surface2);
    font-weight: 600;
    border-top: 1.5px solid var(--border);
    cursor: default;
  }
  .total-row:hover td { background: var(--surface2) !important; }

  /* CHART PANEL */
  .chart-panel {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .chart-header {
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .chart-body { padding: 16px; }

  /* LEGEND */
  .legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 14px;
    max-height: 140px;
    overflow-y: auto;
    padding-right: 4px;
  }

  .legend-container::-webkit-scrollbar { width: 3px; }
  .legend-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  .legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 5px 2px 4px;
    border-radius: 4px;
    transition: background 0.1s;
    border: 1px solid transparent;
  }

  .legend-item:hover { background: var(--surface2); border-color: var(--border); }
  .legend-item.active { background: #ddeaf8; color: var(--text); border-color: #b8d0ea; font-weight: 500; }

  .legend-sq {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    flex-shrink: 0;
  }

  .chart-wrap { position: relative; width: 100%; height: 380px; }

  /* TOOLTIP */
  .tip {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    pointer-events: none;
    display: none;
    z-index: 20;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    min-width: 130px;
  }

  .tip-year { font-weight: 600; color: var(--text); margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
  .tip-sq { width: 10px; height: 10px; border-radius: 2px; }
  .tip-val { color: var(--text-muted); font-family: 'DM Mono', monospace; font-size: 11.5px; }

  @media (max-width: 760px) {
    .main-layout { flex-direction: column; }
    .table-panel { width: 100%; }
    .table-scroll { max-height: 260px; }
  }