/* AI-Laget – skribent- og adminområdet. Bygger på style.css (samme farger og uttrykk). */
.app { width: 100%; max-width: 1112px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 20px; }
.kort {
  width: 100%; max-width: 760px; margin: 0 auto; padding: 28px 22px;
  background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line);
}
.kort.smal { max-width: 520px; }
.kort.bred { max-width: 1000px; }
.kort.sentrert { text-align: center; }
.kort h1 { margin-top: 8px; font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.15; font-weight: 800; text-wrap: balance; }
.kort h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.3rem; font-weight: 800; margin-bottom: 14px; }
.kicker { font-size: .75rem; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }
.ingress { margin-top: 12px; color: var(--body); font-size: 1.05rem; line-height: 1.6; }
.hjelp { margin-top: 14px; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.hjelp a, .kort p a { color: var(--accent); }
.antall { font-size: .85rem; font-weight: 700; color: var(--muted); background: rgba(157,179,196,.12); padding: 2px 10px; border-radius: 999px; }
.teller-merke { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--bg); }
.teller-merke.null { background: rgba(157,179,196,.15); color: var(--muted); }

/* Skjema */
.skjema { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.skjema label { display: flex; flex-direction: column; gap: 7px; font-weight: 650; font-size: .95rem; color: var(--text); }
.skjema input, .skjema textarea, .skjema select {
  width: 100%; font: inherit; font-weight: 400; font-size: 16px;   /* 16px hindrer zoom på iPhone */
  color: var(--text); background: #091119; border: 1px solid rgba(29,221,253,.25); border-radius: 10px;
  padding: 13px 14px; transition: border-color .15s, box-shadow .15s;
}
.skjema input::placeholder, .skjema textarea::placeholder { color: #5f7686; }
.skjema input:focus, .skjema textarea:focus, .skjema select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,221,253,.2); }
.skjema.rad { padding-top: 20px; border-top: 1px solid rgba(29,221,253,.12); }
@media (min-width: 760px) {
  .skjema.rad { flex-direction: row; align-items: flex-end; }
  .skjema.rad label { flex: 1; }
  .skjema.rad .knapp { flex: none; }
}

