/* 화면 공통 기준 — 모든 화면의 틀 · 표 · 카드 · 제목 · 단추가 이 한 곳의 값을 쓴다.
   한규 2026-11-29 "사이트는 1개인데 페이지 1개씩 마다 전부 ui/ux 통일감이 없음".
   화면별 CSS에서 같은 것을 다시 정하지 않는다. 값이 어긋나면 tests/ui-system.test.mjs가 막는다.
   index.html에서 맨 마지막에 읽는다. */
.workspace-frame{
  --ui-radius-card:12px;--ui-radius-control:6px;
  --ui-card-pad:20px;
  --ui-control-h:36px;
  --ui-title-section:16px;--ui-title-card:14px;--ui-label:13px;--ui-kpi-value:24px;
  --ui-weight-strong:600;--ui-weight-mid:500;--ui-weight-regular:400;
  --ui-table-head-size:13px;--ui-table-head-h:48px;--ui-table-cell-size:13px;
  --ui-table-row-h:60px;--ui-table-row-h-image:68px;
  --ui-detail-head-size:12px;--ui-detail-row-h:36px;
}

/* 1. 틀 — 모든 화면이 같은 왼쪽 자리에서, 같은 폭으로 시작한다 */
html .workspace-frame .ws-home,html .workspace-frame .ws-home.ws-home--data{max-width:2080px}

/* 2. 색 — 데이터 관리도 다른 화면과 같은 무채색 바탕 · 선 */
html .workspace-frame .data-overview,html[data-theme=dark] .workspace-frame .data-overview{--data-surface:var(--bg);--data-card:var(--white);--data-border:var(--line);--data-muted:var(--muted)}

/* 3. 제목 — 화면 제목 24 · 구역 제목 16 · 카드 제목 14, 굵기는 600 · 500 · 400 셋만 */
html .workspace-frame .ws-page-heading h1{font-size:24px;font-weight:var(--ui-weight-strong)}
html .workspace-frame .sales-chart-card h2,
html .workspace-frame .settlement-results h2,
html .workspace-frame .profit-card-section h2,
html .workspace-frame .profit-settings-desktop .profit-config-common h3,
html .workspace-frame .profit-settings-desktop .profit-config-channels h3,
html .workspace-frame .profit-aggregation-section>h3,
html .workspace-frame .panel-head h2,
html .workspace-frame .data-toolbar-title{font-size:var(--ui-title-section);font-weight:var(--ui-weight-strong)}
html .workspace-frame .product-insight-panel h2,
html .workspace-frame .profit-board-desktop .profit-board-list h3,
html .workspace-frame .profit-board-list h3,
html .workspace-frame .profit-detail h3,
html .workspace-frame .profit-settings-desktop .profit-config-common .profit-exclusions h2,
html .workspace-frame .profit-settings-desktop .profit-config-channel h4,
html .workspace-frame .data-section>h2,
html .workspace-frame .data-records h2,
html .workspace-frame .data-dataset-card h3{font-size:var(--ui-title-card);font-weight:var(--ui-weight-strong)}

