:root {
  --night: #141A33;
  --cream: #F6E6C8;
  --cream-title: #F8E7C6;
  --gold: #E9B862;
  --gold-light: #FFE0A0;
  --link: #F2C46A;
  --paper: #F3E3C3;
  --rod: #C9A574;
  --rod-shadow: #A9824F;
  --ink: #4A2E1A;
  --ink-red: #9E2F2A;
  --ink-title: #7A2E22;
  --adult-bg: #F7EFE2;
  --adult-text: #2A1E14;
  --adult-muted: #5C4630;
  --safe-top: env(safe-area-inset-top, 0px);
  /* +48px så att Netlifys skylt nere till höger inte täcker knappar och länkar */
  --safe-bottom: calc(env(safe-area-inset-bottom, 0px) + 48px);
}
html { color-scheme: dark; }
html.adult { color-scheme: light; }

/* Egen "mörk stil" (samma färger). Webbläsare som Samsung Internet låter då bli
   att själva mörka sidan när telefonen har mörkt läge. */
@media (prefers-color-scheme: dark) {
  :root {
    --night: #141A33;
    --cream: #F6E6C8;
    --paper: #F3E3C3;
    --ink: #4A2E1A;
    --ink-red: #9E2F2A;
    --ink-title: #7A2E22;
    --adult-bg: #F7EFE2;
    --adult-text: #2A1E14;
  }
  html, body { background: #0B0F20; }
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #0B0F20;
  color: var(--cream);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { font-family: 'Patrick Hand', 'Nunito', system-ui, sans-serif; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
button { font: inherit; color: inherit; }
a { color: var(--link); }

/* Appens ram: telefonbredd, centrerad på stora skärmar */
#app {
  position: fixed;
  top: 0; bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  overflow: hidden;
  background: var(--night);
  container-type: size;
}

/* ---------- Bildlager ---------- */
.night { position: absolute; inset: 0; pointer-events: none; }

.scene {
  position: absolute;
  left: 50%;
  top: 0;
  height: max(100cqh, 179.2cqw);
  aspect-ratio: 768 / 1376;
  transform: translateX(-50%);
  transition: height .9s cubic-bezier(.4, 0, .2, 1), top .9s cubic-bezier(.4, 0, .2, 1);
}
.mode-call .scene {
  height: max(110.4cqh, 197.8cqw);
  top: -22.5cqh;
}
.mode-adult .night { display: none; }

.scene-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  user-select: none; -webkit-user-drag: none;
}

.glow {
  position: absolute;
  left: 50%; top: 50.5%;
  width: 83%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,220,150,.75) 0%, rgba(255,190,110,.3) 38%, rgba(255,190,110,0) 66%);
  mix-blend-mode: screen;
  opacity: var(--g-op, .5);
  transform: translate(-50%, -50%) scale(var(--g-sc, 1));
  will-change: opacity, transform;
}
.mode-start .glow, .mode-adult .glow { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { opacity: .35; transform: translate(-50%, -50%) scale(.96); }
  50%      { opacity: .7;  transform: translate(-50%, -50%) scale(1.03); }
}

.stars { position: absolute; inset: 0; }
.star {
  position: absolute;
  transform: translate(-50%, -50%);
  animation: twinkle 2.6s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .15; scale: .6; }
  50%      { opacity: 1;   scale: 1.1; }
}

.snowfall { position: absolute; inset: 0; overflow: hidden; }
.flake {
  position: absolute; top: -10px;
  border-radius: 50%;
  background: #fff;
  animation: fall linear infinite;
}
@keyframes fall { from { transform: translateY(-20px); } to { transform: translateY(calc(100cqh + 30px)); } }

.call-fade {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 50%;
  background: linear-gradient(rgba(20,26,51,0) 0%, rgba(20,26,51,.85) 45%, #141A33 100%);
  opacity: 0;
  transition: opacity .9s;
}
.mode-call .call-fade { opacity: 1; }

/* ---------- Skärmar ---------- */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-top) + 92px) 24px calc(var(--safe-bottom) + 32px);
  overflow-y: auto;
  animation: screenIn .5s ease-out;
}
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }
.spacer { flex: 1 1 0; min-height: 16px; }

