.tab[aria-selected="true"] { border-bottom-color: var(--app); color: #161A19; font-weight: 600; }   /* 고른 탭: 진한 글자 + 앱 색(빨강) 밑줄 (시험농장 DESIGN.md 7절, 11-01 장부 녹색→앱 색) */

/* 앱 색 — 출하분석 빨강 (11-01, 포털 상자 색과 같게: 시험농장 파랑·스마트컨설팅 노랑·출하분석 빨강·시세전망 초록).
   머리글 윗줄·앱 글자 표시·다른 시스템 메뉴의 '지금 여기'·고른 탭 밑줄에만 쓴다. 단추·데이터 색은 그대로. */
:root { --app: #C8372D; --app-on: #FFFFFF; --app-text: #B4321F; --app-tint: #FBEBEA; }
.app-bar { border-top: 3px solid var(--app); }
.app-mark { background: var(--app); color: var(--app-on); }
.app-current { background: var(--app-tint); color: var(--app-text); }
/* 공통 머리글 (11-17 통일 — 시험농장·스마트컨설팅·포털·시세전망·지도와 같은 모양): 앱 이름은 오빗 400 16px, 다른 시스템 메뉴 5개는 밑줄형.
   회색 글자, 지금 여기만 앱 색 글자 + 앱 색 밑줄. 폰 폭에서 넘치면 메뉴만 가로로 밀리고, 아주 좁으면 앱 이름은 숨긴다. */
.hw-app { font-family: "Orbit", "Malgun Gothic", sans-serif; font-size: 16px; font-weight: 400; letter-spacing: 0; }
.sys-nav { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 500; white-space: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.sys-nav::-webkit-scrollbar { display: none; }
.sys-nav a { color: #59605F; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.sys-nav a:hover { color: #161A19; }
.sys-nav a[aria-current="page"] { color: var(--app-text); font-weight: 600; border-bottom-color: var(--app); }
@media (max-width: 480px) { .sys-nav { gap: 8px; font-size: 13px; } .app-bar > div { padding-left: 12px; padding-right: 12px; } }   /* 메뉴 5개가 375px 폭에 다 들어오게 */
@media (max-width: 639px) { .app-bar .hw-app { display: none; } }
/* 단추 색 통일 (11-17 '모두 파랑' — 시험농장 DESIGN.md 5절과 같은 값): 주 단추(bg-brand)는 파랑 #256FCC(흰 글자 5.0:1), 올리면 #1F5FAE. 평평하게.
   앱 색(윗줄·마크)은 앱을 구분하고, 파랑은 '누르는 곳'. 폭은 각 화면 그대로(시험농장만 폭을 줄임). 막대 그래프의 bg-brand 는 단추가 아니라 해당 없음. */
:is(button, a).bg-brand { background-color: #256FCC; border-color: #256FCC; }
@media (hover: hover) { :is(button, a).bg-brand:hover:not(:disabled) { background-color: #1F5FAE; } }
button.bg-white.border { border-color: #D3D8D7; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
table.grid { display: table; }   /* Tailwind 의 .grid(display:grid)가 표를 깨뜨리지 않게 */
table.grid th { position: sticky; top: 0; background: #FFFFFF; color: #59605F; font-weight: 500; box-shadow: inset 0 -1px 0 #D3D8D7; cursor: pointer; white-space: nowrap; user-select: none; }
table.grid th { text-align: right; }
table.grid th.text-left { text-align: left; }
/* 넓은 화면의 긴 목록은 페이지가 스크롤하고 표 머리글만 고정한다 — 가로 스크롤 상자가 있으면 고정이 풀리므로 좁은 화면에서만 둔다 */
@media (max-width: 1023px) { .list-wrap { overflow-x: auto; } }
table.grid th, table.grid td { padding: .35rem .6rem; border-bottom: 1px solid #E1E4E4; font-size: .85rem; }
table.grid tbody tr:hover { background: #F5F6F6; }
table.grid tr.grp td { border-top: 1px solid #B9C0BF; }   /* 농가별 카드의 지표 묶음(육질·도체·육량·월령) 사이 선 */
table.grid tr.total td { background: transparent; font-weight: 600; border-top: 1px solid #161A19; border-bottom: 3px double #161A19; }   /* 장부식 합계줄 */
.bar { position: relative; display: block; min-width: 3.4rem; }
.bar > i { position: absolute; inset: 0 auto 0 0; opacity: .28; border-radius: 2px; }
.bar > b { position: relative; font-weight: 500; }

/* 프린트 — 메뉴·입력칸은 숨기고 표·차트만 A4 가로로. 표는 잘리지 않고 여러 쪽으로 이어지며 머리글이 쪽마다 반복된다. */
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header, nav[role="tablist"], #flash, .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  .print-only { display: block; }
  section.rounded-xl { border: 0; padding: 0; }
  .overflow-auto, #f-table { max-height: none !important; overflow: visible !important; }
  table.grid th { position: static; cursor: default; }
  table.grid th, table.grid td { padding: .2rem .4rem; font-size: .7rem; }
  table.grid tbody tr:hover { background: transparent; }
  table.grid tr, svg { break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
  /* 한 상자만 인쇄 (심층분석 '성적 추이'의 프린트 단추): 나머지 상자는 숨기고, 차트 4개는 한 줄에 */
  body.print-one main section:not(.print-target) { display: none !important; }
  body.print-one .print-target .grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  body.print-one .print-target table.grid th, body.print-one .print-target table.grid td { padding: .15rem .25rem; font-size: .66rem; }
  body.print-one .print-target .text-xs { font-size: .6rem; }
  /* (11-12 프린트 점검) 차트 제목이 칸보다 길면 두 줄로 꺾여 그 차트만 아래로 밀렸다 → 작게 한 줄. 안내 상자도 화면 크기 그대로라 혼자 컸다 */
  body.print-one .print-target h3 { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.print-one .print-target div.text-sm { font-size: .7rem; padding: .2rem .5rem; }

  /* 비율 칸의 색 막대: 화면은 숫자 뒤에 옅게 까는 막대지만, 인쇄하면 진하게 찍혀 숫자를 덮는다 → 숫자 아래 가는 줄로 */
  .bar { padding-bottom: 3px; }
  .bar > i { inset: auto auto 0 0; height: 3px; opacity: .85; border-radius: 1px; }

  /* 조합 트렌드 — A4 가로 한 장: 차트 4개 한 줄 → 월별(왼쪽) | 연도표 + 전국 대비 표(오른쪽). 표는 칸이 좁아 머리글을 줄바꿈하고 너비를 칸에 맞춘다(잘림 방지). */
  .trend-sheet { break-inside: avoid; }
  .trend-sheet h2 { font-size: 1rem; margin: 0; }
  .trend-sheet .t-intro { font-size: .6rem; margin-top: .15rem; }
  .trend-sheet #t-body { margin-top: .3rem; display: grid; grid-template-columns: 45fr 55fr; gap: .4rem; align-items: start;
    grid-template-areas: "notes notes" "charts charts" "month years" "month nat"; grid-template-rows: auto auto auto 1fr; }
  .trend-sheet .t-notes { grid-area: notes; font-size: .6rem; }
  .trend-sheet .t-notes:empty { display: none; }
  .trend-sheet .t-notes .h-2 { height: .15rem; }
  .trend-sheet div.text-sm { font-size: .6rem; line-height: 1.25; padding: .15rem .4rem; }   /* 알림 상자(note) — 화면용 큰 글씨·여백을 줄인다 */
  .trend-sheet .t-charts { grid-area: charts; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: .4rem; margin: 0; }
  .trend-sheet #t-month { grid-area: month; min-width: 0; }
  .trend-sheet .t-years { grid-area: years; min-width: 0; }
  .trend-sheet .t-nat { grid-area: nat; min-width: 0; }
  .trend-sheet .t-nat:empty { display: none; }
  .trend-sheet #t-month > div, .trend-sheet .t-charts > div { padding: .3rem .4rem; margin: 0; }
  .trend-sheet #t-month p.text-xs:not(.chart-legend) { display: none; }       /* 월별 설명 문단은 화면용 — 인쇄에는 그림·범례·표만 */
  .trend-sheet h3 { font-size: .72rem; margin: 0 0 .1rem; }
  .trend-sheet .t-nat h3 { margin-top: 0; }
  .trend-sheet .t-years > div, .trend-sheet .t-nat > div, .trend-sheet #t-month .overflow-auto { margin-top: .25rem; }
  .trend-sheet table.grid { min-width: 0 !important; width: 100%; table-layout: auto; }
  .trend-sheet table.grid th { white-space: normal; word-break: keep-all; line-height: 1.15; }
  .trend-sheet table.grid th, .trend-sheet table.grid td { padding: .1rem .2rem; font-size: .6rem; }
  .trend-sheet .text-xs { font-size: .55rem; }
  .trend-sheet svg { max-height: 56mm; }
  /* 월별 근내지방도 (11-12 새 배치): 요약 4칸은 한 줄로 작게, 그림 옆 세로 표(넓은 화면에서 그렸을 때)는 칸 폭의 40% 로 */
  .trend-sheet .m-stats { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: .25rem; margin-top: .2rem; }
  .trend-sheet .m-stats > div { padding: .1rem .3rem; }
  .trend-sheet .m-stats .text-lg, .trend-sheet .m-stats .text-base { font-size: .75rem; }
  .trend-sheet .m-stats .text-xs { font-size: .5rem; margin-top: 0; }
  .trend-sheet .m-grid { gap: .3rem; margin-top: .25rem; }
  .trend-sheet .m-grid:has(.m-vert) { grid-template-columns: minmax(0, 1fr) 40% !important; }
  .trend-sheet .t-years > p, .trend-sheet .t-nat > p { font-size: .55rem; margin-top: .15rem; }
}

/* ── 화면 정돈 (2026-11-12, 사용자가 시안 비교에서 '안 2' 선택) ──────────────────────────
   본문·표·숫자 = Pretendard(진짜 굵기 400~700, index.html @theme --font-sans), 제목·탭·앱 이름 = Orbit(굵기 400 그대로 — 가짜 굵게 없음).
   화면에서만: 설명 글 13px·조금 진하게·한 줄 약 90자, 제목 단계, 상자 간격·표 줄 높이, 표 머리글 옅은 바탕, 차트·월별 상자의 테두리 걷기(상자 안 상자 없애기).
   프린트는 위 @media print 의 한 장 맞춤 규칙을 그대로 쓴다. 'html' 을 앞에 붙인 것은 Tailwind(나중에 붙는 style)보다 우선하게 하려는 것. */
html :is(main h1, main h2, main h3, nav[role="tablist"] .tab, header .truncate) { font-family: "Orbit", "Malgun Gothic", sans-serif; font-weight: 400; letter-spacing: 0; }
html nav[role="tablist"] .tab[aria-selected="true"] { font-weight: 400; }
body { letter-spacing: -0.005em; }
@media screen {
  html main { padding-top: 1.25rem; padding-bottom: 2.5rem; }
  html nav[role="tablist"] { margin-bottom: 1.25rem; }
  html nav[role="tablist"] { overflow-x: auto; scrollbar-width: none; }      /* 좁은 화면: 탭은 한 줄로 두고 옆으로 밀어 본다(글자가 꺾여 세 줄이 되지 않게) */
  html nav[role="tablist"] .tab { font-size: .9375rem; padding: .625rem 1.125rem; white-space: nowrap; flex-shrink: 0; }
  @media (max-width: 640px) { html nav[role="tablist"] .tab { font-size: .875rem; padding: .5rem .75rem; } }

  /* 상자: 안쪽 여백을 넓히고, 상자끼리 간격을 벌린다 */
  html main section.rounded-xl { padding: 1.25rem 1.5rem; }
  html #page .space-y-4 > :not(:first-child) { margin-top: 1.25rem; }
  html #page > div > section + section { margin-top: 1.25rem; }

  /* 제목 단계 (Orbit 400): 화면 제목 22px · 상자 제목 17px · 그 아래 작은 제목 15px */
  html main h2.text-lg { font-size: 1.375rem; line-height: 1.4; }
  html main h3.text-base { font-size: 1.0625rem; }
  html main h3.text-sm { font-size: .9375rem; }

  /* 설명 글: 12px 흐린 회색 → 13px 조금 진한 회색, 줄 간격 넓게, 한 줄이 화면 끝까지 늘어나지 않게(약 90자) */
  html main p.text-xs { font-size: .8125rem; line-height: 1.65; color: #4A5150; }
  html main p.text-xs:not(.chart-legend) { max-width: 92ch; }
  html main .text-muted { color: #4F5655; }

  /* 표: 줄 높이를 넉넉히, 머리글은 옅은 바탕으로 구분 */
  html table.grid th, html table.grid td { padding: .5rem .7rem; font-size: .875rem; }
  html table.grid th { background: #F7F8F8; color: #3F4645; font-weight: 600; }
  html table.grid td .text-xs, html table.grid td.text-xs { font-size: .75rem; }
  html .m-vert table.grid td { padding-top: .32rem; padding-bottom: .32rem; }     /* 그림 옆 세로 표(14줄)는 그림 높이에 맞게 촘촘히 */

  /* 상자 안 상자: 차트·월별 상자의 테두리를 걷고 옅은 바탕만 — 겹친 테두리가 화면을 칸막이처럼 만든다 */
  html .chart-box { border-color: transparent; background: #F7F8F8; padding: .875rem 1rem; }
  html .chart-box svg line[stroke="#E1E4E4"] { stroke: #E3E6E6; }
  html .m-box { border: 0; padding: 0 0 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid #E1E4E4; border-radius: 0; }
  html .m-box .m-stats > div { background: #F7F8F8; }

  /* 입력칸·단추 높이를 맞춘다 */
  html main select, html main input:not([type="checkbox"]):not([type="radio"]) { min-height: 2.25rem; }
  html main button.rounded-lg.py-2 { min-height: 2.25rem; }     /* 큰 단추만 — 목록 안 작은 단추(카드 등)는 그대로 */
  html :is(table, svg, .tabular-nums) { font-variant-numeric: tabular-nums; }     /* 숫자는 칸이 흔들리지 않게 고정폭 */
}

/* ── 메뉴를 왼쪽 세로로 (11-17 요청): 넓은 화면(1024px↑)에서 #app 을 [메뉴 | 화면] 두 칸으로. 좁은 화면은 위 가로 탭 그대로.
   고른 메뉴 = 앱 색(빨강) 옅은 바탕 + 앱 색 글자, 나머지는 회색 글자. 스크롤해도 메뉴가 따라오게 sticky. 프린트에서는 위 규칙대로 메뉴가 숨는다. */
@media screen and (min-width: 1024px) {
  html #app:not(.hidden) { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); column-gap: 1.5rem; align-items: start; }
  html #app > nav[role="tablist"] { position: sticky; top: 1rem; flex-direction: column; gap: .125rem; margin: 0; padding: 0; border-bottom: 0; overflow: visible; }
  html #app > nav[role="tablist"] .tab { display: block; padding: .625rem .875rem; border-bottom: 0; border-radius: 6px; font-size: .9375rem; white-space: normal; }
  html #app > nav[role="tablist"] .tab:hover { background: #EEF0F0; color: #161A19; }
  html #app > nav[role="tablist"] .tab[aria-selected="true"] { background: var(--app-tint); color: var(--app-text); }
  html #app > #page { min-width: 0; }
}
