/* Cup2toGram: cream + tomato theme */
:root {
  --bg: #f7f2e8;
  --ink: #1f2a24;
  --muted: #4a544e;
  --line: #e3d9c6;
  --field: #d8ccb4;
  --card: #ffffff;
  --accent: #a93a18;
  --accent-dark: #8c2f12;
  --tint: #fbece5;
  --tint-2: #f6d9cb;
  --badge: #fbe3d8;
  --soft: #f1ece1;
  --radius: 16px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
img, svg { max-width: 100%; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(34px, 5vw, 60px); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 700; }
h3, .h3 { font-size: 21px; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 19px; color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1.5px solid transparent; font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--field); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.linkbtn { background: none; border: 0; padding: 8px 0; font: inherit; font-size: 14px; font-weight: 700; color: var(--accent-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* header */
.site-head { padding: 16px 0; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-word { font-family: var(--serif); font-weight: 700; font-size: 24px; letter-spacing: -0.01em; }
.nav-pill { display: none; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px; }
.nav-pill a { padding: 8px 16px; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 500; }
.nav-pill a:hover { background: var(--tint); color: var(--ink); }
.nav-pill a.on { background: var(--accent); color: #fff; font-weight: 700; }
.head-cta { display: none; border-radius: 999px; }
.mnav { position: relative; }
.mnav summary { list-style: none; cursor: pointer; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; }
.mnav summary::-webkit-details-marker { display: none; }
.mnav-panel { position: absolute; right: 0; top: 54px; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px; width: 240px; box-shadow: 0 20px 40px -20px rgba(31, 42, 36, .35); display: flex; flex-direction: column; }
.mnav-panel a { padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 500; }
.mnav-panel a:hover { background: var(--tint); }
@media (min-width: 1000px) {
  .nav-pill { display: flex; }
  .head-cta { display: inline-flex; }
  .mnav { display: none; }
}

/* breadcrumbs */
.crumbs ol { list-style: none; margin: 0 auto 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--field); }
.crumbs a { color: var(--muted); }

/* hero */
.hero { padding: 24px 0 56px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
.badge { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--badge); color: var(--accent-dark); font-size: 14px; font-weight: 700; margin-bottom: 18px; }
.hero h1 { margin-bottom: 6px; }
.hero-sub { font-family: var(--serif); font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; line-height: 1.1; margin-bottom: 18px; }
.hero-sub em { color: var(--accent); }
.hero-tool { position: relative; }
.tool-shadow { display: none; }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 72px; }
  .tool-shadow { display: block; position: absolute; inset: 26px -18px -18px 26px; border-radius: 30px; background: var(--tint-2); }
}

/* search */
.search label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.search-box { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--field); border-radius: 16px; padding: 6px 6px 6px 16px; max-width: 540px; }
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { color: var(--muted); flex-shrink: 0; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 17px; background: transparent; color: var(--ink); padding: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font-size: 14px; color: var(--ink); text-decoration: none; }
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }

