:root {
  --oransje: #f08920;
  --gul: #fecf05;
  --ink: #0b0b0c;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .09);
  --bubble: #f2f2f4;
  --page: #ffffff;
  --chip: #f6f6f8;
  --chip-ink: #3a3a3c;
  --ease: cubic-bezier(.23, 1, .32, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f2f4; --muted: #9a9aa0; --line: rgba(255, 255, 255, .12); --bubble: #2a2a2e;
    --page: #111113; --chip: #1f1f22; --chip-ink: #d6d6da;
  }
}
:root[data-theme="dark"] {
  --ink: #f2f2f4; --muted: #9a9aa0; --line: rgba(255, 255, 255, .12); --bubble: #2a2a2e;
  --page: #111113; --chip: #1f1f22; --chip-ink: #d6d6da;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--page); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.app { height: 100dvh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; padding-top: env(safe-area-inset-top); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
.wordmark { text-align: center; }
.wordmark b { font-family: Oswald, sans-serif; font-weight: 600; font-size: 20px; letter-spacing: .02em; text-transform: uppercase; }
.wordmark b span { color: var(--oransje); }
.wordmark small { display: block; font-size: 11px; color: var(--muted); }
.ib { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; transition: transform .12s var(--ease); }
.ib:active { transform: scale(.92); }

.thread { flex: 1; overflow-y: auto; padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 18px; }
.tom { margin: auto 0; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.5; padding: 0 12px; }
.tom b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.forslag { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.forslag button { font-size: 14px; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; min-height: 44px; transition: transform .12s var(--ease); }
.forslag button:active { transform: scale(.96); }
.me { align-self: flex-end; background: var(--bubble); padding: 9px 14px; border-radius: 20px; font-size: 16px; line-height: 1.38; max-width: 82%; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai { font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai.feil { color: #c0392b; }
.merke { display: inline-block; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: #8a5a00; background: #fff1cc; border-radius: 6px; padding: 2px 7px; margin-bottom: 6px; }
.kilder { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.3; color: var(--chip-ink); background: var(--chip); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px 5px 6px; text-decoration: none; max-width: 100%; white-space: normal; }
.src i { flex: none; width: 16px; height: 16px; border-radius: 5px; background: #1f7a4d; color: #fff; font-style: normal; font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.src i.w { background: var(--oransje); }
.tenker { display: flex; gap: 5px; padding: 6px 0; }
.tenker i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: puls 1.1s var(--ease) infinite; }
.tenker i:nth-child(2) { animation-delay: .15s; }
.tenker i:nth-child(3) { animation-delay: .3s; }
@keyframes puls { 50% { opacity: .25; transform: scale(.8); } }
.ny { animation: rise .38s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.composer { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.field { display: flex; align-items: flex-end; gap: 4px; border: 1px solid var(--line); border-radius: 26px; padding: 5px 5px 5px 16px; background: var(--page); box-shadow: 0 6px 22px -12px rgba(0, 0, 0, .25); }
.field textarea { flex: 1; resize: none; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.35; padding: 9px 0; max-height: 140px; }
.field textarea::placeholder { color: var(--muted); }
.vbtn { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--oransje); color: #0b0b0c; display: grid; place-items: center; transition: transform .14s var(--ease); }
.vbtn:active { transform: scale(.92); }
.note { text-align: center; font-size: 11px; color: var(--muted); margin-top: 7px; }
.skjult { display: none !important; }

/* hacking-spøken */
.konsoll { background: #050806; color: #4dff88; font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.konsoll .sim { color: var(--gul); font-weight: 700; }

/* stemmemodus */
.voice { position: fixed; inset: 0; background: #050506; color: #fff; display: flex; flex-direction: column; opacity: 0; transform: scale(1.03); pointer-events: none; transition: opacity .3s var(--ease), transform .4s var(--ease); z-index: 10; }
.voice.on { opacity: 1; transform: none; pointer-events: auto; }
.voice canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.vtop { position: relative; padding: calc(24px + env(safe-area-inset-top)) 24px 0; text-align: center; }
.state { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.state.svarer { color: var(--oransje); }
.moduser { display: inline-flex; gap: 2px; margin-top: 12px; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 3px; }
.moduser button { font-size: 12px; color: rgba(255, 255, 255, .6); border-radius: 999px; padding: 6px 14px; min-height: 44px; transition: background .2s var(--ease), color .2s var(--ease); }
.moduser button[aria-pressed="true"] { background: rgba(255, 255, 255, .16); color: #fff; }
.vbottom { position: relative; margin-top: auto; padding: 0 26px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.caption { font-size: 19px; line-height: 1.38; text-align: center; min-height: 54px; }
.vsrc { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 6px 12px 6px 7px; }
.vsrc i { width: 16px; height: 16px; border-radius: 5px; background: #1f7a4d; color: #fff; font-style: normal; font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.ctrls { position: relative; display: flex; justify-content: space-between; padding: 26px 46px calc(30px + env(safe-area-inset-bottom)); }
.ctl { width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .14); display: grid; place-items: center; transition: transform .14s var(--ease), background .2s var(--ease); }
.ctl:active { transform: scale(.92); }
.ctl.end { background: #ff453a; }
.ctl.aktiv { background: #fff; color: #000; }
