/* 사료시장: 기존 한울과 한울 그린의 공통 색·글자 크기를 그대로 사용한다. */
.fm-wrap, .fm-dialog { box-sizing:border-box; }
.fm-wrap *, .fm-dialog * { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font-family:'Noto Sans KR','Malgun Gothic',sans-serif; line-height:1.6; }
.fm-wrap { max-width:1400px; padding:0 0 64px; margin:0 auto; }
.fm-wrap [hidden], .fm-dialog [hidden] { display:none!important; }
.fm-wrap h2, .fm-dialog h2 { font-size:1.05rem; line-height:1.5; margin:0; font-weight:600; }
.fm-wrap h3 { font-size:.95rem; line-height:1.5; margin:0; font-weight:600; }
.fm-wrap p, .fm-dialog p { margin:0; }
.fm-wrap a, .fm-dialog a { color:var(--accent); overflow-wrap:anywhere; }
.fm-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.fm-unit, .fm-small, .fm-muted { color:var(--ink-soft); font-size:var(--fs-small,.8125rem); }
.fm-panel { border:1px solid var(--line); border-radius:14px; padding:20px; margin:20px 0; background:var(--surface); }
.fm-fields { display:grid; grid-template-columns:1fr 1fr 1.1fr; gap:14px; margin:16px 0 12px; }
.fm-fields-two { grid-template-columns:1fr 1fr; }
.fm-fields label, .fm-import-basis { display:grid; gap:6px; color:var(--ink-soft); font-size:var(--fs-small,.8125rem); min-width:0; }
.fm-span-all { grid-column:1/-1; }
.fm-fields input, .fm-fields select, .fm-import-basis select { width:100%; min-width:0; height:2.9rem; border:1px solid var(--line-2); background:var(--field); color:var(--ink); border-radius:8px; padding:8px 10px; font:inherit; font-size:1rem; font-variant-numeric:tabular-nums; }
.fm-fields input::placeholder { color:var(--ink-soft); }
.fm-buttons { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.fm-button { min-height:2.65rem; padding:8px 12px; border:1px solid var(--line-2); border-radius:8px; background:var(--surface); color:var(--ink); font:inherit; font-size:var(--fs-ctl,.875rem); font-weight:500; line-height:1.4; cursor:pointer; text-decoration:none; }
.fm-button:hover { background:var(--surface-2); }
.fm-button.fm-primary { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.fm-button.fm-danger { background:var(--bad-soft); color:var(--t-red); border-color:var(--bad); }
.fm-button.fm-text-button { background:transparent; border-color:transparent; color:var(--ink-soft); }
.fm-button:disabled { opacity:.5; cursor:not-allowed; }
.fm-wrap :is(button,input,select,summary,a):focus-visible, .fm-dialog :is(button,input,select):focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.fm-input-details { margin:4px 0 16px; }
.fm-input-details > summary { cursor:pointer; font-size:var(--fs-small,.8125rem); color:var(--ink-soft); }
.fm-input-details > summary span { margin-left:8px; color:var(--ink); }
.fm-actions { gap:10px; }
.fm-form-note { margin-top:9px!important; }
.fm-notice, .fm-loading, .fm-readiness { margin:14px 0; padding:12px 14px; border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); border-radius:10px; font-size:var(--fs-small,.8125rem); overflow-wrap:anywhere; }
.fm-notice[data-kind="error"] { border-color:var(--bad); background:var(--bad-soft); color:var(--ink); }
.fm-readiness[data-kind="warning"] { border-color:var(--warn); background:var(--warn-soft); color:var(--ink); }
.fm-readiness:empty { display:none; }
.fm-readiness strong { display:block; color:var(--ink); margin-bottom:3px; font-weight:600; }
.fm-section-head { margin:24px 0 12px; }
.fm-forecast-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.fm-forecast-card { min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:19px 16px; }
.fm-forecast-card:last-child { background:var(--accent-05); }
.fm-pct { font-size:1.9rem; font-weight:600; line-height:1.35; letter-spacing:-.025em; font-variant-numeric:tabular-nums; margin:10px 0 4px; color:var(--ink); overflow-wrap:anywhere; }
.fm-pct[data-direction="up"] { color:var(--t-orange); }
.fm-pct[data-direction="down"] { color:var(--t-green); }
.fm-pct.fm-pending { font-size:1.25rem; color:var(--ink-soft); margin:14px 0; }
.fm-price { font-size:.95rem; font-variant-numeric:tabular-nums; }
.fm-range { font-size:var(--fs-small,.8125rem); color:var(--ink-soft); border-top:1px solid var(--line); margin-top:13px!important; padding-top:11px; overflow-wrap:anywhere; }
.fm-footnote { margin-top:10px!important; }
.fm-details > summary { cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; font-weight:500; list-style:none; }
.fm-details > summary::-webkit-details-marker { display:none; }
.fm-details > summary::after { content:''; color:var(--ink-soft); margin-left:auto; width:1em; height:1em; background:currentColor; mask:url('/shared/lucide/plus.svg') center/contain no-repeat; -webkit-mask:url('/shared/lucide/plus.svg') center/contain no-repeat; }
.fm-details[open] > summary::after { mask-image:url('/shared/lucide/minus.svg'); -webkit-mask-image:url('/shared/lucide/minus.svg'); }
.fm-details > summary .fm-small { font-weight:400; }
.fm-inner-head { margin:18px 0 12px; }
.fm-table-scroll { overflow:auto; overscroll-behavior-x:contain; max-width:100%; }
.fm-table { border-collapse:collapse; width:100%; text-align:left; font-size:var(--fs-small,.8125rem); }
.fm-table th, .fm-table td { border-bottom:1px solid var(--line); padding:11px 9px; vertical-align:middle; }
.fm-table th { color:var(--ink-soft); font-weight:500; white-space:nowrap; }
.fm-table td { font-variant-numeric:tabular-nums; }
.fm-table th:first-child, .fm-table td:first-child { padding-left:0; }
.fm-table th:last-child, .fm-table td:last-child { padding-right:0; }
.fm-table .fm-cell-note { display:block; max-width:260px; color:var(--ink-soft); font-size:.75rem; white-space:normal; overflow-wrap:anywhere; }
.fm-table .fm-price-cell, .fm-table .fm-month-cell { white-space:nowrap; }
.fm-table .fm-button { padding:6px 9px; min-height:2.1rem; white-space:nowrap; font-size:var(--fs-small,.8125rem); }
.fm-table .fm-table-actions { display:flex; gap:4px; }
.fm-history-chart { margin-top:12px; color:var(--accent); }
.fm-history-chart svg { display:block; width:100%; height:auto; max-height:170px; overflow:visible; }
.fm-chart-legend { display:flex; justify-content:space-between; color:var(--ink-soft); font-size:.75rem; margin-top:4px; gap:10px; }
.fm-market-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.fm-market-card { border:1px solid var(--line); border-radius:9px; padding:12px; min-width:0; }
.fm-market-value { display:block; font-size:1.2rem; margin:5px 0; font-variant-numeric:tabular-nums; color:var(--ink); }
.fm-market-change { font-size:var(--fs-small,.8125rem); color:var(--ink-soft); }
.fm-validation, .fm-context { font-size:var(--fs-small,.8125rem); }
.fm-validation section, .fm-context article { border-top:1px solid var(--line); padding-top:14px; margin-top:14px; overflow-wrap:anywhere; }
.fm-validation ul { margin:8px 0; padding-left:20px; color:var(--ink-soft); }
.fm-subtitle { margin:22px 0 10px!important; }
.fm-sources { display:grid; gap:8px; margin-bottom:12px; }
.fm-source { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; padding:10px 0; border-bottom:1px solid var(--line); font-size:var(--fs-small,.8125rem); }
.fm-source-detail { grid-column:1/-1; color:var(--ink-soft); overflow-wrap:anywhere; }
.fm-badge { display:inline-block; border:1px solid var(--line); border-radius:6px; padding:2px 7px; color:var(--ink-soft); font-size:.75rem; white-space:nowrap; align-self:start; }
.fm-badge[data-state="error"] { color:var(--t-orange); border-color:var(--warn); }
.fm-report-list { margin-top:16px; display:flex; gap:8px; flex-wrap:wrap; }
.fm-report-list:empty { display:none; }
.fm-report-preview { border-top:1px solid var(--line); margin-top:18px; padding-top:18px; }
.fm-report-text { white-space:pre-wrap; overflow-wrap:anywhere; font-size:.9rem; line-height:1.9; margin-top:18px; max-width:850px; }
.fm-dialog { width:min(850px,calc(100% - 28px)); max-height:85dvh; padding:22px; border:1px solid var(--line-2); border-radius:14px; background:var(--surface-solid); color:var(--ink); box-shadow:var(--shadow); font-family:inherit; }
.fm-dialog::backdrop { background:var(--scrim-70); }
.fm-dialog-small { width:min(460px,calc(100% - 28px)); }
.fm-dialog .fm-table-scroll { margin:18px 0; max-height:40dvh; }
.fm-import-basis { max-width:340px; margin:14px 0; }
.fm-candidate-price { width:7.5rem; max-width:100%; min-height:2.65rem; padding:8px; border:1px solid var(--line-2); border-radius:8px; background:var(--field); color:var(--ink); font:inherit; font-size:1rem; font-variant-numeric:tabular-nums; }
.fm-dialog details > summary { cursor:pointer; color:var(--ink); }
.fm-dialog .fm-price-cell > .fm-button { display:block; margin-top:6px; }
.fm-check { display:flex; align-items:flex-start; gap:8px; font-size:var(--fs-small,.8125rem); margin:16px 0 10px; }
.fm-check input, .fm-table input[type="checkbox"] { width:18px; height:18px; accent-color:var(--accent); flex-shrink:0; }
.fm-dialog-actions { justify-content:flex-end; margin-top:18px; }
.fm-confirm-text { margin-top:14px!important; }
.fm-no-access { margin-top:50px; }
@media(max-width:768px) {
  .fm-wrap { padding:16px 14px 48px; }
  .fm-panel { padding:16px; margin:16px 0; }
  .fm-fields { gap:10px; }
  .fm-market-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fm-forecast-card { padding:15px 12px; }
  .fm-pct { font-size:1.65rem; }
  .fm-table th, .fm-table td { padding:10px 7px; }
}
@media(max-width:520px) {
  .fm-wrap { padding:12px 10px 40px; }
  .fm-panel { padding:14px; }
  .fm-fields { grid-template-columns:1fr 1fr; }
  .fm-fields > label:last-child, .fm-fields-two > label { grid-column:1/-1; }
  .fm-forecast-grid { grid-template-columns:1fr; }
  .fm-forecast-card { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:2px 10px; padding:14px 16px; }
  .fm-forecast-card > .fm-small { align-self:center; }
  .fm-pct { margin:0; text-align:right; font-size:1.75rem; }
  .fm-pct.fm-pending { margin:0; font-size:1rem; }
  .fm-price { grid-column:2; text-align:right; }
  .fm-range { grid-column:1/-1; margin-top:8px!important; padding-top:8px; }
  .fm-actions { align-items:flex-start; }
  .fm-actions > .fm-text-button { padding-left:0; }
  .fm-source { grid-template-columns:minmax(0,1fr); }
  .fm-source .fm-badge { justify-self:start; }
  .fm-table { min-width:480px; }
  .fm-dialog { padding:16px; }
  #fmImportDialog .fm-table { min-width:0; }
  #fmImportDialog thead { display:none; }
  #fmImportRows { display:block; }
  #fmImportRows tr { display:grid; grid-template-columns:26px minmax(0,1fr); gap:2px 8px; padding:12px 0; border-bottom:1px solid var(--line); }
  #fmImportRows td { padding:3px 0; border:0; min-width:0; }
  #fmImportRows td:first-child { grid-column:1; grid-row:1; }
  #fmImportRows td:not(:first-child) { grid-column:2; white-space:normal; }
  #fmImportRows .fm-cell-note { max-width:none; }
  .fm-details > summary .fm-small { flex-basis:75%; }
}
@media(prefers-reduced-motion:reduce) { .fm-wrap *, .fm-dialog * { scroll-behavior:auto!important; } }
