/* Tux AI - Lucipher: rød Tux, gul #FFCB2B, blå #0088ff */
:root {
  --bg: #14121a;
  --panel: #1d1a25;
  --panel-2: #262230;
  --line: #34303f;
  --text: #ecebf1;
  --muted: #9a97a8;
  --red: #e1232d;
  --red-2: #ff4a52;
  --red-rgb: 225, 35, 45; /* accentfarven som tal (til gennemsigtige toner) - temaet overskriver den */
  --yellow: #ffcb2b;
  --blue: #3aa0ff;
  --code-bg: #0f0d14;
  --code: #a0d7ff;
  --user: #2b2536;
  --radius: 14px;
  color-scheme: dark;
}
/* lyst tema: følger systemet, eller vælges i Indstillinger (data-theme="light") */
:root[data-theme="light"] {
  --bg: #faf8f6; --panel: #ffffff; --panel-2: #f2eeea; --line: #e3ddd7; --text: #1d1a22; --muted: #6c6875;
  --code-bg: #1d1a22; --code: #a0d7ff; --user: #f4e9e3; --yellow: #b8860b; --blue: #0070d8; color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf8f6; --panel: #ffffff; --panel-2: #f2eeea; --line: #e3ddd7; --text: #1d1a22; --muted: #6c6875;
    --code-bg: #1d1a22; --code: #a0d7ff; --user: #f4e9e3; --yellow: #b8860b; --blue: #0070d8; color-scheme: light;
  }
}
* { box-sizing: border-box; }
[hidden]:not(.left) { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column;
}
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- top ---------- */
.top {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand img { display: block; }
.brand .name { font-weight: 800; letter-spacing: .18em; font-size: 15px; }
.brand .name b { color: var(--red); }
.models { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 0 auto; }
.models button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.models button[aria-checked="true"] { background: var(--red); color: var(--on-red, #fff); }
.models button:focus-visible, .icon:focus-visible, .send:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.right { display: flex; align-items: center; gap: 10px; }
.left { font-size: 13px; color: var(--muted); white-space: nowrap; }
.left.low { color: var(--yellow); }
.icon { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center; }
.icon:hover { border-color: var(--red); }
.langlink { font-size: 13px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.langlink:hover { color: var(--text); border-color: var(--muted); }

/* ---------- chat ---------- */
.chat { flex: 1; overflow-y: auto; padding: 24px 16px 8px; scroll-behavior: smooth; }
.chat > * { max-width: 800px; margin-left: auto; margin-right: auto; }
.welcome { text-align: center; padding: 6vh 0 2vh; }
.welcome .hero { position: relative; width: var(--hero-size, 170px); height: var(--hero-size, 170px); margin: 0 auto; filter: drop-shadow(0 8px 22px rgba(var(--red-rgb, 225, 35, 45), .35)); user-select: none; }
.welcome .hero img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.welcome .hero img[hidden] { display: none; } /* ellers vises begge Tux-billeder = dobbelte fødder */
/* pupillerne lægges over billedet med blanke øjne og følger musen (samme som Tux på lucipher.dk) */
.tux-pupil { position: absolute; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #4a4a4a 0%, #161616 55%, #000 100%); transition: left .06s linear, top .06s linear; }
.welcome h1 { margin: 14px 0 6px; font-size: clamp(24px, 4vw, 34px); }
.welcome .sub { color: var(--muted); margin: 0 auto 22px; max-width: 520px; }

.msg { display: flex; gap: 12px; margin-bottom: 22px; }
.msg .avatar { flex: none; width: 32px; height: 32px; margin-top: -2px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--user); border-radius: var(--radius) var(--radius) 4px var(--radius); padding: 10px 14px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.tux .body { min-width: 0; flex: 1; }
.msg.tux .who { font-weight: 700; color: var(--red-2); font-size: 14px; margin-bottom: 2px; }
.msg.tux .who small { color: var(--muted); font-weight: 400; }
.content { overflow-wrap: anywhere; }
.content p { margin: 0 0 .7em; }
.content h1, .content h2, .content h3 { margin: 1em 0 .4em; line-height: 1.25; }
.content h1 { font-size: 1.3em; } .content h2 { font-size: 1.15em; } .content h3 { font-size: 1.02em; }
.content ul, .content ol { margin: 0 0 .8em; padding-left: 1.4em; }
.content li { margin: .15em 0; }
.content a { color: var(--blue); }
.content strong { color: var(--text); }
.content code { background: var(--panel-2); color: var(--yellow); border-radius: 5px; padding: .08em .35em; font: .9em ui-monospace, "Cascadia Code", Consolas, monospace; }
.codeblock { margin: .5em 0 1em; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--code-bg); }
.codeblock .bar { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; font-size: 12px; color: #9a97a8; background: #1a1720; }
.codeblock .bar button { border: 0; background: transparent; color: #9a97a8; font-size: 12px; }
.codeblock .bar button:hover { color: #fff; }
.codeblock pre { margin: 0; padding: 12px 14px; overflow-x: auto; }
.codeblock code { background: none; color: var(--code); padding: 0; font-size: 13.5px; line-height: 1.5; }
.quotes { border-left: 3px solid var(--yellow); background: var(--panel); border-radius: 0 10px 10px 0; padding: 8px 12px; margin: 4px 0 10px; font-size: 14px; }
.quotes .src { color: var(--muted); font-size: 12px; }
.quotes .q { color: var(--yellow); font-variant-numeric: tabular-nums; }
.quotes .x { color: var(--muted); padding-left: 12px; font-size: 13px; }
.status { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.status .spin { color: var(--red); font-family: ui-monospace, monospace; }
.status .word { color: var(--yellow); }
.error { color: var(--red-2); background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); padding: 8px 12px; border-radius: 10px; }
.error button { margin-left: 8px; border: 1px solid currentColor; background: transparent; border-radius: 8px; padding: 2px 8px; }

/* ---------- skriv ---------- */
.composer { padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); }
.composer .box {
  max-width: 800px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 8px 8px 8px 16px;
}
.composer .box:focus-within { border-color: var(--red); }
textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; max-height: 220px; padding: 6px 0; line-height: 1.5;
}
.send, .stop { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; display: grid; place-items: center; background: var(--red); color: var(--on-red, #fff); }
.send:disabled { opacity: .35; cursor: default; }
.stop { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.foot { max-width: 800px; margin: 6px auto 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- billede i skrivefeltet (træk ind, indsæt eller vælg) ---------- */
.composer .box { padding-left: 8px; }
.attach { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.attach:hover { color: var(--text); background: var(--panel-2); }
.attach:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.attached { max-width: 800px; margin: 0 auto 8px; }
.attached .chip { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 8px 6px 6px; }
.attached img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; flex: none; background: var(--panel-2); }
.attached .meta { display: flex; flex-direction: column; min-width: 0; }
.attached .meta b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attached .meta small { font-size: 12px; color: var(--muted); }
.attached .x { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 0; background: var(--panel-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.composer.dragover .box { border-color: var(--red); box-shadow: 0 0 0 3px rgba(var(--red-rgb, 225, 35, 45), .25); }
.dropzone { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(10, 8, 14, .6); pointer-events: none; }
.dropzone .dropcard { border: 2px dashed var(--red); border-radius: 22px; background: var(--panel); padding: 28px 36px; text-align: center; max-width: calc(100vw - 32px); }
.dropzone p { margin: 10px 0 0; font-weight: 600; }
.msg.user .bubble .pic { display: block; max-width: min(260px, 100%); max-height: 260px; border-radius: 10px; margin: 2px 0 6px auto; }
.msg.user .bubble .pic:only-child { margin-bottom: 2px; }
.genimg.edited .frame { aspect-ratio: auto; }
.genimg.edited img { height: auto; opacity: 1; object-fit: contain; }

/* ---------- nøgle ---------- */
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); padding: 0; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dlg { padding: 20px; }
.dlg h2 { margin: 0 0 6px; font-size: 18px; }
.dlg p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.dlg input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 14px ui-monospace, monospace; }
.dlg .err { color: var(--red-2); margin-top: 8px; }
.dlg .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dlg .row button { border: 0; background: var(--red); color: var(--on-red, #fff); border-radius: 10px; padding: 8px 16px; font-weight: 600; }
.dlg .row .ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

@media (max-width: 560px) {
  .top { gap: 8px; padding: 8px 12px; }
  .brand .name { display: none; }
  .models button { padding: 6px 10px; font-size: 13px; }
  .left { display: none; }
  .chat { padding: 16px 12px 8px; }
  .composer { padding-left: 12px; padding-right: 12px; }
  .msg .avatar { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }


/* billeder Tux har lavet */
.genimg { margin: 6px 0 4px; max-width: min(100%, 520px); }
.genimg .frame { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); aspect-ratio: 1; display: grid; place-items: center; }
.genimg img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .4s; }
.genimg img.ready { opacity: 1; }
.genimg .wait { position: absolute; inset: 0; display: grid; place-items: center; }
.genimg .cap { color: var(--muted); font-size: 13px; margin-top: 6px; }
.genimg .cap a { color: var(--blue); }

/* ---------- gemte samtaler (skyd-ud-menu i højre side) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); z-index: 21;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(0, 0, 0, .35);
  transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.newsess { margin: 12px 14px 6px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 9px 12px; text-align: left; font-weight: 600; }
.newsess:hover { border-color: var(--red); }
.sesslist { overflow-y: auto; padding: 6px 8px 16px; flex: 1; }
.sess { display: flex; align-items: center; gap: 6px; border-radius: 10px; }
.sess:hover, .sess.active { background: var(--panel-2); }
.sess.active { box-shadow: inset 3px 0 0 var(--red); }
.sess .open { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 9px 10px; }
.sess .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.sess .d { display: block; font-size: 12px; color: var(--muted); }
.sess .del { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; opacity: 0; }
.sess:hover .del, .sess .del:focus-visible { opacity: 1; }
.sess .del:hover { color: var(--red-2); background: var(--panel); }
.drawer .note { color: var(--muted); font-size: 14px; padding: 10px 18px; }
.drawer .note button { margin-top: 10px; border: 0; background: var(--red); color: var(--on-red, #fff); border-radius: 10px; padding: 8px 14px; font-weight: 600; }
@media (hover: none) { .sess .del { opacity: 1; } }

/* ---------- konto ---------- */
.account { padding: 14px 18px 4px; border-bottom: 1px solid var(--line); }
.account h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.acc-form { display: grid; gap: 10px; }
.fld { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.fld input { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 15px system-ui, sans-serif; }
.fld input:focus { outline: none; border-color: var(--red); }
.acc-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.account button.primary { border: 0; background: var(--red); color: var(--on-red, #fff); border-radius: 10px; padding: 8px 14px; font-weight: 600; }
.account button.ghost { border: 1px solid var(--line); background: transparent; border-radius: 10px; padding: 7px 12px; }
.account button.ghost:hover { border-color: var(--muted); }
.account button.link { border: 0; background: none; color: var(--blue); padding: 0; justify-self: start; font-size: 13px; }
.account button:disabled { opacity: .5; }
.who-am-i { margin: 0 0 10px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.who-am-i b { color: var(--text); }
.plan { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; background: var(--panel-2); border: 1px solid var(--line); }
.plan.paid { background: var(--red); border-color: var(--red); color: var(--on-red, #fff); }
.acc-note { font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.acc-note.bad { color: var(--red-2); }

/* kilder Tux har slået op (Wikipedia, vejret, regnestykker) */
.facts { color: var(--muted); font-size: 13px; margin: 2px 0 8px; display: grid; gap: 2px; }
.facts a { color: var(--blue); text-decoration: none; }
.facts a:hover { text-decoration: underline; }

/* ---------- pets (pets-web.js) og video (video-web.js) ---------- */
#petbox { position: fixed; right: 18px; bottom: 96px; width: 150px; height: 110px; z-index: 20; cursor: pointer;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.35)); }
#petbox canvas { width: 100%; height: 100%; image-rendering: pixelated; }
@media (max-width: 640px) { #petbox { width: 96px; height: 70px; bottom: 88px; right: 8px; } }
.petbtn { font-size: 17px; line-height: 1; }
.petdlg { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; width: min(520px, calc(100vw - 32px)); }
.petdlg::backdrop { background: rgba(0,0,0,.55); }
.petdlg h3 { margin: 0 0 12px; font-size: 18px; }
.petdlg h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.petdlg .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.petdlg .row.end { justify-content: flex-end; margin-top: 16px; }
.petdlg .row.three > label { flex: 1; min-width: 120px; }
.petdlg button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; cursor: pointer; font: inherit; }
.petdlg button.on { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.petdlg button.primary { background: var(--red); border-color: var(--red); color: var(--on-red, #fff); }
.petdlg button.sw::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--sw); margin-right: 6px; vertical-align: -1px; }
.petdlg .mine { display: inline-flex; }
.petdlg .mine .del { border-left: 0; border-radius: 0 9px 9px 0; padding: 7px 9px; }
.petdlg .mine button:first-child { border-radius: 9px 0 0 9px; }
.petform label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.petform label.inline { flex-direction: row; align-items: center; gap: 6px; color: var(--text); margin: 0 12px 10px 0; }
.petform input:not([type=radio]), .petform textarea, .petform select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.petstatus { min-height: 1.2em; color: var(--muted); font-size: 13px; margin: 4px 0 0; }
/* petens farvetema */
body.pet-themed .msg.tux .content { color: var(--pet-text, inherit); }
body.pet-themed .msg.tux .who .nm { color: var(--pet-accent, inherit); }
body.pet-themed .status .spin, body.pet-themed .status .word { color: var(--pet-spinner, inherit); }
.genvideo { display: block; width: 100%; max-width: 720px; border-radius: 12px; margin-top: 8px; background: #000; }
.videostatus { color: var(--muted); margin: 4px 0; }
.msg.tux .media a.dl { display: inline-block; margin-top: 6px; color: var(--red-2); }

/* billedsøgning: frie billeder fra Wikimedia Commons */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.gallery .gitem { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--muted, #aaa); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: rgba(255,255,255,0.05); }
.gallery small { font-size: 11px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.models button[data-tier="plus"] { background-image: linear-gradient(90deg, rgba(var(--red-rgb), 0.22), rgba(var(--red-rgb), 0.1)); }

/* chatbot-tema (pets-web.js / app.js): chatbottens figur i stedet for Tux oppe i venstre hjørne og på forsiden */
.brand img.pix { image-rendering: pixelated; object-fit: contain; }
.welcome .hero .pethero { display: none; position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; cursor: pointer; }
body.has-pet .welcome .hero .pethero { display: block; }
body.has-pet .hero .soul, body.has-pet .hero .base, body.has-pet .hero .tux-pupil { display: none !important; }
/* den levende chatbot oppe i venstre hjørne i stedet for logoet (samme størrelse) - ikke længere nederst til højre */
.brand .petlogo { display: none; width: 36px; height: 36px; image-rendering: pixelated; cursor: pointer; }
body.has-pet .brand .petlogo { display: block; }
body.has-pet .brand img { display: none; }
#petbox { display: none !important; }
/* sprogvalg: lille pop-up under sprogknappen */
.langpop { position: fixed; z-index: 40; display: flex; flex-direction: column; min-width: 120px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.langpop[hidden] { display: none; }
.langpop a { padding: 7px 12px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 14px; }
.langpop a:hover { background: var(--panel-2); }
.langpop a.on { color: var(--red-2); font-weight: 600; }
.langpop a.on::after { content: ' ✓'; }
/* farvevælgeren ("More" ved farverne) */
.petdlg .swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; }
.petdlg button.swatch { padding: 0; aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; }
.petdlg button.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }
.petdlg .owncolor { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.petdlg .owncolor input { width: 48px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; }

/* toppen i tre faste kolonner: model-knapperne (Tux / Tux free / Tux+) står altid præcis i midten, så de ikke flytter
   sig, når "beskeder tilbage" vises eller skjules - og den skjulte tæller beholder sin plads, så ikonerne bliver stående */
.top { display: grid; grid-template-columns: 1fr auto 1fr; }
.top .brand { justify-self: start; }
.top .models { margin: 0; }
.top .right { justify-self: end; }
.left[hidden] { display: inline; visibility: hidden; } /* (undtaget fra [hidden]-reglen øverst) */
@media (max-width: 560px) { .left[hidden] { display: none; } }
.petdlg:focus { outline: none; }

/* ---------- indstillinger i menuen ---------- */
.drawer { overflow-y: auto; }
.drawer .sesslist { flex: 1 0 auto; overflow: visible; }
.settings { border-bottom: 1px solid var(--line); padding: 4px 18px 10px; }
.settings summary { cursor: pointer; list-style: none; padding: 10px 0 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary::after { content: '›'; font-size: 18px; transition: transform .2s; }
.settings[open] summary::after { transform: rotate(90deg); }
.set-row { padding: 8px 0; }
.set-row.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-label { font-size: 14px; margin-bottom: 6px; }
.set-row.tog .set-label { margin: 0; }
.set-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { flex: 1 1 auto; border: 0; background: transparent; color: var(--text); border-radius: 8px; padding: 6px 8px; font-size: 13px; white-space: nowrap; }
.seg button:hover { background: rgba(var(--red-rgb), .12); }
.seg button.on { background: var(--red); color: var(--on-red, #fff); font-weight: 600; }
.switch { flex: none; width: 40px; height: 22px; border-radius: 11px; border: 0; background: var(--line); position: relative; padding: 0; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--red); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
/* tekststørrelse og bred samtale */
body.fs-s .msg { font-size: 14px; }
body.fs-l .msg { font-size: 18px; }
body.fs-l .msg pre { font-size: 15px; }
body.wide .chat > *, body.wide .composer .box, body.wide .attached, body.wide .foot { max-width: 1100px; }
/* "er du sikker?" */
dialog.sure { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); padding: 20px 22px 16px; max-width: min(420px, calc(100vw - 32px)); }
dialog.sure::backdrop { background: rgba(0, 0, 0, .5); }
dialog.sure p { margin: 0 0 16px; line-height: 1.45; }
.sure-row { display: flex; justify-content: flex-end; gap: 8px; }
.sure-row button { border-radius: 10px; padding: 8px 14px; font-weight: 600; }
.sure-row .ghost { border: 1px solid var(--line); background: transparent; color: var(--text); }
.sure-row .primary { border: 0; background: var(--red); color: var(--on-red, #fff); }
.petdlg { position: relative; }
.petdlg button.dlgx { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 8px; background: transparent; border: 1px solid transparent; color: var(--muted); }
.petdlg button.dlgx:hover { color: var(--text); border-color: var(--line); background: var(--panel-2); }
.petdlg h3 { padding-right: 34px; }
/* Tux basker/vralter (klik) */
.welcome .hero .tux-anim { position: absolute; inset: -5%; width: 110%; height: 110%; cursor: pointer; } /* luft rundt om (12/240) */
.welcome .hero .tux-anim[hidden] { display: none; }
body:not(.has-pet) .welcome .hero { cursor: pointer; }
@keyframes tux-waddle { 0%,100% { transform: none; } 12% { transform: rotate(-10deg) translateY(-2px); } 37% { transform: rotate(10deg); } 62% { transform: rotate(-10deg) translateY(-2px); } 87% { transform: rotate(8deg); } }
.brand img.tux-waddle { animation: tux-waddle .9s ease-in-out; transform-origin: 50% 90%; }
header img, .hero img, .hero canvas, .petlogo, .avatar, .dropcard img { -webkit-user-drag: none; -webkit-touch-callout: none; }
/* lyst tema: Tux-billederne har 12 enheders luft rundt om (vingespidserne er hele) */
.welcome .hero.tux-wide img.soul, .welcome .hero.tux-wide img.base { inset: -5%; width: 110%; height: 110%; }
