/* mayquit: klar und medizinisch. Weiß als Grund, ein Grün als Akzent. Eigene Texte im Tagebuch in Literata, alles andere Atkinson. */

@font-face { font-family: "Atkinson"; src: url("/fonts/Atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/Atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/Literata-normal.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/Literata-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #ffffff;
  --surface: #f4f8f6;
  --ink: #16302a;
  --ink-soft: #536861;
  --line: #d7e3dd;
  --rule: #e3ece7;
  --green: #0e7c5a;
  --green-dark: #0a6248;
  --green-soft: #e4f3ec;
  --on-green: #ffffff;
  --danger: #b42318;
  --ui: "Atkinson", "Segoe UI", system-ui, sans-serif;
  --text: "Literata", Georgia, "Times New Roman", serif;
  --r-small: 6px;
  --r-big: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1714;
    --surface: #16221d;
    --ink: #e4eeea;
    --ink-soft: #a2b4ad;
    --line: #2b3c35;
    --rule: #22312b;
    --green: #47c095;
    --green-dark: #6fd2ad;
    --green-soft: rgba(71, 192, 149, 0.14);
    --on-green: #0b1a14;
    --danger: #f19a8f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--ui);
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: var(--r-small); }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

.wrap { max-width: 42rem; margin: 0 auto; padding-inline: 1.25rem; }
.wide { max-width: 64rem; }

/* Kopf */
.top { padding-block: 1.1rem; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.01em; }
.logo::before { content: ""; width: 1.35rem; height: 1.35rem; border-radius: 5px; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M8.5 4h3v4.5H16v3h-4.5V16h-3v-4.5H4v-3h4.5z' fill='white'/%3E%3C/svg%3E") center/70% no-repeat; }
.top { border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 1.1rem; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--ink-soft); }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); text-decoration: underline; }

/* Typografie */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); font-weight: 700; }
h2 { font-size: 1.5rem; margin-top: 2.2em; }
h3 { font-size: 1.15rem; margin-top: 1.6em; }
p { margin: 0 0 1em; }
.lead { font-size: 1.22rem; line-height: 1.6; color: var(--ink-soft); }
.small { font-size: 0.9rem; color: var(--ink-soft); }
.prose { font-size: 1.08rem; line-height: 1.7; }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font: 700 1rem/1.2 var(--ui);
  padding: 0.85em 1.3em;
  border-radius: var(--r-small);
  border: 2px solid var(--green);
  background: var(--green); color: var(--on-green);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.ghost:hover { background: var(--green-soft); color: var(--green); }
.btn.danger { border-color: var(--danger); background: transparent; color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--surface); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; margin: 1.6rem 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Der 30-Tage-Streifen: das Erkennungszeichen */
.strip { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin: 1.5rem 0; list-style: none; padding: 0; }
.strip li { aspect-ratio: 1; }
.strip a, .strip span {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  border: 1.5px solid var(--line); border-radius: var(--r-small);
  font-size: 0.85rem; color: var(--ink-soft); text-decoration: none; background: var(--surface);
}
.strip .written { background: var(--green); border-color: var(--green); color: var(--on-green); font-weight: 700; }
.strip .logged:not(.written) { border-color: var(--green); background: var(--green-soft); color: var(--ink); }
.strip .today { outline: 2.5px solid var(--green); outline-offset: 2px; color: var(--ink); font-weight: 700; }
.strip .future { opacity: 0.45; border-style: dashed; }
.strip .used::after { content: ""; position: absolute; bottom: 14%; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.strip a:hover { border-color: var(--green); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.85rem; color: var(--ink-soft); margin: -0.6rem 0 1.5rem; padding: 0; list-style: none; }
.legend i { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 3px; vertical-align: -0.1em; margin-right: 0.35em; border: 1.5px solid var(--line); }
.legend .l-written { background: var(--green); border-color: var(--green); }
.legend .l-logged { background: var(--green-soft); border-color: var(--green); }
.legend .l-used { border: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); margin-inline: 0.2em 0.5em; vertical-align: 0.1em; }