/* cards + converter */
.card { background: var(--card); border-radius: 26px; box-shadow: 0 1px 0 var(--line), 0 26px 50px -30px rgba(31, 42, 36, .35); }
.card.pad, .pad { padding: 26px; }
.card-soft { background: var(--tint); border-radius: var(--radius); padding: 20px 22px; }
.conv { position: relative; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 15px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 700; }
.conv-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.conv-fields .field-ing { grid-column: 1 / -1; }
@media (min-width: 560px) { .conv-fields { grid-template-columns: .8fr 1fr 1.4fr; } .conv-fields .field-ing { grid-column: auto; } .conv-fields.two { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea, .form textarea { width: 100%; min-height: 50px; border-radius: 12px; border: 1.5px solid var(--field); background: #fff; padding: 0 12px; font: inherit; font-size: 17px; color: var(--ink); }
.field textarea { padding: 12px; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.conv-result { background: var(--accent); color: #fff; border-radius: 20px; padding: 22px 24px; display: flex; flex-direction: column; gap: 2px; }
.conv-label { font-size: 15px; opacity: .9; }
.conv-main { font-family: var(--serif); font-size: clamp(44px, 7vw, 72px); font-weight: 700; line-height: 1.05; word-break: break-word; }
.conv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.conv-stats div { background: var(--tint); border-radius: 12px; padding: 12px 6px; display: flex; flex-direction: column; }
.conv-stats strong { color: var(--accent-dark); font-size: 17px; line-height: 1.3; }
.conv-stats span { font-size: 12px; color: var(--muted); }
.conv-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.conv-foot label { font-weight: 700; }
.conv-foot select { min-height: 40px; border-radius: 10px; border: 1.5px solid var(--field); background: #fff; font: inherit; font-size: 14px; padding: 0 8px; }
.conv-foot .linkbtn { margin-left: auto; }

/* sections */
.section { margin-top: 56px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.more { font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }
.tile-l { font-size: 15px; color: var(--muted); }
.tile-v { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--accent); }
.two-col { display: grid; gap: 20px; }
@media (min-width: 800px) { .two-col { grid-template-columns: 1fr 1fr; } }
.link-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; }
.link-list li { padding: 6px 0; break-inside: avoid; }
.band { background: var(--ink); color: var(--bg); border-radius: 28px; padding: 36px 28px; display: grid; gap: 28px; align-items: center; }
.band h2 { color: #fff; }
.band p { color: #cfd5ce; }
.band-demo { background: var(--bg); color: var(--ink); border-radius: 18px; padding: 10px 22px; }
.band-demo div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.band-demo div:last-child { border-bottom: 0; }
.band-demo strong { font-family: var(--serif); font-size: 20px; }
@media (min-width: 860px) { .band { grid-template-columns: 1fr 1fr; padding: 48px; } }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cat { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.cat:hover { border-color: var(--accent); color: var(--ink); }
.cat strong { font-family: var(--serif); font-size: 20px; }
.cat span { color: var(--muted); font-size: 14px; }
.prose-wrap { display: grid; gap: 32px; }
@media (min-width: 900px) { .prose-wrap { grid-template-columns: 1.6fr 1fr; } }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.formula { font-family: var(--serif); font-size: 22px; background: var(--tint); border-radius: 12px; padding: 14px 18px; display: inline-block; }
.guide-card { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-decoration: none; color: var(--ink); margin-bottom: 12px; }
.guide-card:hover { border-color: var(--accent); color: var(--ink); }
.guide-card span { color: var(--muted); font-size: 15px; }
.guide-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* inner pages */
.page { padding-bottom: 40px; }
.page-top { display: grid; gap: 32px; align-items: start; }
@media (min-width: 960px) { .page-top { grid-template-columns: 1fr 1fr; gap: 56px; } }
.answer { background: #fff; border: 1px solid var(--line); border-left: 0; border-radius: 20px; padding: 20px 24px; margin: 8px 0 20px; display: flex; flex-direction: column; gap: 2px; box-shadow: inset 6px 0 0 var(--accent); }
.answer-q { color: var(--muted); font-size: 15px; }
.answer-a { font-family: var(--serif); font-size: clamp(36px, 5vw, 52px); font-weight: 700; color: var(--accent); line-height: 1.1; }
.answer-s { font-size: 15px; color: var(--muted); }
.answer-list { font-size: 19px; font-weight: 500; }
.toc { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 15px; }
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; margin-bottom: 18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl th, .tbl td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl thead th { background: var(--tint); font-size: 14px; color: var(--accent-dark); }
.tbl tbody th { font-weight: 500; }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fdfaf5; }
.tbl tr.is-current { background: var(--tint); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.facts div { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; }
.facts strong { font-family: var(--serif); font-size: 26px; color: var(--accent); }
.facts span { color: var(--muted); font-size: 14px; }
.aff { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 32px; }
.aff p { margin: 4px 0 0; color: var(--muted); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 700; list-style: none; position: relative; padding-right: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 12px; font-size: 24px; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 16px; margin: 0; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.pager a { font-weight: 700; }
.pager .next { margin-left: auto; }
.source { margin-top: 32px; }
.feedback { margin-top: 32px; }
.fb-q { font-weight: 700; margin-bottom: 10px; }
.fb-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fb-form { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.fb-form textarea { border-radius: 12px; border: 1.5px solid var(--field); padding: 10px; font: inherit; }
.fb-form .btn { align-self: flex-start; }
.fb-thanks { margin: 10px 0 0; font-weight: 700; color: var(--accent-dark); }
.notice { background: var(--tint); border-radius: 14px; padding: 16px 20px; margin-bottom: 20px; font-weight: 500; }
.notice-err { background: #fde2dc; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form .btn { align-self: flex-start; }
.cta-box { margin-top: 32px; }
.cta-box p { margin: 4px 0 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.chart-block { margin-top: 28px; }
.print-only { display: none; }
.ad-slot { max-width: 1200px; margin: 32px auto; padding: 0 20px; text-align: center; min-height: 90px; }

/* recipe converter */
.recipe { display: grid; gap: 28px; margin-top: 24px; }
@media (min-width: 900px) { .recipe { grid-template-columns: 1fr 1fr; } }
.recipe-in label { font-weight: 700; font-size: 14px; display: block; margin-bottom: 8px; }
.recipe-in textarea { width: 100%; border-radius: 14px; border: 1.5px solid var(--field); padding: 14px; font: inherit; font-size: 16px; line-height: 1.7; resize: vertical; }
.recipe-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.recipe-out { background: var(--bg); border-radius: 18px; padding: 20px; }
.recipe-out-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rc-list { list-style: none; margin: 10px 0; padding: 0; }
.rc-list li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rc-list li strong { font-family: var(--serif); font-size: 19px; white-space: nowrap; }
.rc-list li.unknown { color: var(--muted); }

/* footer */
.site-foot { margin-top: 80px; border-top: 1px solid var(--line); padding: 48px 0 24px; background: #f3ecdf; }
.foot-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { padding: 4px 0; }
.foot-grid a { color: var(--ink); text-decoration: none; font-size: 15px; }
.foot-grid a:hover { color: var(--accent); text-decoration: underline; }
.foot-h { font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot-bottom nav { display: flex; gap: 18px; }
.foot-bottom a { color: var(--muted); }

@media print {
  .site-head, .site-foot, .no-print, .ad-slot, .crumbs, .feedback { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .tbl-wrap { border: 0; overflow: visible; }
  .tbl th, .tbl td { padding: 4px 8px; font-size: 10pt; }
  .tbl a { color: #000; text-decoration: none; }
  .chart-block { break-inside: avoid; }
  .print-only { display: block; }
}

/* keep grid children from overflowing on small screens */
.hero-grid > *, .page-top > *, .two-col > *, .prose-wrap > *, .recipe > *, .band > * { min-width: 0; }
.search-box .btn { padding: 0 16px; }
@media (max-width: 420px) {
  .conv { padding: 18px; }
  .conv-stats strong { font-size: 15px; }
  .recipe-opts { grid-template-columns: 1fr 1fr; }
}
