:root {
  --fern: #3d5a45;         /* pine green, matches the landing palette */
  --fern-dark: #2e4536;
  --fern-light: #f3e6c8;   /* warm parchment tint, not cool mint */
  --lantern: #e9a23b;      /* the campfire-glow accent: primary CTAs */
  --clay: #c1603a;
  --ink: #3a2c1f;          /* warm brown-black, not cool blue-gray */
  --muted: #8a7568;
  --bg: #faf3e4;           /* warm parchment, not cool near-white */
  --card: #fffaf3;
  --danger: #c1603a;
  --radius: 14px;
  --pop: 3px 3px 0 rgba(58, 34, 20, 0.16); /* hard "sticker" shadow, light mode */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Overscroll (rubber-band at the top/bottom) reveals the html element
   behind the body, which is white by default. Match it to the page so
   no white bar flashes. The landing's dark theme needs its own value. */
html { background: var(--bg); }
html:has(body.landing) { background: #241a13; }

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

h1, h2, h3 { font-family: "Baloo 2", system-ui, sans-serif; }

a { color: var(--fern); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.2rem;
  background: var(--card);
  border-bottom: 1px solid #ecdfc8;
}
.topbar .brand { font-family: "Baloo 2", sans-serif; font-weight: 700; text-decoration: none; color: var(--fern-dark); font-size: 1.15rem; }
.topbar .brand span { color: var(--fern); font-weight: 400; }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar nav a { text-decoration: none; color: var(--ink); }

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

.pagefoot { text-align: center; color: var(--muted); padding: 2.5rem 1.2rem 2rem; font-size: 0.9rem; border-top: 2px dashed #ecdfc8; }

.btn {
  display: inline-block;
  background: var(--lantern);
  color: #33220c;
  border: 2px solid #33220c;
  border-radius: 99px;
  padding: 0.55rem 1.1rem;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--pop);
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}
.btn:hover { background: #f0b562; transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(58, 34, 20, 0.16); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.small { padding: 0.3rem 0.75rem; font-size: 0.9rem; }
.btn.big { padding: 0.8rem 1.6rem; font-size: 1.15rem; }
.btn.ghost { background: transparent; color: var(--fern-dark); border-color: var(--fern); box-shadow: none; }
.btn.ghost:hover { background: var(--fern-light); transform: none; box-shadow: none; }
.btn.danger { background: transparent; border-color: #e7c2ac; color: var(--danger); box-shadow: none; }
.btn.danger:hover { background: #fbeee7; transform: none; box-shadow: none; }
.linklike { background: none; border: none; color: var(--ink); cursor: pointer; font-size: 1rem; padding: 0; }
.linklike:hover { color: var(--fern); }
.inline { display: inline; }

.error {
  background: #fbeee7; border: 2px dashed #e7c2ac; color: var(--danger);
  border-radius: var(--radius); padding: 0.6rem 0.9rem;
}
.success {
  background: var(--fern-light); border: 2px dashed #d8c193; color: var(--fern-dark);
  border-radius: var(--radius); padding: 0.6rem 0.9rem;
}
.notice {
  background: #fff3d6; border: 2px dashed #ecce8f;
  border-radius: var(--radius); padding: 0.6rem 0.9rem;
}
.notice p { margin: 0 0 0.5rem; }
.publish-plans { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 0.92rem; }

/* password strength meter */
.pw-meter { height: 5px; background: #ecdfc8; border-radius: 99px; margin: 0.35rem 0 0.15rem; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 99px; transition: width 0.15s, background 0.15s; }
.pw-meter[data-level="0"] span, .pw-meter[data-level="1"] span { background: var(--clay); }
.pw-meter[data-level="2"] span { background: #d68910; }
.pw-meter[data-level="3"] span { background: #6a9962; }
.pw-meter[data-level="4"] span { background: var(--fern); }
.pw-note { color: var(--muted); font-size: 0.8rem; }

/* ============ landing (cozy campfire: warm dusk + handmade/sticker feel) */
body.landing {
  --dusk: #241a13;         /* base: warm near-black brown, not cold black */
  --dusk-2: #2e2116;
  --pine: #3d5a45;         /* muted forest green, gradient stop + surfaces */
  --parchment: #f3e6c8;    /* warm paper cream, for light theme swatches */
  --lantern: #e9a23b;      /* warm amber glow: the one accent, used sparingly */
  --clay: #c1603a;         /* terracotta pop, danger/featured only */
  --warmtext: #e4d7bd;     /* body copy on dark: warm parchment, not cool sage */
  --pop: 4px 4px 0 rgba(18, 12, 7, 0.4); /* hard "sticker" shadow, no blur */
  background: linear-gradient(170deg, #241a13 0%, #2e2116 45%, #3d5a45 100%);
  color: var(--warmtext);
  font-family: "Nunito", system-ui, sans-serif;
}
body.landing main { max-width: 1060px; }
.landing h1, .landing h2, .landing h3, .landing .brand, .landing .amount {
  font-family: "Baloo 2", system-ui, sans-serif;
}
.landing h2 { font-size: 1.9rem; margin: 0 0 1.4rem; color: #fbf1de; letter-spacing: -0.01em; }
.landing section { padding: 3.5rem 0; }
.landing a { color: var(--lantern); }

.landing .topbar { background: transparent; border-bottom: 1px solid rgba(243, 230, 200, 0.12); }
.landing .topbar .brand, .landing .topbar nav a { color: var(--warmtext); }
.landing .topbar .brand span { color: var(--lantern); }
.landing .btn {
  background: var(--lantern); border-color: var(--lantern); color: var(--dusk); font-weight: 700;
  box-shadow: 3px 3px 0 rgba(18, 12, 7, 0.4); transition: transform 0.1s, box-shadow 0.1s;
}
.landing .btn:hover { background: #f0b562; border-color: #f0b562; transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(18, 12, 7, 0.4); }
.landing .btn:active { transform: translate(3px, 3px); box-shadow: none; }
.landing .btn.ghost {
  background: transparent; color: var(--warmtext); border-color: rgba(243, 230, 200, 0.4);
  box-shadow: 3px 3px 0 rgba(243, 230, 200, 0.12);
}
.landing .btn.ghost:hover { background: rgba(243, 230, 200, 0.08); }

.landing .pagefoot { color: rgba(243, 230, 200, 0.65); border-top: 2px dashed rgba(243, 230, 200, 0.2); }

/* hero */
.landing .hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 3rem; align-items: center; padding-top: 4rem;
}
.eyebrow {
  font-family: "Caveat", cursive; font-weight: 700; font-size: 1.35rem;
  color: var(--lantern); margin: 0 0 0.3rem; display: inline-block; transform: rotate(-2deg);
}
.landing .hero h1 {
  font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1.05;
  letter-spacing: -0.01em; margin: 0 0 1.2rem; color: #fbf1de; font-weight: 800;
}
.landing .hero .sub { font-size: 1.15rem; line-height: 1.6; margin: 0 0 1.6rem; max-width: 34rem; }
.landing .hero .sub strong { color: #fbf1de; }
.price-inline { color: var(--lantern); font-weight: 800; }
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2rem; }
.specs { list-style: none; display: flex; gap: 1.6rem; flex-wrap: wrap; padding: 0; margin: 0; }
.specs li { font-size: 0.85rem; color: rgba(243, 230, 200, 0.7); }
.specs strong { display: block; font-size: 1.25rem; color: #fbf1de; font-variant-numeric: tabular-nums; font-family: "Baloo 2", sans-serif; }

/* the signature: a fern-sprite mascot with a glowing lantern, holding up
   a real LinkFern page like a favorite scrapbook photo — washi tape and
   all, instead of a floating "app screenshot" card. */
.hero-mock { justify-self: center; position: relative; padding: 1.5rem 2rem 0.5rem; }
.mascot {
  position: absolute; top: -2.6rem; right: -1.5rem; width: 108px; height: auto;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35)); z-index: 3;
  animation: bob 4s ease-in-out infinite;
}
.doodle {
  position: absolute; color: var(--lantern); font-size: 1.1rem; z-index: 1;
  animation: twinkle 2.4s ease-in-out infinite;
}
.doodle.d1 { top: -1.6rem; left: 0.4rem; animation-delay: 0.2s; }
.doodle.d2 { top: 2.2rem; left: -1.6rem; font-size: 0.8rem; animation-delay: 1s; }
.doodle.d3 { bottom: 3.5rem; right: -1.8rem; font-size: 0.9rem; animation-delay: 0.6s; }
.doodle.d4 { bottom: -0.4rem; left: -1rem; font-size: 0.7rem; animation-delay: 1.5s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
.mock-page-wrap { position: relative; }
.washi { position: absolute; top: -0.6rem; width: 3.4rem; height: 1.3rem; opacity: 0.85; z-index: 2; }
.washi.left { left: 0.6rem; background: var(--clay); transform: rotate(-8deg); }
.washi.right { right: 0.9rem; background: var(--lantern); transform: rotate(7deg); }
.mock-page {
  width: 290px; padding: 2rem 1.2rem 1.1rem; border-radius: 16px;
  background: linear-gradient(160deg, #241a13, #1b4332, #2d6a4f);
  border: 3px solid var(--parchment);
  box-shadow: var(--pop);
  text-align: center;
  transform: rotate(-1.4deg);
}
.mock-avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 0.6rem;
  background: var(--lantern); color: var(--dusk); font-weight: 800; font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  font-family: "Baloo 2", sans-serif;
}
.mock-name { color: #fbf1de; font-weight: 700; font-size: 1.05rem; font-family: "Baloo 2", sans-serif; }
.mock-bio { color: rgba(243, 230, 200, 0.75); font-size: 0.72rem; line-height: 1.45; margin: 0.25rem 0 0.6rem; }
.mock-socials { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 0.9rem; }
.mock-socials span { width: 18px; height: 18px; border-radius: 50%; background: rgba(243, 230, 200, 0.35); }
.mock-btn {
  border-radius: 99px; color: #fff; font-size: 0.8rem; font-weight: 700;
  padding: 0.55rem 0.8rem; margin-bottom: 0.55rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mock-featured { background: var(--lantern); color: #4a2e0a; animation: mockpulse 2.6s ease-in-out infinite; }
.mock-plain { background: var(--pine); color: #fbf1de; }
.mock-foot { color: rgba(243, 230, 200, 0.4); font-size: 0.6rem; margin-top: 0.7rem; }
.mock-caption {
  text-align: center; font-family: "Caveat", cursive; font-weight: 600;
  font-size: 1.15rem; color: var(--warmtext); margin-top: 1.1rem; transform: rotate(-1deg);
}
@keyframes mockpulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(233, 162, 59, 0.35); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 9px rgba(233, 162, 59, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mock-featured, .mascot, .doodle { animation: none; }
}

/* examples: show the range of themes */
.section-sub { color: rgba(243, 230, 200, 0.72); margin: -0.8rem 0 1.6rem; max-width: 40rem; }
.themestrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.theme-card {
  border-radius: 16px; padding: 1.4rem 1.2rem 1.1rem; min-height: 150px;
  border: 2px dashed rgba(243, 230, 200, 0.35); display: flex; flex-direction: column; gap: 0.5rem;
  justify-content: flex-end; box-shadow: var(--pop);
}
.theme-card:nth-child(odd) { transform: rotate(-1deg); }
.theme-card:nth-child(even) { transform: rotate(1deg); }
.theme-card .theme-dot { width: 100%; height: 0.7rem; border-radius: 99px; background: rgba(255,255,255,0.85); opacity: 0.9; }
.theme-card .theme-dot:nth-child(2) { width: 80%; opacity: 0.7; }
.theme-card .theme-dot:nth-child(3) { width: 90%; opacity: 0.8; }
.theme-card .theme-name { font-weight: 700; color: #fff; margin-top: 0.4rem; font-family: "Baloo 2", sans-serif; }
.theme-forest { background: linear-gradient(160deg, #241a13, #1b4332, #2d6a4f); }
.theme-ocean { background: linear-gradient(160deg, #0c1b33, #124559, #2c7da0); }
.theme-candy { background: linear-gradient(160deg, #fdf2f8, #fce7f3, #e0f2fe); }
.theme-candy .theme-dot { background: #ec4899; }
.theme-candy .theme-name { color: #9d174d; }

/* steps: a real sequence, so the order stays numbered — but the marker
   is a little hand-drawn star, like a kid's sticker chart, not a cold
   numeral-in-a-circle. */
.landing .steps ol { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; padding: 0; margin: 0; }
.landing .steps li { counter-increment: step; position: relative; padding-top: 1.3rem; }
.landing .steps li::before {
  content: ""; position: absolute; top: -0.2rem; left: 0; width: 1.1rem; height: 1.1rem;
  background: var(--lantern);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.landing .steps li::after {
  content: counter(step); font-family: "Baloo 2", sans-serif;
  color: var(--lantern); font-weight: 800; font-size: 1.3rem; display: block; margin: 0.4rem 0 0.2rem 1.6rem;
}
.landing .steps h3 { margin: 0 0 0.4rem; color: #fbf1de; font-size: 1.05rem; font-family: "Baloo 2", sans-serif; }
.landing .steps p { margin: 0; color: rgba(243, 230, 200, 0.75); font-size: 0.95rem; line-height: 1.55; }

/* features */
.featgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.featgrid div {
  background: rgba(243, 230, 200, 0.06); border: 2px dashed rgba(243, 230, 200, 0.25);
  border-radius: 14px; padding: 1.2rem 1.3rem; box-shadow: var(--pop);
}
.featgrid div:nth-child(3n+1) { transform: rotate(-0.6deg); }
.featgrid div:nth-child(3n+2) { transform: rotate(0.5deg); }
.featgrid div:nth-child(3n) { transform: rotate(-0.4deg); }
.featgrid h3 { margin: 0 0 0.4rem; color: #fbf1de; font-size: 1rem; font-family: "Baloo 2", sans-serif; }
.featgrid p { margin: 0; color: rgba(243, 230, 200, 0.72); font-size: 0.93rem; line-height: 1.55; }

/* pricing: one page, one price — a single card, not a comparison table */
.pricegrid.solo { display: flex; justify-content: center; }
.pricecard {
  background: rgba(243, 230, 200, 0.07); border: 2px dashed rgba(243, 230, 200, 0.3);
  border-radius: 18px; padding: 1.8rem 2rem 1.6rem; display: flex; flex-direction: column;
  box-shadow: var(--pop); width: 100%; max-width: 26rem; transform: rotate(-0.6deg);
}
.pricecard h3 { margin: 0; color: rgba(243, 230, 200, 0.8); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; }
.pricetag { margin: 0.4rem 0 1rem; color: rgba(243, 230, 200, 0.7); }
.pricetag .amount { font-size: 2.6rem; font-weight: 800; color: var(--lantern); letter-spacing: -0.02em; }
.pricecard ul { list-style: none; padding: 0; margin: 0 0 1.4rem; flex: 1; }
.pricecard li { padding: 0.4rem 0 0.4rem 1.5rem; position: relative; font-size: 0.95rem; line-height: 1.5; }
.pricecard li::before {
  content: ""; position: absolute; left: 0; top: 0.7rem; width: 0.8rem; height: 0.8rem;
  background: var(--lantern);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.pricecard .btn { align-self: flex-start; }

/* faq */
.landing .faq { max-width: 44rem; }
.landing .faq details {
  border-bottom: 2px dashed rgba(243, 230, 200, 0.2); margin: 0; padding: 0.9rem 0;
}
.landing .faq summary {
  color: #fbf1de; font-weight: 700; font-size: 1rem; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; font-family: "Baloo 2", sans-serif;
}
.landing .faq summary::-webkit-details-marker { display: none; }
.landing .faq summary::after { content: "+"; color: var(--lantern); font-size: 1.3rem; font-weight: 400; }
.landing .faq details[open] summary::after { content: "–"; }
.landing .faq p { color: rgba(243, 230, 200, 0.75); line-height: 1.6; margin: 0.7rem 0 0; }

/* last call */
.lastcall { text-align: center; }
.lastcall h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }

@media (max-width: 860px) {
  .landing .hero { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .hero-mock { order: 2; margin: 0 auto; }
  .landing .steps ol { grid-template-columns: 1fr; }
  .themestrip { grid-template-columns: 1fr; }
  .landing section { padding: 2.5rem 0; }
  .nav-hide-sm { display: none; }
}
@media (max-width: 400px) {
  /* Keep the mascot and its lantern glow from pushing past the edge of
     narrow phones, where the hero card already nearly fills the width. */
  .hero-mock { padding: 1.5rem 1.2rem 0.5rem; }
  .mascot { width: 84px; right: -0.6rem; top: -2.1rem; }
  .mock-page { width: 250px; }
}
body.landing { overflow-x: hidden; }

/* footer */
.footgrid {
  max-width: 1060px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem; text-align: left; font-size: 0.92rem;
}
.footgrid strong { font-family: "Baloo 2", sans-serif; font-size: 1.2rem; color: var(--fern-dark); }
.landing .footgrid strong { color: #fbf1de; }
.footgrid a { display: block; margin-bottom: 0.5rem; text-decoration: none; }
.footgrid a:hover { text-decoration: underline; }
.foot-tag {
  font-family: "Caveat", cursive; font-weight: 600; font-size: 1.15rem;
  color: var(--lantern); margin: 0.2rem 0 0; transform: rotate(-1deg); display: inline-block;
}

/* legal / policy pages */
.legal { max-width: 44rem; margin: 1.5rem auto 3rem; line-height: 1.65; }
.legal h1 { color: var(--fern-dark); }
.legal h2 { margin-top: 1.8rem; font-size: 1.2rem; color: var(--fern-dark); }
.legal .legal-meta { color: var(--muted); font-size: 0.9rem; margin-top: -0.4rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin: 0.3rem 0; }

/* auth + misc cards */
.authcard {
  max-width: 26rem; margin: 3rem auto; background: var(--card);
  border: 2px solid #ecdfc8; border-radius: 20px; padding: 1.8rem;
  box-shadow: var(--pop);
}
.authcard h1 { margin-top: 0; font-size: 1.5rem; color: var(--fern-dark); }
.authcard form { display: flex; flex-direction: column; gap: 0.9rem; }

/* forms */
label { display: block; font-size: 0.95rem; margin-bottom: 0.6rem; }
label input, label textarea, label select {
  display: block; width: 100%; margin-top: 0.25rem;
  padding: 0.45rem 0.6rem; font-size: 1rem;
  border: 2px solid #ddcba9; border-radius: 10px; background: #fff;
  font-family: inherit;
}
label input:focus, label textarea:focus, label select:focus {
  outline: 2px solid var(--lantern); outline-offset: 1px;
}
label.check { display: flex; align-items: center; gap: 0.5rem; }
label.check input { width: auto; margin: 0; }
fieldset {
  border: 2px solid #ecdfc8; border-radius: var(--radius);
  background: var(--card); padding: 1rem 1.2rem; margin: 0 0 1.2rem;
}
legend { font-family: "Baloo 2", sans-serif; font-weight: 700; padding: 0 0.4rem; color: var(--fern-dark); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
details { margin: 0.5rem 0; }
summary { cursor: pointer; color: var(--muted); font-size: 0.92rem; }

/* dashboard */
.dash h1 { color: var(--fern-dark); }
.pagelist { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 2rem; }
.pagecard {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem;
  background: var(--card); border: 2px dashed #ecdfc8; border-radius: var(--radius); padding: 0.9rem 1.2rem;
  box-shadow: var(--pop);
}
.pagecard h2 { margin: 0; font-size: 1.15rem; }
.pagecard .meta { margin: 0.2rem 0 0; display: flex; gap: 0.8rem; align-items: center; }
.pagecard-actions { display: flex; gap: 0.5rem; align-items: center; }
.badge {
  font-size: 0.75rem; padding: 0.1rem 0.55rem; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle;
}
.badge.live { background: var(--fern-light); color: var(--fern-dark); }
.badge.draft { background: #f2e9d8; color: var(--muted); }
.badge.suspended { background: #fbe3c2; color: #a05a1f; }
.clicks { color: var(--muted); font-size: 0.9rem; }
.newpage { background: var(--card); border: 2px dashed #d8c193; border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--pop); }
.newpage h2 { margin-top: 0; font-size: 1.1rem; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 1.5rem 1rem 2rem; text-align: center; }
.empty-mascot { width: 96px; height: auto; }
.newpage form { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.slugform { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; margin: 0; }
.sluginput { display: flex; align-items: center; gap: 0.3rem; }
.sluginput input { height: 2.35rem; padding: 0.45rem 0.6rem; font-size: 1rem; border: 2px solid #ddcba9; border-radius: 10px; }
.sluginput .suffix { color: var(--muted); white-space: nowrap; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 1.5rem; }
@media (max-width: 980px) { .editor { grid-template-columns: 1fr; } }
.editor h1 { font-size: 1.4rem; color: var(--fern-dark); }
.crumbs { margin: 0; }
.linkrow, .socialrow {
  border: 2px solid #ecdfc8; border-radius: var(--radius);
  margin-bottom: 0.7rem; background: #fffdf8;
}
.socialrow { display: flex; gap: 0.5rem; align-items: center; padding: 0.6rem 0.9rem; }
.socialrow input { flex: 1; padding: 0.45rem 0.6rem; border: 2px solid #ddcba9; border-radius: 10px; }
.row-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0.9rem; cursor: pointer; list-style: none; user-select: none;
}
.row-head::-webkit-details-marker { display: none; }
.row-head::before { content: "▸"; color: var(--muted); margin-right: 0.5rem; transition: transform 0.15s; }
details[open] > .row-head::before { transform: rotate(90deg); }
.row-head .rowtitle { flex: 1; }
.row-body { padding: 0.4rem 0.9rem 0.5rem; border-top: 1px solid #f2e9d8; }
.rowtitle {
  color: var(--ink); font-size: 0.95rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rowbtns { display: flex; gap: 0.3rem; }
.mini {
  border: 2px solid #ddcba9; background: #fff; border-radius: 8px;
  width: 1.9rem; height: 1.9rem; cursor: pointer; font-size: 0.9rem;
}
.mini:hover { background: var(--fern-light); }
.mini.danger:hover { background: #fbeee7; color: var(--danger); }
.savebar { display: flex; gap: 1rem; align-items: center; position: sticky; bottom: 0; background: var(--bg); padding: 0.8rem 0; }
.mini-link { float: right; font-size: 0.82rem; font-weight: 400; }
.statcards { display: flex; gap: 0.8rem; margin-bottom: 0.8rem; }
.statcard { flex: 1; background: #fbf1dc; border: 2px dashed #ecdfc8; border-radius: var(--radius); padding: 0.7rem 0.9rem; box-shadow: var(--pop); }
.statcard .statbig { display: block; font-size: 1.6rem; font-weight: 700; color: var(--fern-dark); font-variant-numeric: tabular-nums; font-family: "Baloo 2", sans-serif; }
.statcard .statlbl { color: var(--muted); font-size: 0.82rem; }
.trend .bar-click { background: var(--lantern); opacity: 0.6; }
.trend {
  display: flex; align-items: flex-end; gap: 2px; height: 60px;
  padding: 0.3rem 0; margin-bottom: 0.3rem;
}
.trend .bar { flex: 1; min-height: 1px; background: var(--fern); border-radius: 2px 2px 0 0; opacity: 0.85; }
.share { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.domainrow {
  display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start;
  border-bottom: 1px solid #f2e9d8; padding: 0.6rem 0;
}
.domainrow code { background: #f2e9d8; padding: 0.05rem 0.3rem; border-radius: 4px; font-size: 0.85em; }
.domainrow-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.danger-zone { border-color: #e7c2ac; }
.danger-zone legend { color: var(--danger); }
.twofa-setup { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: flex-start; }
.twofa-qr { border: 2px solid #ecdfc8; border-radius: 12px; }
.twofa-secret code { background: #f2e9d8; padding: 0.3rem 0.5rem; border-radius: 6px; letter-spacing: 1px; word-break: break-all; }
.recovery { display: grid; grid-template-columns: repeat(2, max-content); gap: 0.3rem 1.4rem; font-family: ui-monospace, monospace; background: #fbf1dc; border: 2px solid #ecdfc8; border-radius: 12px; padding: 0.9rem 1.2rem; list-style: none; }
/* Template picker sits inline beside the slug box, same height. */
.tpl { display: flex; align-items: center; gap: 0.4rem; margin: 0; white-space: nowrap; font-size: 0.95rem; }
.tpl select { width: auto; height: 2.35rem; margin-top: 0; }
.import { width: 100%; max-width: 32rem; }
.import summary { color: var(--muted); font-size: 0.92rem; cursor: pointer; }
.import textarea { width: 100%; margin-top: 0.4rem; font-family: inherit; }
.importform { margin: 0 0 1.2rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.inline-field { display: flex; gap: 0.4rem; margin-top: 0.25rem; }
.inline-field input { flex: 1; padding: 0.45rem 0.6rem; border: 2px solid #ddcba9; border-radius: 10px; }
.linkrow.dragging { opacity: 0.5; }
.row-head[draggable="true"] { cursor: grab; }
.emoji-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; margin: 0.3rem 0 0.5rem; }
.emoji-lbl { color: var(--muted); font-size: 0.82rem; margin-right: 0.2rem; }
.emoji-pick button {
  border: 2px solid #ecdfc8; background: #fff; border-radius: 8px;
  width: 1.9rem; height: 1.9rem; font-size: 1rem; cursor: pointer; padding: 0; line-height: 1;
}
.emoji-pick button:hover { background: var(--fern-light); border-color: var(--fern); }

.stats { width: 100%; border-collapse: collapse; table-layout: fixed; }
.stats td { padding: 0.35rem 0.2rem; border-bottom: 1px solid #f2e9d8; overflow-wrap: anywhere; }
.stats .num { text-align: right; font-variant-numeric: tabular-nums; width: 4rem; vertical-align: top; }
.stats .statname { display: block; font-weight: 500; }
.stats .staturl {
  display: block; color: var(--muted); font-size: 0.8rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.editor-preview { position: sticky; top: 1rem; align-self: start; }
.preview-frame {
  border: 3px solid var(--card); outline: 2px solid #ecdfc8; border-radius: 24px; overflow: hidden;
  background: #fff; box-shadow: var(--pop);
}
.preview-frame iframe {
  width: 100%; border: 0; display: block;
  /* Fill the viewport next to the sticky editor column. */
  height: clamp(700px, calc(100vh - 140px), 1100px);
}
.preview-placeholder {
  border: 2px dashed #d8c193; border-radius: 24px; padding: 3rem 1.5rem;
  text-align: center; color: var(--muted);
}
.preview-placeholder p:first-child { font-size: 2.5rem; margin: 0; }
