/* Egen side – version 2
   Ét grunddesign. Hver side farves med CSS-variabler: --bg --ink --accent --card --bar --muted --tex --font --radius
   Platformens egne sider (feed, venner, indstillinger) bruger de samme variabler med faste værdier. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

:root {
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --bg: #E7E7E2; --ink: #121212; --accent: #FF4D2E; --on-accent: #121212;
  --card: #FFFFFF; --bar: #EDECE6; --muted: #5D5A52; --tex: #D3D2CA;
  --font: 'IBM Plex Sans', system-ui, sans-serif; --radius: 0px;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 110px;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.inline { display: inline; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; min-width: 0; }
.row.between { justify-content: space-between; flex-wrap: wrap; }

/* ---------- Baggrunde ---------- */
.tex-prikker { background-image: radial-gradient(var(--tex) 1px, transparent 1.2px); background-size: 16px 16px; }
.tex-gitter { background-image: linear-gradient(var(--tex) 1px, transparent 1px), linear-gradient(90deg, var(--tex) 1px, transparent 1px); background-size: 24px 24px; }
.tex-linjer { background-image: repeating-linear-gradient(0deg, transparent 0 5px, var(--tex) 5px 6px); }
.tex-skraa { background-image: repeating-linear-gradient(45deg, transparent 0 7px, var(--tex) 7px 8px); }

