/* TidyRecap base styles: header, footer, type, layout, content blocks.
   The tool page adds /assets/app.css on top of this file. */

:root {
  --text: #1f2328;
  --muted: #57606a;
  --rule: #d8dee4;
  --rule-strong: #b7c0c9;
  --bg: #ffffff;
  --panel: #f6f8fa;
  --accent: #1a7f4b;
  --accent-dark: #13643a;
  --accent-soft: #e9f5ee;
  --focus: #0f5132;
  --radius: 6px;
  --wrap: 1040px;
  --measure: 720px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Malgun Gothic", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

:lang(ko) { word-break: keep-all; }
:lang(ko) body, html[lang="ko"] body { line-height: 1.75; }

img, svg { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  background: var(--bg);
  padding: 8px 12px;
  border: 1px solid var(--rule-strong);
}

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--bg); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  color: var(--text);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent) url("/assets/favicon.svg") center / cover no-repeat;
  flex: none;
}
.brand:hover { color: var(--text); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  padding: 6px 0;
}
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a:first-child { color: var(--accent); font-weight: 600; }

/* Page body */
main { display: block; }
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 40px 20px 64px;
}
.page-wide { max-width: var(--wrap); }

h1, h2, h3 { line-height: 1.3; color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: 34px; margin: 0 0 16px; }
h2 {
  font-size: 24px;
  margin: 48px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
h3 { font-size: 19px; margin: 28px 0 8px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 24px; }
li { margin: 0 0 6px; }
li > ul, li > ol { margin-top: 6px; }

.lead { font-size: 20px; color: var(--text); margin-bottom: 20px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.meta-line { color: var(--muted); font-size: 15px; margin-bottom: 28px; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #ffffff; }
.button-quiet {
  background: var(--bg);
  color: var(--accent);
}
.button-quiet:hover { background: var(--accent-soft); color: var(--accent-dark); }
.button-small { min-height: 40px; padding: 6px 16px; font-size: 15px; }
.actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 24px 0 8px; }
.actions-row .note { color: var(--muted); font-size: 15px; }

/* Home: intro block */
.intro { padding: 12px 0 8px; }
.intro h1 { font-size: 38px; max-width: 20em; }
.promise-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 15px; }
.promise-list li { margin: 0; }
.promise-list li::before { content: "\2713"; color: var(--accent); font-weight: 700; margin-right: 6px; }

/* Purpose rows: one rule between each, no boxes */
.purpose-list { margin: 8px 0 0; padding: 0; list-style: none; }
.purpose-list > li {
  margin: 0;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.purpose-list > li:first-child { border-top: 1px solid var(--rule); }
.purpose-list > li:last-child { border-bottom: 0; }
.purpose-list h3 { margin: 0 0 4px; font-size: 19px; }
.purpose-list h3 .ko-alt { color: var(--muted); font-weight: 400; font-size: 16px; margin-left: 6px; }
.purpose-list p { margin: 0 0 8px; }
.purpose-list .links { font-size: 15px; margin: 0; }
.purpose-list .links a + a { margin-left: 16px; }

/* Numbered steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 8px 0 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 44px;
  margin: 0;
}
.steps > li::before {
  content: counter(step) ".";
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  font-weight: 700;
  color: var(--accent);
  font-size: 19px;
  line-height: 1.5;
}
.steps > li strong { display: block; }

/* Examples, templates, source text */
.example {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 16px 0 24px;
  background: var(--bg);
}
.example-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}
:lang(ko) .example-label { text-transform: none; letter-spacing: 0; font-size: 14px; }
.example h3:first-of-type, .example h4:first-child { margin-top: 0; }
.example h4 { font-size: 17px; margin: 18px 0 6px; }
.example p:last-child, .example ul:last-child, .example ol:last-child { margin-bottom: 0; }

.transcript {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 12px 0 20px;
  font-size: 15px;
  line-height: 1.6;
}
.transcript p { margin: 0 0 8px; }
.transcript p:last-child { margin: 0; }
.transcript .who { font-weight: 600; }

pre.template {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 12px 0 12px;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.copy-row { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.copy-status { color: var(--muted); font-size: 15px; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 12px 0 20px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; border-bottom: 2px solid var(--rule-strong); background: var(--bg); }
caption { text-align: left; font-weight: 700; padding: 0 0 8px; }
th[scope="row"] { border-bottom: 1px solid var(--rule); white-space: nowrap; width: 1%; padding-right: 16px; }
/* Tables with 4 or more columns keep a readable width and scroll inside their box on phones.
   Narrower tables wrap their text instead. */
.table-scroll table:has(thead th:nth-child(4)) { min-width: 600px; }

/* Notes and callouts: plain rule above and below, no side bar */
.note-box {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0 24px;
}
.note-box p:last-child, .note-box ul:last-child { margin-bottom: 0; }
.plan-note { color: var(--muted); font-size: 15.5px; }
.plan-note strong { color: var(--text); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--rule); padding: 4px 0; }
.faq details:first-of-type { border-top: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 28px 12px 0;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 10px;
  font-size: 20px;
  color: var(--muted);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 12px; }

/* Guide list */
.guide-list { list-style: none; padding: 0; margin: 8px 0 0; }
.guide-list li { padding: 16px 0; margin: 0; border-bottom: 1px solid var(--rule); }
.guide-list li:first-child { border-top: 1px solid var(--rule); }
.guide-list li:last-child { border-bottom: 0; }
.guide-list a { font-weight: 600; font-size: 18px; }
.guide-list p { margin: 4px 0 0; color: var(--muted); font-size: 15.5px; }

/* Tool call to action inside guides */
.cta {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
  margin: 40px 0 8px;
}
.cta h2 { border: 0; padding: 0; margin: 0 0 8px; font-size: 21px; }
.cta p { margin-bottom: 14px; }

.sources { font-size: 15px; color: var(--muted); }
.sources li { margin-bottom: 8px; }
.pair-link { margin-top: 40px; font-size: 15px; color: var(--muted); }

/* Ad units: kept away from buttons and navigation by wide margins */
.ad-unit {
  margin: 64px 0;
  padding: 10px 0 14px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-height: 120px;
}
.ad-label {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
:lang(ko) .ad-label { text-transform: none; letter-spacing: 0; }
.ad-unit + h2 { border-top: 0; padding-top: 0; margin-top: 0; }

/* Contact form (/contact): hidden until its script runs, so it never posts without it */
[hidden] { display: none !important; }
.contact-form { margin: 8px 0 12px; }
.cf-topics { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.cf-label { display: block; font-weight: 600; font-size: 16px; margin: 0 0 6px; padding: 0; }
.cf-topic {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
}
.cf-topic:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cf-topic input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
.cf-help { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.contact-form textarea,
.contact-form input[type="text"] {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.55;
}
.contact-form textarea { min-height: 180px; resize: vertical; }
.contact-form textarea:focus,
.contact-form input[type="text"]:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.contact-form input[type="radio"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cf-count { color: var(--muted); font-size: 14px; text-align: right; margin: 6px 0 20px; font-variant-numeric: tabular-nums; }
.cf-count.is-over { color: var(--text); font-weight: 700; }
.cf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .turnstile { margin: 18px 0 0; }
.cf-actions { margin: 20px 0 0; }
.contact-form .button:disabled { opacity: 0.55; cursor: not-allowed; }
.cf-status { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); font-size: 15.5px; line-height: 1.55; }
.cf-status.is-error { background: var(--panel); border: 1px solid var(--rule-strong); font-weight: 600; }
.cf-done { margin: 8px 0 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--accent-soft); }
.cf-done:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.cf-done-title { font-weight: 700; }
.cf-done p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 15px;
  padding: 24px 0 40px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; padding: 6px 0; display: inline-block; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 0; }

/* Phone widths */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .page { padding: 28px 16px 48px; }
  .wrap { padding: 0 16px; }
  h1, .intro h1 { font-size: 28px; }
  h2 { font-size: 21px; margin-top: 40px; padding-top: 24px; }
  .lead { font-size: 18px; }
  .site-header .wrap { min-height: 56px; }
  .site-nav { gap: 2px 16px; }
  .site-nav a { font-size: 15px; }
  .button { width: 100%; }
  .actions-row .button { width: auto; flex: 1 1 100%; }
  .example { padding: 16px; }
  pre.template { padding: 14px; font-size: 14px; }
  table { font-size: 14.5px; }
  th, td { padding: 8px 8px; }
  .copy-row .button { width: auto; }
  /* Stacked tables: each row becomes a block, each cell shows its column heading */
  .table-scroll table.stack { min-width: 0 !important; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; left: -9999px; }
  table.stack tr { border-bottom: 1px solid var(--rule-strong); padding: 10px 0; }
  table.stack tr:first-child { border-top: 2px solid var(--rule-strong); }
  table.stack td { border: 0; padding: 3px 0; }
  table.stack td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
  }
}

@media print {
  .site-header, .site-footer, .ad-unit, .cta, .copy-row { display: none; }
  body { font-size: 12pt; }
}
