/* F1 web tool factory: shared stylesheet. Mobile-first, light and dark, no external fonts. */
:root {
  color-scheme: light dark;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --text: #1c2127;
  --muted: #56616e;
  --border: #d6d9de;
  --accent: #0a6b4d;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ea;
  --warn-bg: #fff4d6;
  --warn-ink: #5e4500;
  --err-bg: #fde7e7;
  --err-ink: #8a1b1b;
  --focus: #1a5fd0;
  --radius: 12px;
  --maxw: 70rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --surface: #181d23;
    --surface-2: #20262e;
    --text: #e6e9ed;
    --muted: #a0aab6;
    --border: #2e3640;
    --accent: #45cf9f;
    --accent-ink: #06170f;
    --accent-soft: #143428;
    --warn-bg: #352b0c;
    --warn-ink: #ffdf86;
    --err-bg: #3a1616;
    --err-ink: #ffb3b3;
    --focus: #8ab4f8;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block; }
.site-nav { display: flex; gap: 16px; font-size: .95rem; }
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 24px 0 32px; color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0; }

/* page */
main { padding-top: 20px; }
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 12px; }
.lede { font-size: 1.05rem; color: var(--text); max-width: 46rem; }
.privacy-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 6px 14px; font-size: .9rem; margin-bottom: 20px; }
.privacy-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.draft-banner { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-weight: 600; }
section { margin: 32px 0; }
.prose { max-width: 46rem; }

/* tool */
.tool { display: grid; gap: 16px; margin-top: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
@media (min-width: 900px) {
  h1 { font-size: 2.1rem; }
  .tool--split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .tool--split .results { position: sticky; top: 16px; }
  .card { padding: 20px 24px; }
}
.tool > .results { margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 10px; }
details.group { border-top: 1px solid var(--border); padding: 4px 0; }
details.group > summary { cursor: pointer; font-weight: 700; padding: 10px 0; min-height: 44px; display: flex; align-items: center; }
details.group[open] > summary { margin-bottom: 4px; }
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field > label, .field-label { font-weight: 600; }
.help { color: var(--muted); font-size: .875rem; margin: 0; }
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
input[type="file"] { font: inherit; max-width: 100%; padding: 8px 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.field--check { display: flex; align-items: flex-start; gap: 10px; }
.field--check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.field--check label { font-weight: 500; }
.seg { display: grid; gap: 8px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { display: block; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; min-height: 44px; background: var(--surface); }
.seg input:checked + label { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (min-width: 560px) { .seg { grid-template-columns: 1fr 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border: 0; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* results */
.results h2 { margin-bottom: 8px; }
.kv { margin: 0; }
.kv-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv-row:last-child { border-bottom: 0; }
.kv-row dt { color: var(--muted); }
.kv-row dd { margin: 0; display: flex; align-items: baseline; gap: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.kv-row dd output { white-space: pre-line; overflow-wrap: anywhere; }   /* 11-14 AI 구매자 검수 다수 지적: 여러 줄 결과(목록 · 날마다 시간 · 단가)가 한 줄로 뭉침 */
.kv-row--primary output { font-size: 1.45rem; font-weight: 700; }
.copy { font: inherit; font-size: .8rem; padding: 4px 10px; min-height: 32px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.copy:disabled { opacity: .45; cursor: default; }
.empty { color: var(--muted); padding: 8px 0 4px; }
.alert { background: var(--err-bg); color: var(--err-ink); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.warnings, .notes { margin: 12px 0 0; padding-left: 1.2em; font-size: .92rem; }
.warnings li { background: var(--warn-bg); color: var(--warn-ink); border-radius: 6px; padding: 6px 10px; margin: 0 0 6px -1.2em; list-style: none; }
.notes { color: var(--muted); }
.notes li { margin-bottom: 4px; }
.table-wrap { margin-top: 16px; overflow: auto; max-height: 30rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.table-wrap table { border-collapse: collapse; font-size: .85rem; min-width: 100%; }
.table-wrap caption { text-align: left; padding: 8px 10px; color: var(--muted); font-size: .85rem; }
.table-wrap th, .table-wrap td { padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; font-variant-numeric: tabular-nums; }
.table-wrap th { position: sticky; top: 0; background: var(--surface-2); }
.notice { color: var(--muted); font-size: .9rem; margin-top: 12px; max-width: 46rem; }
.meta { color: var(--muted); font-size: .85rem; }

/* content sections */
.howto ol { padding-left: 1.3em; max-width: 46rem; }
.howto li { margin-bottom: 6px; }
.faq-item { max-width: 46rem; margin-bottom: 18px; }
.faq-item h3 { margin-bottom: 4px; }
.related ul, .tool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.tool-card h3 { margin-bottom: 6px; }
.tool-card p { color: var(--muted); margin: 0; font-size: .95rem; }
.tool-card .cat { display: inline-block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: 6px; }
.ad-slot { min-height: 90px; border: 1px dashed var(--border); border-radius: 8px; margin: 24px 0; }
.affiliate { font-size: .95rem; }
@media print {
  .site-header, .site-footer, .copy, .actions, .ad-slot, .related { display: none !important; }
  body { background: #fff; color: #000; }
}