/* ---------- Knapper og felter ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--bg);
  font: 500 14px/1 var(--mono); text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 4px; font: 12px var(--mono); color: var(--muted); text-decoration: underline; cursor: pointer; }
input:not([type=radio]):not([type=file]):not([type=color]), textarea {
  width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
textarea { resize: vertical; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Beskeder ---------- */
.flash, .newbar {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 40;
  padding: 10px 16px; border-radius: 4px; background: #121212; color: #EDEDED;
  font: 13px var(--mono); box-shadow: 0 6px 18px rgba(0,0,0,.2);
}
.flash { animation: fadeout 5s forwards; }
@keyframes fadeout { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.newbar a { color: #FF4D2E; }
.error { padding: 12px 14px; border: 1px solid #C8461E; background: #FBE3DC; color: #7E2A0B; }

/* ---------- Moduler (fælles for siderne) ---------- */
.module { background: var(--card); border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 32px; padding: 0 12px;
  border-bottom: 1px solid var(--ink); background: var(--bar);
  font: 12px var(--mono); color: var(--ink);
}
.bar label { font: inherit; }
.module-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- En persons side ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 48px 32px; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: start; }
.sidebar { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; }
.profile { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.avatar-big { width: 100%; aspect-ratio: 1; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--bar); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.avatar-big span { font-size: 96px; font-weight: 700; color: var(--muted); }
.path { font: 14px var(--mono); color: var(--accent); }
.profile h1 { font-size: 44px; font-weight: 700; line-height: .95; letter-spacing: -.03em; overflow-wrap: anywhere; }
.bio { font-size: 15px; }
.facts { display: flex; flex-direction: column; gap: 2px; font: 12px var(--mono); color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 13px var(--mono); }
.note { font: 12px/1.5 var(--mono); color: var(--muted); }
.gb { font-size: 14px; }
.gb-entry a { font-weight: 600; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.stack-sm label { font-family: var(--mono); }

.stream { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.empty { padding: 20px 0; }
.activity { list-style: none; margin: 0; font-size: 15px; gap: 8px; }
.activity a { font-weight: 600; }

.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 16px; }
.story-tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); min-width: 0; }
.story-tile img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--bar); }
.story-tile.unseen img { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile-label { font: 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-new { display: flex; flex-direction: column; gap: 6px; }
.story-pick { position: relative; aspect-ratio: 9 / 16; border: 1px dashed var(--ink); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; text-align: center; font: 12px var(--mono); cursor: pointer; padding: 8px; overflow: hidden; }
.story-pick input, .file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.story-new input[name=caption] { min-height: 34px; font-size: 12px; padding: 4px 6px; }

.file { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px dashed var(--ink); border-radius: var(--radius); font: 13px var(--mono); cursor: pointer; }
.post-image { width: 100%; border-bottom: 1px solid var(--ink); }
.post-body { font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; }
.post-delete { align-self: flex-end; }

/* Hjerter med navne der glider forbi */
.ticker { display: flex; align-items: stretch; height: 38px; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; font: 13px var(--mono); }
.heart-form { display: flex; }
.heart { width: 44px; border: 0; border-right: 1px solid var(--ink); background: var(--card); color: var(--accent); font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.heart.on { background: var(--accent); color: var(--on-accent); }
.heart.static { cursor: default; }
.ticker-view { flex: 1; overflow: hidden; display: flex; align-items: center; padding-left: 12px; }
.ticker-track { display: flex; gap: 22px; white-space: nowrap; width: max-content; }
.ticker-track.run { padding-right: 22px; animation: tick 20s linear infinite; }
.ticker:hover .ticker-track.run, .ticker:focus-within .ticker-track.run { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track.run { animation: none; } }
.empty-names { color: var(--muted); }

.comments { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--ink); }
.comment { font-size: 15px; overflow-wrap: anywhere; }
.comment a { font-weight: 600; margin-right: 4px; }

/* ---------- Platformens sider ---------- */
.app { font-family: 'IBM Plex Sans', system-ui, sans-serif; }
main.wide { max-width: 1180px; margin: 0 auto; padding: 48px 32px; display: flex; flex-direction: column; gap: 32px; }
main.narrow { max-width: 640px; margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 24px; }
.app-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.app-head h1 { font-size: 36px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.app-head > span, .app-head > a { font: 13px var(--mono); }
.app-section { display: flex; flex-direction: column; gap: 12px; }
.story-strip { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 8px; }
.story-strip .story-tile { width: 120px; flex-shrink: 0; }
.windows { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.window-wrap { display: flex; flex-direction: column; gap: 8px; }
.window-wrap form { align-self: flex-start; }
.window { display: flex; flex-direction: column; border: 1px solid #121212; background: #fff; text-decoration: none; color: #121212; transition: transform .12s ease; }
.window:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 #121212; }
.window .bar { border-color: #121212; background: #EDECE6; color: #121212; }
.new { display: inline-flex; align-items: center; gap: 6px; }
.sq { width: 8px; height: 8px; background: #FF4D2E; }
.mini { position: relative; height: 170px; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; background-color: var(--bg); color: var(--ink); font-family: var(--font); }
.mini-name { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.mini-bio { font-size: 13px; color: var(--muted); }
.mini-avatar { position: absolute; top: 14px; right: 14px; width: 52px; height: 52px; object-fit: cover; border: 1px solid var(--ink); border-radius: var(--radius); }
.done { text-align: center; font: 14px var(--mono); color: var(--muted); }
.empty-box { padding: 24px; border: 1px dashed #121212; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.people { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px; border: 1px solid #121212; background: #fff; }
.person { display: flex; align-items: center; gap: 12px; color: #121212; text-decoration: none; }
.sq-avatar { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid #121212; background: #D9D7CC; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }
.sq-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sq-avatar.big { width: 72px; height: 72px; font-size: 28px; }

/* Login */
.lead { font-size: 17px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label { font: 500 13px var(--mono); margin-top: 8px; }
.stack .btn { margin-top: 12px; }
.testcode { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 2px dashed #FF4D2E; background: #fff; }
.testcode span { font: 12px var(--mono); color: #7E2A0B; }
.testcode strong { font: 600 34px var(--mono); letter-spacing: .2em; }
.code-input { font: 500 26px var(--mono) !important; letter-spacing: .3em; text-align: center; }
.handle-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.handle-row input { flex: 1; min-width: 160px; }

/* Indstillinger */
.settings { max-width: 1180px; margin: 0 auto; padding: 48px 32px; display: flex; flex-direction: column; gap: 24px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.settings-col { display: flex; flex-direction: column; gap: 16px; }
.panel { margin: 0; border: 1px solid #121212; background: #fff; padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.panel legend { padding: 0 6px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.panel > label, .panel .two label { font: 500 12px var(--mono); margin-top: 6px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.color-row { display: flex; align-items: center; gap: 12px; font: 13px var(--mono); }
.color-row input[type=color] { width: 44px; height: 44px; padding: 0; border: 1px solid #121212; background: none; cursor: pointer; }
.color-row label { flex: 1; }
.contrast-warn { padding: 10px 12px; border: 1px solid #E0A100; background: #FFF6DA; font: 12px/1.5 var(--mono); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.choice-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice > span:not(.sr) { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 8px; border: 1px solid #C9C8C0; background-color: #FAFAF7; font-size: 15px; cursor: pointer; }
.choice input:checked + span { border: 2px solid #121212; }
.choice input:focus-visible + span { outline: 3px solid #FF4D2E; outline-offset: 2px; }
.choice .rounded { border-radius: 6px; }
.choice > .tex-swatch { height: 52px; background-color: #EDEDE8; --tex: #A9A8A0; }
.preview-wrap { gap: 10px; }
.preview { padding: 18px; background-color: var(--bg); color: var(--ink); font-family: var(--font); }
.preview .pv-name { font-size: 24px; }
.preview .pv-accent { color: var(--accent); font: 13px var(--mono); }
.wide-btn { width: 100%; min-height: 50px; }
.logout { align-self: flex-start; }

/* Story-visning */
.story-view { position: fixed; inset: 0; z-index: 20; background: #0D0D0D; color: #EDEDED; display: grid; grid-template-rows: auto 1fr auto; font-family: var(--mono); }
.story-top { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 10px; max-width: 720px; width: 100%; margin: 0 auto; }
.story-progress { display: flex; gap: 4px; }
.story-progress span { flex: 1; height: 3px; background: #3A3A3A; }
.story-progress span.done { background: #EDEDED; }
.story-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.story-meta a { color: #EDEDED; }
.story-meta span { color: #9A9A9A; flex: 1; }
.story-close { font-size: 20px; text-decoration: none; padding: 6px 10px; }
.story-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 12px; }
.story-stage figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-height: 100%; }
.story-stage img { max-height: calc(100vh - 230px); max-width: min(100%, 560px); object-fit: contain; }
.story-stage figcaption { font-size: 15px; }
.story-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 96px; display: flex; align-items: center; justify-content: center; font-size: 44px; color: #EDEDED; text-decoration: none; }
.story-nav.prev { left: 8px; }
.story-nav.next { right: 8px; }
.story-foot { padding: 12px 16px 96px; max-width: 720px; width: 100%; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 13px; }
.seen-by { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.seen-by a { color: #EDEDED; }
.seen-by .label { color: #9A9A9A; }
.story-view .muted { color: #9A9A9A; }

/* ---------- Docken: ens på alle sider ---------- */
.dock {
  position: fixed; left: 50%; bottom: 20px; z-index: 30; transform: translateX(-50%);
  width: min(660px, calc(100% - 24px)); height: 60px; padding: 6px;
  display: flex; align-items: center; gap: 4px;
  border-radius: 6px; background: #121212; color: #EDEDED;
  font: 13px var(--mono);
  box-shadow: 0 0 0 1px #2A2A2A, 0 10px 24px rgba(0,0,0,.28);
}
nav.dock a { position: relative; height: 48px; padding: 0 14px; display: flex; align-items: center; gap: 8px; border-radius: 3px; color: #EDEDED; text-decoration: none; flex-shrink: 0; }
nav.dock a:hover { background: #262626; }
.dock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
nav.dock .dock-home { width: 48px; padding: 0; justify-content: center; background: #EDEDED; color: #121212; }
nav.dock .dock-home:hover { background: #fff; }
.dock-space { flex: 1; }
nav.dock .outlined { border: 1px solid #3A3A3A; }
.story-ico { width: 10px; height: 16px; border: 1.5px solid #EDEDED; border-radius: 1px; }
.outlined .story-ico + .lbl { margin-left: -2px; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 2px; background: #FF4D2E; color: #121212; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
nav.dock .dock-me { width: 48px; padding: 0; justify-content: center; margin-left: 4px; background: #A7A28F; color: #121212; font-weight: 700; font-size: 18px; box-shadow: inset 0 0 0 1px #EDEDED; }
.dock-me img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.dock-me .dot { position: absolute; top: -5px; right: -5px; width: 12px; height: 12px; border-radius: 2px; background: #FF4D2E; box-shadow: 0 0 0 2px #121212; }
nav.dock .dock-login { background: #EDEDED; color: #121212; font-weight: 500; }

/* ---------- Telefon ---------- */
@media (max-width: 860px) {
  .wrap { display: flex; flex-direction: column; padding: 24px 16px; gap: 20px; }
  .sidebar { display: contents; }
  .profile { order: 1; }
  .sidebar .note { order: 2; }
  .stream { order: 3; }
  #gaestebog { order: 4; }
  .profile { display: grid; grid-template-columns: 96px 1fr; column-gap: 14px; row-gap: 4px; align-items: end; }
  .avatar-big { grid-row: span 3; width: 96px; }
  .avatar-big span { font-size: 40px; }
  .profile h1 { font-size: 32px; }
  .profile .bio, .profile .facts, .profile .links, .profile form, .profile .btn { grid-column: 1 / -1; }
  .stories { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings, main.wide { padding: 24px 16px; }
}
@media (max-width: 600px) {
  .dock { justify-content: space-between; }
  .dock .lbl, .dock-space { display: none; }
  nav.dock a { width: 48px; padding: 0; justify-content: center; }
  .dock-feed .badge { position: absolute; top: 3px; right: 0; }
  nav.dock .dock-login { width: auto; padding: 0 14px; }
  .module-body { padding: 12px; }
  .post-body { font-size: 16px; }
}
