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

:root {
  --red:        #c0392b;
  --red-dark:   #8e2a1f;
  --red-bg:     #fbeae7;
  --red-text:   #5b1a13;

  --amber:      #d68a1f;
  --amber-bg:   #fdf4dc;
  --amber-text: #7a4d0f;

  --border:     rgba(0,0,0,0.10);
  --text:       #1a1a1a;
  --text-muted: #555;
  --text-hint:  #888;
  --bg:         #f8f5f0;
  --surface:    #ffffff;
  --surface2:   #f2eee7;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;

  --done-rare:        #d94a3d;
  --done-rare-bg:     #fceae7;
  --done-mr:          #e26a3a;
  --done-mr-bg:       #fdeee2;
  --done-m:           #d99220;
  --done-m-bg:        #fbf2dc;
  --done-mw:          #8a8a52;
  --done-mw-bg:       #efeede;
  --done-w:           #5d6b6f;
  --done-w-bg:        #e6ebec;
  --done-tender:      #6b4a2a;
  --done-tender-bg:   #f0e6d8;
  --done-safe:        #2e7d52;
  --done-safe-bg:     #e1f0e6;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; }

.page { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

/* ── Top bar ── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; gap: 12px;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); padding: .5rem 0; margin-top: -.5rem;
}
.logo {
  font-size: 15px; font-weight: 800; letter-spacing: .04em;
  color: var(--text); text-decoration: none;
}
.logo span { color: var(--red); }

.top-actions { display: flex; align-items: center; gap: 8px; }

/* ── Unit toggle ── */
.unit-toggle {
  display: inline-flex; align-items: stretch;
  height: 36px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  font-family: inherit; cursor: pointer; padding: 0;
  overflow: hidden;
}
.unit-toggle span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 0 12px;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  transition: background .12s, color .12s;
}
html[data-unit="c"] .unit-toggle .unit-c,
html[data-unit="f"] .unit-toggle .unit-f {
  background: var(--red); color: #fff;
}

/* ── Language picker ── */
.lang-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.lang-btn {
  height: 28px; padding: 0 10px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  font-family: inherit; font-size: 11px; font-weight: 700;
  color: var(--text-muted); cursor: pointer; transition: all .12s;
  display: inline-flex; align-items: center; gap: 4px; text-decoration: none;
}
.lang-btn:hover { background: var(--surface2); }
.lang-btn.active { background: var(--red-bg); border-color: var(--red); color: var(--red-text); }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px; margin-bottom: 1rem;
  font-size: 13px; color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb .bc-sep { color: var(--text-hint); }
.breadcrumb .bc-current { color: var(--text); font-weight: 700; }

/* ── Hero ── */
.hero { margin-bottom: 2rem; }
.hero h1 {
  font-size: clamp(28px, 6vw, 44px); font-weight: 800;
  line-height: 1.1; margin-bottom: .5rem; letter-spacing: -.01em;
}
.hero p { font-size: 16px; color: var(--text-muted); line-height: 1.6; }

/* ── Page head (meat hub + cut page) ── */
.page-head { margin-bottom: 1.5rem; }
.page-head h1 {
  font-size: clamp(26px, 5vw, 36px); font-weight: 800;
  line-height: 1.1; letter-spacing: -.01em;
  margin-bottom: .25rem;
}
.page-head .page-sub { font-size: 14px; color: var(--text-muted); }

/* ── Section labels ── */
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-hint);
  margin-bottom: .75rem;
}

