/* =========================================================================
   오늘의 리빙노트 — 공용 스타일
   큰 글씨 · 높은 대비 · A4 인쇄 최적화
   ========================================================================= */

:root {
  --ink: #1b1b1b;
  --ink-soft: #43403b;
  --muted: #6b665e;
  --paper: #ffffff;
  --bg: #f6f2e9;
  --card: #fffdf8;
  --brand: #14614f;
  --brand-dark: #0d4438;
  --brand-soft: #e3efe9;
  --accent: #a9550b;
  --accent-soft: #fbeee0;
  --line: #d9d2c3;
  --line-strong: #b9b1a0;
  --focus: #1d4ed8;
  --shadow: 0 10px 30px rgba(38, 32, 22, 0.10);
  --radius: 16px;
  --font: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR",
          "Noto Sans CJK KR", "Nanum Gothic", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
}

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

a { color: var(--brand-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--brand); color: #fff; padding: 12px 18px; z-index: 100;
  border-radius: 0 0 10px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- header */
.site-header {
  background: #fffdf8;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); font-weight: 800; font-size: 22px;
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 800; line-height: 1;
}
.logo small {
  display: block; font-size: 13px; font-weight: 500; color: var(--muted);
  letter-spacing: 0;
}
.main-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  display: inline-block; padding: 10px 14px; border-radius: 10px;
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 17px;
}
.main-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.main-nav a[aria-current="page"] {
  background: var(--brand); color: #fff;
}

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.page-main { padding: 34px 0 60px; }
.narrow { max-width: 860px; margin: 0 auto; }

.hero {
  background: linear-gradient(180deg, #fffdf8 0%, #f3ece0 100%);
  border-bottom: 1px solid var(--line);
  padding: 54px 0 46px;
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center;
}
.eyebrow {
  display: inline-block; background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 700; font-size: 15px; padding: 6px 14px; border-radius: 999px;
  margin-bottom: 16px;
}
h1 {
  font-size: 40px; line-height: 1.32; letter-spacing: -0.03em; margin: 0 0 18px;
}
h2 { font-size: 29px; line-height: 1.4; letter-spacing: -0.02em; margin: 0 0 14px; }
h3 { font-size: 22px; line-height: 1.45; margin: 0 0 10px; }
p { margin: 0 0 16px; }
.lead { font-size: 21px; color: var(--ink-soft); }
.muted { color: var(--muted); }
.small { font-size: 15px; line-height: 1.6; }

.hero-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 26px;
}
.hero-card h2 { font-size: 20px; margin-bottom: 14px; }
.hero-list { list-style: none; margin: 0; padding: 0; }
.hero-list li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
  font-size: 18px;
}
.hero-list li:last-child { border-bottom: 0; }
.hero-list .tick {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: 16px; font-weight: 800; margin-top: 2px;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 14px 26px;
  font-family: inherit; font-size: 20px; font-weight: 800;
  border-radius: 12px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #8a4407; color: #fff; }
.btn-outline { background: #fff; color: var(--brand-dark); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }
.btn-sm { min-height: 46px; font-size: 17px; padding: 10px 18px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- tool cards */
.tool-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 28px 0 8px;
}
.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 22px; display: flex; flex-direction: column;
  box-shadow: 0 4px 14px rgba(38, 32, 22, .05);
}
.tool-card .icon {
  width: 56px; height: 56px; border-radius: 14px; background: var(--brand-soft);
  display: grid; place-items: center; margin-bottom: 16px;
  font-size: 26px; font-weight: 800; color: var(--brand-dark);
}
.tool-card h3 { font-size: 23px; margin-bottom: 8px; }
.tool-card p { color: var(--ink-soft); font-size: 17px; flex: 1; }
.tool-card .tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.tag {
  font-size: 14px; font-weight: 700; color: var(--brand-dark);
  background: var(--brand-soft); padding: 4px 10px; border-radius: 8px;
}

/* ---------------------------------------------------------------- section */
.section { padding: 46px 0; }
.section-head { max-width: 720px; margin-bottom: 22px; }
.section-alt { background: #fffdf8; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.step {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
}
.step .num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-weight: 800; display: grid; place-items: center;
  font-size: 19px; margin-bottom: 12px;
}
.step h3 { font-size: 20px; }
.step p { margin: 0; font-size: 17px; color: var(--ink-soft); }

