/* 분석 의뢰 CSV 제출(형식 선택·업로드 칸)과 의뢰 가이드의 제출 양식 절 */

/* ---------- 제출 형식 선택 (3가지) ---------- */
.view:not(#view-home) .processed-format { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.view:not(#view-home) .processed-format label { min-height: 72px; align-items: flex-start; padding: 14px 16px; }
.view:not(#view-home) .processed-format input[type="radio"] { margin-top: 2px; }
.processed-format__card { display: grid; gap: 3px; min-width: 0; }
.processed-format__card b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.processed-format__card small { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.45; word-break: keep-all; }
.processed-format__card em { justify-self: start; margin-top: 3px; padding: 1px 8px; border-radius: 99px; background: var(--portal-blue); color: #fff; font-size: 10.5px; font-style: normal; font-weight: 800; }
.processed-format input:disabled + .processed-format__card { opacity: .45; }

/* ---------- CSV 제출 영역 ---------- */
.csv-intake { margin: 0 0 4px; padding: 22px; border: 1px solid var(--portal-line); border-radius: 18px; background: var(--portal-soft); }
.csv-intake[hidden] { display: none; }
.csv-intake__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.csv-intake__head h3 { margin: 0 0 4px; color: var(--portal-ink); font-size: 16px; font-weight: 800; }
.csv-intake__head p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; word-break: keep-all; }
.csv-intake__guide { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--portal-blue); border-radius: 10px; background: var(--portal-card); color: var(--portal-blue); font-size: 12.5px; font-weight: 800; text-decoration: none; }
.csv-intake__guide:hover { background: var(--portal-blue); color: #fff; }
.csv-intake__note, .csv-intake__fields { margin-top: 14px; }
.csv-intake__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.csv-intake .field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--portal-ink); }
.csv-intake textarea, .csv-intake input[type="text"], .csv-intake select { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--portal-line); border-radius: 10px; background: var(--portal-card); color: var(--portal-ink); font: inherit; font-weight: 500; font-size: 13px; }
.csv-slots { display: grid; gap: 10px; }
.csv-slots__hint { margin: 0; padding: 12px 14px; border: 1px dashed var(--portal-line); border-radius: 12px; color: var(--muted); font-size: 12.5px; }