/* Startseite */
.hero { padding-block: 3rem 2rem; }
.hero h1 { max-width: 14ch; }
.hero .strip { max-width: 30rem; }
.steps { list-style: none; padding: 0; margin: 1.5rem 0; counter-reset: w; }
.steps li { position: relative; padding: 0 0 1.4rem 3.2rem; counter-increment: w; }
.steps li::before {
  content: counter(w); position: absolute; left: 0; top: -0.1rem;
  width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  background: var(--green-soft); color: var(--green); border-radius: 50%; font-weight: 700;
}
.steps strong { display: block; }
.points { display: grid; gap: 1.4rem 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.5rem 0; }
.points h3 { margin-top: 0; }
details.faq { border-top: 1px solid var(--line); padding-block: 0.9rem; }
details.faq:last-of-type { border-bottom: 1px solid var(--line); }
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq p { margin: 0.7rem 0 0; }

/* Hilfe-Fuß */
.help { margin-top: 4rem; padding-block: 2rem; background: var(--surface); border-top: 1px solid var(--line); font-size: 0.95rem; }
.help h2 { font-size: 1.05rem; margin: 0 0 0.6rem; }
.help ul { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.35rem; }
.help .tel { font-weight: 700; white-space: nowrap; }
.foot { background: var(--surface); padding-block: 0 2.5rem; font-size: 0.88rem; color: var(--ink-soft); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }

/* Tagebuch */
.app-main { padding-block: 1.5rem 2rem; min-height: 60vh; }
.daynav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.95rem; margin-bottom: 1rem; }
.daynav a { text-decoration: none; color: var(--ink-soft); }
.daynav a:hover { color: var(--ink); }
.day-head { margin-bottom: 1.4rem; }
.day-head .meta { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0.3rem; }
.impulse { font-size: 1.12rem; line-height: 1.7; margin-bottom: 1rem; }
.impulse .extra { border-left: 3px solid var(--green); padding-left: 1rem; color: var(--ink-soft); }
details.ideas { margin: 0 0 1.4rem; }
details.ideas summary { cursor: pointer; color: var(--green); font-weight: 700; }
details.ideas ul { margin: 0.7rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }

/* Die linierte Seite */
.page-label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
textarea.page {
  display: block; width: 100%; min-height: 18rem; resize: vertical;
  padding: 0.35rem 1rem 1rem 1.1rem;
  font: 400 1.1rem/2rem var(--text); color: var(--ink);
  background-color: var(--surface);
  background-image: linear-gradient(transparent calc(2rem - 1px), var(--rule) calc(2rem - 1px));
  background-size: 100% 2rem;
  background-position: 0 0.35rem;
  background-attachment: local;
  border: 1.5px solid var(--line); border-radius: var(--r-small);
}
textarea.page:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-soft); }
.saved { font-size: 0.85rem; color: var(--ink-soft); min-height: 1.3em; margin-top: 0.35rem; }

/* Formulare, Kurz-Protokoll */
.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-big); padding: 1.2rem 1.25rem; margin: 1.8rem 0; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 1.3rem; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 0.5rem; }
.hint { font-size: 0.9rem; color: var(--ink-soft); margin: -0.3rem 0 0.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 0.45em 0.85em; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper); font-size: 0.95rem; cursor: pointer;
}
.chip span:hover { border-color: var(--green); }
.chip input:checked + span { background: var(--green); border-color: var(--green); color: var(--on-green); }
.chip input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: flex-end; }
label.field { display: grid; gap: 0.3rem; font-weight: 700; }
input[type="number"], input[type="text"], input[type="date"], select {
  font: 400 1rem var(--ui); color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--r-small); padding: 0.5em 0.6em;
}
input[type="number"] { width: 6rem; }
.scale { display: grid; grid-template-columns: auto 1fr auto; gap: 0.7rem; align-items: center; max-width: 26rem; }
.scale output { font-weight: 700; min-width: 2ch; text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--green); }
.scale-ends { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-soft); max-width: 26rem; }
.check { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0.6rem 0; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; accent-color: var(--green); flex: none; }
.notice { border-left: 4px solid var(--green); background: var(--green-soft); padding: 0.9rem 1.1rem; margin: 1.2rem 0; border-radius: 0 var(--r-small) var(--r-small) 0; }
.warn { border-left-color: var(--danger); background: var(--surface); }

