:root {
  --text: #222;
  --muted: #666;
  --background: #fafafa;
  --line: #e2e2e2;
  --primary: #444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.app-name { font-weight: 600; }

header { border-top: 4px solid var(--primary); }

.logout { margin: 0; }

.link-button {
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}

.login-form input {
  padding: 10px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.login-form button {
  padding: 10px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.error {
  padding: 10px 12px;
  color: #8a1c1c;
  background: #fdecec;
  border-radius: 6px;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}

.hint, .muted { color: var(--muted); }

a { color: inherit; }
.brand { text-decoration: none; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 16px; }
h2 { font-size: 1.05rem; margin: 0; }
.back { margin: 0 0 8px; }
.back a { color: var(--muted); text-decoration: none; }

/* Startseite: große Kacheln */
.tiles { display: grid; gap: 12px; }
.tile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  align-items: center;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 10px;
  text-decoration: none;
}
.tile:hover { border-color: var(--primary); }
.tile-icon { grid-row: span 2; font-size: 2rem; }
.tile-title { font-weight: 600; font-size: 1.1rem; }
.tile-text { color: var(--muted); font-size: 0.95rem; }

/* Karten */
.card {
  margin: 0 0 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Formular */
.skript-form { display: flex; flex-direction: column; gap: 10px; }
.field-label { font-weight: 600; }
textarea {
  width: 100%;
  padding: 10px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}
.choices { display: flex; gap: 8px; }
.choice { flex: 1; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block;
  padding: 10px 6px;
  text-align: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
.choice input:checked + span {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, white);
  font-weight: 600;
}
.choice input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.primary-button {
  margin-top: 6px;
  padding: 14px;
  font: inherit;
  font-weight: 600;
  font-size: 1.1rem;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.primary-button:disabled { opacity: 0.5; cursor: wait; }

#laden { display: none; margin: 0; text-align: center; color: var(--muted); }
#laden.htmx-request { display: block; }

/* Ergebnis */
.notice { background: #fff8e1; border-color: #f1d27a; }
.notice ul { margin: 8px 0 0; padding-left: 20px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.result-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.result-text ol, .result-text ul { white-space: normal; margin: 0; padding-left: 22px; }
.hashtags { color: var(--primary); }
.cover-text {
  display: inline-block;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  background: var(--primary);
  border-radius: 6px;
}
.copy-button {
  flex-shrink: 0;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.copy-button.copied { background: #e7f6ea; border-color: #7cc48b; }
.error-card { background: #fdecec; border-color: #f2b8b8; color: #8a1c1c; }
.error-card p { margin: 0; }

/* Feedback */
.feedback form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.feedback-buttons { display: flex; gap: 8px; }
.feedback-buttons button {
  flex: 1;
  padding: 10px;
  font: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.feedback p { margin: 6px 0 0; }
