/* gaveønsker.no
   Dark glass UI over the candle-window photo, with a handwritten paper list. */

@font-face { font-family: 'Caveat'; src: url(/fonts/Caveat-400.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url(/fonts/Caveat-700.ttf) format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Dancing Script'; src: url(/fonts/DancingScript-400.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Dancing Script'; src: url(/fonts/DancingScript-700.ttf) format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(/fonts/Nunito-400.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(/fonts/Nunito-600.ttf) format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(/fonts/Nunito-700.ttf) format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(/fonts/Nunito-800.ttf) format('truetype'); font-weight: 800; font-display: swap; }

:root {
  --text: #f5ecdf;
  --muted: #b9ad9c;
  --faint: #8a8174;
  --flame: #f2b45a;
  --flame-soft: #ffd79a;
  --flame-deep: #d98f2b;
  --ice: #9cc0e6;
  --danger: #e7766a;
  --glass: rgba(14, 16, 22, 0.66);
  --glass-strong: rgba(14, 16, 22, 0.84);
  --glass-line: rgba(255, 228, 190, 0.10);
  --field: rgba(255, 255, 255, 0.06);
  --field-line: rgba(255, 236, 210, 0.16);

  --ink: #2a1d12;
  --ink-soft: #5d4630;
  --ink-red: #9c2f22;
  --pencil: #6f6a64;

  --radius: 18px;
  --shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.75);
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 1rem/1.5 var(--ui);
  color: var(--text);
  background: #140e0a; /* dark brown like the bottom of the photo, shows when over-scrolling */
  overflow-x: hidden;
}

/* ---------- background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(6, 7, 10, 0.15), rgba(6, 7, 10, 0.55)),
    url(/img/bg.webp) center 30% / cover no-repeat,
    #07080b;
}
/* Phones: the tall photo. It's scaled to 113% height so the dark wall below
   the windowsill falls off-screen and the snowy sill with the candle holders
   sits at the bottom edge. Darkened at the top (behind the text), not below. */
@media (max-aspect-ratio: 3/4) {
  .bg {
    background-image:
      linear-gradient(180deg, rgba(6, 7, 10, .40) 0%, rgba(6, 7, 10, .22) 45%, rgba(6, 7, 10, .05) 80%, rgba(6, 7, 10, 0) 100%),
      url(/img/bg-tall.webp);
    background-size: 100% 100%, auto 113%;
    background-position: center, center top;
  }
}

a { color: var(--flame-soft); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.15; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--glass-line); margin: 1.4rem 0; width: 100%; }
.hand { font-family: var(--hand); font-weight: 700; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- icons ---------- */
.icon { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon.big { width: 2rem; height: 2rem; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px max(16px, env(safe-area-inset-left)) 6px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--glass-line);
  color: var(--flame); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-name { font: 700 1.9rem/1 var(--hand); text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.topnav { display: flex; gap: .5rem; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .85rem; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  max-width: 50vw;
}
.chip:hover { border-color: rgba(242, 180, 90, .4); }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: 12px 16px 64px; max-width: 1180px; margin: 0 auto; }

/* ---------- glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.card { padding: 1.25rem 1.35rem; }
.card + .card { margin-top: 1rem; }
.narrow { max-width: 440px; margin: 6vh auto 0; }
.center { text-align: center; }
.card h1.hand { font-size: 2.6rem; color: var(--flame-soft); }
.card-title { display: flex; align-items: center; gap: .5rem; font-size: 1rem; font-weight: 700; margin-bottom: .85rem; }
.card-title .icon { color: var(--flame); }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.1rem;
  border-radius: 12px; border: 1px solid transparent;
  font: 700 .95rem/1 var(--ui); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
  color: var(--text); background: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--flame-soft), var(--flame)); color: #2a1a08; box-shadow: 0 6px 24px -8px rgba(242, 180, 90, .6); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffe2b3, #f5be6c); }
.btn.ghost { background: rgba(255, 255, 255, .05); border-color: var(--field-line); }
.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.btn.danger { background: rgba(231, 118, 106, .14); border-color: rgba(231, 118, 106, .45); color: #ffc6bf; }
.btn.danger:hover { background: rgba(231, 118, 106, .24); }
.danger-text { color: var(--danger) !important; }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 34px; padding: .4rem .7rem; font-size: .85rem; }
.btn.icon-btn { padding: 0; width: 44px; flex: none; }
.btn.icon-btn.small { width: 34px; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .wish:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--flame); outline-offset: 2px;
}

.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: .9rem; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.label { font-weight: 700; font-size: .88rem; color: var(--muted); }
.hint { font-size: .8rem; color: var(--faint); }
input, textarea {
  width: 100%;
  font: 400 1rem/1.4 var(--ui);
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: 12px;
  padding: .7rem .85rem;
  transition: border-color .15s, background .15s;
}
input:focus, textarea:focus { outline: none; border-color: rgba(242, 180, 90, .6); background: rgba(255, 255, 255, .09); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.check { display: flex; gap: .6rem; align-items: center; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--flame); }
.form-error { color: #ffb4aa; min-height: 1.2em; margin: 0; font-weight: 600; }
.form-error:empty { display: none; }

.auth h1 { margin-bottom: .2rem; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; font-size: .92rem; }

/* ---------- landing ---------- */
.landing { max-width: 760px; margin: 8vh auto 0; }
.hero { padding: 2.4rem 2rem 2rem; text-align: center; }
.hero-title { font-size: clamp(3rem, 9vw, 4.6rem); color: var(--flame-soft); text-shadow: 0 0 40px rgba(242, 180, 90, .35); margin-bottom: .6rem; }
.hero-lead { font-size: 1.15rem; color: var(--text); max-width: 34em; margin: 0 auto 1.5rem; }
.hero .row { justify-content: center; }
.steps { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step { padding: 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .25rem; }
.step-n { font-size: 2.1rem; line-height: 1; color: var(--flame); }
@media (max-width: 680px) { .steps { grid-template-columns: 1fr; } }

/* ---------- home: lists as paper notes ---------- */
.home { max-width: 980px; margin: 2vh auto 0; }
.page-title { font-size: 2.8rem; color: var(--flame-soft); text-shadow: 0 2px 20px rgba(0, 0, 0, .6); }
.section-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 1.8rem 0 .9rem; text-shadow: 0 1px 8px #000; }
.section-title.small { margin: 0; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem; }
.note {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-start; gap: .3rem;
  min-height: 150px; padding: 1.2rem 1.2rem 1rem;
  color: var(--ink); text-decoration: none;
  border: 0; border-radius: 3px; cursor: pointer; font: inherit; text-align: left;
  background: var(--paper-bg);
  box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .8), inset 0 0 40px rgba(140, 95, 40, .25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.note:hover { transform: translateY(-4px) rotate(0deg) !important; box-shadow: 0 26px 40px -14px rgba(0, 0, 0, .85), inset 0 0 40px rgba(140, 95, 40, .25); }
.tilt-0 { transform: rotate(-.5deg); } .tilt-1 { transform: rotate(.4deg); }
.tilt-2 { transform: rotate(-.2deg); } .tilt-3 { transform: rotate(.6deg); }
.note-title { font: 700 1.9rem/1.05 var(--paper-font); color: var(--ink); }
/* each card wears its list's paper style */
.note[data-paper="pergament"] { box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .8), var(--paper-edge); border-radius: 2px; }
.note[data-paper="brev"] { box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .8), var(--paper-edge); }
.note[data-paper="brev"]::after { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(156, 47, 34, .3); pointer-events: none; }
.note[data-paper="brev"] .note-title { font-size: 1.75rem; }
.note[data-paper="rull"] { border-radius: 0; border-top: 9px solid #8a5a2e; border-bottom: 9px solid #8a5a2e; box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .8); }
.note[data-paper="rull"] .note-title { font-size: 1.75rem; }
.note-owner { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-red); }
.note-meta { margin-top: auto; font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.note-owner { color: var(--ink-red); }
.note-new {
  align-items: center; justify-content: center; gap: .5rem;
  background: rgba(14, 16, 22, .5); color: var(--flame-soft);
  border: 2px dashed rgba(255, 215, 154, .35);
  box-shadow: none; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.note-new .hand { font-size: 1.7rem; }
.note-new:hover { border-color: var(--flame); box-shadow: none; }
.empty-hint { max-width: 32em; text-shadow: 0 1px 8px #000; }

/* ---------- paper ---------- */
:root {
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .38 0 0 0 0 .27 0 0 0 0 .13 0 0 0 .13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paper-bg:
    var(--paper-grain),
    radial-gradient(ellipse 120% 90% at 50% 40%, rgba(255, 250, 235, 0) 55%, rgba(130, 85, 30, .22) 100%),
    linear-gradient(172deg, #faf1da 0%, #f2e3c1 55%, #e8d3a6 100%);
}

.list-layout {
  display: grid;
  grid-template-columns: minmax(0, 640px) 340px;
  justify-content: center;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5vh;
}
.list-layout.role-anon, .list-layout.role-guest, .list-layout.role-banned { grid-template-columns: minmax(0, 640px); }
.role-anon .side, .role-guest .side, .role-banned .side { position: static; display: flex; justify-content: center; }
.secret-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  margin: .4rem 0 0; padding: .65rem 1.2rem;
  border-radius: 999px; cursor: pointer;
  font: 700 .95rem var(--ui); color: var(--flame-soft); text-decoration: none;
  transition: border-color .15s, background .15s;
}
.secret-pill:hover { border-color: rgba(242, 180, 90, .5); background: var(--glass-strong); }
p.secret-pill { cursor: default; font-weight: 600; color: var(--muted); }
.side { position: sticky; top: 16px; }

/* Paper styles, chosen per list by its owner: pergament | brev | rull.
   [data-paper] can sit on any element (body, the list page, a dashboard card);
   it sets the paper background, ink colours and handwriting font below it. */
body, [data-paper="pergament"] {
  --paper-font: 'Caveat', 'Segoe Print', cursive;
  --item-size: 1.9rem;
  --title-size: clamp(2.6rem, 7vw, 3.5rem);
  --ink: #2b1a0c;
  --ink-soft: #5e4027;
  --ink-red: #8e2a1c;
  --paper-bg:
    var(--paper-grain),
    radial-gradient(circle at 18% 12%, rgba(150, 100, 35, .20), transparent 32%),
    radial-gradient(circle at 88% 64%, rgba(140, 88, 28, .22), transparent 38%),
    radial-gradient(circle at 30% 88%, rgba(120, 75, 25, .16), transparent 30%),
    radial-gradient(ellipse 85% 80% at 50% 48%, transparent 45%, rgba(105, 58, 16, .42) 100%),
    linear-gradient(160deg, #f2e0b6 0%, #e8cd95 55%, #dbb97a 100%);
  --paper-edge: inset 0 0 55px rgba(90, 48, 10, .45), inset 0 0 8px rgba(70, 35, 5, .55);
  --paper-filter: url(#deckle) drop-shadow(0 30px 34px rgba(0, 0, 0, .7));
}
[data-paper="brev"] {
  --paper-font: 'Dancing Script', 'Segoe Script', cursive;
  --item-size: 1.65rem;
  --title-size: clamp(2.4rem, 6.5vw, 3.2rem);
  --ink: #1d2844;
  --ink-soft: #46506a;
  --ink-red: #8f2c20;
  --paper-bg:
    var(--paper-grain),
    radial-gradient(ellipse 90% 85% at 50% 45%, transparent 50%, rgba(120, 90, 45, .26) 100%),
    linear-gradient(175deg, #ece2cc 0%, #e3d6ba 100%);
  --paper-edge: inset 0 0 40px rgba(110, 80, 40, .22);
  --paper-filter: url(#deckle-soft) drop-shadow(0 28px 30px rgba(0, 0, 0, .65));
}
[data-paper="rull"] {
  --paper-font: 'Dancing Script', 'Segoe Script', cursive;
  --item-size: 1.65rem;
  --title-size: clamp(2.4rem, 6.5vw, 3.2rem);
  --ink: #2b1a0c;
  --ink-soft: #5e4027;
  --ink-red: #8e2a1c;
  --paper-bg:
    var(--paper-grain),
    radial-gradient(circle at 80% 20%, rgba(150, 100, 35, .16), transparent 35%),
    radial-gradient(circle at 15% 75%, rgba(140, 88, 28, .16), transparent 35%),
    linear-gradient(90deg, rgba(110, 65, 20, .30), transparent 9%, transparent 91%, rgba(110, 65, 20, .30)),
    linear-gradient(180deg, #e9d29f 0%, #f1dfb6 12%, #efdcae 88%, #e4c891 100%);
  --paper-edge: inset 0 0 0 transparent;
  --paper-filter: url(#deckle-side) drop-shadow(0 26px 30px rgba(0, 0, 0, .7));
}

.paper {
  position: relative;
  isolation: isolate;
  color: var(--ink);
  padding: 3.4rem 3.2rem 2.4rem;
  min-height: 420px;
}
.paper-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--paper-bg);
  box-shadow: var(--paper-edge);
  filter: var(--paper-filter);
}
/* letter paper: thin double frame */
[data-paper="brev"] .paper-bg::after {
  content: '';
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(156, 47, 34, .32);
  outline: 1px solid rgba(156, 47, 34, .18);
  outline-offset: 4px;
}
/* scroll: wooden rods top and bottom */
.roll { display: none; }
[data-paper="rull"] .paper { margin: 22px 0; padding-top: 3rem; padding-bottom: 2.2rem; }
[data-paper="rull"] .roll {
  display: block;
  position: absolute;
  left: -22px; right: -22px;
  height: 30px;
  border-radius: 15px;
  background: linear-gradient(180deg, #5a3517 0%, #9a6a3a 30%, #c89a62 48%, #8a5a2e 70%, #4a2a10 100%);
  box-shadow: 0 8px 14px rgba(0, 0, 0, .55);
  z-index: 1;
}
[data-paper="rull"] .roll::before, [data-paper="rull"] .roll::after {
  content: '';
  position: absolute;
  top: -5px;
  width: 22px; height: 40px;
  border-radius: 8px;
  background: radial-gradient(circle at 40% 35%, #d9a865, #7a4c22 60%, #3e220b);
}
[data-paper="rull"] .roll::before { left: -14px; }
[data-paper="rull"] .roll::after { right: -14px; }
.roll-top { top: -16px; }
.roll-bottom { bottom: -16px; }

.paper-title, .paper-title-input {
  display: block;
  width: 100%;
  font: 700 var(--title-size)/1.1 var(--paper-font);
  color: var(--ink);
  margin: 0;
  text-align: center;
  overflow-wrap: anywhere;
}
.paper-title-input {
  background: transparent;
  border: 0;
  border-bottom: 2px dashed transparent;
  border-radius: 0;
  padding: 0 0 .1rem;
}
.paper-title-input:hover { border-bottom-color: rgba(94, 64, 39, .3); }
.paper-title-input:focus { background: transparent; border-bottom-color: rgba(142, 42, 28, .5); }
.title-swash { display: block; width: 220px; height: 22px; margin: .2rem auto 1.6rem; color: var(--ink-red); opacity: .75; }

.wishes { list-style: none; margin: 0; padding: 0; }
.wish {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: .7rem;
  font: 400 var(--item-size)/1.3 var(--paper-font);
  padding: .3rem .5rem;
  margin: 0 -.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s;
}
.wish:hover { background: rgba(120, 75, 25, .09); }
.wish:focus-visible { outline-offset: 0; }
.mark { flex: none; min-width: 1.7rem; text-align: right; color: var(--ink-soft); font-size: .8em; }
.wish-body { position: relative; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wish-title { color: var(--ink); text-decoration: none; }
.star-inline { color: var(--ink-red); font-size: .75em; margin-left: .35rem; font-family: var(--ui); vertical-align: .1em; }
a.wish-title {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='4' viewBox='0 0 12 4'%3E%3Cpath d='M0 2 Q3 0 6 2 T12 2' fill='none' stroke='%238e2a1c' stroke-opacity='.5' stroke-width='1.1'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: 0 92%;
  background-size: 12px 4px;
  padding-bottom: 3px;
}
a.wish-title:hover { color: var(--ink-red); }
a.wish-title::after { content: '↗'; font: 600 .5em var(--ui); margin-left: .25em; color: var(--ink-red); opacity: .65; vertical-align: .5em; }
.wish-extra { margin-left: .4rem; font: .55em var(--ui); color: var(--ink-soft); opacity: .6; vertical-align: .3em; }

/* reserved (members only): crossed out, name pencilled beside it */
.wish.reserved .wish-title {
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  background-image: none;
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--ink-soft) 85%, transparent);
  text-decoration-thickness: 2px;
}
.wish.reserved a.wish-title::after { opacity: .3; }
.reserved-by {
  display: inline-block;
  margin-left: .6rem;
  font: 400 1.35rem/1 'Caveat', cursive;
  color: var(--pencil);
  transform: rotate(-4deg);
  white-space: nowrap;
}
.wish.mine .reserved-by { color: #2f6d3a; font-weight: 700; }

.add-line { display: flex; gap: .7rem; align-items: baseline; padding: .3rem .5rem; margin: .2rem -.5rem 0; }
.add-mark { flex: none; min-width: 1.7rem; text-align: right; font: 700 1.6rem/1 var(--ui); color: var(--ink-red); opacity: .6; }
.add-line input {
  flex: 1;
  font: 400 var(--item-size)/1.3 var(--paper-font);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px dashed color-mix(in srgb, var(--ink-soft) 35%, transparent);
  border-radius: 0;
  padding: 0;
}
.add-line input:focus { background: transparent; border-bottom-color: color-mix(in srgb, var(--ink-red) 60%, transparent); }
.add-line input::placeholder { color: color-mix(in srgb, var(--ink-soft) 50%, transparent); }
.paper-empty { font: 400 calc(var(--item-size) * .85)/1.3 var(--paper-font); color: var(--ink-soft); opacity: .85; margin: .5rem 0 0; text-align: center; }

.paper-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; }
.signature { font: 400 calc(var(--item-size) * 1.1)/1.2 var(--paper-font); margin: 0 .3rem 0 auto; color: var(--ink); transform: rotate(-2deg); }
.seal {
  flex: none;
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 48% 52% 50% 46% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 36% 30%, #d0503f, #9a2419 55%, #6b140d);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .4), inset 0 0 0 5px rgba(0, 0, 0, .12), inset 0 -3px 6px rgba(0, 0, 0, .3);
  color: rgba(255, 215, 190, .55);
  font: 1.6rem/1 var(--ui);
  transform: rotate(-8deg);
}
[data-paper="brev"] .seal { display: none; }
.paper-tip { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 1.6rem; text-shadow: 0 1px 6px #000; }


/* owner's style chooser: three small paper swatches */
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.style-opt {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: .5rem .3rem .45rem; border-radius: 12px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font: 700 .8rem var(--ui);
}
.style-opt:hover { background: rgba(255, 255, 255, .05); }
.style-opt[aria-pressed="true"] { border-color: rgba(242, 180, 90, .6); background: rgba(242, 180, 90, .08); color: var(--flame-soft); }
.swatch {
  position: relative; width: 100%; height: 58px;
  display: grid; place-items: center;
  background: var(--paper-bg); box-shadow: var(--paper-edge), 0 4px 10px rgba(0, 0, 0, .4);
  border-radius: 3px; color: var(--ink);
  font: 700 1.35rem/1 var(--paper-font);
}
[data-paper="rull"] .swatch { border-top: 6px solid #8a5a2e; border-bottom: 6px solid #8a5a2e; border-radius: 0; }
[data-paper="brev"] .swatch::after { content: ''; position: absolute; inset: 5px; border: 1px solid rgba(156, 47, 34, .35); }

/* ---------- hover preview & item sheet ---------- */
.hover-card {
  position: absolute;
  z-index: 40;
  width: 280px;
  padding: 1rem 1.1rem 1.1rem;
  color: var(--ink);
  background: var(--paper-bg);
  border-radius: 4px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .8), inset 0 0 40px rgba(150, 105, 45, .2);
  pointer-events: none;
  transform: rotate(.8deg);
  animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: rotate(.8deg) translateY(4px); } }
.polaroid {
  margin: 0 0 .8rem;
  padding: 8px 8px 22px;
  background: #fdfbf6;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
  transform: rotate(-1.5deg);
}
.polaroid img { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #fff; }
.detail-title { display: block; font-family: var(--paper-font); font-size: 1.7rem; line-height: 1.1; color: var(--ink); margin: 0 0 .3rem; }
.detail-title .star { color: var(--ink-red); }
.detail-note { font-family: var(--paper-font); font-size: 1.4rem; font-weight: 400; line-height: 1.2; color: var(--ink-soft); margin: 0 0 .4rem; white-space: pre-wrap; }
.detail-price { font-weight: 700; color: var(--ink-soft); font-size: .9rem; margin: 0 0 .3rem; }
.detail-link { display: flex; gap: .35rem; align-items: center; color: var(--ink-red); font-size: .85rem; font-weight: 700; margin: 0; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(3, 4, 6, .55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 1.4rem;
  background: var(--glass-strong);
  animation: rise .18s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.modal h3 { font-size: 1.15rem; }
.modal h3.hand { font-size: 2.1rem; color: var(--flame-soft); }
.modal p { color: var(--text); }
/* item details render on paper inside the modal */
.modal:has(.item-sheet) { background: var(--paper-bg); color: var(--ink); border: 0; border-radius: 4px; }
.modal .item-sheet .detail-title { font-size: 2.3rem; color: var(--ink); }
.modal .item-sheet .detail-note { color: var(--ink-soft); font-size: 1.55rem; }
.modal .item-sheet .detail-price { color: var(--ink-soft); }
.item-sheet .btn.ghost { color: var(--ink); background: rgba(90, 60, 25, .08); border-color: rgba(90, 60, 25, .25); }
.item-sheet .btn.ghost:hover { background: rgba(90, 60, 25, .14); }
.item-sheet .btn { margin-top: .4rem; }
.reserve-box { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed rgba(90, 60, 25, .3); }
.reserve-box p { color: var(--ink); font-weight: 600; margin-bottom: .2rem; }
.reserve-box .btn.primary { width: 100%; }
.sheet-hint { font-size: .85rem; color: var(--ink-soft) !important; font-weight: 400 !important; margin-top: .6rem; }
.item-editor .row.between { margin-top: .3rem; }

/* ---------- side: share, people, chat ---------- */
.share-row { display: flex; gap: .5rem; margin-bottom: .6rem; }
.share-row input { font-size: .85rem; color: var(--flame-soft); }
.more summary { cursor: pointer; font-weight: 700; color: var(--muted); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ' ▾'; }
.more[open] summary { margin-bottom: 1rem; }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.people li { display: flex; align-items: center; gap: .65rem; min-height: 36px; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(156, 192, 230, .16); color: var(--ice); font-weight: 800; font-size: .9rem;
}
.avatar.owner { background: rgba(242, 180, 90, .18); color: var(--flame); }
.tag { font-size: .75rem; font-weight: 700; color: var(--flame); background: rgba(242, 180, 90, .12); padding: .15rem .5rem; border-radius: 999px; }
.leave { margin-top: 1rem; color: var(--muted); }


.chat { display: flex; flex-direction: column; height: min(560px, calc(100dvh - 120px)); }
.chat .card-title { flex-wrap: wrap; }
.secret { margin-left: auto; font-weight: 600; font-size: .78rem; }
.messages {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: .5rem;
  padding: .25rem .15rem .5rem;
  margin: 0 -.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.messages:empty::before { content: 'Ingen meldinger ennå. Si hei!'; color: var(--faint); text-align: center; margin: auto; font-size: .9rem; }
.msg { max-width: 85%; align-self: flex-start; display: flex; flex-direction: column; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-name { font-size: .75rem; font-weight: 800; color: var(--ice); margin: 0 0 .15rem .6rem; }
.msg-body {
  padding: .5rem .8rem;
  border-radius: 14px 14px 14px 4px;
  background: rgba(255, 255, 255, .08);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.mine .msg-body { border-radius: 14px 14px 4px 14px; background: rgba(242, 180, 90, .22); }
.msg time, .msg-system time { font-size: .68rem; color: var(--faint); margin: .1rem .5rem 0; }
.msg-system { align-self: center; text-align: center; font-size: .8rem; color: var(--muted); font-style: italic; padding: .2rem .6rem; max-width: 92%; }
.msg-system time { display: block; font-style: normal; }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; margin-top: .5rem; }
.chat-form textarea { resize: none; min-height: 44px; max-height: 140px; }

.chat-fab {
  display: none;
  position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30;
  align-items: center; gap: .45rem;
  padding: .8rem 1.1rem; border-radius: 999px; border: 0;
  font: 800 .95rem var(--ui); color: #2a1a08; cursor: pointer;
  background: linear-gradient(180deg, var(--flame-soft), var(--flame));
  box-shadow: 0 10px 30px -6px rgba(0, 0, 0, .7);
  transition: opacity .2s, transform .2s;
}
.chat-fab.hide { opacity: 0; transform: translateY(20px); pointer-events: none; }
.badge { background: var(--ink-red); color: #fff; border-radius: 999px; font-size: .75rem; padding: .05rem .45rem; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: .7rem 1.1rem; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--glass-line); box-shadow: var(--shadow); font-weight: 600; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: rise .2s ease-out; transition: opacity .4s; }
.toast-error { border-color: rgba(231, 118, 106, .5); color: #ffc6bf; }
.toast.out { opacity: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .list-layout, .list-layout.role-anon, .list-layout.role-guest, .list-layout.role-banned {
    grid-template-columns: minmax(0, 640px);
  }
  .side { position: static; }
  .chat-fab { display: inline-flex; }
}
@media (max-width: 560px) {
  main { padding: 8px 12px 96px; }
  .paper { padding: 2.6rem 1.4rem 1.8rem; }
  .paper { --item-size: 1.55rem; }
  [data-paper="pergament"] .paper { --item-size: 1.7rem; }
  [data-paper="rull"] .roll { left: -8px; right: -8px; }
  [data-paper="rull"] .roll::before { left: -6px; width: 14px; }
  [data-paper="rull"] .roll::after { right: -6px; width: 14px; }
  .mark, .add-mark { min-width: 1.2rem; }
  .wish, .add-line { gap: .5rem; }
  .seal { width: 46px; height: 46px; font-size: 1.3rem; }
  .card { padding: 1.1rem; }
  .hero { padding: 2rem 1.2rem 1.5rem; }
  .brand-name { font-size: 1.6rem; }
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
  .note { min-height: 130px; padding: 1rem .9rem .8rem; }
  .note-title { font-size: 1.6rem; overflow-wrap: anywhere; }
  .note-new .hand { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.img-field summary { cursor: pointer; font-weight: 700; font-size: .88rem; color: var(--muted); }
.img-field[open] summary { margin-bottom: .4rem; }
.img-field .hint { display: block; margin-bottom: .5rem; }
.back-link { display: inline-block; margin-bottom: .8rem; font-weight: 700; font-size: .92rem; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