/* 업로드 칸 */
.csv-slot { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border: 1.5px solid var(--portal-line); border-radius: 14px; background: var(--portal-card); transition: border-color .15s, box-shadow .15s; }
.csv-slot.is-dragover { border-color: var(--portal-blue); box-shadow: 0 0 0 3px rgba(31,99,224,.14); }
.csv-slot.is-ok { border-color: rgba(31,99,224,.45); }
.csv-slot.is-error { border-color: #e2a35b; }
.csv-slot__main { display: flex; gap: 14px; min-width: 0; }
.csv-slot__icon { flex: none; display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; background: var(--portal-soft); color: var(--muted); font-size: 10.5px; font-weight: 900; letter-spacing: .04em; }
.csv-slot.has-file .csv-slot__icon { background: var(--portal-blue); color: #fff; }
.csv-slot.is-error .csv-slot__icon { background: #f6e3cc; color: #9a5a12; }
.csv-slot__body { min-width: 0; }
.csv-slot__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.csv-slot__title strong { color: var(--portal-ink); font-size: 14px; }
.csv-slot__title code { padding: 1px 7px; border-radius: 6px; background: rgba(31,99,224,.08); color: #1a4fb8; font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; }
.csv-slot__req { padding: 1px 7px; border-radius: 99px; border: 1px solid var(--portal-line); color: var(--muted); font-size: 10.5px; font-weight: 800; }
.csv-slot__hint { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.csv-slot__file { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin: 8px 0 0; font-size: 12.5px; color: var(--portal-ink); word-break: break-all; }
.csv-slot__file small { color: var(--muted); }
.csv-slot__status { margin-top: 8px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.csv-slot__status p { margin: 0; }
.csv-slot__status ul { margin: 3px 0 0; padding-left: 16px; }
.csv-slot.is-ok .csv-slot__status p { color: var(--portal-blue); font-weight: 750; }
.csv-slot.is-ok .csv-slot__status p::before { content: "✓ "; }
.csv-slot.is-error .csv-slot__status p { color: #a35a0c; font-weight: 750; }
.csv-slot.is-error .csv-slot__status p::before { content: "! "; }
.csv-slot.is-info .csv-slot__status p { color: var(--portal-ink); }
.csv-slot__links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.csv-slot__links a { color: var(--portal-blue); font-size: 12px; font-weight: 700; text-decoration: none; }
.csv-slot__links a:hover { text-decoration: underline; }
.csv-slot__actions { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.csv-slot__actions small { color: var(--muted); font-size: 11px; }
.csv-slot__pick { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 10px; background: var(--accent-btn, #0071e3); color: #fff; font-size: 12.5px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.csv-slot.has-file .csv-slot__pick { border: 1px solid var(--portal-blue); background: var(--portal-card); color: var(--portal-blue); }
.csv-slot__pick:focus-within { outline: 3px solid rgba(31,99,224,.35); outline-offset: 2px; }
.csv-slot__remove { width: 30px; height: 30px; border: 1px solid var(--portal-line); border-radius: 8px; background: var(--portal-card); color: var(--muted); font-size: 16px; cursor: pointer; }
.csv-slot__remove:hover { border-color: #e2a35b; color: #a35a0c; }
.csv-slot__orient { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.csv-slot__orient span { margin-right: 2px; font-weight: 700; }
.csv-slot__orient button { min-height: 28px; padding: 0 10px; border: 1px solid var(--portal-line); border-radius: 8px; background: var(--portal-card); color: var(--portal-ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.csv-slot__orient button[aria-pressed="true"] { border-color: var(--portal-blue); background: rgba(31,99,224,.08); color: var(--portal-blue); }
:root[data-theme="dark"] .csv-slot__title code { background: rgba(91,157,255,.14); color: #b6d2ff; }
:root[data-theme="dark"] .csv-slot.is-error { border-color: #a8783f; }
:root[data-theme="dark"] .csv-slot.is-error .csv-slot__icon { background: #4a3a26; color: #f1c893; }
:root[data-theme="dark"] .csv-slot.is-error .csv-slot__status p { color: #f1c893; }
:root[data-theme="dark"] .csv-slot__orient button[aria-pressed="true"] { background: rgba(91,157,255,.14); }

/* 데이터 시각화 머리의 양식 링크 */
.forms-link { display: inline-flex; margin-top: 12px; color: var(--portal-blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.forms-link:hover { text-decoration: underline; }

/* ---------- 의뢰 가이드: 제출 양식 ---------- */
.sf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.request-guide .sf-head h2 { margin-bottom: 6px; }
.sf-head p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; word-break: keep-all; }
.sf-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--portal-line); border-radius: 9px; background: var(--portal-card); color: var(--portal-ink); font-size: 12.5px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.sf-btn:hover { border-color: var(--portal-blue); color: var(--portal-blue); }
.sf-btn--primary { border-color: var(--portal-blue); background: var(--portal-blue); color: #fff; }
.sf-btn--primary:hover { background: #1854bd; color: #fff; }
.sf-btn--lg { flex: none; min-height: 42px; padding: 0 18px; font-size: 13px; }
.sf-which { margin-bottom: 18px; }
.request-guide .sf-which h3 { margin-bottom: 10px; font-size: 14px; }
.sf-table-wrap { overflow-x: auto; border: 1px solid var(--portal-line); border-radius: 12px; }
.sf-which table, .sf-columns, .sf-preview, .sf-files { width: 100%; border-collapse: collapse; font-size: 13px; }
.sf-which th, .sf-which td, .sf-columns th, .sf-columns td { padding: 10px 14px; border-bottom: 1px solid var(--portal-line); text-align: left; vertical-align: top; line-height: 1.6; }
.sf-which tr:last-child > *, .sf-columns tr:last-child > *, .sf-preview tr:last-child > * { border-bottom: 0; }
.sf-which thead th, .sf-columns thead th, .sf-preview thead th { background: var(--portal-soft); color: var(--muted); font-size: 12px; font-weight: 800; }
.sf-which tbody th { width: 30%; color: var(--portal-ink); white-space: nowrap; }
.sf-which em { margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--portal-blue); color: #fff; font-size: 10.5px; font-style: normal; }
.sf-inline { margin-left: 6px; color: var(--portal-blue); font-weight: 750; white-space: nowrap; }
.sf-cards { display: grid; gap: 14px; }
.sf-card { padding: 20px 22px; border: 1px solid var(--portal-line); border-radius: 16px; background: var(--portal-card); }
.sf-card > header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sf-num { display: grid; flex: none; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--accent-tint-strong, rgba(0,113,227,.14)); color: var(--portal-blue); font-size: 15px; font-weight: 900; }
.sf-name { flex: 1 1 220px; min-width: 0; }
.request-guide .sf-name h3 { font-size: 16px; }
.request-guide .sf-name code { display: inline-block; margin-top: 4px; }
.sf-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-what { margin: 14px 0 4px; color: var(--portal-ink); font-size: 14px; line-height: 1.65; word-break: keep-all; }
.sf-when { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; word-break: keep-all; }
.sf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.sf-row { padding: 4px 11px; border-radius: 99px; background: rgba(31,99,224,.1); color: var(--portal-blue); font-size: 12px; font-weight: 800; }
.sf-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12px; }
.sf-cols b { margin: 0 2px 0 6px; color: var(--muted); font-size: 11.5px; }
.sf-cols b:first-child { margin-left: 0; }
.sf-files { margin-top: 12px; }
.sf-files th, .sf-files td { padding: 8px 10px; border-top: 1px solid var(--portal-line); text-align: left; vertical-align: middle; }
.sf-files th { width: 110px; color: var(--portal-ink); font-size: 13px; }
.sf-files td:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.sf-details { margin-top: 14px; border-top: 1px dashed var(--portal-line); padding-top: 12px; }
.sf-details summary { color: var(--portal-blue); font-size: 13px; font-weight: 800; cursor: pointer; }
.sf-details[open] summary { margin-bottom: 12px; }
.request-guide .sf-details h4 { margin: 14px 0 8px; color: var(--portal-ink); font-size: 13px; }
.sf-columns { min-width: 620px; }
.sf-columns td.is-required { color: var(--portal-blue); font-weight: 800; white-space: nowrap; }
.sf-columns td:nth-child(2) { color: var(--muted); white-space: nowrap; }
.sf-extra { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.sf-preview th, .sf-preview td { padding: 6px 10px; border-bottom: 1px solid var(--portal-line); font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; white-space: nowrap; text-align: left; }
.sf-mistakes { display: grid; gap: 4px; margin: 0; padding-left: 18px; color: var(--portal-ink); font-size: 13px; line-height: 1.6; }
.sf-try { margin-top: 12px; padding: 0; border: 0; background: none; color: var(--portal-blue); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.sf-try:hover { text-decoration: underline; }
.sf-foot { display: grid; gap: 8px; margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--portal-soft); }
.request-guide .sf-foot h3 { margin-bottom: 6px; font-size: 14px; }
.sf-foot ol { margin: 0; padding-left: 18px; color: var(--portal-ink); font-size: 13px; line-height: 1.7; }
.sf-note, .sf-message { margin: 0; color: var(--muted); font-size: 12px; }
.sf-message:empty { display: none; }
.sf-state { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .view:not(#view-home) .processed-format { grid-template-columns: minmax(0, 1fr); }
  .view:not(#view-home) .processed-format label { min-height: 0; }
  .csv-intake__fields { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .csv-intake { padding: 16px 14px; }
  .csv-intake__head, .sf-head { flex-direction: column; align-items: stretch; }
  .csv-intake__guide { align-self: flex-start; }
  .csv-slot { flex-direction: column; padding: 14px; }
  .csv-slot__actions { flex-direction: row; align-items: center; align-self: stretch; justify-content: space-between; }
  .sf-card { padding: 16px; }
  .sf-name { flex: 1 1 0; }
  .sf-actions { flex-basis: 100%; }
  .sf-which tbody th { white-space: normal; width: 38%; }
  .sf-files th { width: auto; }
  .sf-files tr { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--portal-line); }
  .sf-files th, .sf-files td { padding: 0 10px; border: 0; }
  .sf-files td:last-child { justify-content: flex-start; }
}