/* Knapper */
.knapp {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px;
  padding: 12px 20px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem;
  color: var(--text); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .15s;
}
.knapp:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.knapp:focus-visible, .lenkeknapp:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.knapp.hoved { background: var(--accent); color: #031018; box-shadow: 0 0 24px rgba(29,221,253,.25); }
.knapp.hoved:hover { background: #5be7ff; transform: translateY(-1px); }
.knapp.stor { width: 100%; min-height: 56px; font-size: 1.1rem; margin-top: 22px; }
.knapp.liten { min-height: 38px; padding: 7px 14px; font-size: .88rem; }
.knapp.fare { color: #ffb4b4; box-shadow: inset 0 0 0 1px rgba(255,120,120,.35); }
.knapp.fare:hover { box-shadow: inset 0 0 0 1px #ff8a8a; }
.lenkeknapp { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 650; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Meldinger */
.varsel { margin-top: 18px; padding: 13px 16px; border-radius: 10px; line-height: 1.5; font-size: .97rem; }
.varsel.ok { background: rgba(29,221,253,.1); box-shadow: inset 3px 0 0 var(--accent); color: var(--text); }
.varsel.feil { background: rgba(255,110,110,.1); box-shadow: inset 3px 0 0 #ff7b7b; color: #ffd0d0; }

/* Innlogget-linje */
.innlogget-linje { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid rgba(29,221,253,.12); color: var(--muted); font-size: .92rem; }
.innlogget-linje b { color: var(--text); }

/* Lister med personer */
.personliste { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.personliste li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px; background: #0a131c; box-shadow: inset 0 0 0 1px rgba(29,221,253,.1); }
.person { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.person small { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.person .status { color: #7f97a8; }
.handlinger { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tom tilstand */
.tom { margin-top: 22px; padding: 26px 20px; border-radius: 12px; border: 1px dashed rgba(29,221,253,.3); color: var(--body); line-height: 1.6; }
.tom p + p { margin-top: 6px; }

@media (max-width: 520px) {
  .app { padding: 20px 12px 48px; }
  .kort { padding: 22px 16px; border-radius: 14px; }
  .handlinger { width: 100%; }
  .handlinger form { flex: 1; }
  .handlinger .knapp { width: 100%; }
}

/* Ankerlenker havner ikke under den faste toppmenyen */
.kort[id] { scroll-margin-top: 80px; }
.varsel + .kicker { display: block; margin-top: 22px; }

/* ================= Steg 2: saker og skrivesiden ================= */
.tittel-rad { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.tittel-rad h1 { margin-top: 0; }
.tilbakelenke { margin-bottom: 12px; }
.tilbakelenke a { color: var(--accent); text-decoration: none; font-weight: 650; }
.tilbakelenke a:hover { text-decoration: underline; }
.knapperad { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Statusmerker */
.status-merke { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.s-utkast { background: rgba(157,179,196,.16); color: #c6d6e2; }
.s-sendt { background: rgba(29,221,253,.16); color: var(--accent); }
.s-tilbake { background: rgba(255,196,90,.16); color: #ffcf70; }
.s-publisert { background: rgba(80,220,140,.16); color: #74e3a4; }

/* Liste over saker */
.sakliste { list-style: none; margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.sakliste a { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 15px 16px; border-radius: 12px;
  background: #0a131c; box-shadow: inset 0 0 0 1px rgba(29,221,253,.1); color: var(--text); text-decoration: none; transition: box-shadow .15s, background .15s; }
.sakliste a:hover { background: var(--card-2); box-shadow: inset 0 0 0 1px var(--accent); }
.sak-tittel { font-weight: 700; font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; }
.sakliste small { grid-column: 2; color: var(--muted); font-size: .85rem; }
@media (max-width: 520px) { .sakliste a { grid-template-columns: 1fr; } .sakliste small { grid-column: 1; } .tittel-rad .knapp { width: 100%; } .tittel-rad form { width: 100%; } }

/* Kommentar fra redaksjonen */
.kommentar { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: rgba(255,196,90,.08); box-shadow: inset 3px 0 0 #ffcf70; line-height: 1.55; }
.kommentar p { margin-top: 6px; color: var(--body); }

/* Skrivesiden */
.redigering { max-width: 860px; }
.skriv .stor-tekst { font-size: 1.25rem; font-weight: 700; }
.skjema select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
.skjema textarea { resize: vertical; line-height: 1.6; }
#tekst { min-height: 340px; font-size: 16px; }
.felt { display: flex; flex-direction: column; gap: 8px; }
.felt > label, .feltnavn { font-weight: 650; font-size: .95rem; }
.hjelp.liten { margin-top: 2px; font-size: .84rem; }
.hjelp code, .kort code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: rgba(29,221,253,.08); padding: 1px 5px; border-radius: 4px; color: var(--text); }

.verktoy { display: flex; gap: 6px; flex-wrap: wrap; }
.verktoy button { font: inherit; font-size: .88rem; font-weight: 650; color: var(--text); background: #0a131c; border: 1px solid rgba(29,221,253,.22);
  border-radius: 8px; padding: 8px 12px; min-height: 40px; cursor: pointer; }
.verktoy button:hover { border-color: var(--accent); }

/* Bildeopplasting */
.opplast { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; cursor: pointer; }
.opplast input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.opplast:focus-within .knapp { outline: 2px solid var(--accent); outline-offset: 3px; }
.opplast .knapp { pointer-events: none; }
.opplast-status { font-size: .9rem; color: var(--muted); min-height: 1.2em; }
.opplast-status.ok { color: var(--accent); }
.opplast-status.feil { color: #ffb4b4; }
.bildeliste { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.bildeliste li { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 14px; border-radius: 12px; background: #0a131c; box-shadow: inset 0 0 0 1px rgba(29,221,253,.1); }
.bildeliste img { width: 160px; height: auto; max-height: 200px; object-fit: cover; border-radius: 8px; background: #091119; }
.bilde-felt { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bilde-felt label { font-size: .88rem; }
.bilde-felt input[type=text] { padding: 10px 12px; }
.bilde-knapper { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.valg { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 600 !important; font-size: .9rem !important; cursor: pointer; padding: 6px 4px; }
.valg input { width: 18px !important; height: 18px; accent-color: var(--accent); }
@media (max-width: 560px) {
  .bildeliste li { grid-template-columns: 1fr; }
  .bildeliste img { width: 100%; max-height: 260px; }
}

/* Knappene nederst følger med når man skroller */
.handlingslinje { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
  margin: 8px -22px -28px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-radius: 0 0 16px 16px;
  background: rgba(13,22,32,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid rgba(29,221,253,.15); }
@media (max-width: 520px) {
  .handlingslinje { margin: 8px -16px -22px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .handlingslinje .knapp { flex: 1 1 40%; padding: 10px 12px; font-size: .95rem; }
  .handlingslinje .knapp.hoved { flex-basis: 100%; order: -1; }
}
.slett-sak { margin-top: 40px; text-align: right; }
.fare-tekst { color: #ff9c9c; }

/* Forhåndsvisning */
.forhandsvis-stripe { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: #ffcf70; color: #1a1306; font-size: .92rem; line-height: 1.4; }
.forhandsvis-stripe a { color: #1a1306; font-weight: 800; }
.article figcaption .kreditt { color: #7f97a8; white-space: nowrap; }
.sakliste .status-merke { justify-self: start; }

/* ================= Steg 3: godkjenning ================= */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.godkjenning { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.godkjenning > li { padding: 18px; border-radius: 14px; background: #0a131c; box-shadow: inset 0 0 0 1px rgba(29,221,253,.14); scroll-margin-top: 80px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px 18px; align-items: start; }
.g-hode { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.g-tittel { color: var(--text); font-weight: 800; font-size: 1.15rem; text-decoration: none; overflow-wrap: anywhere; }
.g-tittel:hover { color: var(--accent); }
.g-hode small, .person small { color: var(--muted); }
.g-ingress { color: var(--body); line-height: 1.5; font-size: .95rem; }
.g-handlinger { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.g-handlinger .knapp[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.godkjenning details { grid-column: 1 / -1; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 650; font-size: .93rem; padding: 4px 0; list-style-position: outside; }
details[open] > summary { margin-bottom: 8px; }
.skjema.kompakt { margin-top: 6px; gap: 10px; }
.skjema.kompakt .knapp { align-self: flex-start; }
.notater ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.notater li { padding: 10px 12px; border-radius: 10px; background: rgba(29,221,253,.06); font-size: .93rem; }
.notater li small { color: var(--muted); }
.notater li p { margin-top: 4px; color: var(--body); line-height: 1.5; }
@media (max-width: 640px) {
  .godkjenning > li { grid-template-columns: 1fr; }
  .g-handlinger { justify-content: stretch; }
  .g-handlinger > * { flex: 1; }
  .g-handlinger .knapp { width: 100%; }
}

/* ================= Kontakt oss ================= */
.honning { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.kontakt .skjema textarea { min-height: 170px; }
.kontakt .knapp.hoved { align-self: flex-start; min-width: 160px; }
@media (max-width: 520px) { .kontakt .knapp.hoved { align-self: stretch; } }
.henvliste { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.henvliste li { padding: 14px 16px; border-radius: 12px; background: #0a131c; box-shadow: inset 0 0 0 1px rgba(29,221,253,.1); }
.henv-hode { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.henv-hode a { color: var(--accent); overflow-wrap: anywhere; }
.henv-hode small { color: var(--muted); }
.henvliste p { margin-top: 8px; color: var(--body); line-height: 1.55; overflow-wrap: anywhere; }
.henvliste form { margin-top: 6px; text-align: right; }

/* ================= Endring av publiserte saker ================= */
.s-endring { background: rgba(190,140,255,.18); color: #d4b5ff; }
.endring-merke { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: rgba(190,140,255,.18); color: #d4b5ff; vertical-align: 2px; }
.endring-info { margin-top: 14px; padding: 13px 16px; border-radius: 12px; background: rgba(190,140,255,.08); box-shadow: inset 3px 0 0 #b48cff; line-height: 1.55; color: var(--body); }
.endring-info b { color: var(--text); }
.endringer { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; line-height: 1.5; }
.endringer li { padding: 8px 12px; border-radius: 8px; background: rgba(157,179,196,.07); color: var(--body); overflow-wrap: anywhere; }
.endringer li.lagt-til { background: rgba(80,220,140,.09); box-shadow: inset 3px 0 0 #74e3a4; }
.endringer li.fjernet { background: rgba(255,110,110,.08); box-shadow: inset 3px 0 0 #ff8a8a; }
.endringer del { color: #ffb4b4; }
.endringer ins { color: #9ff0c0; text-decoration: none; }

/* ================= Episodeplan ================= */
.admin-meny { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-meny a { padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--muted); text-decoration: none; box-shadow: inset 0 0 0 1px rgba(29,221,253,.18); }
.admin-meny a:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.admin-meny a[aria-current="page"] { background: rgba(29,221,253,.14); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(29,221,253,.4); }
.ep-ide { background: rgba(157,179,196,.16); color: #c6d6e2; }
.ep-planlegges { background: rgba(255,196,90,.16); color: #ffcf70; }
.ep-booket { background: rgba(29,221,253,.16); color: var(--accent); }
.ep-innspilt { background: rgba(190,140,255,.18); color: #d4b5ff; }
.ep-publisert { background: rgba(80,220,140,.16); color: #74e3a4; }
.ep-plan-liste { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ep-plan-kort { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px 18px; border-radius: 14px; background: #0a131c;
  box-shadow: inset 0 0 0 1px rgba(29,221,253,.12); color: var(--text); text-decoration: none; transition: box-shadow .15s, background .15s; }
.ep-plan-kort:hover { background: var(--card-2); box-shadow: inset 0 0 0 1px var(--accent); }
.ep-plan-topp { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ep-nr { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ep-plan-kort strong { font-size: 1.12rem; line-height: 1.3; overflow-wrap: anywhere; }
.ep-datoer { display: flex; flex-direction: column; gap: 3px; font-size: .9rem; color: var(--body); }
.ep-datoer em { font-style: normal; color: var(--muted); }
.ep-gjester { font-size: .88rem; color: var(--muted); }
.ep-gjester i { font-style: normal; color: #ffcf70; }
.ep-varsel { font-size: .85rem; color: #ffcf70; }
.ep-kort-mini { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ep-kort-mini a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: #0a131c; box-shadow: inset 0 0 0 1px rgba(29,221,253,.1); color: var(--text); text-decoration: none; }
.ep-kort-mini a:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.ep-kort-mini small { color: var(--muted); }
.felt-rad { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 700px) { .felt-rad { flex-direction: row; } .felt-rad > label { flex: 1; } .felt-rad .smal-felt { flex: 0 0 120px; } .halv { max-width: calc(50% - 8px); } }
.gruppe { border: 0; padding: 18px 0 0; border-top: 1px solid rgba(29,221,253,.12); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.gruppe legend { font-weight: 800; font-size: 1.05rem; color: var(--text); padding: 0; float: left; width: 100%; margin-bottom: 4px; }
.gjesteliste { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.gjest-rad { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 14px; border-radius: 12px; background: #0a131c; box-shadow: inset 0 0 0 1px rgba(29,221,253,.1); }
.gjest-rad label { font-size: .88rem; }
.gjest-rad input[type=text] { padding: 10px 12px; }
@media (min-width: 760px) { .gjest-rad { grid-template-columns: 1fr 1.4fr 1fr auto; align-items: end; } }
.kalender-lenker { font-size: .92rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.kalender-lenker a { color: var(--accent); font-weight: 650; }
.lenker-boks { padding: 12px 14px; border-radius: 10px; background: rgba(29,221,253,.05); font-size: .9rem; }
.lenker-boks span { color: var(--muted); font-weight: 650; }
.lenker-boks ul { list-style: none; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.lenker-boks a { color: var(--accent); overflow-wrap: anywhere; }
.gruppe [data-legg-til-gjest] { align-self: flex-start; }
