/* CalorieMe AI website. No external fonts, no scripts, no cookies. Colours follow the app. */
:root {
  --bg: #F4F4F1;
  --card: #FFFFFF;
  --ink: #0E0E10;
  --ink-2: #4A4A50;
  --ink-3: #6E6E74;
  --line: #E4E4DE;
  --lime: #D2F34C;
  --lime-ink: #5E7A00;
  --dark: #0E0E10;
  --radius: 24px;
  --shadow: 0 1px 2px rgba(14, 14, 16, 0.04), 0 10px 30px rgba(14, 14, 16, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--lime-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; z-index: 10; }
.skip:focus { left: 16px; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { padding: 18px 0 8px; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; display: block; }

.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg) translate(-2px, -2px); }
.lang[open] summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 5;
  margin: 0; padding: 6px; list-style: none; min-width: 180px;
  background: var(--card); border-radius: 16px; box-shadow: 0 12px 40px rgba(14, 14, 16, 0.16);
}
.lang li a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-size: 15px; }
.lang li a:hover { background: var(--bg); }
.lang li a[aria-current="true"] { font-weight: 700; background: var(--bg); }

/* Document pages */
main { padding: 16px 0 40px; }
.doc { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 44px 44px; }
.doc h1 { font-size: clamp(30px, 6vw, 42px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 800; margin: 0 0 10px; }
.doc .meta { color: var(--ink-3); font-size: 15px; margin: 0 0 24px; }
.doc h2 { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 750; margin: 40px 0 10px; padding-top: 28px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.doc h3 { font-size: 18px; line-height: 1.35; font-weight: 700; margin: 26px 0 6px; scroll-margin-top: 16px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: 4px 0; }
.doc li > p { margin: 0 0 6px; }
.doc strong { font-weight: 700; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.doc blockquote { margin: 0 0 16px; padding: 14px 18px; background: var(--bg); border-radius: 16px; border-left: 4px solid var(--lime); }
.doc blockquote p:last-child { margin-bottom: 0; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--bg); padding: 1px 6px; border-radius: 6px; }

.toc { background: var(--bg); border-radius: 18px; padding: 16px 20px; margin: 0 0 8px; }
.toc p { margin: 0 0 6px; font-weight: 700; font-size: 15px; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: 28px; font-size: 15px; }
.toc li { break-inside: avoid; margin: 3px 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.table { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 16px; -webkit-overflow-scrolling: touch; }
.table table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table th { background: var(--bg); font-weight: 700; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td { min-width: 140px; }

/* Home */
.hero { background: var(--dark); color: #fff; border-radius: var(--radius); padding: 40px 44px; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.hero h1 { font-size: clamp(34px, 7vw, 54px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 14px; }
.hero h1 em { font-style: normal; color: var(--lime); display: inline-block; }
.hero p { margin: 0; color: #C9C9CC; font-size: 18px; max-width: 34em; }
.hero img { width: 132px; height: 132px; border-radius: 30px; display: block; }
.points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.points li { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 18px 20px; }
.points strong { display: block; font-size: 17px; margin-bottom: 2px; }
.points span { color: var(--ink-2); font-size: 15px; }
.section-title { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 700; margin: 34px 4px 10px; }
.links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.links a { display: block; height: 100%; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 18px 20px; text-decoration: none; }
.links a:hover { box-shadow: 0 0 0 2px var(--ink), var(--shadow); }
.links strong { display: block; font-size: 17px; }
.links span { color: var(--ink-2); font-size: 15px; }
.links .health { background: var(--lime); }
.links .health span { color: #2F3A00; }

/* Footer */
footer { padding: 8px 0 40px; color: var(--ink-3); font-size: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
footer a { color: var(--ink-2); }
footer p { margin: 4px 0; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .doc { padding: 26px 20px 30px; border-radius: 20px; }
  .doc h2 { font-size: 20px; margin-top: 32px; padding-top: 22px; }
  .toc ol { columns: 1; }
  .table { border: 0; border-radius: 0; overflow: visible; }
  .table table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table tr { border: 1px solid var(--line); border-radius: 16px; margin: 0 0 10px; padding: 8px 0; }
  .table td { border: 0; padding: 5px 16px; min-width: 0; }
  .table td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 700; color: var(--ink-3); }
  .table td:first-child { font-weight: 700; }
  .table td:first-child::before { display: none; }
  .hero { grid-template-columns: 1fr; padding: 30px 22px; border-radius: 22px; }
  .hero img { width: 84px; height: 84px; border-radius: 20px; order: -1; }
  .points, .links { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; }
  .top .lang, .toc, footer nav, .skip { display: none; }
  .doc { box-shadow: none; padding: 0; }
  a { text-decoration: none; }
}
.operator { color: var(--ink-3); font-size: 14px; margin: 26px 4px 0; }
.notice { background: var(--lime); color: #2F3A00; border-radius: 16px; padding: 12px 18px; margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.hero .hero-links { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; font-weight: 650; }
.hero .hero-links a { color: #fff; text-decoration-color: var(--lime); }
.hero .hero-links a:hover { text-decoration-color: #fff; }
.notes { list-style: none; margin: 0; padding: 4px 20px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
.notes li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.notes li:last-child { border-bottom: 0; }
.notes strong { display: block; font-size: 16px; }
.notes span { color: var(--ink-2); font-size: 15px; }