/* 4. 카드 — 모서리 · 안쪽 여백 하나 */
html .workspace-frame .sales-summary-section .sales-kpi,
html .workspace-frame .product-insight-panel,
html .workspace-frame .profit-metric-card,
html .workspace-frame .profit-board-list,
html .workspace-frame .profit-detail,
html .workspace-frame .profit-companies,
html .workspace-frame .settlement-results,
html .workspace-frame .sales-chart-card,
html .workspace-frame .data-dataset-card,
html .workspace-frame .data-records,
html .workspace-frame .ws-page-content>.panel{border-radius:var(--ui-radius-card)}
@media(min-width:721px){
  html .workspace-frame .sales-summary-section .sales-kpi,
  html .workspace-frame .product-insight-panel,
  html .workspace-frame .profit-metric-card{padding:var(--ui-card-pad)}
  /* 숫자 카드: 이름표 13 · 값 24, 증감은 값 오른쪽 */
  html .workspace-frame .sales-summary-section .sales-kpi>span,
  html .workspace-frame .profit-metric-card h3{font-size:var(--ui-label);font-weight:var(--ui-weight-mid);color:var(--ink)}
  html .workspace-frame .sales-summary-section .sales-kpi strong,
  html .workspace-frame .profit-metric-card strong{font-size:var(--ui-kpi-value);font-weight:var(--ui-weight-strong)}

  /* 5. 큰 목록 표 — 머리 13 · 높이 48, 글 행 60 · 사진 행 68 */
  html .workspace-frame .settlement-results th,
  html .workspace-frame .profit-companies thead th{font-size:var(--ui-table-head-size);font-weight:var(--ui-weight-mid);height:var(--ui-table-head-h);padding-top:0;padding-bottom:0;background:var(--bg);color:var(--muted)}
  html .workspace-frame .settlement-results th button{font-weight:var(--ui-weight-mid)}
  html .workspace-frame .settlement-results th[aria-sort=ascending] button,
  html .workspace-frame .settlement-results th[aria-sort=descending] button{font-weight:var(--ui-weight-strong);color:var(--ink)}
  html .workspace-frame .settlement-results td,
  html .workspace-frame .profit-companies tbody td,
  html .workspace-frame .profit-companies tbody th{font-size:var(--ui-table-cell-size)}
  html .workspace-frame .sales-daily-table td,
  html .workspace-frame .profit-companies tbody tr{height:var(--ui-table-row-h)}
  html .workspace-frame .sales-products-table>tbody>tr.sales-product-row>td{height:var(--ui-table-row-h-image)}
  html .workspace-frame .data-record-head{font-size:var(--ui-table-head-size);font-weight:var(--ui-weight-mid);min-height:var(--ui-table-head-h);background:var(--bg);color:var(--muted)}

  /* 6. 작은 내역 표 — 머리 12 · 행 36 */
  html .workspace-frame .profit-detail thead th{font-size:var(--ui-detail-head-size);font-weight:var(--ui-weight-regular);color:var(--muted)}
  html .workspace-frame .profit-detail tbody tr{height:var(--ui-detail-row-h)}

  /* 7. 단추 · 고르는 칸 · 적는 칸 — 높이 36 · 모서리 6 */
  html .workspace-frame .ws-home select,
  html .workspace-frame .ws-home input[type=search],
  html .workspace-frame .ws-home input[type=text],
  html .workspace-frame .ws-home input[type=number],
  html .workspace-frame .ws-home input:not([type]),
  html .workspace-frame .ws-home .btn,
  html .workspace-frame .ws-home .data-refresh,
  html .workspace-frame .ws-home .data-summary-counts button,
  html .workspace-frame .ws-home .table-actions>button,
  html .workspace-frame .ws-home .table-actions>details>summary,
  html .workspace-frame .ws-home .settlement-results>header .table-actions button:not([role=menuitem]):not(.table-download-options button),
  html .workspace-frame .ws-home .settlement-results>header .table-actions summary,
  html .workspace-frame .ws-home .settlement-presets button,
  html .workspace-frame .ws-home .sales-period summary,
  html .workspace-frame .ws-home .profit-filter button{height:var(--ui-control-h);min-height:var(--ui-control-h);border-radius:var(--ui-radius-control)}
}

@media(min-width:721px){
  html .workspace-frame .settlement-pagination button{border-radius:var(--ui-radius-control)}
  html .workspace-frame .ws-home .sales-period summary{padding-top:0;padding-bottom:0}
  /* 상품별 이익도 상품성과와 같은 사진 행 높이 */
  html .workspace-frame .profit-results .sales-products-table>tbody>tr>td{height:var(--ui-table-row-h-image);padding-top:8px;padding-bottom:8px}
  /* 긴 상품 이름은 한 번에 보이게 두고 넘치면 말줄임 — 이름 때문에 행 높이가 달라지지 않는다 */
  html .workspace-frame .profit-results .sales-products-table .settlement-product strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:560px}
  html .workspace-frame .profit-results .sales-products-table .settlement-product small{white-space:nowrap}
  /* 정산설정도 다른 화면과 같은 왼쪽 자리에서 시작 */
  html .workspace-frame .profit-settings-desktop{padding-inline:0}
}

/* 8. 도움말 표시 — 어느 화면이든 ⓘ 하나 */
html .workspace-frame .profit-help{width:auto;height:auto;min-width:0;border:0;background:none;border-radius:0;font-size:13px;font-weight:var(--ui-weight-regular);color:var(--muted);line-height:1}
