/* Husk Livet — varm, dansk, læseligt */

:root {
  --bg: #faf7f2;
  --paper: #ffffff;
  --ink: #2a2520;
  --muted: #7d736a;
  --accent: #c46a3a;       /* varm terracotta */
  --accent-soft: #f3dfd1;
  --green: #6a7a4f;         /* salvie */
  --border: #e8dfd2;
  --shadow: 0 2px 12px rgba(60, 40, 20, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", "Source Serif Pro", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

.beta-bar {
  background: var(--accent);
  color: var(--paper);
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.beta-bar strong {
  letter-spacing: 0.08em;
  margin-right: 0.5rem;
}
.beta-bar a {
  color: var(--paper);
  text-decoration: underline;
}
.beta-bar a:hover { opacity: 0.85; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* Full-bleed modifier — breaker ud af main's max-width til hele viewport */
.full-bleed {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  width: 100vw;
  max-width: 100vw;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem max(1.5rem, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
}
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.4rem; }
.brand-name { letter-spacing: 0.01em; }
.topbar nav a {
  margin-left: 1rem;
  color: var(--muted);
}
.topbar nav a:hover { color: var(--accent); }
.topbar nav a.admin-link {
  color: var(--accent);
  font-weight: 600;
}
.topbar nav a.topbar-cta {
  background: var(--accent);
  color: var(--paper);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  margin-right: 0.5rem;
}
.topbar nav a.topbar-cta:hover {
  background: #a85b30;
  color: var(--paper);
  text-decoration: none;
}
.pwa-btn {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  margin-right: 0.5rem;
}
.pwa-btn:hover {
  background: var(--accent);
  color: var(--paper);
}

/* ---------- log form ---------- */
.log-form .log-field {
  margin: 0 0 1.25rem;
}
.log-form .form-label {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  margin: 0 0 0.4rem;
}
.log-form select,
.log-form textarea,
.log-form input[type="text"] {
  display: block;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--sans) !important;   /* iOS Safari ignorerer ofte inherited font-family */
  background: var(--bg);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.log-form textarea {
  min-height: 110px;
  line-height: 1.5;
  resize: vertical;
}
.log-form select:focus,
.log-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
}
.log-form input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  font-family: var(--sans);
  color: var(--ink);
}
.log-media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.log-media-card {
  padding: 1rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.log-media-card .form-label { margin-bottom: 0.5rem; }
.log-tip {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 600px) {
  .log-media-row { grid-template-columns: 1fr; }
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

/* Hero med baggrundsbillede — bedstemor + barn på sofaen. Tekst lægges over
   det tomme væg-område til venstre i billedet. Full-bleed: fylder hele viewport. */
.hero-with-image {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -1.5rem;
  margin-bottom: 2.5rem;
  width: 100vw;
  text-align: left;
  min-height: 520px;
  overflow: hidden;
  background: var(--paper);
}
.hero-image {
  position: absolute;
  inset: 0;
  background-image: url('/static/hero.png');
  background-size: cover;
  background-position: center right;
  z-index: 0;
}
.hero-image::after {
  /* Subtil gradient i venstre side for tekst-læselighed */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(250, 247, 242, 0.92) 0%,
    rgba(250, 247, 242, 0.78) 28%,
    rgba(250, 247, 242, 0.35) 48%,
    rgba(250, 247, 242, 0) 62%
  );
}
.hero-text {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto 0 max(2.5rem, calc(50vw - 550px));
  padding: 4rem 2rem 4rem 0;
}
.hero-with-image h1 {
  font-family: var(--serif);
  font-size: 3.4rem;
  line-height: 1;
  margin: 0 0 0.5rem;
  color: #2a2520;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hero-with-image .tagline {
  font-family: var(--serif);
  font-style: italic;
  color: #6b3e22;
  font-size: 1.35rem;
  margin: 0 0 1.5rem;
}
.hero-with-image .lead {
  font-size: 1.05rem;
  max-width: 100%;
  color: #322a22;
  margin: 0 0 1.75rem;
}
.hero-with-image .cta-row {
  justify-content: flex-start;
}

@media (max-width: 760px) {
  .hero-with-image {
    min-height: auto;
  }
  .hero-image {
    position: relative;
    inset: auto;
    height: 280px;
  }
  .hero-image::after {
    background: linear-gradient(
      to bottom,
      rgba(250, 247, 242, 0) 60%,
      rgba(250, 247, 242, 0.85) 100%
    );
  }
  .hero-text {
    max-width: 100%;
    padding: 1.5rem 1.25rem 2rem;
  }
  .hero-with-image h1 { font-size: 2.4rem; }
}
.hero.compact { padding: 1.5rem 0; text-align: left; }
.hero h1 {
  font-family: var(--serif);
  font-size: 3rem;
  margin: 0 0 0.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hero.compact h1 { font-size: 2.2rem; }
.tagline {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 1.3rem;
  margin: 0 0 1.5rem;
}
.lead {
  font-size: 1.15rem;
  color: #4a423a;
  max-width: 36em;
  margin: 0 auto 1.5rem;
}
.cta-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.hero.compact .cta-row { justify-content: flex-start; }

.crumb { color: var(--muted); margin: 0 0 0.5rem; font-size: 0.9rem; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--paper);
}
.btn-primary:hover {
  background: #a85b30;
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

/* ---------- sections ---------- */
.how, .for-whom, .beta-note {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.how h2, .for-whom h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
}
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}
.steps li {
  counter-increment: step;
  padding: 1rem 0 1rem 3rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1rem;
  width: 2rem;
  height: 2rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-family: var(--serif);
}
.steps strong { display: block; font-size: 1.1rem; }
.steps p { margin: 0.25rem 0 0; color: var(--muted); }

.kinds {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.kinds li {
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.kind-icon { font-size: 1.6rem; }

.beta-note {
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* ---------- cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card h1, .card h2 { font-family: var(--serif); margin-top: 0; }

.telegram-login-wrap {
  margin: 2rem 0 1.5rem;
  display: flex;
  justify-content: center;
}

/* ---------- dashboard ---------- */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.subject-card {
  display: block;
  padding: 1.5rem 1rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
  color: var(--ink);
  transition: all 0.15s ease;
}
.subject-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.subject-kind { font-size: 2.5rem; line-height: 1; margin-bottom: 0.5rem; }
.subject-card h3 {
  font-family: var(--serif);
  margin: 0.5rem 0 0.25rem;
  font-size: 1.2rem;
}
.subject-meta { color: var(--muted); font-size: 0.85rem; margin: 0; }

.info-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.info-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}
.info-card h3 { margin-top: 0; font-family: var(--serif); }

/* ---------- subject view ---------- */
.chapters-row { margin: 2rem 0; }

.missing-chapters {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.missing-chapters h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
  color: #6b3e22;
}
.missing-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.missing-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(196, 106, 58, 0.15);
}
.missing-list li:last-child { border-bottom: 0; }
.missing-period {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}
.chapters-row h2 { font-family: var(--serif); }
.chapter-list { list-style: none; padding: 0; margin: 0; }
.chapter-list li { border-bottom: 1px solid var(--border); }
.chapter-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  color: var(--ink);
}
.chapter-list a:hover { text-decoration: none; color: var(--accent); }
.chapter-period {
  font-family: var(--serif);
  color: var(--accent);
  width: 5rem;
  flex-shrink: 0;
}
.chapter-title { flex: 1; }
.chapter-meta { color: var(--muted); font-size: 0.85rem; }

.entries h2 { font-family: var(--serif); }
.entry-list { list-style: none; padding: 0; margin: 0; }
.entry {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.entry-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.entry-id { margin-left: auto; opacity: 0.5; }
.entry-body p { margin: 0.25rem 0; }

/* ---------- subject actions row ---------- */
.subject-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* ---------- entry rich media ---------- */
.entry-photo {
  display: inline-block;
  max-width: 360px;
  margin: 0.25rem 0;
}
.entry-photo img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.entry-caption,
.entry-transcript {
  margin: 0.4rem 0 0;
  color: var(--ink);
}
.entry audio {
  width: 100%;
  max-width: 420px;
  margin: 0.4rem 0;
  display: block;
}

/* ---------- photo gallery ---------- */
.photo-gallery {
  margin: 2.5rem 0 1.5rem;
}
.photo-gallery h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin: 0 0 1rem;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.photo-thumb {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--paper);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.photo-thumb:hover img { transform: scale(1.04); }
.photo-thumb:hover { text-decoration: none; }
.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
  padding: 1.5rem 0.75rem 0.5rem;
  font-size: 0.85rem;
}

/* ---------- quotes ---------- */
.quotes-list {
  margin: 2rem 0;
}
.quotes-list h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin: 0 0 1rem;
}
.quote-card {
  background: var(--paper);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 1.25rem 1.5rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}
.quote-text {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.5;
  margin: 0 0 0.5rem;
  color: #2d2620;
}
.quote-meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: normal;
}

.family-action {
  text-align: center;
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ---------- chapter view ---------- */
.chapter-prose {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem 2.25rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}
.chapter-prose p {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.75;
  text-align: justify;
  text-indent: 1.5em;
  margin: 0 0 1.25rem;
  color: #322a22;
}
.chapter-prose p:first-child { text-indent: 0; }
.chapter-prose p:first-child::first-letter {
  font-family: var(--serif);
  font-size: 3.5rem;
  font-weight: 600;
  float: left;
  line-height: 0.85;
  padding-right: 0.5rem;
  padding-top: 0.4rem;
  color: var(--accent);
}
.chapter-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---------- utility ---------- */
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
code {
  background: var(--accent-soft);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: #6b3e22;
}

/* ---------- features / about / privacy ---------- */
.features, .privacy-note {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.features h2, .privacy-note h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 0 0 1rem;
}
.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.6rem;
}
.features-list li {
  padding: 0.7rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.privacy-note p {
  color: #4a423a;
  line-height: 1.6;
}

.prose {
  max-width: 38em;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.7;
  color: #322a22;
}
.prose h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
  color: var(--ink);
}
.prose p { margin: 0 0 1rem; }
.prose ul {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}
.prose li { margin-bottom: 0.4rem; }

/* ---------- pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 2rem 0 3rem;
}
.pricing-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}
.pricing-card.pricing-featured {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}
.pricing-card header {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.pricing-card h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}
.pricing-price {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
  line-height: 1;
}
.pricing-price span {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 0.15rem;
}
.pricing-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.4rem 0 0;
}
.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--paper);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  flex: 1;
}
.pricing-features li {
  padding: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
}
.pricing-features li.muted {
  color: #bbafa0;
  text-decoration: line-through;
}
.pricing-cta {
  text-align: center;
}
.pricing-cta .btn { width: 100%; }

.pricing-extras, .pricing-faq {
  margin: 2.5rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.pricing-extras h2, .pricing-faq h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 0 0 1rem;
}
.pricing-faq h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 1.5rem 0 0.4rem;
}
.pricing-faq p { margin: 0 0 0.5rem; color: #4a423a; }

@media (max-width: 720px) {
  .pricing-card.pricing-featured { transform: none; }
}

/* ---------- admin ---------- */
.admin-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin: 0 0 1.75rem;
  padding: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-nav a, .admin-nav-soon {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
}
.admin-nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.admin-nav a.active { background: var(--accent); color: var(--paper); }
.admin-nav-soon {
  color: #b8ada0;
  font-style: italic;
  cursor: help;
}

.admin-stats h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 1.5rem 0 0.75rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 0 0 1.5rem;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  text-align: center;
}
.stat-num {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

.system-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.system-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.system-list li:last-child { border-bottom: 0; }
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: 1px;
}
.status-ok { background: #6a7a4f; }
.status-warn { background: #c89a3a; }
.status-err { background: #c44a3a; }

.admin-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 2rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover { background: var(--bg); }

.tier-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tier-free { background: #e8dfd2; color: var(--muted); }
.tier-beta { background: var(--accent-soft); color: var(--accent); }
.tier-pro { background: var(--accent); color: var(--paper); }
.tier-comp { background: #d8e8d1; color: #4a5a30; margin-left: 0.25rem; }

.invite-link a { color: var(--accent); }

.form-inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.form-inline input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--sans);
  background: var(--bg);
}
.form-inline input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
}
.inline-form { display: inline; margin: 0; }
.btn-tiny {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  color: var(--muted);
}
.btn-tiny:hover { background: var(--accent-soft); color: var(--accent); }
.btn-danger:hover { background: #f3d1cc; color: #a83a2a; border-color: #d8a6a0; }

.flash {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 0 0 1rem;
}

.danger-card {
  border-color: #d8a6a0;
  background: #fbf3f1;
}

/* --- Tier badge på dashboard --- */
.tier-line {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--paper);
  border-radius: 6px;
  display: inline-block;
}
.tier-line .warn {
  color: #c46a3a;
  font-weight: 600;
}

/* --- Familie-deling --- */
.share-banner {
  background: #f3ece1;
  border-left: 3px solid var(--accent);
  padding: 0.65rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}
.share-banner strong { color: var(--accent); }
.share-banner em { font-style: italic; color: var(--muted); }

.share-cta {
  margin-top: 2rem;
  text-align: center;
  background: var(--accent-soft);
}
.share-cta h3 {
  font-family: var(--serif);
  margin: 0 0 0.5rem;
}

.shares-card { /* container på subject.html */ }
.share-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.share-list li {
  padding: 0.6rem 0;
  border-bottom: 1px dotted var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.share-list li:last-child { border-bottom: none; }
.share-list .share-label { font-weight: 600; }
.share-list .share-url {
  font-family: var(--mono, monospace);
  font-size: 0.8rem;
  background: var(--paper);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  word-break: break-all;
  flex: 1 1 100%;
}
.share-list .share-meta {
  font-size: 0.8rem;
  color: var(--muted);
}
.share-list .share-revoked {
  opacity: 0.55;
  text-decoration: line-through;
}

.archived-section {
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.archived-section h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
  color: var(--muted);
}
.archived-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.archived-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.archived-list li:last-child { border-bottom: 0; }
.archived-emoji { font-size: 1.5rem; }
.archived-name { font-family: var(--serif); font-weight: 600; flex: 0 0 auto; }
.archived-meta { flex: 1; }

.subject-danger {
  margin: 3rem 0 1rem;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.subject-danger summary {
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--muted);
  font-size: 1.05rem;
  list-style: none;
}
.subject-danger summary::-webkit-details-marker { display: none; }
.subject-danger[open] summary { margin-bottom: 1rem; color: var(--ink); }
.subject-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}
.settings-card {
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.settings-card h3 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-size: 1.05rem;
}
.settings-card .form-inline { margin-bottom: 0.4rem; }
.settings-card.danger-card { background: #fbf3f1; border-color: #d8a6a0; }
.danger-card h2 {
  color: #a83a2a;
}
.danger-card .form-inline input[type="text"] {
  font-family: var(--sans);
  letter-spacing: 0.04em;
}

/* ---------- guide ---------- */
.guide-tip {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
  color: #6b3e22;
  font-family: var(--sans);
}
.guide-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.guide-example {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.guide-example-tag {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.guide-buttons {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.guide-btn {
  padding: 0.5rem 1rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-family: var(--sans);
}
.guide-dl {
  margin: 1rem 0;
}
.guide-dl dt {
  font-family: var(--sans);
  font-weight: 600;
  margin: 1rem 0 0.2rem;
  color: var(--ink);
}
.guide-dl dt code {
  background: var(--accent-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.95em;
}
.guide-dl dd {
  margin: 0 0 0.5rem;
  padding-left: 1rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.95rem;
}

/* ---------- prerequisite callout ---------- */
.prereq-callout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
}
.prereq-callout.compact {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
}
.prereq-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}
.prereq-callout.compact .prereq-icon { font-size: 1.3rem; }
.prereq-body {
  flex: 1;
  color: #4a3a28;
  line-height: 1.5;
}
.prereq-body a {
  font-weight: 600;
}

/* ---------- order form ---------- */
.order-form label {
  display: block;
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.order-form label input[type="text"],
.order-form label input[type="tel"] {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
}
.order-form label input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
}
.order-form h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 1.5rem 0 0.75rem;
}
.order-form .form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 0 0 0.75rem;
  flex-wrap: wrap;
}
.order-form .form-row label {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.order-form .form-row label.grow-1 { flex: 1 1 80px; }
.order-form .form-row label.grow-3 { flex: 3 1 200px; }
.order-summary {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

/* ---------- status pills ---------- */
.status-pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.status-pending { background: #f3e4cc; color: #8a5a20; }
.status-paid { background: #d8e8d1; color: #4a5a30; }
.status-in_print { background: #d8d8f0; color: #3a3a78; }
.status-shipped { background: #cce4f3; color: #205a8a; }
.status-delivered { background: #b8d8c8; color: #2a5a3a; }
.status-canceled { background: #e8e0d8; color: var(--muted); }

.filter-bar {
  display: flex;
  gap: 0.4rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.filter-bar a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--muted);
}
.filter-bar a.active { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.filter-bar a:hover { text-decoration: none; }

.order-status-form { display: inline-block; }
.order-status-form summary { cursor: pointer; list-style: none; }
.order-status-form summary::-webkit-details-marker { display: none; }
.order-status-form form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.order-status-form select,
.order-status-form input[type="text"] {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--serif);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-nav {
  display: flex;
  gap: 1rem;
}
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--accent); }
footer em { color: var(--accent); }
.footer-legal {
  max-width: 720px;
  margin: 1rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--sans);
}
.footer-legal a { color: var(--muted); text-decoration: underline; }

/* ---------- mobile ---------- */
@media (max-width: 600px) {
  .hero h1 { font-size: 2.2rem; }
  .chapter-prose { padding: 1.5rem 1.25rem; }
  .chapter-prose p { font-size: 1rem; }
}
