/* CBC page-specific */
.hero { display: grid; gap: 2px; padding: 0 0 4px; animation: rise 0.55s ease both; }

    /* —— Date list —— */
    .dates-panel { animation: rise 0.6s ease 0.05s both; }
    .date-list {
      display: flex;
      gap: 8px;
      padding: 12px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
    }
    @media (min-width: 900px) {
      .date-list {
        flex-direction: column;
        max-height: calc(100vh - 220px);
        overflow-y: auto;
        overflow-x: hidden;
      }
    }
    .date-btn {
      flex: 0 0 auto;
      min-width: 136px;
      text-align: left;
      border: 1px solid var(--line);
      background: #FAFCFC;
      border-radius: 12px;
      padding: 10px 12px;
      cursor: pointer;
      transition: border-color 0.2s, background 0.2s, transform 0.2s;
      font-family: inherit;
      color: inherit;
    }
    .date-btn:hover { border-color: #9FCBD1; transform: translateY(-1px); }
    .date-btn.active {
      background: var(--teal-soft);
      border-color: #7EB8C0;
      box-shadow: inset 0 0 0 1px rgba(11,110,122,0.15);
    }
    .date-btn .d { font-weight: 650; font-size: 0.95rem; color: var(--teal-deep); }
    .date-btn .s {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      margin-top: 4px;
      font-size: 0.75rem;
      color: var(--muted);
    }
    .badge-abn {
      color: var(--high);
      font-weight: 600;
    }

    /* —— Main —— */
    .main-panel { animation: rise 0.65s ease 0.1s both; }
    .toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      padding: 12px 14px;
      border-bottom: 1px solid var(--line);
      background: linear-gradient(180deg, #FBFEFE, #F7FBFA);
      position: sticky;
      top: 0;
      z-index: 5;
    }
    .seg {
      display: inline-flex;
      padding: 3px;
      background: #E7F0F1;
      border-radius: 10px;
    }
    .seg button {
      border: 0;
      background: transparent;
      padding: 7px 12px;
      border-radius: 8px;
      font-family: inherit;
      font-size: 0.84rem;
      color: var(--muted);
      cursor: pointer;
      font-weight: 500;
    }
    .seg button.active {
      background: #fff;
      color: var(--teal-deep);
      box-shadow: 0 1px 3px rgba(11,61,74,0.12);
    }
    .spacer { flex: 1; }

    .info-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px 14px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      font-size: 0.86rem;
    }
    @media (min-width: 700px) {
      .info-grid { grid-template-columns: 1fr 1fr 1fr; }
    }
    .info-item .k { color: var(--muted); font-size: 0.75rem; margin-bottom: 2px; }
    .info-item .v { color: var(--ink); font-weight: 500; word-break: break-all; }

    .summary {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      padding: 12px 14px;
      border-bottom: 1px solid var(--line);
    }
    .sum-card {
      text-align: center;
      padding: 10px 6px;
      border-radius: 12px;
      background: #F3F8F8;
    }
    .sum-card .n {
      font-size: 1.25rem;
      font-weight: 700;
      letter-spacing: -0.02em;
    }
    .sum-card .l { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
    .sum-card.high { background: var(--high-bg); }
    .sum-card.high .n { color: var(--high); }
    .sum-card.low { background: var(--low-bg); }
    .sum-card.low .n { color: var(--low); }
    .sum-card.ok { background: var(--ok-bg); }
    .sum-card.ok .n { color: var(--ok); }

    .section { padding: 8px 10px 14px; }
    .section-title {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 6px 8px;
      font-size: 0.9rem;
      font-weight: 650;
      color: var(--teal-deep);
    }
    .section-title::before {
      content: "";
      width: 4px;
      height: 14px;
      border-radius: 2px;
      background: var(--teal);
    }

    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .item-cards { display: none; }
    @media (max-width: 699px) {
      .table-wrap { display: none; }
      .item-cards { display: grid; gap: 8px; padding: 0 4px; }
    }
    .item-card {
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      background: #FBFEFE;
    }
    .item-card.abn-high { background: var(--high-bg); border-color: #F0C7BF; }
    .item-card.abn-low { background: var(--low-bg); border-color: #C5DCE6; }
    .item-card .top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
    }
    .item-card .mid {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      margin-top: 8px;
      gap: 8px;
    }
    .item-card .bot { margin-top: 10px; }
    table.items {
      width: 100%;
      border-collapse: collapse;
      min-width: 520px;
      font-size: 0.86rem;
    }
    table.items th {
      text-align: left;
      padding: 8px 10px;
      color: var(--muted);
      font-weight: 500;
      font-size: 0.75rem;
      border-bottom: 1px solid var(--line);
      white-space: nowrap;
    }
    table.items td {
      padding: 11px 10px;
      border-bottom: 1px solid #EEF3F4;
      vertical-align: middle;
    }
    table.items tr:last-child td { border-bottom: 0; }
    table.items tr.abn-high { background: linear-gradient(90deg, var(--high-bg), transparent 70%); }
    table.items tr.abn-low { background: linear-gradient(90deg, var(--low-bg), transparent 70%); }
    .code {
      font-family: "Outfit", monospace;
      font-weight: 600;
      color: var(--teal-deep);
      font-size: 0.9rem;
    }
    .name { color: var(--ink); }
    .name small { display: block; color: var(--muted); font-size: 0.72rem; margin-top: 1px; }
    .val {
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.01em;
    }
    .val.high { color: var(--high); }
    .val.low { color: var(--low); }
    .unit, .ref { color: var(--muted); font-size: 0.8rem; }
    .flag {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 28px;
      height: 24px;
      border-radius: 6px;
      font-weight: 700;
      font-size: 0.85rem;
    }
    .flag.high { background: var(--high-bg); color: var(--high); }
    .flag.low { background: var(--low-bg); color: var(--low); }
    .flag.ok { background: #F0F4F5; color: #8A9AA1; }

    /* range bar */
    .bar {
      width: 100%;
      max-width: 140px;
      height: 6px;
      border-radius: 99px;
      background: #E3EBED;
      position: relative;
      overflow: visible;
    }
    .bar .fill {
      position: absolute;
      inset: 0;
      border-radius: inherit;
      background: linear-gradient(90deg, #B7D9DE, #7EB8C0);
      opacity: 0.55;
    }
    .bar .dot {
      position: absolute;
      top: 50%;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      transform: translate(-50%, -50%);
      background: var(--teal);
      border: 2px solid #fff;
      box-shadow: 0 0 0 1px rgba(11,110,122,0.35);
    }
    .bar .dot.high { background: var(--high); box-shadow: 0 0 0 1px rgba(194,59,34,0.35); }
    .bar .dot.low { background: var(--low); box-shadow: 0 0 0 1px rgba(31,111,139,0.35); }

    /* —— Trends —— */
    .trend-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      padding: 14px;
    }
    @media (min-width: 700px) {
      .trend-grid { grid-template-columns: 1fr 1fr; }
    }
    .trend-card {
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 14px;
      background: #FBFEFE;
      transition: transform 0.25s ease, box-shadow 0.25s ease;
    }
    .trend-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(11,61,74,0.08);
    }
    .trend-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-bottom: 6px;
    }
    .trend-head h3 { font-size: 0.95rem; color: var(--teal-deep); }
    .trend-head .latest {
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      font-size: 1.05rem;
    }
    .trend-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .zoom-btn {
      border: 1px solid var(--line);
      background: #fff;
      color: var(--teal-deep);
      border-radius: 8px;
      padding: 5px 10px;
      font-family: inherit;
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
    }
    .zoom-btn:hover { border-color: #7EB8C0; background: var(--teal-soft); }
    .trend-meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; }
    .trend-chart {
      width: 100%;
      height: 220px;
    }
    .trend-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 14px;
      margin-top: 8px;
      font-size: 0.72rem;
      color: var(--muted);
    }
    .trend-legend i {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-right: 4px;
      vertical-align: middle;
    }
    .trend-legend .band {
      display: inline-block;
      width: 14px;
      height: 8px;
      border-radius: 2px;
      background: rgba(11, 110, 122, 0.18);
      margin-right: 4px;
      vertical-align: middle;
    }

    /* —— Chart modal —— */
    .chart-modal {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: none;
      align-items: stretch;
      justify-content: center;
      padding: 12px;
      background: rgba(11, 61, 74, 0.55);
      backdrop-filter: blur(4px);
    }
    .chart-modal.open { display: flex; }
    .chart-modal-panel {
      width: min(1100px, 100%);
      margin: auto;
      background: #fff;
      border-radius: 16px;
      box-shadow: 0 20px 50px rgba(0,0,0,0.25);
      display: flex;
      flex-direction: column;
      max-height: calc(100vh - 24px);
      max-height: calc(100dvh - 24px);
      overflow: hidden;
    }
    .chart-modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      background: linear-gradient(180deg, #FBFEFE, #F5FAFA);
    }
    .chart-modal-head h3 {
      font-size: 1.05rem;
      color: var(--teal-deep);
      margin-bottom: 4px;
    }
    .chart-modal-head p {
      font-size: 0.8rem;
      color: var(--muted);
      line-height: 1.4;
    }
    .modal-close {
      border: 0;
      background: #E7F0F1;
      color: var(--teal-deep);
      width: 36px;
      height: 36px;
      border-radius: 10px;
      font-size: 1.2rem;
      cursor: pointer;
      flex-shrink: 0;
      line-height: 1;
    }
    .modal-close:hover { background: var(--teal-soft); }
    .chart-modal-body {
      padding: 8px 12px 16px;
      flex: 1;
      min-height: 0;
    }
    .chart-modal-chart {
      width: 100%;
      height: min(62vh, 520px);
    }
    @media (max-width: 699px) {
      .chart-modal { padding: 0; }
      .chart-modal-panel {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
      }
      .chart-modal-chart { height: calc(100dvh - 120px); }
      .trend-chart { height: 200px; }
    }

    .empty {
      padding: 40px 20px;
      text-align: center;
      color: var(--muted);
    }

    .footnote {
      margin-top: 16px;
      text-align: center;
      font-size: 0.75rem;
      color: #8A9AA1;
      line-height: 1.5;
      padding: 0 12px;
    }

    @keyframes rise {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: none; }
    }

    @media (max-width: 899px) {
      .app { padding-top: 14px; }
      .info-grid { grid-template-columns: 1fr 1fr; }
    }
