/* Mesterhjernen – klinisk tema: skifergrå flater, dyp blå merkefarge, hvitt.
   Samme verdier brukes i Android (res/values/colors.xml) og dock.html/pill.html. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #0f1a2a;
  --muted: #5b6778;
  --faint: #94a0b0;
  --border: #dde3ea;
  --border-strong: #c9d1dc;
  --accent: #1e5aa8;
  --accent-2: #0e3a6e;
  --accent-soft: #e8f0fa;
  --accent-text: #ffffff;
  /* Merkefargen er lik i lyst og mørkt tema (ikon, primærknapp, mikrofonknapp). */
  --brand: #1e5aa8;
  --brand-rgb: 30, 90, 168;
  --gradient: linear-gradient(135deg, #2b6cb8, #0e3a6e);
  --rec: #d93a3f;
  --rec-soft: #fcebeb;
  --ok: #1b7a4f;
  --ok-soft: #e6f4ec;
  --warn: #9a5a00;
  --warn-soft: #fdf1e1;
  --mark: #fff0b3;
  --shadow: 0 1px 2px rgba(15, 26, 42, 0.05), 0 4px 14px rgba(15, 26, 42, 0.05);
  --shadow-lg: 0 12px 40px rgba(15, 26, 42, 0.16);
  --radius: 10px;
  --radius-sm: 7px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1220;
    --surface: #111b2b;
    --surface-2: #172338;
    --text: #e6ecf3;
    --muted: #96a3b5;
    --faint: #64718a;
    --border: #1f2c42;
    --border-strong: #2b3a55;
    --accent: #6fa8ff;
    --accent-2: #3f7fe0;
    --accent-soft: #14284a;
    --accent-text: #0a1220;
    --rec: #ff6b6f;
    --rec-soft: #3a1d22;
    --ok: #4cc38a;
    --ok-soft: #15301f;
    --warn: #ffb35c;
    --warn-soft: #36260f;
    --mark: #5b4a12;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h2, h3, h4 { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 26px; font-weight: 650; }
h3 { margin: 0; font-size: 16px; font-weight: 600; }
h4 { margin: 22px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

code, .mono { font-family: "Cascadia Code", ui-monospace, monospace; font-size: 0.92em; }

.icon { flex: none; display: block; }

/* ---------- Ramme ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 232px;
  height: 100vh;
  flex: none;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand img { border-radius: 9px; box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.35); }
.brand strong { display: block; font-size: 15px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--muted); }

nav { display: flex; flex-direction: column; gap: 2px; }
nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a.active { background: var(--accent-soft); color: var(--accent); }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}
.sidebar-foot kbd { align-self: flex-start; }

main { flex: 1; min-width: 0; max-width: 1080px; margin: 0 auto; padding: 40px 40px 96px; }

.page-head { margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.section-title { margin: 36px 0 12px; }

/* ---------- Grunnelementer ---------- */

button, select, input, textarea { font: inherit; color: inherit; }

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, box-shadow 120ms, transform 120ms;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--gradient); border-color: transparent; color: #fff; box-shadow: 0 2px 10px rgba(var(--brand-rgb), 0.3); }
button.primary:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(var(--brand-rgb), 0.4); }
button.ghost { border-color: transparent; background: none; color: var(--muted); }
button.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: transparent; }
button.small { padding: 4px 10px; font-size: 13px; }
button.link { padding: 0; border: none; background: none; color: var(--accent); font-weight: 500; }
button.link:hover { text-decoration: underline; }
.icon-button { padding: 7px; }

select, input[type="text"], input[type="search"], input[type="password"], textarea {
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 120ms, box-shadow 120ms;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; resize: vertical; line-height: 1.6; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.hint { color: var(--muted); font-size: 13px; }
.error { color: var(--rec); }
.empty { color: var(--faint); font-size: 14px; }
.with-icon { display: inline-flex; align-items: center; gap: 5px; }

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  font: 500 11.5px/1.5 "Segoe UI", system-ui, sans-serif;
  text-align: center;
  color: var(--muted);
}