/* ── Meat grid (homepage) ── */
.meat-grid-section { margin-bottom: 2.5rem; }
.meat-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.meat-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1rem 1.1rem; text-decoration: none; color: inherit;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.meat-card:hover { border-color: var(--red); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(192,57,43,0.08); }
.meat-card .meat-name { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.meat-card .meat-tagline { font-size: 13px; color: var(--text-muted); }

/* ── Cut grid (meat hub) ── */
.cut-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cut-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: .9rem 1rem; text-decoration: none; color: inherit;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.cut-card:hover { border-color: var(--red); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(192,57,43,0.08); }
.cut-card .cut-name { font-size: 16px; font-weight: 700; }
.cut-card .cut-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-family: 'DM Mono', monospace; }
.cut-card .cut-chev { color: var(--text-hint); flex-shrink: 0; font-size: 18px; }
.cut-card .safety-badge {
  display: inline-block; font-size: 10px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  background: var(--amber-bg); color: var(--amber-text);
  padding: 3px 8px; border-radius: 99px; margin-left: 6px;
}

/* ── Doneness cards (cut page) ── */
.doneness-section { margin-bottom: 1.75rem; }
.doneness-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: .75rem; }
.doneness-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1rem 1.1rem;
  border-left-width: 4px;
}
.doneness-card.d-rare        { border-left-color: var(--done-rare);   background: var(--done-rare-bg); }
.doneness-card.d-medium-rare { border-left-color: var(--done-mr);     background: var(--done-mr-bg); }
.doneness-card.d-medium      { border-left-color: var(--done-m);      background: var(--done-m-bg); }
.doneness-card.d-medium-well { border-left-color: var(--done-mw);     background: var(--done-mw-bg); }
.doneness-card.d-well-done   { border-left-color: var(--done-w);      background: var(--done-w-bg); }
.doneness-card.d-tender      { border-left-color: var(--done-tender); background: var(--done-tender-bg); }
.doneness-card.d-safe-minimum { border-left-color: var(--done-safe);  background: var(--done-safe-bg); }

.doneness-card .doneness-name {
  font-size: 14px; font-weight: 800; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text); margin-bottom: 4px;
}
.doneness-card .doneness-temp {
  font-family: 'DM Mono', monospace; font-size: 28px; font-weight: 500;
  letter-spacing: -.02em; line-height: 1.1;
}
.doneness-card .doneness-desc {
  font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5;
}

/* C/F display: pre-rendered both, toggle hides one */
.temp-c, .temp-f { display: inline; }
html[data-unit="c"] .temp-f { display: none; }
html[data-unit="f"] .temp-c { display: none; }

/* ── Safety panel ── */
.safety-panel {
  background: var(--amber-bg); border: 1px solid #efc873;
  border-radius: var(--radius-md); padding: 1.1rem 1.2rem;
  margin-bottom: 1.5rem;
}
.safety-panel h2 {
  font-size: 14px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--amber-text);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: .6rem;
}
.safety-panel h2::before { content: "⚠"; font-size: 18px; }
.safety-panel p { font-size: 14px; color: var(--text); line-height: 1.6; margin-bottom: .75rem; }
.safety-panel .safe-temp {
  display: inline-flex; align-items: baseline; gap: 10px;
  background: #fff; border: 1px solid #efc873; border-radius: var(--radius-sm);
  padding: .5rem .85rem; margin-top: .25rem;
}
.safety-panel .safe-temp-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--amber-text);
}
.safety-panel .safe-temp-val {
  font-family: 'DM Mono', monospace; font-size: 20px; font-weight: 500;
}

/* ── Rest / carryover info ── */
.rest-info {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: .85rem 1rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 1.5rem;
}
.rest-info .info-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-hint);
  margin-bottom: 3px;
}
.rest-info .info-val {
  font-family: 'DM Mono', monospace; font-size: 16px; font-weight: 500;
}

/* ── Tip / USDA ── */
.tip-box, .usda-box {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: .85rem 1rem; margin-bottom: 1.5rem; background: var(--surface);
}
.tip-box {
  border-left: 4px solid var(--red); padding-left: 1rem;
}
.tip-box .tip-label, .usda-box summary {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-hint);
  margin-bottom: 4px;
}
.tip-box p { font-size: 14px; color: var(--text); line-height: 1.55; }
.usda-box summary { cursor: pointer; list-style: none; outline: none; }
.usda-box summary::-webkit-details-marker { display: none; }
.usda-box summary::after { content: " +"; color: var(--text-hint); }
.usda-box[open] summary::after { content: " −"; }
.usda-box p { font-size: 13px; color: var(--text-muted); margin-top: .5rem; line-height: 1.6; }

