/* Tintenzug: Papier-und-Tinte. Keine externen Schriften oder Ressourcen (Datenschutz). */
:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #1b2a41;
  --muted: #5a6473;
  --line: #e6dfd2;
  --accent: #2457d6;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefc;
  --warn-bg: #fff4d6;
  --warn-ink: #5c4300;
  --ok-bg: #e5f5ea;
  --ok-ink: #14532d;
  --bad-bg: #fde8e8;
  --bad-ink: #7a1b1b;
  --shadow: 0 1px 2px rgba(27, 42, 65, 0.06), 0 8px 24px rgba(27, 42, 65, 0.06);
  --radius: 14px;
  --maxw: 1080px;
  --serif: ui-serif, 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b;
    --card: #1c1f26;
    --ink: #ebe8e1;
    --muted: #a3abb8;
    --line: #2c303a;
    --accent: #7aa2ff;
    --accent-ink: #0d1424;
    --accent-soft: #1d2740;
    --warn-bg: #3a3014;
    --warn-ink: #f3dc9a;
    --ok-bg: #123322;
    --ok-ink: #a5e6bf;
    --bad-bg: #3a1a1a;
    --bad-ink: #f5b5b5;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}
img, canvas, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header / Footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--serif); font-weight: 700; font-size: 1.35rem; text-decoration: none; color: var(--ink); }
.brand-mark { flex: none; width: 34px; height: 34px; overflow: visible; }
.brand-mark .bar { fill: var(--accent); }
.brand-mark .nib { fill: var(--ink); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover, .nav a[aria-current='page'] { background: var(--accent-soft); color: var(--accent); }
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 0.92rem; }
.site-footer .cols { display: flex; gap: 24px 48px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* Buttons & Formulare */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.92rem; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
input[type='text'], input[type='email'], input[type='url'], input[type='number'], input[type='date'], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
textarea { min-height: 120px; resize: vertical; }
input[type='range'] { width: 100%; }
input[type='checkbox'] { width: 20px; height: 20px; margin-right: 8px; vertical-align: middle; accent-color: var(--accent); }
.field { margin-bottom: 16px; }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; align-items: flex-start; gap: 4px; font-weight: 400; }