.card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; }
.card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
}
.chip.soft { background: var(--accent-soft); color: var(--accent); }
.chip.accent { background: var(--accent); color: var(--accent-text); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }

.badge {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rec);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

.tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
}
.tip .icon { color: var(--accent); }

/* ---------- Opptaker ---------- */

.hero { display: flex; justify-content: center; padding: 44px 22px 36px; }
.recorder { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.recorder.big { flex-direction: column; gap: 18px; text-align: center; }

.mic-button {
  position: relative;
  width: 112px;
  height: 112px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 30px rgba(var(--brand-rgb), 0.35);
}
.mic-button:hover:not(:disabled) { box-shadow: 0 14px 38px rgba(var(--brand-rgb), 0.45); }
.mic-button .ring { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; pointer-events: none; }
.recorder.on .mic-button { background: var(--rec); box-shadow: 0 10px 30px rgba(229, 72, 77, 0.35); }
.recorder.on .mic-button .ring { border-color: var(--rec); animation: ring 1.6s ease-out infinite; }
@keyframes ring { 0% { transform: scale(0.9); opacity: 0.7; } 100% { transform: scale(1.25); opacity: 0; } }

.rec-status { display: flex; align-items: center; gap: 14px; }
.timer { min-width: 3.2em; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.recorder:not(.big) .timer { font-size: 15px; }
.bars { display: flex; align-items: center; gap: 3px; height: 32px; }
.bars span { width: 3px; height: 100%; border-radius: 2px; background: var(--border-strong); transform: scaleY(0.12); transition: transform 90ms linear; }
.recorder.on .bars span { background: var(--accent); }
.rec-hint { color: var(--muted); font-size: 13px; }
.recorder:not(.big) .rec-hint { display: none; }

.rec-small { padding: 9px 16px; }
.recorder.on .rec-small { border-color: var(--rec); color: var(--rec); background: var(--rec-soft); }

/* ---------- Lister ---------- */

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list-item {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.list-item.clickable { cursor: pointer; transition: border-color 120ms, box-shadow 120ms; }
.list-item.clickable:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.list-item .empty { margin: 0; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.item-text { margin: 6px 0 0; overflow-wrap: anywhere; }
.labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.recent-item .copy { margin-left: auto; padding: 3px 9px; }
.recent-item.new { animation: arrive 2.4s ease-out; }
@keyframes arrive { 0% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); } 100% { border-color: var(--border); box-shadow: none; } }
#view-record .list + .list { margin-top: 8px; }
.muted { color: var(--faint); }
.small-text { font-size: 13px; margin: 6px 0 0; }
.row.tight { margin: 0; gap: 6px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status.s-done::before { background: var(--ok); }
.status.s-needs_attention { color: var(--rec); }
.status.s-needs_attention::before { background: var(--rec); }
.status:not(.s-done):not(.s-needs_attention)::before { background: var(--accent); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.filters .search { position: relative; display: flex; align-items: center; flex: 1 1 240px; }
.filters .search .icon { position: absolute; left: 11px; color: var(--faint); }
.filters .search input { width: 100%; padding-left: 34px; }

.dropzone {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-body { display: flex; flex-direction: column; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.drop-body .icon { color: var(--accent); margin-bottom: 4px; }

/* ---------- Logg ---------- */

.day + .day { margin-top: 28px; }
.day-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.count { color: var(--faint); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.feed + button, .library-results > button { margin-top: 16px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 56px 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-state .icon { color: var(--accent); margin-bottom: 6px; }
.empty-state strong { color: var(--text); }

.card-item .item-meta a.chip { text-decoration: none; }
.card-item .item-meta a.chip:hover { color: var(--text); }
.card-actions { display: inline-flex; gap: 2px; margin-left: auto; }
.card-actions button { padding: 3px 8px; }
.play { font-variant-numeric: tabular-nums; }
.item-title { display: block; margin-top: 6px; color: var(--text); font-weight: 600; text-decoration: none; }
.item-title:hover { color: var(--accent); }
.item-title + .item-text { margin-top: 2px; color: var(--muted); }
.labels a.chip { text-decoration: none; }
.labels a.chip:hover { background: var(--accent); color: var(--accent-text); }
.list-item.new { animation: arrive 2.4s ease-out; }
mark { padding: 0 2px; border-radius: 3px; background: var(--mark); color: inherit; }

/* ---------- Bibliotek ---------- */

.library {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  grid-template-areas: "search facets" "results facets";
  grid-template-rows: auto 1fr;
  column-gap: 28px;
  align-items: start;
}
.library-search { grid-area: search; }
.library-results { grid-area: results; }
.facets { grid-area: facets; }
.library .filters input[type="date"] { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.active-filters:empty { display: none; }
.small-link { font-size: 13px; margin-left: 4px; }
.result-count { margin: 14px 2px 10px; font-size: 13px; color: var(--muted); }
.facets { position: sticky; top: 24px; }
.facets h4:first-child { margin-top: 4px; }
.facet { list-style: none; margin: 0; padding: 0; }
.facet-row { justify-content: space-between; width: 100%; padding: 5px 10px; border: none; background: none; color: var(--text); font-weight: 400; }
.facet-row:hover:not(:disabled) { background: var(--surface-2); }
.facet-row.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.facet-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill { gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.tag-pill.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.tag-pill.active .count { color: inherit; opacity: 0.75; }

/* ---------- Ett innspill ---------- */

.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; color: var(--muted); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--accent); }
.item-head { margin-bottom: 14px; }
.title-input {
  width: 100%;
  margin: 0 0 6px -11px;
  border-color: transparent !important;
  background: none !important;
  font: 650 26px/1.25 "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.01em;
}
.title-input:hover { border-color: var(--border) !important; }
.title-input:focus { border-color: var(--accent) !important; }
#view-innspill audio { width: 100%; margin: 6px 0 4px; }
.props { display: grid; gap: 14px; margin: 16px 0; padding: 16px 18px; }
.prop { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 12px; }
.prop-label { font-size: 13px; color: var(--muted); }
.prop select { justify-self: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-head h4 { margin-bottom: 8px; }
.section-head a { font-size: 14px; }

.tag-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: text; }
.tag-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tag-editor > .icon { color: var(--faint); }
.tag-chips { display: contents; }
.tag-input { flex: 1 1 120px; padding: 4px !important; border: none !important; box-shadow: none !important; background: none !important; }
.chip-x { padding: 0; margin-right: -3px; border: none; background: none; color: inherit; opacity: 0.6; }
.chip-x:hover:not(:disabled) { opacity: 1; }

/* ---------- Opplasting ---------- */

.upload-list { margin-top: 16px; }
.upload-row { display: flex; align-items: center; gap: 12px; }
.upload-row > .icon { color: var(--accent); }
.upload-name { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.upload-status { display: flex; align-items: center; gap: 12px; font-size: 13px; }

/* ---------- Felles ---------- */

.summary { margin: 14px 0; padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); }
.layer { white-space: pre-wrap; color: var(--muted); overflow-wrap: anywhere; font-size: 14px; }
.attachments { list-style: none; padding: 0; margin: 12px 0; }
details { margin: 10px 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
summary { cursor: pointer; color: var(--muted); font-weight: 500; }

/* ---------- Varsler ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  animation: rise 180ms ease-out;
}
.toast.error { background: var(--rec); color: #fff; }
@keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } }

#login { max-width: 460px; margin: 10vh auto 0; }

/* ---------- Smal skjerm ---------- */

@media (max-width: 980px) {
  .library { grid-template-columns: minmax(0, 1fr); grid-template-areas: "search" "facets" "results"; }
  .facets { position: static; margin-top: 8px; }
  .facet { display: flex; flex-wrap: wrap; gap: 4px; }
  .facet-row { width: auto; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
}

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .prop { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sidebar {
    position: sticky;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    width: auto;
    height: auto;
    gap: 12px;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .brand div, .sidebar-foot { display: none; }
  .brand { padding: 0; }
  nav { flex-direction: row; }
  nav a { width: auto; padding: 8px 10px; }
  nav a span { display: none; }
  main { padding: 24px 16px 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Meny: grupper ---------- */

.nav-label { margin: 14px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }

/* ---------- Kategorier: én dempet farge hver, i samme kliniske familie ---------- */

.chip.cat { text-decoration: none; background: var(--surface-2); color: var(--muted); }
.chip.cat::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--cat, var(--faint)); }
.chip.cat:hover { color: var(--text); }
[data-cat="tanke"] { --cat: #7a8ca6; }
[data-cat="oppgave"] { --cat: #1e5aa8; }
[data-cat="notat"] { --cat: #3d8fb8; }
[data-cat="rapport"] { --cat: #1b7a4f; }
[data-cat="idé"] { --cat: #c08a1e; }
[data-cat="spørsmål"] { --cat: #7a5cc0; }

/* ---------- Tabeller (Lydfiler, Dokumenter, Tilgang) ---------- */

.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: none; }
.table tr.trow { cursor: pointer; transition: background 100ms; }
.table tr.trow:hover, .table tr.trow.open { background: var(--accent-soft); }
.table tr.trow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.table tr.panel td { padding: 4px 16px 18px 56px; background: var(--accent-soft); }
.table tr.revoked { opacity: 0.55; }
.table .nowrap { white-space: nowrap; }
.table .narrow { width: 1%; padding-right: 0; }
.table .grow { width: 100%; min-width: 220px; }
.table .actions { width: 1%; white-space: nowrap; text-align: right; }
.table .muted-cell { color: var(--muted); font-size: 12.5px; }
.table .muted-cell > * + * { margin-left: 10px; }
.table td.actions > * { vertical-align: middle; }
.table .play { padding: 2px 8px; }
.cell-title { display: flex; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.cell-title .chip { font-weight: 500; }
.cell-sub { display: -webkit-box; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 13px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.source { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.file-type { flex: none; min-width: 36px; padding: 1px 5px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-align: center; }
.icon-link { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-sm); color: var(--muted); }
.icon-link:hover { background: var(--surface-2); color: var(--accent); }
.panel-body { max-width: 75ch; }
.panel-body .layer { color: var(--text); font-size: 14.5px; line-height: 1.6; }
.tags-cell { min-width: 180px; }
.tag-editor.compact { min-height: 0; padding: 2px 4px; border-color: transparent; background: none; }
.tag-editor.compact:hover { border-color: var(--border); background: var(--surface); }
.tag-editor.compact .tag-input { flex: 1 1 30px; min-width: 30px; }

/* ---------- Ett innspill / dokument ---------- */

.item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.item-top .back { margin: 0; }
button.danger:hover:not(:disabled) { background: var(--rec-soft); color: var(--rec); }
.doc-section { margin: 22px 0; }
.prose { max-width: 75ch; margin: 0; white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.report { padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.answer { margin: 16px 0; border-left: 3px solid #7a5cc0; }
.answer h4 { display: flex; align-items: center; gap: 6px; margin-top: 0; }
.answer .layer { color: var(--text); font-size: 15px; }
.comments { margin: 26px 0; }
.comments .section-head { margin-bottom: 8px; }
.comments .section-head h4 { margin: 0; }
.text-block > summary { margin-bottom: 4px; }
.text-block[open] > summary { margin-bottom: 10px; }

/* ---------- Tilgang ---------- */

.key-created { align-items: flex-start; margin-bottom: 14px; }
.key-created p { margin: 2px 0 8px; }
.key-value { flex: 1 1 320px; font-size: 12.5px; }

@media (max-width: 820px) {
  .nav-label { display: none; }
  .table tr.panel td { padding-left: 16px; }
  .table .grow { min-width: 200px; }
}