.faq { border-top: 1px solid var(--line); }
.faq details {
  border-bottom: 1px solid var(--line); padding: 6px 0;
}
.faq summary {
  cursor: pointer; font-weight: 700; font-size: 20px; padding: 16px 4px;
  list-style: none; position: relative; padding-right: 40px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 8px; top: 12px;
  font-size: 26px; font-weight: 500; color: var(--muted);
}
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 4px 18px; color: var(--ink-soft); font-size: 18px; }

/* ---------------------------------------------------------------- tool page */
.tool-layout {
  display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 28px; align-items: start;
  margin-top: 10px;
}
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: 0 4px 16px rgba(38, 32, 22, .05);
  position: sticky; top: 86px;
}
.panel h2 { font-size: 24px; margin-bottom: 6px; }
.panel .hint { font-size: 16px; color: var(--muted); margin-bottom: 18px; }

.field { margin-bottom: 20px; }
.field > label, .field-label {
  display: block; font-weight: 800; font-size: 18px; margin-bottom: 8px;
}
.field .help { font-size: 15px; color: var(--muted); margin-top: 6px; }

input[type="text"], input[type="date"], textarea, select {
  width: 100%; font-family: inherit; font-size: 19px; color: var(--ink);
  background: #fff; border: 2px solid var(--line-strong); border-radius: 10px;
  padding: 12px 14px; min-height: 52px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: none; }