/* Bausteine */
.hero { padding: 56px 0 32px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 40em; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.underline-hand { background: linear-gradient(transparent 62%, var(--accent-soft) 62%); padding: 0 4px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.price { font-family: var(--serif); font-size: 2rem; font-weight: 700; }
.price small { font-family: var(--sans); font-size: 0.9rem; font-weight: 400; color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { counter-increment: s; padding-left: 52px; position: relative; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700;
}
.notice { padding: 14px 16px; border-radius: 12px; margin: 0 0 16px; background: var(--accent-soft); }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice.bad { background: var(--bad-bg); color: var(--bad-ink); }
.draft-banner { background: #b91c1c; color: #fff; text-align: center; padding: 8px 12px; font-weight: 700; font-size: 0.9rem; }
section.block { padding: 40px 0; }
details { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin-bottom: 10px; background: var(--card); }
summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.legal h2 { margin-top: 1.6em; font-size: 1.4rem; }
.legal h3 { margin-top: 1.2em; }
.legal li { margin-bottom: 4px; }

/* Werkzeug-Layout */
.tool { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .tool.two { grid-template-columns: minmax(300px, 400px) 1fr; align-items: start; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 1.3rem; }
.stepper { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; padding: 0; list-style: none; }
.stepper li { padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.stepper li.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.stepper li.done { color: var(--ok-ink); background: var(--ok-bg); border-color: transparent; }
.preview { background: #d9d4c8; border-radius: var(--radius); padding: 16px; display: grid; gap: 16px; justify-items: center; }
.preview canvas { background: #fff; box-shadow: var(--shadow); width: 100%; max-width: 640px; height: auto; }
.glyph-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.glyph-sheet div { background: #fff; border: 1px solid var(--line); border-radius: 6px; height: 40px; display: grid; place-items: center; position: relative; }
.glyph-sheet div.missing { background: var(--bad-bg); }
.glyph-sheet canvas { max-height: 34px; max-width: 30px; }
.glyph-sheet span.lbl { position: absolute; left: 2px; top: 0; font-size: 9px; color: #888; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.paywall { position: relative; }
.blurred { filter: blur(6px); user-select: none; pointer-events: none; }
.letter-preview { background: #fff; color: #111; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 28px 32px; font-family: Arial, Helvetica, sans-serif; font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; border-radius: 6px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 700; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } html { scroll-behavior: auto; } }
@media print { .site-header, .site-footer, .no-print { display: none !important; } }

.notice:empty { display: none; }

/* Beta-Hinweis und Feedback am Seitenende */
.beta-box { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 24px; }
.beta-box textarea { min-height: 80px; margin-top: 8px; }
.beta-box summary { font-weight: 600; cursor: pointer; }
.beta-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Handschrift-Studio: Schriftkarten, Farbwahl, Export, Schreiben auf der Seite ---------- */
.field .label { display: block; font-weight: 600; margin-bottom: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hand-cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hand-card { text-align: left; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 11px; cursor: pointer; min-height: 72px; display: flex; flex-direction: column; gap: 4px; font: inherit; }
.hand-card:hover { border-color: var(--accent); }
.hand-card[aria-checked='true'] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.hand-card .name { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.hand-card .sample { font-size: 1.3rem; line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
.hand-card .own-sample { height: 34px; width: auto; max-width: 100%; align-self: flex-start; background: #fffdf8; border-radius: 6px; padding: 2px 6px; }
.colorpicker .swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-checked='true'] { box-shadow: 0 0 0 3px var(--accent); }
.wheel-box { margin-top: 10px; }
.wheel-box summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; padding: 6px 0; }
.wheel-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 6px 0 12px; }
canvas.wheel { width: 180px; height: 180px; touch-action: none; border-radius: 50%; cursor: crosshair; background: transparent; }
.wheel-side { display: grid; gap: 10px; min-width: 150px; }
.wheel-side label { display: grid; gap: 4px; }
.wheel-side input[type='text'] { font-family: ui-monospace, Consolas, monospace; width: 12ch; }
.chip { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); display: block; }
.more-formats { margin-top: 12px; }
.more-formats summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.export-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 4px 0 10px; }
.app-help { padding-left: 1.1rem; }
.app-help li { margin-bottom: 10px; }
/* Schreiben auf der Seite */
.cap [hidden] { display: none !important; }
.cap-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.cap-title { font-size: 1.1rem; font-weight: 600; margin: 0; }
.cap-char { font-family: var(--serif); font-size: 2rem; color: var(--accent); }
.cap-progress { width: 100%; height: 8px; margin: 8px 0 12px; accent-color: var(--accent); }
.cap-pad { position: relative; width: 100%; max-width: 560px; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; user-select: none; -webkit-user-select: none; }
.cap-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cap-ink { touch-action: none; cursor: crosshair; }
.cap-tools, .cap-nav { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.cap-nav .btn { flex: 0 1 auto; }
.cap-sheet { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); margin: 10px 0 14px; }
.cap-cell { background: #fff; border: 1px solid var(--line); border-radius: 8px; height: 50px; display: grid; place-items: center; position: relative; padding: 0; cursor: pointer; }
.cap-cell.missing { background: var(--bad-bg); }
.cap-cell canvas { max-height: 40px; max-width: 38px; }
.cap-cell span.lbl { position: absolute; left: 3px; top: 0; font-size: 9px; color: #888; }
@media (max-width: 560px) { .export-grid { grid-template-columns: 1fr; } }

/* ---------- Konto ---------- */
.acct-btn { margin-left: 4px; }
.acct-dialog { border: 1px solid var(--line); border-radius: 20px; padding: 30px 28px 26px; width: min(94vw, 400px); background: var(--card); color: var(--ink); box-shadow: 0 24px 60px rgba(10, 16, 28, 0.35); }
.acct-dialog::backdrop { background: rgba(10, 16, 28, 0.6); backdrop-filter: blur(3px); }
.acct-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.acct-close:hover { background: var(--accent-soft); color: var(--ink); }
.acct-dialog h2 { margin: 0 0 6px; font-size: 1.6rem; }
.acct-intro { margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.acct-google { display: grid; gap: 10px; }
.acct-gbtn { width: 100%; justify-content: center; min-height: 46px; }
.acct-gbtn[hidden] { display: none; }
.acct-google-host { display: flex; justify-content: center; min-height: 46px; }
.acct-google-host[hidden] { display: none; }
.acct-fine { margin: 0; font-size: 0.8rem; color: var(--muted); line-height: 1.45; text-align: center; }
.acct-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 0.85rem; }
.acct-or::before, .acct-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.acct-form { display: grid; gap: 8px; }
.acct-form[hidden] { display: none; }
.acct-form label { font-weight: 600; font-size: 0.9rem; }
.acct-form input { width: 100%; }
.acct-form .btn { width: 100%; justify-content: center; }
.acct-actions { display: grid; gap: 8px; margin-top: 16px; }
.acct-actions .btn { width: 100%; justify-content: center; }
.acct-msg { margin: 16px 0 0; }
.acct-msg:empty { display: none; }
.acct-mail { overflow-wrap: anywhere; }
.cloud-box { margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--accent-soft); }
.cloud-box[hidden] { display: none; }