/* Start-Schritte */
.progress { display: flex; gap: 4px; margin-bottom: 1.6rem; }
.progress i { flex: 1; height: 4px; background: var(--line); border-radius: 2px; }
.progress i.on { background: var(--green); }
.pledge { font-family: var(--text); font-size: 1.3rem; line-height: 1.6; padding: 1.2rem 1.4rem; border: 1.5px solid var(--green); background: var(--green-soft); border-radius: var(--r-big); margin: 1.2rem 0; }

/* Übersicht */
.today-card { display: block; text-decoration: none; padding: 1.3rem 1.4rem; border: 2px solid var(--green); border-radius: var(--r-big); background: var(--surface); margin: 1rem 0 2rem; }
.today-card:hover { background: var(--green-soft); }
.today-card > span:last-child { color: var(--green); font-weight: 700; }
.today-card .meta { color: var(--ink-soft); font-size: 0.95rem; }
.today-card strong { display: block; font-size: 1.45rem; margin: 0.2rem 0 0.4rem; }
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.2rem; }
.links a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.links a:hover strong { text-decoration: underline; }
.links span { color: var(--ink-soft); font-size: 0.92rem; text-align: right; }

/* Nebenwirkungen */
.se-list { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.5rem; }
.se-item { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-small); padding: 0.75rem 0.9rem; }
.se-item.no { border-left: 5px solid var(--green); }
.se-item.accept { border-left: 5px solid var(--ink-soft); }
.se-item p { margin: 0 0 0.55rem; }
.se-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.se-btns button {
  font: 400 0.88rem var(--ui); padding: 0.35em 0.75em; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
}
.se-btns button[aria-pressed="true"] { background: var(--green); color: var(--on-green); border-color: var(--green); }
.se-btns button:hover { border-color: var(--green); }
.se-hidden { margin-top: 0.8rem; font-size: 0.92rem; color: var(--ink-soft); }
.se-hidden ul { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.3rem; }
.se-result { columns: 2 16rem; column-gap: 2rem; margin: 0; padding-left: 1.2rem; }
.se-result li { break-inside: avoid; margin-bottom: 0.3rem; }
.count { font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; }

/* Auswertung */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.stat { border-top: 3px solid var(--green); padding-top: 0.5rem; }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; }
.stat span { font-size: 0.9rem; color: var(--ink-soft); }
.bars { list-style: none; padding: 0; margin: 0.8rem 0; display: grid; gap: 0.4rem; }
.bars li { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 2.5rem; gap: 0.7rem; align-items: center; font-size: 0.95rem; }
.bars .bar { height: 0.8rem; background: var(--green); border-radius: 0 3px 3px 0; min-width: 2px; }
.bars .n { text-align: right; color: var(--ink-soft); }
.chart-wrap { overflow-x: auto; }
.craving { display: block; width: 100%; height: auto; min-width: 28rem; }
.craving .b { fill: var(--green); }
.craving .b.none { fill: var(--line); }
.craving text { fill: var(--ink-soft); font: 400 10px var(--ui); }
.craving .grid { stroke: var(--line); stroke-width: 1; }
.decisions { display: grid; gap: 0.6rem; margin: 1rem 0; }
.decision { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.9rem 1rem; border: 1.5px solid var(--line); border-radius: var(--r-big); background: var(--surface); cursor: pointer; }
.decision input { margin-top: 0.3rem; accent-color: var(--green); width: 1.1rem; height: 1.1rem; flex: none; }
.decision:has(input:checked) { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: var(--green-soft); }
.decision strong { display: block; }

/* Rückblick */
.entry { border-top: 1px solid var(--line); padding-block: 1rem; }
.entry h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.entry p { font-family: var(--text); white-space: pre-wrap; }

@media (max-width: 30rem) {
  body { font-size: 1rem; }
  .strip { gap: 3px; }
  .strip a, .strip span { font-size: 0.72rem; }
  .bars li { grid-template-columns: 6.5rem 1fr 2rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero .strip li { animation: fill 0.5s both; animation-delay: calc(var(--i) * 28ms); }
  @keyframes fill { from { opacity: 0; transform: scale(0.85); } }
}
@media print {
  .top, .help, .foot, .actions, .daynav { display: none; }
}
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[tabindex="-1"]:focus { outline: none; }
.gtk { margin: 0.8rem 0 1.5rem; display: grid; gap: 0.2rem; }
.gtk dt { font-weight: 700; margin-top: 0.8rem; }
.gtk dd { margin: 0; }