/* ── Source attribution ── */
.source-block {
  margin: 1.5rem 0;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.source-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-hint);
  margin-bottom: 4px;
}
.source-attr { font-size: 13px; color: var(--text-muted); }
.source-attr a { color: var(--red-dark); text-decoration: none; border-bottom: 1px dotted var(--red); }
.source-attr a:hover { color: var(--red); border-bottom-style: solid; }
.source-review-note { font-size: 11px; color: var(--text-hint); margin-top: 6px; font-style: italic; line-height: 1.5; }
.source-line { font-size: 11px; color: var(--text-hint); margin-bottom: .5rem; line-height: 1.5; }
.source-line a { color: var(--text-muted); text-decoration: none; border-bottom: 1px dotted var(--text-hint); }
.source-line a:hover { color: var(--red); }
.source-review { font-style: italic; }

/* ── Related cuts ── */
.related-section { margin-top: 2rem; }
.related-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.related-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: .7rem .9rem;
  text-decoration: none; color: inherit; font-size: 14px;
  transition: border-color .12s;
}
.related-card:hover { border-color: var(--red); }
.related-card .chev { color: var(--text-hint); }

/* ── Content sections ── */
.content-section { margin-top: 2rem; }
.content-section h2 { font-size: 20px; font-weight: 800; margin-bottom: .75rem; }
.intro { font-size: 15px; color: var(--text-muted); line-height: 1.65; }

/* ── FAQ ── */
.faq { display: flex; flex-direction: column; gap: 6px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: .9rem 1.1rem;
}
.faq-item summary {
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 18px; color: var(--text-hint); flex-shrink: 0; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-top: .6rem; }

/* ── Footer ── */
footer { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); text-align: center; }
footer .disclaimer { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: .5rem; }
footer .copyright { font-size: 11px; color: var(--text-hint); letter-spacing: .04em; }
footer .legal-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: .5rem 0 .75rem; font-size: 12px; }
footer .legal-nav a { color: var(--text-muted); text-decoration: none; border-bottom: 1px dotted var(--text-hint); }
footer .legal-nav a:hover { color: var(--red); border-bottom-style: solid; }
footer .legal-sep { color: var(--text-hint); }

/* ── Legal pages ── */
.legal { font-size: 15px; line-height: 1.65; color: var(--text); }
.legal-intro { font-size: 16px; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.6; }
.legal-section { margin-bottom: 1.75rem; }
.legal-section h2 { font-size: 17px; font-weight: 700; margin-bottom: .5rem; color: var(--text); }
.legal-section p { font-size: 14px; color: var(--text); margin-bottom: .6rem; line-height: 1.65; }
.legal-section ul { padding-left: 1.4rem; margin: .25rem 0 .6rem; }
.legal-section li { font-size: 14px; color: var(--text); line-height: 1.65; margin-bottom: .25rem; }

/* ── Tablet / desktop ── */
@media (min-width: 600px) {
  .page { padding: 2rem 1.5rem 4rem; }
  .meat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cut-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .doneness-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .page { max-width: 860px; }
  .meat-grid { grid-template-columns: repeat(3, 1fr); }
  .doneness-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Print ── */
@media print {
  body { background: #fff; color: #000; }
  .top-bar, .lang-row, .related-section, footer, .usda-box, .tip-box { display: none !important; }
  .breadcrumb { color: #000; }
  .page { padding: 0; max-width: none; }
  .doneness-card, .safety-panel, .rest-info {
    background: #fff !important; border: 1px solid #000 !important;
    page-break-inside: avoid;
  }
  /* Show both units in print */
  html[data-unit] .temp-c, html[data-unit] .temp-f { display: inline !important; }
  .temp-c::after { content: " / "; color: #666; }
}