.kicker {
  margin: 0;
  font-family: Fredoka, sans-serif; font-size: 18px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.title {
  margin: 6px 0 0;
  font-family: Fredoka, sans-serif; font-weight: 700; font-size: 52px; line-height: 1.05;
  text-align: center;
  color: var(--cream-title);
  text-shadow: 0 2px 0 #8A5A22, 0 0 18px rgba(255,200,120,.45);
}
.lead {
  margin: 16px 0 0;
  font-size: 21px; line-height: 1.35; text-align: center;
  max-width: 320px;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}

/* Ringknappen */
.dial {
  position: relative;
  width: 150px; height: 150px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.ripple {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(120,220,140,.55);
  animation: ripple 2.4s ease-out infinite;
}
.ripple-2 { animation-delay: 1.2s; }
@keyframes ripple { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
.dial-halo {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(80,190,100,.35) 0%, rgba(80,190,100,0) 70%);
}
.call-btn {
  position: relative;
  width: 104px; height: 104px;
  border: 0; border-radius: 50%;
  padding: 0;
  background: radial-gradient(circle at 40% 35%, #5DBB6A 0%, #2F8A43 70%, #23703A 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 6px rgba(70,170,90,.25), 0 0 30px 6px rgba(80,200,110,.45);
  cursor: pointer;
  transition: transform .15s;
}
.call-btn:active { transform: scale(.94); }
.call-btn:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 6px; }
.ringicon { animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes ring {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(-12deg); } 20% { transform: rotate(12deg); }
  30% { transform: rotate(-8deg); }  40% { transform: rotate(8deg); }
  50% { transform: rotate(0); }
}
.dialing .ringicon { animation-duration: .9s; }
.call-btn:disabled { cursor: default; filter: saturate(.35) brightness(.8); }
.dial.off .ripple, .dial.off .ringicon { animation: none; }
.dial.off .call-btn { filter: saturate(.3) brightness(.75); box-shadow: none; }

.tap-hint {
  margin: 14px 0 0;
  font-size: 24px;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.notice {
  margin: 10px 0 0;
  max-width: 320px;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(20,26,51,.75);
  font-size: 19px; line-height: 1.3; text-align: center;
  color: var(--gold-light);
}
.adult-link {
  margin-top: 22px;
  min-height: 44px;
  display: flex; align-items: center; gap: 8px;
  font-size: 19px;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.adult-link:hover { color: var(--gold-light); }

/* ---------- Samtalet ---------- */
.screen-call { padding-top: calc(var(--safe-top) + 56px); padding-bottom: calc(var(--safe-bottom) + 20px); overflow: hidden; }
.call-kicker { font-size: 16px; font-variant-numeric: tabular-nums; }
.status-pill {
  margin-top: 12px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  background: rgba(20,26,51,.6);
  display: flex; align-items: center; gap: 10px;
  font-size: 21px;
  color: var(--gold-light);
}
.dots { display: flex; gap: 4px; }
.dots i {
  width: 6px; height: 6px; border-radius: 3px;
  background: var(--gold-light);
  animation: dot 1.2s infinite;
}
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.listening .dots { display: none; }

/* Pappersrullen */
.scroll {
  width: 336px; max-width: 100%;
  display: flex; flex-direction: column; align-items: center;
  flex: 0 1 auto; min-height: 0;
  position: relative; z-index: 2;
}
.scroll-rod {
  flex: none;
  width: 100%; height: 20px;
  border-radius: 10px;
  background: var(--rod);
  box-shadow: inset 0 -5px 0 var(--rod-shadow);
  position: relative; z-index: 1;
}
.scroll-rod-bottom { box-shadow: inset 0 5px 0 var(--rod-shadow); }
.scroll-paper {
  width: calc(100% - 32px);
  margin: -6px 0;
  min-height: 0;
  max-height: 40cqh;
  overflow-y: auto;
  background: var(--paper);
  padding: 20px 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  color: var(--ink);
  -webkit-overflow-scrolling: touch;
}
.scroll-title {
  margin: 0 0 6px;
  font-family: Caveat, cursive; font-weight: 700; font-size: 32px; line-height: 1;
  color: var(--ink-title);
  text-align: center;
}
.wish-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wish {
  display: flex; align-items: baseline; gap: 10px;
  font-family: Caveat, cursive; font-size: 27px; line-height: 1.2;
  color: var(--ink);
}
.wish::before { content: "✦"; color: var(--ink-red); flex: none; }
.wish .ink {
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
  background-size: 200% 100%;
  background-position: 0 0;
  padding: 0 .25em 0 .1em;
  margin: 0 -.25em 0 -.1em;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.wish.newest .ink { animation: ink 1.4s ease-out both; }
@keyframes ink { from { background-position: 100% 0; } to { background-position: 0 0; } }
.wish.newest { animation: inkin .6s ease-out both; }
@keyframes inkin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.just-now {
  font-family: Nunito, sans-serif; font-size: 12px; font-weight: 700;
  color: #7A5A2E;
  white-space: nowrap;
}
.scroll-empty {
  margin: 4px 0 0;
  font-family: Caveat, cursive; font-size: 22px; line-height: 1.2;
  text-align: center;
  color: #8A6A44;
}

.hangup-btn {
  margin-top: 22px; flex: none;
  width: 68px; height: 68px;
  border: 0; border-radius: 50%; padding: 0;
  background: #C8463D;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px 4px rgba(200,70,61,.35);
  cursor: pointer;
  position: relative; z-index: 2;
}
.hangup-btn:active { transform: scale(.94); }
.hangup-btn:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 5px; }
.hangup-label { margin: 6px 0 0; font-size: 18px; color: var(--cream); position: relative; z-index: 2; }

/* ---------- För vuxna ---------- */
#app.mode-adult { background: var(--adult-bg); }
.screen-adult {
  align-items: stretch;
  padding: calc(var(--safe-top) + 40px) 24px calc(var(--safe-bottom) + 28px);
  background: var(--adult-bg);
  color: var(--adult-text);
  font-family: Nunito, system-ui, sans-serif;
}
.screen-adult a { color: var(--ink-title); }
.back-link {
  min-height: 44px; align-self: flex-start;
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 700; text-decoration: none;
}
.adult-kicker {
  margin: 18px 0 0;
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: #6B4E2E;
}
.adult-title {
  margin: 8px 0 0;
  font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 36px; line-height: 1.1;
}
.adult-sub { margin: 8px 0 0; font-size: 16px; color: var(--adult-muted); }

.lock { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.lock-text { margin: 0; font-size: 17px; line-height: 1.4; color: var(--adult-muted); }
.pin {
  width: 100%;
  min-height: 64px;
  border: 2px solid var(--rod);
  border-radius: 16px;
  background: #FFFDF8;
  font-family: Nunito, sans-serif; font-size: 32px; font-weight: 700;
  letter-spacing: 18px; text-align: center;
  color: var(--adult-text);
}
.pin:focus { outline: 3px solid var(--ink-red); outline-offset: 2px; }
.lock-error { margin: 0; min-height: 1.3em; font-size: 15px; font-weight: 700; color: #A32920; }
.link-btn {
  align-self: center;
  min-height: 44px; padding: 0 12px;
  border: 0; background: none;
  font-family: Nunito, sans-serif; font-size: 15px; font-weight: 700;
  color: var(--ink-title); text-decoration: underline;
  cursor: pointer;
}

.btn {
  min-height: 52px;
  border-radius: 16px;
  font-family: Nunito, sans-serif; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
}
.btn-primary { border: 0; background: var(--ink-red); color: #fff; min-height: 56px; }
.btn-primary:active { background: #86241F; }
.btn-secondary { border: 2px solid var(--rod); background: transparent; color: var(--ink); }
.btn-ghost { border: 0; background: transparent; color: #8A3A2E; text-decoration: underline; min-height: 44px; font-size: 15px; }

.adult-content { display: flex; flex-direction: column; flex: 1 0 auto; }
.scroll-adult { margin-top: 20px; width: 100%; max-width: 342px; align-self: center; }
.scroll-adult .scroll-paper { max-height: none; overflow: visible; padding: 22px 24px; box-shadow: 0 8px 24px rgba(74,46,26,.18); }
.call-group + .call-group { margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(122,46,34,.3); }
.call-head {
  margin: 0 0 4px;
  font-family: Nunito, sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  color: #7A5A2E;
}
.scroll-adult .wish { font-size: 28px; line-height: 1.3; }
.adult-empty { margin: 0; font-family: Caveat, cursive; font-size: 26px; text-align: center; color: #7A5A2E; }
.child-lists { display: flex; flex-direction: column; gap: 22px; margin-top: 20px; }
.child-lists .scroll-adult { margin-top: 0; }
.scroll-adult .scroll-title { margin-bottom: 12px; font-size: 34px; }
.child-tools {
  margin-top: 14px; padding-top: 10px;
  border-top: 1px dashed rgba(122,46,34,.3);
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.mini-btn {
  min-height: 44px; padding: 0 6px;
  border: 0; background: none;
  font-family: Nunito, sans-serif; font-size: 15px; font-weight: 700;
  color: var(--ink-title); text-decoration: underline;
  cursor: pointer;
}
.adult-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.toast { margin: 10px 0 0; min-height: 1.3em; text-align: center; font-weight: 700; color: #2F6B3A; }
.quota { margin: 4px 0 0; text-align: center; font-size: 14px; color: var(--adult-muted); }

@media (prefers-reduced-motion: reduce) {
  .flake, .star, .ripple, .ringicon, .mode-start .glow { animation: none !important; }
  .scene { transition: none; }
}
@media (max-height: 700px) {
  .screen-start { padding-top: calc(var(--safe-top) + 48px); }
  .title { font-size: 44px; }
  .screen-call { padding-top: calc(var(--safe-top) + 28px); }
}

/* ---------- Skydd mot webbläsarens "mörkt läge" (t.ex. Samsung Internet) ----------
   Ljusa ytor är riktiga bilder, som webbläsaren inte färgar om.
   Mörk text på pergamentet ritas som bakgrund klippt till texten,
   så att den inte blir ljus på det ljusa pappret. */
.call-btn { background: url(img/ringknapp.png) center / 100% 100% no-repeat; }
.scroll-rod { background: url(img/stang-topp.png) center / 100% 100% no-repeat; box-shadow: none; }
.scroll-rod-bottom { background-image: url(img/stang-botten.png); box-shadow: none; }
.scroll-paper { background: url(img/pergament.png) 0 0 / 240px 240px repeat; }

.scroll-title, .wish::before, .just-now, .scroll-empty, .call-head, .adult-empty, .scroll-paper .mini-btn {
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}
.scroll-title { background-image: linear-gradient(var(--ink-title), var(--ink-title)); }
.wish::before { background-image: linear-gradient(var(--ink-red), var(--ink-red)); }
.just-now { background-image: linear-gradient(#7A5A2E, #7A5A2E); }
.scroll-empty, .call-head, .adult-empty { background-image: linear-gradient(#7A5A2E, #7A5A2E); }
.scroll-paper .mini-btn {
  background-image: linear-gradient(var(--ink-title), var(--ink-title));
  text-decoration-color: var(--ink-title);
}

/* ---------- Tips till tomten ---------- */
.tips {
  margin-top: 20px;
  padding: 16px;
  border: 2px dashed var(--rod);
  border-radius: 16px;
  background: #FFFDF8;
}
.tips-title { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 22px; color: var(--adult-text); }
.tips-text { margin: 6px 0 12px; font-size: 15px; line-height: 1.4; color: var(--adult-muted); }
.tips-form { display: flex; flex-direction: column; gap: 6px; }
.tips-label { font-size: 14px; font-weight: 700; color: var(--adult-text); }
.tips-input {
  width: 100%; min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--rod); border-radius: 12px;
  background: #fff;
  font: 16px Nunito, system-ui, sans-serif; color: var(--adult-text);
  resize: vertical;
}
.tips-input:focus { outline: 3px solid var(--ink-red); outline-offset: 1px; }
.tips-form .btn { margin-top: 6px; }
.tips-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tips-list:empty { display: none; }
.tip-item { padding: 10px 12px; border-radius: 12px; background: #F3E9D6; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.tip-item p { margin: 0; flex: 1 1 100%; font-size: 15px; line-height: 1.35; color: var(--adult-text); }
.tip-note { font-size: 13px; color: var(--adult-muted); }
.tip-item .mini-btn { margin-left: auto; min-height: 36px; }

/* ---------- Tomtens anteckningar: förslag och mikrofon ---------- */
.tips-field { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.tips-hint { margin: -4px 0 0; font-size: 13px; color: var(--adult-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--rod); border-radius: 18px;
  background: #F3E9D6; color: var(--adult-text);
  font: 600 14px Nunito, system-ui, sans-serif;
  cursor: pointer;
}
.chip:active { background: #E8D9BC; }
.tips-row { display: flex; gap: 8px; align-items: flex-start; }
.tips-row .tips-input { flex: 1; }
.mic-btn {
  flex: none; width: 48px; height: 48px;
  border: 2px solid var(--rod); border-radius: 50%;
  background: #fff; color: var(--ink-title);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.mic-btn.listening { background: var(--ink-red); border-color: var(--ink-red); color: #fff; animation: micpulse 1s ease-in-out infinite; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 6px rgba(158,47,42,.25); } }
.tip-tools { display: flex; gap: 8px; margin-left: auto; }
.tip-history { color: var(--adult-muted) !important; font-size: 14px !important; }

/* ---------- Föräldradelen: flikar ---------- */
.adult-tabs {
  position: sticky; top: -40px; z-index: 5;
  margin: 18px -24px 0; padding: 10px 16px;
  display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 6px;
  background: var(--adult-bg);
  border-bottom: 1px solid rgba(122,46,34,.15);
}
.adult-tab {
  min-height: 60px; padding: 6px 4px;
  border: 2px solid var(--rod); border-radius: 14px;
  background: #FFFDF8; color: var(--adult-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: 700 13px/1.15 Nunito, system-ui, sans-serif; text-align: center;
  cursor: pointer;
}
.adult-tab[aria-selected="true"] { background: var(--ink-red); border-color: var(--ink-red); color: #fff; }
.adult-tab:focus-visible { outline: 3px solid var(--ink-title); outline-offset: 2px; }
.adult-panel { padding-top: 18px; display: flex; flex-direction: column; }
.panel-title { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 26px; line-height: 1.15; color: var(--adult-text); }
.panel-intro { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--adult-muted); }
.panel-subtitle { margin: 22px 0 0; font-size: 16px; font-weight: 700; color: var(--adult-text); }
#panel-lists .adult-sub { margin-top: 12px; font-weight: 700; color: var(--adult-text); }
#panel-notes .tips { margin-top: 14px; }
.quota-card {
  margin-top: 18px; padding: 20px 16px;
  border: 2px solid var(--rod); border-radius: 16px; background: #FFFDF8;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.quota-big { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 40px; font-weight: 700; color: var(--ink-red); }
.quota-card .quota { margin: 0 0 10px; font-size: 15px; }
.quota-card .btn { align-self: stretch; }
/* Kvittot ("Sparat!" osv.) syns oavsett flik */
.screen-adult .toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 8px); transform: translateX(-50%);
  width: min(440px, calc(100% - 32px)); margin: 0; z-index: 20;
  padding: 12px 16px; border-radius: 14px;
  background: #2F6B3A; color: #fff; font-weight: 700; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.screen-adult .toast:empty { display: none; }

/* Tomtens minne av samtalen */
.memory-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.memory-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px solid rgba(0,0,0,.12); border-radius: 12px; background: #fff; }
.memory-item p { margin: 0; color: var(--adult-text); }
.memory-empty { color: var(--adult-muted); font-size: 15px; }

/* Tysta-knapp bredvid Lägg på */
.call-buttons { display: flex; justify-content: center; gap: 44px; margin-top: 22px; position: relative; z-index: 2; flex: none; }
.call-btn-wrap { display: flex; flex-direction: column; align-items: center; }
.call-buttons .hangup-btn { margin-top: 0; }
.mute-btn {
  width: 68px; height: 68px; flex: none;
  border: 2px solid rgba(255,246,230,.55); border-radius: 50%; padding: 0;
  background: rgba(255,246,230,.12); color: #FFF6E6;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.mute-btn:disabled { opacity: .4; cursor: default; }
.mute-btn:active:not(:disabled) { transform: scale(.94); }
.mute-btn:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 5px; }
.mute-btn .mute-slash { display: none; }
.mute-btn[aria-pressed="true"] { background: #FFF6E6; color: #1E2A4A; border-color: #FFF6E6; }
.mute-btn[aria-pressed="true"] .mute-slash { display: inline; }

/* Redigera önskelistan för hand */
.wish-list li:has(.wish-edit) { display: flex; align-items: center; gap: 6px; }
.wish-list li:has(.wish-edit) .ink { flex: 1; min-width: 0; }
.wish-edit { display: inline-flex; gap: 4px; margin-left: auto; flex: none; white-space: nowrap; }
.wish-edit .mini-btn { width: 34px; height: 34px; padding: 0; font-size: 18px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(122,40,30,.35); border-radius: 50%; }
.wish-add { display: flex; gap: 8px; margin: 12px 0 4px; }
.wish-add input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid #B89A6E; border-radius: 8px; background: #FFFDF7; color: #3A2A18; }

/* Teckenräknare för anteckningarna */
.tips-max { font-weight: 400; font-size: 13px; color: var(--adult-muted); }
.tips-count { margin: 4px 0 0; font-size: 12px; color: var(--adult-muted); text-align: right; }
.tips-count.near { color: #b3541e; font-weight: 600; }

/* Tidigare rapporter, en rad per rapport */
.tip-history-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.tip-history-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tip-history-list .h-text { flex: 1 1 160px; font-size: 14px; color: var(--adult-muted); }
.tip-history-list .h-btns { display: flex; gap: 6px; }

/* Telefonsvararens brytare */
.vm-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 4px 0 6px; }
.vm-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vm-track { flex: none; width: 50px; height: 30px; border-radius: 15px; background: #d9cdb8; position: relative; transition: background .2s; }
.vm-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.vm-switch input:checked + .vm-track { background: #2f7a4b; }
.vm-switch input:checked + .vm-track::after { transform: translateX(20px); }
.vm-switch input:focus-visible + .vm-track { outline: 3px solid #b3541e; outline-offset: 2px; }
.vm-label { font-weight: 600; }
.vm-hint { margin-top: 0; }
.tip-history-list .h-pending { color: inherit; }

/* Tomtens anteckningar: barnen först, formuläret öppnas vid barnet */
.add-child-btn { margin-top: 12px; width: 100%; }
#panel-notes .tips-list { margin-top: 8px; }
.tip-item .tips { margin-top: 10px; flex: 1 1 100%; }
.tip-item.editing { outline: 2px solid var(--rod); }
.tips-form-title { margin: 0 0 4px; font-family: Fraunces, Georgia, serif; font-size: 20px; color: var(--adult-text); }
.tips-form .tips-field { padding: 12px; border-radius: 12px; background: #F7F0E2; }
.tips-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.tips-actions .btn { flex: 1; margin-top: 0; }
.tip-empty-note { color: var(--adult-muted) !important; font-style: italic; }
.tip-item.editing > .tip-tools { display: none; }
.tip-item p.card-heading { margin-top: 8px; font-size: 15px; }
.card-heading strong { color: var(--ink-title, var(--adult-text)); }
.card-heading span { color: var(--adult-muted); font-size: 13px; }
.tip-item > p:first-child + p.card-heading { margin-top: 2px; }

/* Nissarnas rapport: skriv och lägg till i listan */
.tip-add-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tip-add-row .tips-count { margin: 0; text-align: left; }
.tips-form .tip-add-btn { margin-top: 0; min-height: 40px; padding: 6px 18px; width: auto; }
.tip-draft { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.tip-draft:empty { display: none; }
.tip-draft li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid #e3d5bb; }
.tip-draft .h-text { flex: 1; font-size: 15px; }
.tips-form .tip-add-btn { white-space: nowrap; flex: none; }
.card-add { flex: 1 1 100%; display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.card-add .tips-input { flex: 1; min-height: 40px; padding: 8px 10px; font-size: 15px; border-width: 1px; }
.card-add .mini-btn { margin-left: 0; white-space: nowrap; }

/* Provsamtal, säkerhetskopia, hemskärmstips */
.test-call-btn { margin-top: 10px; width: 100%; }
.backup-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.backup-last { margin: 8px 0 0; font-size: 14px; color: var(--adult-muted); }
.homescreen-tip { margin: 4px 0 16px; padding: 12px 14px; border-radius: 14px; background: #FFF6DF; border: 1px solid #E5C98A; }
.homescreen-tip p { margin: 0 0 6px; font-size: 15px; line-height: 1.4; color: var(--adult-text); }
.homescreen-tip .homescreen-how { color: var(--adult-muted); font-size: 14px; }
.about-link { margin-top: 6px; min-height: 40px; display: flex; align-items: center; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; color: var(--cream); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.about-link-adult { align-self: flex-start; margin-top: 18px; min-height: 40px; display: flex; align-items: center; font-size: 15px; font-weight: 700; }

/* Om tjänsten */
.screen-about { gap: 0; }
.about-lead { margin: 12px 0 4px; font-size: 19px; line-height: 1.45; color: var(--adult-text); }
.about-block { margin-top: 20px; }
.about-block h2 { margin: 0 0 6px; font-family: Fraunces, Georgia, serif; font-size: 21px; line-height: 1.2; color: var(--ink-title); }
.about-block p, .about-block li { margin: 0; font-size: 16px; line-height: 1.5; color: var(--adult-text); }
.about-block ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.about-actions { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.about-actions .btn { text-decoration: none; text-align: center; justify-content: center; }
.screen-about .about-actions .btn-primary { color: #FFF6E6; }
.code-form { display: flex; gap: 8px; align-items: center; width: 100%; margin-top: 6px; }
.code-form .tips-input { flex: 1; min-height: 44px; text-transform: uppercase; letter-spacing: 1px; }
.code-form .mini-btn { margin-left: 0; white-space: nowrap; }