.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 10px 18px; border-radius: 10px;
  border: 2px solid var(--line-strong); background: #fff;
  font-size: 18px; font-weight: 700; cursor: pointer;
}
.choice input:checked + span {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.preset-row { display: flex; gap: 10px; flex-wrap: wrap; }
.checkline {
  display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600;
  cursor: pointer; padding: 6px 0;
}
.checkline input { width: 26px; height: 26px; accent-color: var(--brand); }

.status { font-size: 16px; color: var(--brand-dark); background: var(--brand-soft);
  border-radius: 10px; padding: 10px 14px; margin-top: 14px; display: none; }
.status.show { display: block; }
.status.warn { background: var(--accent-soft); color: #7a3c05; }

/* preview */
.preview { min-width: 0; }
.preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.preview-head h2 { font-size: 22px; margin: 0; }
.sheet-stage {
  background: #e9e3d6; border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 22px;
  overflow-x: auto;
}

/* ---------------------------------------------------------------- A4 sheet */
.sheet {
  width: 210mm; min-height: 297mm; padding: 10mm;
  background: #fff; color: #000; box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
  font-size: 12pt; line-height: 1.4;
  display: flex; flex-direction: column;
}
.sheet * { box-sizing: border-box; }
.sheet-head { border-bottom: 2.5pt solid #000; padding-bottom: 3mm; margin-bottom: 4mm; }
.sheet-title {
  font-size: 22pt; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 1.5mm;
  line-height: 1.2;
}
.sheet-sub {
  display: flex; justify-content: space-between; gap: 6mm;
  font-size: 11pt; color: #333;
}
.sheet-sub .fill { flex: 1; }
.sheet-sub .fill span { display: inline-block; min-width: 34mm; border-bottom: 1pt solid #777; }

.sheet-body { flex: 1; display: flex; flex-direction: column; }
.sheet-foot {
  margin-top: auto; padding-top: 3mm; border-top: 1pt solid #bbb;
  display: flex; justify-content: space-between; font-size: 8.5pt; color: #444;
}

/* word search */
.ws-grid {
  display: grid; gap: 0;
  width: 170mm; max-width: 100%; aspect-ratio: 1 / 1; margin: 0 auto;
  border: 2pt solid #000; background: #000;
}
.ws-cell {
  background: #fff; display: grid; place-items: center;
  border-right: 0.5pt solid #b9b9b9; border-bottom: 0.5pt solid #b9b9b9;
  font-weight: 600; color: #000; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ws-cell.ans { background: #d9d9d9; font-weight: 800; }
.ws-words { margin-top: 5mm; }
.ws-words h3 {
  font-size: 11pt; margin: 0 0 1mm; color: #333; font-weight: 700; letter-spacing: .04em;
}
.ws-word-list {
  columns: 3; column-gap: 8mm; list-style: none; margin: 0; padding: 0;
  font-size: 18pt; font-weight: 700; line-height: 1.5;
}
.ws-word-list li { break-inside: avoid; display: flex; align-items: center; gap: 2mm; }
.ws-word-list .box {
  flex: 0 0 4mm; width: 4mm; height: 4mm; border: 1pt solid #555; border-radius: 0.6mm;
}
.ws-word-list .box.on { background: #555; }

/* math */
.math-note { font-size: 11pt; color: #333; margin-bottom: 4mm; }
.math-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10mm; flex: 1; grid-auto-rows: 1fr; }
.math-item {
  display: flex; align-items: center; gap: 2.5mm;
  font-size: 22pt; font-weight: 700; padding: 2.2mm 0;
  border-bottom: 0.5pt dashed #c9c9c9;
}
.math-item .no { font-size: 11pt; font-weight: 600; color: #555; min-width: 7mm; }
.math-item .eq { white-space: nowrap; font-variant-numeric: tabular-nums; }
.math-item .blank {
  display: inline-block; min-width: 18mm; border-bottom: 1.5pt solid #000; height: 1em;
}
.math-item .blank.filled { border-bottom: 0; font-weight: 800; text-align: center; }
.math-answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3mm 6mm; }
.math-answers .ans-item { font-size: 13pt; font-weight: 600; }
.math-answers .ans-item b { font-weight: 800; }

/* care sheet */
.care-meds {
  border: 1.5pt solid #000; border-radius: 2mm; padding: 3mm 4mm; margin-bottom: 4mm;
}
.care-meds h3 { font-size: 12pt; margin: 0 0 2mm; }
.care-meds ol { margin: 0; padding-left: 6mm; font-size: 13pt; line-height: 1.75; }
.care-meds .dot { display: inline-block; min-width: 55mm; border-bottom: 1pt dotted #666; }
.care-table { width: 100%; border-collapse: collapse; }
.care-table th, .care-table td {
  border: 1pt solid #000; padding: 1.6mm 1mm; text-align: center;
  font-size: 13pt;
}
.care-table thead th { background: #ededed; font-size: 12pt; padding: 2mm 1mm; }
.care-table td.day { font-weight: 800; font-size: 14pt; white-space: nowrap; }
.care-table td.day small { display: block; font-weight: 500; font-size: 9.5pt; color: #444; }
.care-table .chk {
  width: 9mm; height: 9mm; border: 1.2pt solid #000; border-radius: 1mm;
  margin: 0 auto; display: block; background: #fff;
}
.care-table td.note { text-align: left; padding-left: 2mm; }
.care-memo { margin-top: 4mm; border: 1.5pt solid #000; border-radius: 2mm; padding: 3mm 4mm; flex: 1; }
.care-memo h3 { font-size: 12pt; margin: 0 0 3mm; }
.care-memo .line { border-bottom: 1pt solid #aaa; height: 9mm; }
.care-legend { font-size: 9.5pt; color: #444; margin-top: 2mm; display: flex; gap: 6mm; }

/* ---------------------------------------------------------------- ads */
.ad-slot {
  min-height: 250px; width: 100%; margin: 26px 0;
  display: flex; align-items: center; justify-content: center;
  background: #fffdf8; border: 1px dashed var(--line-strong); border-radius: 12px;
  color: var(--muted); font-size: 14px; text-align: center; overflow: hidden;
}
.ad-slot.ads-on { border: 0; background: transparent; }
.ad-slot.side { min-height: 600px; }

/* ---------------------------------------------------------------- recommend */
.recommend {
  background: #fffdf8; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin: 26px 0;
}
.recommend h2 { font-size: 22px; margin-bottom: 4px; }
.recommend .sub { font-size: 16px; color: var(--muted); margin-bottom: 18px; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.product {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  background: #fff; display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; color: inherit;
}
.product:hover { border-color: var(--brand); }
.product .p-badge {
  align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 2px 8px;
}
.product .p-title { font-weight: 800; font-size: 18px; }
.product .p-desc { font-size: 15px; color: var(--ink-soft); line-height: 1.55; margin: 0; }
.product .p-cta { font-size: 15px; font-weight: 800; color: var(--brand-dark); margin-top: auto; }
.product.static { opacity: .96; }
.disclosure { font-size: 13px; color: var(--muted); margin-top: 14px; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  background: var(--brand-dark); color: #e9f1ee; padding: 34px 0 40px; margin-top: 20px;
}
.site-footer a { color: #fff; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.footer-top { display: flex; gap: 26px; flex-wrap: wrap; justify-content: space-between; }
.footer-brand { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 16px; }
.footer-note { font-size: 14px; color: #c7d8d2; margin-top: 18px; line-height: 1.7; }

/* ---------------------------------------------------------------- prose */
.prose h2 { margin-top: 38px; font-size: 26px; }
.prose h3 { margin-top: 26px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; font-size: 18px; }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0 22px; font-size: 17px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: #fffdf8; }
.callout {
  background: var(--brand-soft); border-left: 5px solid var(--brand);
  border-radius: 0 10px 10px 0; padding: 16px 20px; margin: 22px 0; font-size: 17px;
}
.page-title { font-size: 34px; margin: 0 0 8px; letter-spacing: -0.03em; }
.page-sub { font-size: 19px; color: var(--ink-soft); margin-bottom: 26px; }
.breadcrumb { font-size: 15px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }

/* ---------------------------------------------------------------- print */
@media print {
  @page { size: A4; margin: 10mm; }

  html, body {
    background: #fff !important;
    font-size: 12pt;
    margin: 0; padding: 0;
  }
  .no-print, .site-header, .site-footer, .ad-slot, .recommend,
  .panel, .preview-head, .hero, .tool-grid, .section,
  .breadcrumb, .prose, .callout, .skip-link { display: none !important; }

  .page-main { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }
  .tool-layout { display: block; margin: 0; gap: 0; }
  .preview { display: block; }
  .sheet-stage {
    display: block !important; zoom: 1 !important;
    background: none !important; border: 0 !important;
    padding: 0 !important; margin: 0 !important;
    overflow: visible !important; gap: 0 !important;
  }
  .print-root { display: block !important; margin: 0; padding: 0; }

  .sheet {
    width: 100%; min-height: 268mm; padding: 0; margin: 0;
    box-shadow: none; border: none; page-break-after: always;
    break-after: page;
  }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
  .ws-cell.ans { background: #d0d0d0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .care-table thead th { background: #ededed !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1040px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 18px; }
  h1 { font-size: 31px; }
  h2 { font-size: 25px; }
  .page-title { font-size: 28px; }
  .tool-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .main-nav { width: 100%; margin-left: 0; gap: 0; overflow-x: auto; }
  .main-nav a { padding: 10px 12px; font-size: 16px; white-space: nowrap; }
  .header-inner { padding: 10px 16px; gap: 10px; }
  .site-header { position: static; }
  .hero { padding: 34px 0 30px; }
  .wrap { padding: 0 16px; }
  .sheet-stage { padding: 10px; align-items: flex-start; }
  .ad-slot { min-height: 180px; }
}

@media (max-width: 460px) {
  .sheet { width: 210mm; }
  .sheet-stage { overflow-x: auto; }
}
