/* Arbeidsområde – «Myk» (fra Drodle-notatboken). Mørk er standard, lys kan velges. */
@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Mørk (standard) */
  --bg: #0F0D18;
  --frame: #1B1828;
  --rail: #211D31;
  --soft: #2A2540;
  --hover: #2A2540;
  --card: #2A2540;
  --text: #F4F1FB;
  --strong: #F4F1FB;
  --muted: #A9A3BF;
  --faint: #8A84A3;
  --border: #2F2A45;
  --dash: #4A4466;
  --accent: #F08A4B;
  --accent-text: #1E1B2E;
  --accent-soft: rgba(240, 138, 75, 0.16);
  --purple: #6B3FA0;
  --teal: #8CCBD1;
  --orange: #F08A4B;
  --ink: #1E1B2E;
  --error: #FF9B8F;
  --frame-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  --pop-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --glow-purple: 0 16px 40px rgba(124, 77, 196, 0.45);
  --glow-teal: 0 16px 40px rgba(140, 203, 209, 0.3);
  --glow-orange: 0 16px 40px rgba(240, 138, 75, 0.4);
  --radius: 14px;
  --side-w: 256px;

  --c-gray-bg: #3A3550; --c-gray-fg: #E6E2F2;
  --c-brown-bg: #4A3229; --c-brown-fg: #F2E2DA;
  --c-orange-bg: #5C3B23; --c-orange-fg: #FFDCC6;
  --c-yellow-bg: #564328; --c-yellow-fg: #FDECC8;
  --c-green-bg: #243D30; --c-green-fg: #D3EDD9;
  --c-blue-bg: #18394C; --c-blue-fg: #D3E8F2;
  --c-purple-bg: #3E2C5C; --c-purple-fg: #EADCFB;
  --c-pink-bg: #4E2C3C; --c-pink-fg: #F7DDE8;
  --c-red-bg: #552C2A; --c-red-fg: #FFDFDA;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F4EFEA;
  --frame: #FFFFFF;
  --rail: #FFF6EE;
  --soft: #F6F3F0;
  --hover: #F3EFEB;
  --card: #FFFFFF;
  --text: #1E1B2E;
  --strong: #1E1B2E;
  --muted: #6B6779;
  --faint: #7A7688;
  --border: #EEE9E4;
  --dash: #CFC8C1;
  --accent: #1E1B2E;
  --accent-text: #FFFFFF;
  --accent-soft: rgba(240, 138, 75, 0.18);
  --error: #B3261E;
  --frame-shadow: 0 20px 60px rgba(60, 40, 20, 0.08);
  --pop-shadow: 0 16px 48px rgba(30, 27, 46, 0.16);
  --glow-purple: 0 12px 28px rgba(107, 63, 160, 0.25);
  --glow-teal: 0 12px 28px rgba(80, 160, 170, 0.22);
  --glow-orange: 0 12px 28px rgba(240, 138, 75, 0.28);

  --c-gray-bg: #ECEAF0; --c-gray-fg: #3A3646;
  --c-brown-bg: #EEE0DA; --c-brown-fg: #442A1E;
  --c-orange-bg: #FADEC9; --c-orange-fg: #49290E;
  --c-yellow-bg: #FDECC8; --c-yellow-fg: #402C1B;
  --c-green-bg: #DBEDDB; --c-green-fg: #1C3829;
  --c-blue-bg: #D3E5EF; --c-blue-fg: #183347;
  --c-purple-bg: #EDE6FA; --c-purple-fg: #3B2161;
  --c-pink-bg: #F5E0E9; --c-pink-fg: #4C2337;
  --c-red-bg: #FFE2DD; --c-red-fg: #5D1715;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { color: var(--strong); line-height: 1.2; }
input, select, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
.pad { padding: 8px 10px; }
.error { color: var(--error); min-height: 1.5em; margin: 0; }
.danger-text { color: var(--error) !important; }
.placeholder { color: var(--faint); }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.sm { width: 16px; height: 16px; }

/* Knapper og felt */
.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 15px;
}
.primary:hover { filter: brightness(1.06); }
.primary.small, .ghost.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.primary.danger { background: var(--error); color: var(--ink); }
.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: none; color: var(--text); font-weight: 500;
}
.ghost:hover { background: var(--soft); }
.link { background: none; border: 0; padding: 0; color: var(--muted); }
.link:hover { color: var(--strong); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius);
  background: var(--soft); color: var(--text);
}
.icon-btn:hover { filter: brightness(1.15); }
.icon-btn.small { width: 26px; height: 26px; border-radius: 8px; background: none; color: var(--muted); font-size: 18px; }
.icon-btn.small:hover { background: var(--soft); color: var(--strong); }
input:not([type="checkbox"]):not([type="file"]), select, textarea {
  min-height: 44px; padding: 0 14px; border: 1.5px solid transparent; border-radius: var(--radius);
  background: var(--soft); color: var(--text); min-width: 0; outline: none;
}
textarea { padding: 10px 14px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--orange); }

/* Logo: fire avrundede ruter */
.logo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; width: 26px; height: 26px; flex: none; }
.logo i { border-radius: 6px; }
.logo i:nth-child(1) { background: var(--purple); }
.logo i:nth-child(2) { background: var(--orange); }
.logo i:nth-child(3) { background: var(--teal); }
.logo i:nth-child(4) { background: var(--text); }

/* --- Innlogging --- */
.login-screen { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--frame); border-radius: 28px; padding: 32px;
  display: grid; gap: 16px; box-shadow: var(--frame-shadow);
}
.login-card h1 { margin: 6px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
.login-card label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.login-card input { font-size: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--strong); letter-spacing: -0.3px; }

/* --- Ramme: avrundet flate på mørk bunn --- */
.shell { display: flex; height: 100%; padding: 20px; gap: 0; }
.frame { display: flex; flex: 1; min-width: 0; background: var(--frame); border-radius: 32px; box-shadow: var(--frame-shadow); overflow: hidden; }
.sidebar {
  width: var(--side-w); flex: none; background: var(--frame); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 28px 18px 18px; gap: 4px; overflow-y: auto;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 18px; }
.workspace { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--strong); letter-spacing: -0.3px; min-width: 0; }
.workspace-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; margin-bottom: 18px;
  background: var(--soft); border: 0; border-radius: var(--radius); color: var(--muted); font-size: 15px; text-align: left; width: 100%;
}
.search-trigger:hover { color: var(--strong); }
.search-trigger kbd { margin-left: auto; font: 12px "Outfit", sans-serif; color: var(--faint); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.side-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: var(--radius);
  color: var(--muted); font-weight: 500; font-size: 15px; background: none; border: 0; text-align: left; width: 100%;
}
.side-item:hover { color: var(--strong); background: var(--soft); }
.side-item.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.side-item.disabled { opacity: .5; cursor: default; }
.side-item.disabled:hover { background: none; color: var(--muted); }
.nav-collections .side-item { min-height: 40px; color: var(--text); }
.nav-collections .side-item.active { color: var(--accent-text); }
.side-icon { width: 20px; display: grid; place-items: center; flex: none; font-size: 16px; }
.dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.k-purple { --k: var(--purple); --k-ink: #FFFFFF; --k-glow: var(--glow-purple); }
.k-teal { --k: var(--teal); --k-ink: var(--ink); --k-glow: var(--glow-teal); }
.k-orange { --k: var(--orange); --k-ink: var(--ink); --k-glow: var(--glow-orange); }
/* samlingskortene på forsiden: hvit tekst på oransje */
.fav-card.k-orange { --k-ink: #FFFFFF; }
.fav-card.k-orange .fav-name, .fav-card.k-orange .fav-meta { text-shadow: 0 1px 2px rgba(30, 27, 46, 0.18); }
.fav-card.k-orange .progress { background: rgba(255, 255, 255, 0.3); }
.dot.k-purple, .dot.k-teal, .dot.k-orange { background: var(--k); }
.side-section { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 18px 14px 6px; }
.side-section-row { display: flex; align-items: center; justify-content: space-between; padding-right: 6px; }
.side-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted-item { color: var(--faint) !important; }
.sidebar-bottom {
  margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 16px 8px 0; border-top: 1px solid var(--border); font-size: 14px;
}
.who { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 14px 32px 0; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; flex-wrap: wrap; }
.crumbs a:hover { color: var(--strong); }
.crumbs .sep { color: var(--faint); }
.view { flex: 1; overflow-y: auto; padding: 8px 40px 56px; outline: none; }
.page { max-width: 920px; margin: 0 auto; padding-top: 16px; }
.page-wide { max-width: 1240px; }
.page-icon { font-size: 40px; line-height: 1; display: inline-block; }
.page-title { font-size: 34px; font-weight: 700; letter-spacing: -0.6px; margin: 12px 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.section-title { font-size: 20px; font-weight: 600; margin: 36px 0 16px; color: var(--strong); }

.only-mobile { display: none !important; }
.scrim { display: none; }

/* Mobil: ingen ramme, sidemenyen glir inn */
@media (max-width: 860px) {
  .only-mobile { display: inline-grid !important; }
  .only-desktop { display: none !important; }
  .shell { padding: 0; }
  .frame { border-radius: 0; box-shadow: none; background: var(--frame); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(84vw, 310px);
    transform: translateX(-100%); transition: transform .22s ease;
    padding-top: max(24px, env(safe-area-inset-top)); border-radius: 0 24px 24px 0;
  }
  .shell.menu-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .5); }
  .shell.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 10; }
  .topbar { padding: max(10px, env(safe-area-inset-top)) 16px 0; min-height: 56px; }
  .view { padding: 4px 16px 48px; }
  .page { padding-top: 4px; }
  .page-title { font-size: 28px; }
}

/* --- Startside --- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; max-width: 1240px; margin: 0 auto; padding-top: 8px; }
.home-main { min-width: 0; }
.home-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.home-head h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.6px; }
.home-head .date { color: var(--muted); font-size: 15px; }
.home-actions { display: flex; gap: 10px; }
@media (max-width: 1180px) { .home { grid-template-columns: minmax(0, 1fr); } }

/* Huskeliste (visningstypen «checklist» og oppgavekortet på forsiden) */
.checklist { max-width: 760px; }
.chk-new { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 14px; border-radius: 14px; background: var(--soft); margin-bottom: 18px; color: var(--muted); }
.chk-new:focus-within { outline: 2px solid var(--accent); outline-offset: 0; }
.chk-new input.chk-new-input { flex: 1; min-width: 0; width: auto; height: auto; min-height: 0; border: 0; border-radius: 0; background: none; box-shadow: none; padding: 12px 0; font-size: 15px; color: var(--text); }
.chk-new input.chk-new-input:focus-visible { outline: none; border: 0; }
.chk-hint { flex: none; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--orange); white-space: nowrap; }
.chk-group + .chk-group { margin-top: 18px; }
.chk-h { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.g-late .chk-h { color: var(--orange); }
.chk-n { font-weight: 500; opacity: .7; }
.chk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.chk-item { display: flex; align-items: flex-start; gap: 12px; padding: 8px 8px; margin: 0 -8px; border-radius: 12px; }
.chk-item:hover { background: rgba(255, 255, 255, 0.04); }
:root[data-theme="light"] .chk-item:hover { background: rgba(30, 27, 46, 0.04); }
input[type="checkbox"].chk-box { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0; border-radius: 50%;
  border: 2px solid var(--muted); background: none; display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
input[type="checkbox"].chk-box:hover { border-color: var(--teal); }
input[type="checkbox"].chk-box:checked { background: var(--teal); border-color: var(--teal); }
input[type="checkbox"].chk-box:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.chk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.chk-title { font-size: 15px; overflow-wrap: anywhere; transition: color .2s; }
.chk-text:hover .chk-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.chk-item.done .chk-title { color: var(--muted); text-decoration: line-through; }
.chk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.chk-meta .chip { font-size: 11px; }
.chk-when.late { color: var(--orange); font-weight: 600; }
.chk-empty { margin: 8px 0; }
.chk-done-btn { margin-top: 14px; }

/* Dashbord på forsiden: kinovakt, kjøreforhold, frister, pågående */
.dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.dash > .rail-empty { grid-column: 1 / -1; }
.dash-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; border-radius: 22px; min-width: 0; }
.dash-card.filled { background: var(--k); color: var(--k-ink); box-shadow: var(--k-glow); }
.dash-card.soft { background: var(--soft); color: var(--text); }
.dash-card.k-teal.soft { background: var(--k); color: var(--k-ink); box-shadow: var(--k-glow); }
.dash-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; opacity: .85; }
.dash-card:has(.dash-refresh, .dash-pick) .dash-label { padding-right: 56px; }
.dash-big { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -0.5px; color: inherit; }
a.dash-big:hover { text-decoration: underline; text-underline-offset: 4px; }
.dash-sub { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.dash-note { font-size: 13px; opacity: .85; overflow-wrap: anywhere; }
.dash-more { font-size: 13px; margin-top: auto; padding-top: 6px; opacity: .9; }
.dash-more a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.dash-refresh, .dash-pick { position: absolute; top: 14px; right: 14px; }
.dash-refresh { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; border: 0; padding: 0;
  background: rgba(255, 255, 255, 0.18); color: inherit; }
.dash-refresh:hover { background: rgba(255, 255, 255, 0.3); }
.dash-refresh.spin svg { animation: dash-spin 1s linear infinite; }
@keyframes dash-spin { to { transform: rotate(360deg); } }
.dash-weather { display: flex; align-items: center; gap: 10px; }
svg.ic.dash-wicon { width: 34px; height: 34px; }
svg.ic.xs { width: 13px; height: 13px; }
.dash-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-tags .badge { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.dash-card.k-teal .badge.warn { background: var(--ink); color: var(--orange); }
.dash-credit { margin-top: auto; font-size: 11px; opacity: .7; padding-top: 4px; }
.dash-group { display: flex; flex-direction: column; gap: 2px; }
.dash-group + .dash-group { margin-top: 8px; }
.dash-group-h { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.dash-group-h.late { color: var(--orange); }
.dash-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 0 12px; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; color: var(--text); align-items: baseline; }
.dash-item:hover { background: rgba(255, 255, 255, 0.05); }
:root[data-theme="light"] .dash-item:hover { background: rgba(30, 27, 46, 0.05); }
.dash-item.one { grid-template-columns: minmax(0, 1fr); }
.dash-when { grid-row: span 2; font-size: 13px; color: var(--muted); }
.dash-item.late .dash-when { color: var(--orange); font-weight: 600; }
.dash-item b { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.dash-item small { font-size: 12px; color: var(--muted); }
.dash-item small.stale { color: var(--orange); }
@media (max-width: 700px) {
  .dash { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 20px; }
  .dash-big { font-size: 26px; }
  .dash-item { grid-template-columns: 78px minmax(0, 1fr); }
}

.fav-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.fav-card {
  display: flex; flex-direction: column; gap: 20px; padding: 22px; min-height: 170px; border-radius: 22px;
  background: var(--k); color: var(--k-ink); box-shadow: var(--k-glow); border: 0; text-align: left;
  transition: transform .12s ease;
}
.fav-card:hover { transform: translateY(-2px); }
.fav-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, 0.22); font-size: 20px; }
.k-teal .fav-icon { background: rgba(255, 255, 255, 0.45); }
.fav-name { font-size: 22px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.fav-meta { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.progress { height: 6px; border-radius: 6px; background: rgba(30, 27, 46, 0.15); overflow: hidden; }
.k-purple .progress { background: rgba(255, 255, 255, 0.28); }
.progress i { display: block; height: 100%; border-radius: 6px; background: var(--k-ink); width: 0; transition: width .4s ease; }
.add-card {
  display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 22px; min-height: 170px; border-radius: 22px;
  background: none; border: 1.5px dashed var(--dash); color: var(--muted); text-align: left;
}
.add-card:hover { color: var(--strong); border-color: var(--muted); }
.add-card .plus { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.recent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.recent-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: var(--soft); color: var(--text); min-width: 0; }
.recent-card:hover { filter: brightness(1.12); }
.recent-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--k); color: var(--k-ink); font-size: 16px; }
.recent-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-when { font-size: 13px; color: var(--muted); }
.app-list { display: flex; flex-direction: column; gap: 12px; }
.app-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--card); color: var(--text); }
.app-row:hover { filter: brightness(1.12); }
.app-badge { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--k); color: var(--k-ink); font-weight: 600; }
.app-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-text b { font-weight: 600; font-size: 15px; }
.app-text span { font-size: 13px; color: var(--muted); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 8px; background: var(--soft); color: var(--muted); font-weight: 500; white-space: nowrap; }
.badge.warn { background: var(--accent-soft); color: var(--orange); }
:root[data-theme="light"] .badge.warn { color: #9A4A14; }

.rail { background: var(--rail); border-radius: 24px; padding: 28px 24px; display: flex; flex-direction: column; gap: 22px; align-self: start; }
.rail h2 { margin: 0; font-size: 20px; font-weight: 600; }
.rail-day { display: flex; flex-direction: column; gap: 14px; }
.rail-day + .rail-day { border-top: 1px solid var(--border); padding-top: 20px; }
.rail-date { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.rail-date::first-letter { text-transform: uppercase; }
.rail-item { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 2px 12px; align-items: baseline; color: var(--text); }
.rail-item .dot { width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); }
.rail-item small { font-size: 13px; color: var(--muted); grid-column: 2; }
.rail-item b { font-size: 15px; font-weight: 500; grid-column: 2; overflow-wrap: anywhere; }
.rail-item:hover b { text-decoration: underline; text-underline-offset: 3px; }
.rail-empty { color: var(--muted); font-size: 14px; margin: 0; }
/* «Kommende» i turkis med mørk tekst (samme i lyst og mørkt tema) */
.rail { background: var(--teal); color: var(--ink); box-shadow: var(--glow-teal); }
.rail h2, .rail-item, .rail-item b { color: var(--ink); }
.rail-date, .rail-item small, .rail-empty { color: rgba(30, 27, 46, 0.68); }
.rail-day + .rail-day { border-top-color: rgba(30, 27, 46, 0.16); }
.rail-item .dot { background: var(--ink); }
.rail-item:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.rail a:not(.rail-item) { color: var(--ink); }

/* --- VINYL DB --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { border-radius: 18px; padding: 14px 16px; background: var(--soft); }
.stat b { display: block; font-size: 24px; font-weight: 700; color: var(--strong); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.filters input[type="search"], .filters select { grid-column: 1 / -1; }
.filters .check { grid-column: 1 / -1; }
@media (min-width: 861px) {
  .filters { grid-template-columns: 2fr 1fr 110px 110px; }
  .filters input[type="search"], .filters select { grid-column: auto; }
}
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.tracks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tracks li { padding: 14px 16px; border-radius: 18px; background: var(--card); display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; }
.tracks .title { font-weight: 600; color: var(--strong); overflow-wrap: anywhere; }
.tracks .meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.tracks .nums { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); grid-row: span 2; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 8px; background: var(--soft); margin: 4px 4px 0 0; }
:root:not([data-theme="light"]) .tracks .tag { background: #3A3550; }
.tag.warn { background: var(--accent-soft); color: var(--orange); }
.more { margin: 16px auto; display: block; }
.empty { border: 1.5px dashed var(--dash); border-radius: 18px; padding: 28px; text-align: center; color: var(--muted); background: none !important; display: block !important; }

/* --- Søk --- */
.search-overlay {
  position: fixed; inset: 0; background: rgba(8, 6, 14, 0.6); z-index: 50;
  display: flex; justify-content: center; align-items: flex-start; padding: max(12vh, env(safe-area-inset-top)) 12px 12px;
}
.search-box { width: 100%; max-width: 620px; background: var(--rail); border-radius: 22px; overflow: hidden; box-shadow: var(--pop-shadow); }
.search-box input { width: 100%; border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important; padding: 18px 20px !important; min-height: 60px !important; font-size: 18px; background: none !important; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 55vh; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results li a { display: block; padding: 10px 12px; border-radius: 12px; }
.search-results li a:hover, .search-results li a.sel { background: var(--soft); }
.search-results .r-title { color: var(--strong); font-weight: 500; }
.search-results .r-meta { color: var(--muted); font-size: 13px; }
.search-results .no-hits, .search-results .error { padding: 10px 12px; }

/* ===================== Samlinger ===================== */
.chip { display: inline-block; padding: 1px 9px; border-radius: 8px; font-size: 13px; line-height: 20px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.c-gray { background: var(--c-gray-bg); color: var(--c-gray-fg); }
.c-brown { background: var(--c-brown-bg); color: var(--c-brown-fg); }
.c-orange { background: var(--c-orange-bg); color: var(--c-orange-fg); }
.c-yellow { background: var(--c-yellow-bg); color: var(--c-yellow-fg); }
.c-green { background: var(--c-green-bg); color: var(--c-green-fg); }
.c-blue { background: var(--c-blue-bg); color: var(--c-blue-fg); }
.c-purple { background: var(--c-purple-bg); color: var(--c-purple-fg); }
.c-pink { background: var(--c-pink-bg); color: var(--c-pink-fg); }
.c-red { background: var(--c-red-bg); color: var(--c-red-fg); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.rel-chip, .file-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 8px; font-size: 13px; line-height: 20px;
  background: var(--soft); color: var(--strong); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
:root:not([data-theme="light"]) .grid .rel-chip, :root:not([data-theme="light"]) .grid .file-chip { background: #3A3550; }
.rel-chip::before { content: "↗"; font-size: 11px; color: var(--teal); }
:root[data-theme="light"] .rel-chip::before { color: var(--purple); }
span.rel-chip::before { content: none; }
.file-chip::before { content: "⎙"; font-size: 11px; color: var(--muted); }
.x { background: none; border: 0; color: var(--muted); padding: 0 4px; font-size: 16px; line-height: 1; }
.x:hover { color: var(--strong); }
.v-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--dash); text-underline-offset: 3px; }
.v-num { font-variant-numeric: tabular-nums; }
.v-check { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--dash); font-size: 13px; line-height: 1; }
.v-check.on { background: var(--orange); box-shadow: none; color: var(--ink); }

.field-row { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.field-row input, .field-row select { color: var(--text); font-size: 15px; }
.row { display: flex; gap: 8px; }
.row > input:last-child { flex: 1; }
.icon-input { width: 60px; text-align: center; font-size: 20px; padding: 0 !important; }

/* Dialog */
.dialog-overlay { position: fixed; inset: 0; background: rgba(8, 6, 14, 0.6); z-index: 60; display: grid; place-items: start center; padding: max(12vh, env(safe-area-inset-top)) 12px 12px; overflow-y: auto; }
.dialog { width: 100%; max-width: 460px; background: var(--rail); border-radius: 24px; padding: 24px; display: grid; gap: 14px; box-shadow: var(--pop-shadow); }
.dialog h2 { margin: 0; font-size: 20px; font-weight: 600; }
.dialog p { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.dialog .field-label { display: grid; gap: 6px; font-size: 14px; }
.type-preview { display: grid; gap: 6px; }
.type-preview ul { margin: 0; padding-left: 18px; }

/* Popover */
.popover { position: fixed; z-index: 65; background: var(--rail); border-radius: 18px; box-shadow: var(--pop-shadow); max-height: min(440px, 70vh); overflow-y: auto; border: 1px solid var(--border); }
.pop-edit { display: grid; gap: 10px; padding: 12px; }
.pop-edit textarea, .pop-edit input:not([type="checkbox"]):not([type="file"]) { width: 100%; resize: vertical; }
.pop-label { font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.pop-actions { display: flex; justify-content: flex-end; gap: 8px; }
.opt-list { display: grid; gap: 2px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: none; border: 0; border-radius: 10px; min-height: 40px; padding: 0 10px; text-align: left; color: var(--text); width: 100%; }
.opt:hover, .opt.sel { background: var(--soft); }
.opt .tick { color: var(--orange); font-weight: 700; }
.opt.create { color: var(--muted); justify-content: flex-start; gap: 4px; }
.opt.more-opt { color: var(--muted); justify-content: center; font-size: 13px; }
.opt-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-group { font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 10px 2px; text-transform: uppercase; letter-spacing: 1px; }
.chosen:empty { display: none; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }
.file-row a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-btn { display: block; border: 1.5px dashed var(--dash); border-radius: var(--radius); padding: 12px; text-align: center; color: var(--muted); cursor: pointer; position: relative; }
.upload-btn:hover { color: var(--strong); border-color: var(--muted); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.opt-editor { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.opt-edit-row { display: flex; gap: 6px; align-items: center; }
.opt-edit-row input { flex: 1; }
.opt-edit-row select { width: 100px; }

.toast.has-action { display: flex; align-items: center; gap: 14px; width: max-content; }
.toast-btn { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 2px 4px; }
.toast { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--strong); color: var(--frame); padding: 12px 18px; border-radius: 14px; z-index: 70; max-width: calc(100vw - 32px); font-size: 14px; font-weight: 500; }

/* Samlingsside */
.icon-edit { background: none; border: 0; padding: 4px; margin-left: -4px; border-radius: 12px; }
.icon-edit:hover, .editable:hover { background: var(--soft); }
.editable { cursor: text; border-radius: 12px; margin-left: -6px; padding: 0 6px; }
/* Visninger (faner) og filter */
.view-tabs { display: flex; gap: 6px; margin: 14px 0 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.view-tabs::-webkit-scrollbar { display: none; }
.view-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--soft); color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.view-tab:hover { color: var(--strong); }
.view-tab.on { background: var(--orange); color: var(--ink); font-weight: 600; }
.view-tab.add { background: none; border: 1.5px dashed var(--dash); }
.tab-more { opacity: .7; letter-spacing: 1px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.filter-bar[hidden] { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--rail); border: 1px solid var(--line); font-size: 13px; }
.filter-chip .x { width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.filter-chip .x:hover { background: var(--soft); color: var(--strong); }
.filter-editor { display: grid; gap: 8px; }
.filter-editor select, .filter-editor input { width: 100%; }
.filter-value { display: grid; gap: 8px; }
.filter-value:empty { display: none; }
.order-btn { min-width: 36px; justify-content: center; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 16px; }
.toolbar-search { flex: 1 1 200px; max-width: 340px; }
.toolbar-sort { max-width: 220px; }
.toolbar .primary { margin-left: auto; }
/* «Ny» + malmenyen (▾) som én knapp */
.split-btn { display: inline-flex; margin-left: auto; }
.toolbar .split-btn .primary { margin-left: 0; }
.split-btn > .primary:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-btn > .split-more { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 10px; border-left: 1px solid rgba(0, 0, 0, 0.18); }
.tpl-row { display: flex; align-items: center; gap: 2px; }
.tpl-row > .opt { flex: 1; min-width: 0; }
.tpl-row .tpl-act { flex: none; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 7px; border-radius: 8px; font: inherit; }
.tpl-row .tpl-act:hover, .tpl-row .tpl-act:focus-visible { color: var(--text); background: var(--line); }
.tpl-row .tpl-act.on { color: var(--accent); }
.tpl-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin: 14px 0 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); font-size: 14px; }
.tpl-banner b { font-weight: 700; }
.tpl-banner .tpl-banner-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 18px; background: var(--card); }
:root:not([data-theme="light"]) .grid-wrap { background: #211D31; }
:root[data-theme="light"] .grid-wrap { box-shadow: 0 6px 20px rgba(30, 27, 46, 0.07); }
.grid { border-collapse: collapse; min-width: 100%; font-size: 14px; }
.grid th, .grid td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: left; vertical-align: top; }
.grid th:last-child, .grid td:last-child { border-right: 0; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.th-btn { background: none; border: 0; width: 100%; text-align: left; padding: 12px 12px; color: inherit; display: flex; gap: 8px; align-items: center; }
.th-btn:hover { background: var(--soft); color: var(--strong); }
.type-icon { display: inline-grid; place-items: center; color: var(--faint); }
.type-icon svg { width: 15px; height: 15px; stroke-width: 1.8; }
.grid th[draggable="true"] { cursor: grab; }
.grid th.dragging { opacity: .45; }
.grid th.drop-before { box-shadow: inset 3px 0 0 var(--orange); }
.grid th.drop-after { box-shadow: inset -3px 0 0 var(--orange); }
.th-add { width: 48px; }
.th-add .th-btn { justify-content: center; font-size: 18px; }
.grid td { padding: 11px 12px; min-width: 150px; max-width: 320px; cursor: pointer; position: relative; overflow: hidden; text-overflow: ellipsis; }
.grid td:hover { background: var(--soft); }
.grid td:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grid td.t-title { min-width: 240px; font-weight: 600; color: var(--strong); padding-right: 64px; }
.grid td.t-checkbox { min-width: 80px; text-align: center; }
.grid td.t-number { text-align: right; min-width: 100px; }
.grid td.t-text { white-space: nowrap; }
.grid td.t-pad { min-width: 48px; cursor: default; }
.grid td.t-pad:hover { background: none; }
.row-btns { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; opacity: 0; }
.open-btn { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 8px; background: var(--accent); color: var(--accent-text); }
.dup-btn { font-size: 13px; line-height: 1; padding: 3px 7px; border-radius: 8px; background: var(--rail); color: var(--text); border: 1px solid var(--border); cursor: pointer; }
.dup-btn:hover { border-color: var(--accent); }
.del-btn { display: inline-grid; place-items: center; padding: 2px 6px; border-radius: 8px; background: var(--rail); color: var(--muted); border: 1px solid var(--border); cursor: pointer; }
.del-btn:hover, .del-btn:focus-visible { color: var(--error); border-color: var(--error); }
.grid tr:hover .row-btns, .row-btns:focus-within { opacity: 1; }
@media (hover: none) { .row-btns { opacity: 1; } }
.grid tr.flash td { animation: row-flash 1.2s ease-out; }
@keyframes row-flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }
.empty-cell { color: var(--muted); text-align: center !important; padding: 32px !important; cursor: default !important; }
.add-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 1.5px dashed var(--dash); border-radius: 14px; min-height: 44px; padding: 0 14px; margin-top: 12px; color: var(--muted); }
.add-row:hover { color: var(--strong); border-color: var(--muted); }

/* Postside */
.props { display: grid; gap: 4px; margin: 20px 0 28px; padding: 12px; border-radius: 22px; background: var(--rail); }
.prop { display: grid; grid-template-columns: 170px 1fr; gap: 8px; align-items: start; min-height: 40px; }
.prop-name { display: flex; gap: 8px; align-items: center; color: var(--muted); font: inherit; font-size: 14px; padding: 9px 8px; overflow: hidden; white-space: nowrap; background: none; border: 0; border-radius: 12px; text-align: left; cursor: pointer; min-width: 0; }
.prop-name:hover { background: var(--soft); color: var(--text); }
.prop-label { overflow: hidden; text-overflow: ellipsis; }
svg.prop-hidden-ic { flex: none; width: 14px; height: 14px; opacity: .7; }
.props-more { display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin: 4px 0 0; padding: 8px 10px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.props-more:hover { background: var(--soft); color: var(--text); }
svg.more-ic { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform .15s; }
svg.more-ic.open { transform: none; }
.props-hidden { display: grid; gap: 4px; }
.props-empty { padding: 8px 10px; }
.pop-sub { margin-top: 6px; padding: 0 10px; font-size: 11px; }
.pop-sep { height: 1px; background: var(--line); margin: 4px 0; }
.prop-value { padding: 8px 10px; border-radius: 12px; cursor: pointer; min-height: 40px; overflow-wrap: anywhere; }
.prop-value:hover { background: var(--soft); }
.prop-value.t-text { white-space: pre-wrap; }
@media (max-width: 860px) {
  .prop { grid-template-columns: 1fr; gap: 0; margin-bottom: 6px; }
  .prop-name { padding: 6px 10px 0; }
  .toolbar-search { max-width: none; }
  .fav-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .fav-card, .add-card { min-height: 132px; padding: 16px; gap: 12px; border-radius: 20px; }
  .fav-name { font-size: 18px; }
  .fav-icon { width: 34px; height: 34px; font-size: 17px; }
  .home-head h1 { font-size: 28px; }
}
.record-meta { margin-top: 8px; }

/* Koblede oppføringer */
.linked { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 0 0 28px; }
.linked-box { min-width: 0; }
.linked:empty { display: none; }
.linked-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.linked-head h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 0 -30px; font-size: 17px; font-weight: 600; color: var(--strong); }
.linked-head h2 .md-fold { margin-right: -4px; }
.linked-box.folded .linked-wrap, .linked-box.folded .linked-actions { display: none; }
.linked-box.folded .fold-ic { transform: rotate(-90deg); }
.linked-box.folded .linked-head { margin-bottom: 0; }
@media (max-width: 860px) { .linked-head h2 { margin-left: -6px; } }
.cols-menu { min-width: 220px; }
.cols-menu .check-row { padding: 6px 4px; }
.cols-menu .type-icon { color: var(--muted); }
.linked-icon { font-size: 18px; }
.linked-count { min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.linked-actions { display: flex; gap: 6px; }
.ghost.small { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 12px; font-size: 13px; }
.ghost.small svg.ic { width: 16px; height: 16px; }
.linked-grid td, .linked-grid th { padding: 10px 12px; }
.linked-grid td.t-title { min-width: 200px; padding-right: 12px; }
.linked-grid td.t-title a { color: var(--strong); }
.linked-row { cursor: pointer; }
.linked-row:hover td { background: var(--soft); }
.record-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 14px; font-weight: 500; }
.back-link:hover { color: var(--strong); filter: brightness(1.12); }

/* Sidetekst */
.page-body { margin: 0 0 8px; padding: 18px 20px 20px; border-radius: 22px; background: var(--rail); }
.body-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.body-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.body-status { font-size: 13px; color: var(--muted); }
.body-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.body-tools .tb { min-width: 36px; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--soft); color: var(--text); border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.body-tools .tb:hover { filter: brightness(1.15); }
.body-tools .tb-b { font-weight: 700; }
.body-tools .tb-i { font-style: italic; }
.body-tools .tb-h { font-weight: 700; }
.body-tools .tb-tog { font-weight: 600; }
.body-tools .tb-gap { flex: 0 0 8px; }
.body-tools .tb-done { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.body-view { min-height: 64px; padding: 8px 10px 8px 40px; border-radius: 14px; cursor: text; line-height: 1.6; overflow-wrap: anywhere; }
.body-view:hover { background: var(--soft); }
.body-view:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.body-edit { display: block; width: 100%; min-height: 160px; resize: none; box-sizing: border-box; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--frame); color: var(--text); font: inherit; font-size: 15px; line-height: 1.6; }
.body-edit:focus { outline: none; border-color: var(--accent); }
.md-root > :first-child { margin-top: 0; }
.md-root > :last-child, .md-sec-body > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md .md-h { margin: 18px 0 8px; color: var(--strong); line-height: 1.25; }
.md .md-toggle, .md .md-tog-h { display: flex; align-items: flex-start; gap: 4px; margin-left: -30px; }
.md .md-tog-h { margin-top: 2px; margin-bottom: 2px; }
.md-root > :first-child.md-h, .md-root > .md-sec:first-child > .md-h { margin-top: 0; }
/* innholdet i en veksel er rykket inn, med en tynn linje fra pila og ned */
.md-sec-body { margin: 0 0 6px -17px; padding: 2px 0 2px 42px; }
.md-sec-body:empty { display: none; }
.md-fold { flex: none; display: grid; place-items: center; width: 26px; height: 1.25em; min-height: 24px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.md-fold:hover { background: var(--soft); color: var(--strong); }
.md-fold.empty { opacity: .35; }
.fold-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.md-sec.folded > .md-h .fold-ic, .md-sec.folded > .md-tog-h .fold-ic { transform: rotate(-90deg); }
.md-tog > .md-sec-body { margin-top: 2px; }
.md h2.md-h { font-size: 24px; }
.md h3.md-h { font-size: 19px; }
.md h4.md-h { font-size: 16px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 24px; }
.md li { margin: 2px 0; }
.md ul.md-todo { list-style: none; padding-left: 0; }
.md ul.md-todo li { display: flex; gap: 10px; align-items: flex-start; }
.md ul.md-todo li.done > span { color: var(--muted); text-decoration: line-through; }
.md ul.md-todo .v-check { flex: none; margin-top: 3px; cursor: pointer; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.md ul.md-todo .v-check.on { background: var(--orange); color: var(--ink); }
.md a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
[data-theme="light"] .md a { color: #6B3FA0; }
.md code { padding: 1px 6px; border-radius: 6px; background: var(--soft); font-size: .92em; }
.md blockquote { margin: 0 0 10px; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.md-code { margin: 0 0 10px; padding: 12px 14px; border-radius: 12px; background: var(--frame); overflow-x: auto; font-size: 13.5px; line-height: 1.5; }
.md-code code { padding: 0; background: none; font-size: inherit; white-space: pre; }
.md-table { margin: 0 0 12px; overflow-x: auto; }
.md-table table { border-collapse: collapse; font-size: 14px; min-width: 50%; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.md-table th { background: var(--soft); font-weight: 600; }
.md-img { display: inline-block; margin: 4px 0; }
.md-img img { display: block; max-width: 100%; max-height: 480px; border-radius: 12px; }
.md a.md-ref { color: var(--orange); text-decoration: none; border-bottom: 1px dashed currentColor; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
@media (max-width: 860px) {
  .page-body { padding: 14px 14px 16px; border-radius: 20px; }
  .body-edit { font-size: 16px; }
  .body-view { padding-left: 34px; }
  .md-sec-body { padding-left: 30px; }
}

/* Delte sider (/s/…) */
.share-body { height: auto; min-height: 100%; display: flex; flex-direction: column; overflow: auto; }
.share-page { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 24px 24px; box-sizing: border-box; }
.share-page .page { padding-top: 0; }
.share-page .props .prop-name { cursor: default; }
.share-page .props .prop-name:hover { background: none; color: var(--muted); }
.share-page .body-view { cursor: auto; }
.share-page .body-view:hover { background: none; }
.share-grid td.t-title a { color: var(--strong); font-weight: 600; }
.share-msg { max-width: 520px; margin: 12vh auto 0; text-align: center; }
.share-msg h1 { font-size: 28px; margin: 0 0 8px; }
.share-lock { margin: 10vh auto 0; }
.share-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 16px 28px; color: var(--muted); font-size: 13px; }
.share-foot .logo { width: 18px; height: 18px; gap: 2px; }
.share-foot .logo i { border-radius: 4px; }
.share-foot .link { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.md-ref.off { color: inherit; border: 0; }
@media (max-width: 860px) {
  .share-page { padding: 20px 16px 16px; }
}

/* Delingsdialogen */
.share-dialog { width: min(560px, 100%); }
.share-list { display: grid; gap: 10px; margin: 0 0 6px; }
.share-item { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--rail); }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; min-width: 0; font-size: 13px; }
.share-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-size: 13px; }
.share-meta .badge { padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--text); font-size: 12px; }
.share-meta .grow { flex: 1; }
.share-form { display: grid; gap: 10px; }
.share-form h3 { margin: 8px 0 0; font-size: 15px; }
.share-form .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-form .row > input, .share-form .row > select { flex: 1; min-width: 140px; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--orange); flex: none; }
.share-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 12px; max-height: 200px; overflow: auto; padding: 2px; }
.share-warn { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 13px; }
.record-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.record-top .back-link { margin-top: 0; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; }

/* Tavle */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.board-col { flex: 0 0 300px; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 22px; background: var(--rail); scroll-snap-align: start; transition: outline-color .1s; outline: 2px dashed transparent; outline-offset: -2px; }
.board-col.drop { outline-color: var(--orange); }
.board-col-head { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 2px; }
.board-col-head .md-fold { margin-left: -4px; }
.board-cards { display: flex; flex-direction: column; gap: 10px; min-height: 8px; }
.board-card { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--card); cursor: grab; box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.board-card:hover { background: var(--soft); }
.board-card:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.board-card.dragging { opacity: .45; cursor: grabbing; }
.card-top { display: flex; align-items: flex-start; gap: 8px; }
.card-title { flex: 1; min-width: 0; font-weight: 600; color: var(--strong); line-height: 1.3; overflow-wrap: anywhere; }
.card-move { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 15px; cursor: pointer; opacity: .55; }
.board-card:hover .card-move, .card-move:focus-visible { opacity: 1; }
.card-move:hover { background: var(--rail); color: var(--strong); }
.card-fields { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.card-field { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.card-field .v-link { color: var(--muted); }
.board-add { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.board-add:hover { background: var(--soft); color: var(--strong); }
.board-col.folded { flex: 0 0 56px; align-items: center; padding: 12px 6px; }
.board-col.folded .board-col-head { flex-direction: column; gap: 10px; }
.board-col.folded .board-col-head .md-fold { margin: 0; }
.board-col.folded .fold-ic { transform: rotate(-90deg); }
.board-col.folded .chip, .board-col.folded .board-col-head > .muted { writing-mode: vertical-rl; white-space: nowrap; }
.field-row { display: grid; gap: 6px; }
@media (hover: none) { .card-move { opacity: 1; } }
@media (max-width: 860px) {
  .board { gap: 10px; margin: 0 -16px; padding: 2px 16px 12px; scroll-padding: 0 16px; }
  .board-col { flex-basis: 82vw; }
}

/* Forsiden: velg samlinger */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 36px 0 16px; }
.section-head .section-title { margin: 0; }
.fav-empty { grid-column: 1 / -1; margin: 0; }
.home-pick-icon { width: 22px; text-align: center; }

/* Ikoner: strekikon eller monogram på farget flis */
.ico-o { --ico-bg: var(--orange); --ico-ink: #FFFFFF; }
.ico-p { --ico-bg: var(--purple); --ico-ink: #FFFFFF; }
.ico-t { --ico-bg: var(--teal); --ico-ink: var(--ink); }
.ico-k { --ico-bg: #3A3550; --ico-ink: #F4F1FB; }
:root[data-theme="light"] .ico-k { --ico-bg: var(--ink); --ico-ink: #FFFFFF; }
.ico { display: inline-grid; place-items: center; line-height: 1; vertical-align: middle; }
.ico-tile { width: 1.25em; height: 1.25em; border-radius: 0.3em; background: var(--ico-bg); color: var(--ico-ink); }
.ico-svg { width: 0.72em; height: 0.72em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-mono { font-size: 0.5em; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.ico.bare { width: auto; height: auto; background: none; color: inherit; }
.ico.bare .ico-svg { width: 1em; height: 1em; }
.ico.bare .ico-mono { font-size: 0.8em; }
.side-icon .ico-tile { font-size: 18px; }
.linked-icon .ico-tile, .home-pick-icon .ico-tile { font-size: 16px; }
.page-icon.icon-edit { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 14px; }
.page-icon.icon-edit:hover { background: var(--soft); }
.page-icon .ico-tile { font-size: 40px; }
.icon-pick-btn { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--soft); font-size: 26px; cursor: pointer; }
.icon-pick-btn .ico-tile { font-size: 28px; }

/* Ikonvelgeren */
.icon-picker { box-sizing: border-box; width: 100%; padding: 14px; display: grid; gap: 10px; }
.icon-picker input[type=search] { width: 100%; box-sizing: border-box; }
.ip-tabs { display: flex; gap: 6px; }
.ip-tab { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--soft); color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.ip-tab.on { background: var(--orange); color: var(--ink); font-weight: 600; }
.ip-swatches { display: flex; gap: 8px; }
.ip-swatch { width: 28px; height: 28px; border-radius: 9px; border: 2px solid transparent; background: var(--ico-bg); cursor: pointer; padding: 0; }
.ip-swatch.on { border-color: var(--strong); box-shadow: 0 0 0 2px var(--rail) inset; }
.ip-body { max-height: 300px; overflow-y: auto; display: grid; gap: 6px; align-content: start; }
.ip-label { margin-top: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.ip-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ip-cell { aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: none; font-size: 26px; cursor: pointer; }
.ip-cell:hover, .ip-cell:focus-visible { background: var(--soft); }
.ip-emoji { font-size: 22px; }
.ip-foot { display: flex; justify-content: space-between; gap: 8px; }
.ip-mono { display: grid; gap: 12px; justify-items: start; padding: 6px 2px; }
.ip-mono-preview { font-size: 48px; }
.ip-mono-row { display: flex; gap: 8px; }
.ip-mono-input { width: 120px; }

/* Kalender */
.cal { display: grid; gap: 14px; }
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-head .grow { flex: 1; }
.cal-title { margin: 0 6px; font-size: 22px; font-weight: 600; min-width: 180px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { padding: 0 8px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cal-day { min-height: 118px; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 14px; background: var(--rail); cursor: pointer; outline: 2px dashed transparent; outline-offset: -2px; min-width: 0; }
.cal-day:hover { background: var(--soft); }
.cal-day.other { opacity: 0.45; }
.cal-day.weekend { background: color-mix(in srgb, var(--rail) 70%, var(--bg)); }
.cal-day.drop { outline-color: var(--orange); }
.cal-day:focus-visible { outline: 2px solid var(--orange); }
.cal-num { font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 4px; }
.cal-day.today .cal-num { align-self: flex-start; min-width: 26px; text-align: center; border-radius: 999px; background: var(--orange); color: var(--ink); }
.cal-card { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 8px; border-radius: 9px; background: var(--card); color: var(--text); font-size: 13px; line-height: 1.25; cursor: grab; }
.cal-card:hover { background: var(--frame); color: var(--strong); }
.cal-card.dragging { opacity: 0.45; }
.cal-card-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-time { flex: none; font-size: 11px; color: var(--muted); }
.cal-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; padding: 0; }
.cal-dot[class*="c-"] { background: currentColor; }
.cal-more { align-self: flex-start; padding: 2px 6px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.cal-more:hover { color: var(--strong); background: var(--card); }
.cal-pop { display: grid; gap: 6px; padding: 12px; }
.cal-nodate summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.cal-nodate-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cal-nodate-list .cal-card { max-width: 260px; }
.cal-agenda { display: grid; gap: 14px; }
.cal-agenda-day h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.cal-agenda-day h3::first-letter { text-transform: uppercase; }
.cal-agenda-day.today h3 { color: var(--orange); }
.cal-agenda-list { display: grid; gap: 6px; }
.cal-agenda .cal-card { padding: 12px 14px; font-size: 15px; border-radius: 14px; }
.cal-agenda .cal-card-title { white-space: normal; }
.cal-empty { padding: 20px 0; }
.cal-help { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
@media (max-width: 860px) {
  .cal-title { min-width: 0; font-size: 19px; }
  .cal-head .grow { flex-basis: 100%; height: 0; }
}

/* Sidemenyen i samme lyse lilla som kortene på forsiden */
.sidebar { background: var(--soft); --side-hover: #352F4D; }
:root[data-theme="light"] .sidebar { --side-hover: #ECE7E2; }
.sidebar .search-trigger { background: var(--frame); }
.sidebar .side-item:hover { background: var(--side-hover); }
.sidebar .side-item.disabled:hover { background: none; }
.cal-ico { flex: none; font-size: 13px; display: inline-grid; }
.cal-ico .ico-tile { font-size: 14px; }
.cal-card.done .cal-card-title { color: var(--muted); }
.cal-day.no-add { cursor: default; }

/* Samlingskort: større ikon med navnet til høyre (inntil to linjer) */
.fav-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.fav-top .fav-icon { flex: none; width: 56px; height: 56px; border-radius: 16px; font-size: 30px; }
.fav-top .fav-icon .ico-svg { width: 30px; height: 30px; }
.fav-top .fav-name { min-width: 0; font-size: 21px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; }
.fav-top .fav-name.long { font-size: 17px; line-height: 1.2; }
@media (max-width: 860px) {
  .fav-top { gap: 10px; }
  .fav-top .fav-icon { width: 44px; height: 44px; border-radius: 13px; font-size: 24px; }
  .fav-top .fav-icon .ico-svg { width: 24px; height: 24px; }
  .fav-top .fav-name { font-size: 17px; }
  .fav-top .fav-name.long { font-size: 14.5px; }
}

/* --- Samtykke for KI-koblinger (/oauth/authorize) --- */
.consent { max-width: 440px; }
.consent p { margin: 0; }
.consent-form { display: grid; gap: 16px; }
.consent-form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.consent-opts { display: grid; gap: 10px; }
.consent-opt {
  display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 22px;
  border: 1.5px solid var(--border); background: var(--soft); color: var(--text);
}
.consent-opt strong { color: var(--strong); font-size: 16px; }
.consent-opt span { color: var(--muted); font-size: 14px; }
.consent-opt:hover { border-color: var(--accent); }
.consent-opt.primary-opt { background: var(--accent); border-color: var(--accent); }
.consent-opt.primary-opt strong, .consent-opt.primary-opt span { color: var(--accent-text); }
.consent-opt:disabled { opacity: 0.6; cursor: default; }
.consent-notes { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* --- KI-tilgang (#/ki) --- */
.ki-card { background: var(--soft); border-radius: 22px; padding: 18px 20px; display: grid; gap: 14px; }
.ki-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ki-card .ki-url input[readonly] { flex: 1; background: var(--frame); }
.ki-sub { margin: -6px 0 14px; }
.ki-list { display: grid; gap: 8px; }
.ki-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--soft); }
.ki-col { cursor: pointer; }
.ki-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ki-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; }
.ki-ico .ico { width: 28px; height: 28px; font-size: 18px; }
.ki-link { color: var(--strong); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.ki-ch { overflow-wrap: anywhere; }
.ki-log { align-items: flex-start; }
.ki-when { white-space: nowrap; }

/* --- Sider --- */
.nav-pages .side-item { min-height: 38px; gap: 6px; color: var(--text); }
.nav-pages .side-item.active { color: var(--accent-text); }
.tree-tog { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--muted); padding: 0; }
.tree-tog:hover { background: var(--frame); color: var(--strong); }
.tree-tog .fold-ic { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform .15s; }
.tree-tog.open .fold-ic { transform: none; }
.tree-tog.empty { visibility: hidden; }
.side-item.active .tree-tog { color: inherit; }
.page-doc .doc-top, .page .doc-top { display: flex; align-items: flex-start; justify-content: space-between; }
.page-title-input {
  display: block; width: 100%; min-height: 0 !important; padding: 0 !important; margin: 12px 0 16px; resize: none; overflow: hidden;
  border: 0 !important; background: none !important; color: var(--strong) !important; font: inherit; font-size: 34px; font-weight: 700;
  letter-spacing: -0.6px; line-height: 1.2;
}
.page-title-input::placeholder { color: var(--faint); }
@media (max-width: 860px) { .page-title-input { font-size: 28px; } }
/* På sider tar «Lagret» ingen plass – den legger seg over skrivefeltet, så teksten ikke hopper */
.body-head.bare { position: relative; height: 0; min-height: 0; margin: 0; }
.body-head.bare .body-status { position: absolute; right: 0; bottom: 4px; pointer-events: none; }
.body-status { transition: opacity .3s; }
.body-status:empty { opacity: 0; }
.tb.tb-ins { font-size: 13px; }
.subpages { display: grid; gap: 6px; margin-top: 28px; justify-items: start; }
.subpages-h { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0 0 2px; }
.subpages .md-page-link { justify-self: stretch; }
.md-page-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0; border-radius: 14px;
  color: var(--strong); font-weight: 500; text-decoration: none !important;
}
.md-page-t { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 4px; }
.md-page-link:hover { background: var(--soft); }
.md-page-link:hover .md-page-t { text-decoration-color: var(--muted); }
.md-page-link.off { color: var(--faint); text-decoration: line-through !important; }
.md-page-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; font-size: 18px; }
.md-page-ic .ico-tile { font-size: 16px; }
.md-page-n { margin-left: auto; text-decoration: none; }
.md-embed { margin: 14px 0; min-width: 0; }
.md-embed.off { padding: 10px 14px; border-radius: 14px; background: var(--soft); }
.embed-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 600; color: var(--strong); }
.embed-head h3 a { display: inline-flex; align-items: center; gap: 8px; color: inherit; }
.embed-head h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.embed-view { font-weight: 500; }
.embed-filter { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 500; }
.embed-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-x { border: 0; background: none; color: inherit; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.chip-x:hover { color: var(--strong); }
.embed-more { display: inline-block; margin-top: 6px; }
.row-ic { display: inline-grid; place-items: center; width: 18px; margin-right: 6px; vertical-align: -2px; }
.row-ic .ico-tile { font-size: 12px; }
.md-include { margin: 12px 0; padding: 10px 16px 6px; border-left: 3px solid var(--teal); border-radius: 0 14px 14px 0; background: color-mix(in srgb, var(--teal) 6%, transparent); }
.md-include-src { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.md-include-src:hover { color: var(--strong); }
.page-body.doc-body { padding: 0; background: none; border-radius: 0; }
.doc-body .body-view { margin-left: -40px; min-height: 120px; }
.doc-body .body-view:hover { background: color-mix(in srgb, var(--soft) 45%, transparent); }
@media (max-width: 860px) { .doc-body .body-view { margin-left: -12px; padding-left: 28px; } }

/* Verktøylinja følger med når du skriver; på mobil ligger den over tastaturet */
/* Svever nederst på skjermen mens du skriver, så teksten aldri hopper når den vises */
.body-tools {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; margin: 0; padding: 6px;
  flex-wrap: nowrap; align-items: center; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none;
  border-radius: 18px; border: 1px solid var(--border); background: var(--rail); box-shadow: var(--pop-shadow);
}
.body-tools .tb-plus { font-size: 18px; font-weight: 600; background: var(--accent); color: var(--accent-text); }
.block-menu { padding: 10px 8px; }
.block-menu .pop-label { padding: 0 6px; }
.block-opt { justify-content: flex-start; gap: 12px; min-height: 48px; }
.block-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--soft); color: var(--strong); font-weight: 700; font-size: 14px; }
.block-txt { display: grid; gap: 0; text-align: left; }
.block-txt strong { font-weight: 600; color: var(--strong); font-size: 14px; }
@media (max-width: 860px) {
  .body-tools { left: 8px; right: 8px; bottom: 0; transform: none; margin: 0 0 8px; border-radius: 22px; }
  .body-tools::-webkit-scrollbar { display: none; }
  .body-tools .tb { flex: none; height: 42px; min-width: 42px; border-radius: 14px; }
  .body-tools .tb-gap { flex: 1 0 4px; }
  .body-tools .tb-done { position: sticky; right: 0; box-shadow: -8px 0 12px var(--rail); }
  .page-body .pm-mount { margin-bottom: 76px; }
}

/* Teksteditoren (editor.js, ProseMirror): ser ut som den ferdige teksten, og kan skrives i direkte */
.ProseMirror { position: relative; word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; font-variant-ligatures: none; }
.ProseMirror pre { white-space: pre-wrap; }
.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }
.ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1.5px solid var(--text); animation: pm-blink 1.1s steps(2, start) infinite; }
.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
@keyframes pm-blink { to { visibility: hidden; } }
.pm-editor { outline: none; cursor: text; min-height: 64px; }
.pm-editor:hover, .doc-body .pm-editor:hover { background: none; }
.pm-editor:focus-visible { outline: none; }
.pm-editor > :first-child { margin-top: 0; }
.pm-editor .ProseMirror-selectednode, .pm-editor .pm-selected { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.pm-editor hr.ProseMirror-selectednode { outline-offset: 4px; }
/* hjelpetekst i tomme linjer */
.pm-editor .pm-ph::before { content: attr(data-ph); float: left; height: 0; pointer-events: none; color: var(--faint, var(--muted)); opacity: .75; }
/* veksler: innholdet skjules når de er lukket; tom veksel vises likevel mens man skriver */
.pm-editor .pm-toggle.folded > .md-sec-body { display: none; }
.pm-editor .pm-toggle.folded > .pm-tog-title .fold-ic { transform: rotate(-90deg); }
.pm-editor .md-sec-body:empty { display: block; min-height: 0; padding-top: 0; padding-bottom: 0; }
.pm-editor .pm-empty-toggle .md-fold { opacity: .35; }
.pm-tog-text { flex: 1; min-width: 0; }
/* sjekkliste */
.pm-editor ul.md-todo li > span { flex: 1; min-width: 0; }
.pm-editor ul.md-todo .v-check { user-select: none; }
/* tabeller: overskriftsrad og redigerbare celler */
.pm-editor .md-table td { min-width: 60px; }
.pm-editor .md-table.pm-has-head tr:first-child td { background: var(--soft); font-weight: 600; }
/* innebygde samlinger og sider */
.pm-embed { position: relative; margin: 14px 0; }
.pm-embed > .md-embed, .pm-embed > .md-include, .pm-embed > .md-page-link { margin: 0; }
.pm-embed-x, .pm-embed-grip, .pm-embed-edit { position: absolute; top: -10px; z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--border); border-radius: 9px; background: var(--rail); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; }
.pm-embed-x { right: -6px; }
.pm-embed-edit { right: 26px; }
.pm-embed-grip { left: -34px; top: 4px; font-size: 11px; letter-spacing: -2px; cursor: grab; }
.pm-embed:hover .pm-embed-x, .pm-embed:hover .pm-embed-grip, .pm-embed:hover .pm-embed-edit, .pm-embed.pm-selected .pm-embed-x, .pm-embed.pm-selected .pm-embed-edit { opacity: 1; }
.pm-embed-x:hover, .pm-embed-edit:hover { color: var(--strong); background: var(--soft); }
/* På mobil: grepet (velg blokken – så kan den flyttes inn i en veksel med ⇥) står ved siden av de andre knappene */
@media (hover: none) { .pm-embed-x, .pm-embed-edit, .pm-embed-grip { opacity: 1; } .pm-embed-grip { left: auto; right: 58px; top: -10px; } }
.pm-img { display: inline-block; }
.pm-img-off { font-size: 14px; }
/* svevende menyer: /-meny, formatering, lenke og tabell */
.pm-menu { width: min(300px, calc(100vw - 16px)); padding: 10px 8px; }
.pm-bubble, .pm-tablebar { display: flex; align-items: center; gap: 4px; padding: 5px; max-width: calc(100vw - 16px); overflow-x: auto; border-radius: 14px; }
.pm-bubble .tb, .pm-tablebar .tb { min-width: 34px; height: 32px; padding: 0 9px; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.pm-bubble .tb:hover, .pm-tablebar .tb:hover, .pm-bubble .tb.on { background: var(--soft); color: var(--strong); }
.pm-bubble .tb-b { font-weight: 700; }
.pm-bubble .tb-i { font-style: italic; }
.pm-bubble .tb-code { font-family: ui-monospace, monospace; font-size: 12px; }
.pm-bubble .tb-done { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.pm-bubble input { width: min(260px, 60vw); height: 32px; padding: 0 10px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--frame); color: var(--text); font: inherit; font-size: 14px; }
.pm-bubble input:focus { outline: none; border-color: var(--accent); }
.pm-link-open { border: 0; background: none; color: var(--teal); font: inherit; font-size: 14px; padding: 0 8px; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="light"] .pm-link-open { color: #6B3FA0; }
.pm-link-open:hover { text-decoration: underline; }
.pm-tablebar .tb { font-size: 13px; }
/* plass til verktøylinja under teksten */
.page-body .pm-mount { padding-bottom: 64px; }
@media (max-width: 860px) {
  .pm-editor { font-size: 16px; }
  .pm-embed-grip { left: auto; right: 58px; top: -10px; }
}
.pm-editor ::selection { background: color-mix(in srgb, var(--accent) 55%, transparent); }

/* --- Toppbilde --- */
.cover { position: relative; margin: -8px -40px 0; height: 240px; overflow: hidden; border-radius: 0 0 22px 22px; background: var(--soft); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-actions { position: absolute; right: 16px; bottom: 12px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.cover:hover .cover-actions, .cover:focus-within .cover-actions { opacity: 1; }
.cover-actions .ghost { background: color-mix(in srgb, var(--frame) 85%, transparent); backdrop-filter: blur(6px); }
.page.has-cover > :first-child .page-icon, .page.has-cover > .page-icon, .page.has-cover .doc-top .page-icon { margin-top: -48px; position: relative; }
.cover-row { display: flex; justify-content: flex-end; margin-bottom: -28px; }
.doc-top-r { display: flex; gap: 6px; align-items: center; }
@media (hover: none) { .cover-actions { opacity: 1; } }
@media (max-width: 860px) { .cover { margin: -4px -16px 0; height: 160px; border-radius: 0 0 14px 14px; } }

/* --- Galleri --- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.gal-card {
  display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: 22px; background: var(--soft);
  color: var(--strong); text-decoration: none !important; border: 1px solid var(--border); transition: transform .15s, border-color .15s;
}
.gal-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.gal-cover { display: block; aspect-ratio: 16 / 9; background: var(--rail); overflow: hidden; }
.gal-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-cover.none { display: grid; place-items: center; font-size: 40px; }
.gal-ph .ico, .gal-ph svg { width: 44px; height: 44px; opacity: .6; }
.gal-foot { display: grid; gap: 6px; padding: 12px 16px 14px; }
.gal-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; line-height: 1.3; }
.gal-ic { display: inline-grid; place-items: center; width: 22px; flex: none; }
.gal-vals { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.gal-new { place-items: center; grid-template-rows: none; min-height: 120px; gap: 6px; display: flex; justify-content: center; align-items: center;
  color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; border-style: dashed; background: none; }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; } .gal-title { font-size: 14px; } }

/* Grupper i sidemenyen som kan lukkes */
.side-fold {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px 2px 2px; margin-left: -4px; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.side-fold:hover { color: var(--strong); background: var(--side-hover, var(--frame)); }
.side-fold .fold-ic { width: 13px; height: 13px; transition: transform .15s; }
.side-group.folded .side-fold .fold-ic { transform: rotate(-90deg); }
.embed-board { margin-top: 6px; }
.embed-cal { margin-top: 6px; }
@media (max-width: 860px) { .embed-board { margin: 6px 0 0; padding: 2px 0 12px; } }
/* På PC ligger knappene for innebygde blokker i venstre marg, så de ikke dekker «+ Ny» */
@media (hover: hover) and (min-width: 861px) {
  .pm-embed-edit { right: auto; left: -34px; top: 36px; }
  .pm-embed-x { right: auto; left: -34px; top: 68px; }
}

/* Herah-logoen øverst i sidemenyen (fra Drodle-notatboken: «Herah titter over sida») */
.workspace.herah { gap: 12px; text-decoration: none; color: var(--strong); border-radius: 14px; }
.workspace.herah:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Logoen som bilde: lys strek i mørkt tema, mørk strek i lyst tema */
.herah-logo { display: block; height: 34px; width: auto; }
.herah-logo.for-light { display: none; }
:root[data-theme="light"] .herah-logo.for-dark { display: none; }
:root[data-theme="light"] .herah-logo.for-light { display: block; }

/* Sidebredde per side og samling: smal, bred eller full */
.page.w-narrow { max-width: 920px; }
.page.w-wide { max-width: 1240px; }
.page.w-full { max-width: none; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--soft); }
.seg-btn { min-height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.seg-btn:hover { color: var(--strong); }
.seg-btn.on { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.pop-edit .width-pick { justify-self: start; }

/* Favoritter: stjerne på postsiden */
.record-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.fav-btn.on { color: var(--orange); }

/* Toppbilde: flytt utsnittet ved å dra */
.cover.moving { cursor: grab; touch-action: none; user-select: none; }
.cover.moving:active { cursor: grabbing; }
.cover.moving img { pointer-events: none; }
.cover-actions-on { opacity: 1 !important; }
.cover-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 12px; pointer-events: none;
  background: color-mix(in srgb, var(--frame) 80%, transparent); backdrop-filter: blur(6px); color: var(--strong); font-size: 14px; font-weight: 600; }

/* Kalender: uke for uke, med perioder som stolper over dagene (som i Notion) */
.cal-weeks { display: grid; gap: 6px; }
.cal-wds { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 6px; row-gap: 3px; min-height: 118px; }
.cal-week > .cal-day { min-height: 0; }
.cal-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; min-width: 0; height: 24px; margin: 0 4px; padding: 0 8px;
  border-radius: 8px; font-size: 13px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; overflow: hidden; cursor: pointer; }
.cal-bar[draggable="true"] { cursor: grab; }
.cal-bar:hover { filter: brightness(1.12); }
.cal-bar.cont-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.cont-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar.done { opacity: .6; }
.cal-bar.dragging { opacity: .45; }
.cal-bar .cal-time { color: inherit; opacity: .75; }
.cal-week > .cal-more { position: relative; z-index: 1; justify-self: start; align-self: center; margin-left: 4px; }
.fav-btn { min-width: 36px; justify-content: center; font-size: 18px; line-height: 1; }
.fav-btn.on { color: var(--orange); }

/* Bokmerker (::bokmerke): kort med bilde til venstre, ikon, tittel, beskrivelse og adresse (som i Notion) */
.md-bookmark { display: flex; align-items: stretch; min-height: 108px; margin: 10px 0; overflow: hidden; border: 1px solid var(--line);
  border-radius: 14px; background: var(--rail); color: var(--text); text-decoration: none !important; transition: background .15s; }
.md a.md-bookmark { color: var(--text); text-decoration: none; }
.md-bookmark:hover { background: var(--soft); }
.md-bookmark:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bm-media { flex: 0 0 34%; max-width: 260px; position: relative; overflow: hidden; background: var(--soft); }
.md-bookmark:not(.has-media) .bm-media { display: none; }
.bm-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.bm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; justify-content: center; padding: 14px 18px; }
.bm-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bm-icon:empty { display: none; }
.bm-icon img { width: 20px; height: 20px; border-radius: 5px; display: block; object-fit: contain; }
.bm-title { font-weight: 600; font-size: 15px; color: var(--strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-desc { font-size: 13.5px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bm-desc:empty { display: none; }
.bm-url { font-size: 12.5px; color: var(--faint, var(--muted)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.md-bookmark.loading .bm-title::after { content: " …"; color: var(--muted); }
.pm-embed > .md-bookmark { margin: 0; }
@media (max-width: 860px) {
  .md-bookmark { min-height: 92px; }
  .bm-media { flex-basis: 30%; }
  .bm-text { padding: 12px 14px; }
}

/* Kolonnebredde: dra i høyre kant av kolonneoverskriften (dobbeltklikk = standard) */
.grid th { position: relative; }
.grid th .th-btn { overflow: hidden; text-overflow: ellipsis; }
.col-resize { position: absolute; top: 0; right: -4px; bottom: 0; z-index: 2; width: 9px; cursor: col-resize; touch-action: none; }
.col-resize::after { content: ""; position: absolute; top: 6px; bottom: 6px; left: 3px; width: 3px; border-radius: 3px; background: var(--accent); opacity: 0; transition: opacity .12s; }
.grid th:hover .col-resize::after, .grid th.resizing .col-resize::after { opacity: .9; }
.grid th.resizing { cursor: col-resize; }
/* Bokmerke uten bilde: logoen (eller forbokstaven) sentrert i bildefeltet */
.bm-media.bm-media-logo { display: grid; place-items: center; background: var(--soft); }
.bm-media.bm-media-logo img { position: static; width: 64px; height: 64px; object-fit: contain; border-radius: 14px; }
.bm-letter { font-size: 44px; font-weight: 700; color: var(--strong); opacity: .85; }

/* Delte sider (/s/…): sti til undersider og toppbilde */
.share-crumbs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.share-crumbs a { color: var(--muted); }
.share-crumbs a:hover { color: var(--strong); }
.share-page .share-cover { margin: -32px -24px 0; }
.share-page .share-md .md-page-link { margin: 6px 0; }
@media (max-width: 860px) { .share-page .share-cover { margin: -32px -24px 0; } }
/* Herah-symbolet nederst på delte sider: lys versjon i mørkt tema, mørk versjon i lyst */
.herah-symbol { display: block; height: 26px; width: auto; }
.herah-symbol.for-light { display: none; }
:root[data-theme="light"] .herah-symbol.for-dark { display: none; }
:root[data-theme="light"] .herah-symbol.for-light { display: block; }

/* Favorittkort: farge fra ikonet (blekk = mørk flis), eller toppbildet med toning så teksten kan leses */
.k-ink { --k: #2E2A44; --k-ink: #FFFFFF; --k-glow: 0 16px 40px rgba(15, 13, 24, 0.5); }
:root[data-theme="light"] .k-ink { --k: #1E1B2E; --k-glow: 0 12px 28px rgba(30, 27, 46, 0.25); }
.fav-card.k-purple .fav-name, .fav-card.k-ink .fav-name { text-shadow: 0 1px 2px rgba(15, 13, 24, 0.25); }
.fav-card { position: relative; overflow: hidden; isolation: isolate; }
.fav-card.has-cover { --k-ink: #FFFFFF; background: var(--ink); }
.fav-card.has-cover::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(15, 13, 24, 0.15) 0%, rgba(15, 13, 24, 0.35) 45%, rgba(15, 13, 24, 0.82) 100%); }
.fav-cover { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.fav-card.has-cover .fav-name, .fav-card.has-cover .fav-meta { color: #FFFFFF; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
.fav-card.has-cover .fav-icon { background: rgba(15, 13, 24, 0.55); backdrop-filter: blur(6px); color: #FFFFFF; }

/* Tavle (som i Notion): kolonnen tones i valgets farge, kortene har ikon og vanlig skrift */
.board-col.tinted { background: color-mix(in srgb, var(--tint) 55%, var(--rail)); }
.board-col.tinted .linked-count { background: none; color: var(--tint-fg); opacity: .8; font-weight: 600; }
.board-col.tinted .board-card { background: color-mix(in srgb, var(--tint) 75%, var(--rail)); box-shadow: none; }
.board-col.tinted .board-card:hover { background: color-mix(in srgb, var(--tint) 100%, var(--rail)); }
.board-col.tinted .board-add, .board-col.tinted .board-head-add { color: var(--tint-fg); }
.board-col-head .linked-count { margin-right: auto; }
.board-head-add { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.board-head-add:hover { background: color-mix(in srgb, var(--strong) 10%, transparent); }
.card-top { align-items: center; gap: 10px; }
.card-icon { flex: none; display: grid; place-items: center; width: 22px; font-size: 17px; opacity: .85; }
.card-icon .ico-tile { font-size: 18px; }
.board-card .card-title { font-weight: 500; font-size: 15.5px; }
.board-card .card-move { width: 26px; height: 26px; font-size: 13px; opacity: .45; }

@media (max-width: 860px) {
  /* sveipingen stopper ved hver kolonne, og neste kolonne synes i kanten */
  .board { scroll-snap-type: x mandatory; }
  .board-col { flex-basis: 84vw; }
  .board-card { padding: 13px 14px; }
  .board-card .card-title { font-size: 16px; }
  /* verktøylinja: én rad – søk som ikon, «Del» bare ikon, antall skjult */
  .toolbar { flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 10px 0 14px; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: none; }
  .toolbar .toolbar-search { display: none; }
  .toolbar.searching { flex-wrap: wrap; }
  .toolbar.searching .toolbar-search { display: block; order: -1; flex: 1 0 100%; max-width: none; }
  .toolbar .toolbar-sort { max-width: 28vw; }
  .toolbar .toolbar-new { margin-left: auto; }
  .toolbar .toolbar-new > .primary:first-child { min-width: 38px; padding: 0 10px; justify-content: center; }
  .toolbar .split-more { padding: 0 7px; }
  .toolbar .toolbar-new .btn-label { display: none; }
  .filter-hint { display: none; }
  .toolbar > .muted.small-text { display: none; }
  .toolbar .share-btn .btn-label { display: none; }
  .toolbar .share-btn, .toolbar-search-btn { min-width: 40px; padding: 0 10px; justify-content: center; }
}
@media (min-width: 861px) { .toolbar-search-btn { display: none !important; } }

/* Innebygde samlinger i sider: titler er ikke tekstlenker (ingen understrek/lenkefarge) */
.md .embed-head h3 a, [data-theme="light"] .md .embed-head h3 a,
.md .board-card .card-title, [data-theme="light"] .md .board-card .card-title { color: var(--strong); text-decoration: none; }
.md .embed-head h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* på mobil ligger knappene (⋮⋮ ⚙ ×) på en egen rad over blokken, så tittelen får hele bredden */
@media (hover: none), (max-width: 860px) {
  .pm-embed { padding-top: 32px; }
  .pm-embed-x, .pm-embed-edit, .pm-embed-grip { top: 0; }
  .pm-embed-x { right: 0; }
  .pm-embed-edit { right: 32px; }
  .pm-embed-grip { right: 64px; }
}
/* tavle inne i en side: kolonnene følger bredden på blokken (innrykk i veksler), ikke skjermen */
@media (max-width: 860px) {
  .embed-board { scroll-padding: 0; gap: 8px; }
  .embed-board .board-col { flex-basis: calc(100% - 18px); padding: 10px; }
}
.embed-groups { display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; }
.embed-groups .check-row { padding: 4px 2px; }

/* Mobilkalender (som i Notion): liten månedsrute med prikker, valgt dag listes under */
.cal-mini { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 6px -4px 0; touch-action: pan-y; }
.cal-mini-wd { padding: 4px 0 8px; text-align: center; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal-mini-day { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 58px; padding: 8px 0 6px; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: var(--text); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cal-mini-day.other { color: var(--faint); }
.cal-mini-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 16px; font-variant-numeric: tabular-nums; }
.cal-mini-day.today .cal-mini-num { color: var(--orange); font-weight: 700; }
.cal-mini-day.sel .cal-mini-num { background: var(--soft); color: var(--strong); font-weight: 600; }
.cal-mini-day.today.sel .cal-mini-num { background: var(--orange); color: var(--ink); }
.cal-mini-dots { display: flex; gap: 3px; height: 6px; }
.cal-mini-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.cal-mini-dot[class*="c-"] { background: currentColor; }
.cal-mini-day.other .cal-mini-dot { opacity: .5; }
.cal-mlist { display: grid; gap: 8px; margin-top: 16px; }
.cal-mlist-day { margin: 0 0 2px; font-size: 15px; font-weight: 600; color: var(--muted); }
.cal-mlist-day::first-letter { text-transform: uppercase; }
.cal-mlist-day.today { color: var(--orange); }
.cal-mlist .cal-card { padding: 12px 14px; font-size: 15px; border-radius: 14px; }
.cal-mlist .cal-card-title { white-space: normal; }
.cal-mlist-empty { margin: 0; padding: 4px 0; }
.cal-madd { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; }
.cal-madd:hover { color: var(--strong); background: var(--soft); }

/* Mobil: postsiden går helt ut til kanten – felt og notater er ikke egne kort */
@media (max-width: 860px) {
  .props { margin: 14px 0 20px; padding: 6px 0; border-radius: 0; background: none; border-block: 1px solid var(--border); }
  .page-body:not(.doc-body) { padding: 0; border-radius: 0; background: none; }
}
@media (max-width: 860px) {
  /* «november 2026» til venstre, ‹ I dag › til høyre (som i Notion) */
  .cal-head { gap: 2px; }
  .cal-head > .cal-title { order: 0; flex: 1; margin: 0; text-align: left; font-size: 18px; }
  .cal-head > :nth-child(1) { order: 1; }
  .cal-head > :nth-child(4) { order: 2; }
  .cal-head > :nth-child(3) { order: 3; }
  .cal-head > .grow { order: 4; }
  .cal-head > * { order: 5; }
  .cal-head > :nth-child(1), .cal-head > :nth-child(3), .cal-head > :nth-child(4) { border-color: transparent; background: none; min-width: 36px; font-size: 18px; }
  .cal-head > :nth-child(4) { font-size: 15px; }
}
:root[data-theme="light"] .cal-mlist .cal-card { background: var(--rail); }

/* Oppgavekortet på forsiden */
.dash-card .chk-new { margin: 4px 0 6px; background: rgba(0, 0, 0, 0.2); }
:root[data-theme="light"] .dash-card .chk-new { background: #FFFFFF; }
.dash-card .chk-item { padding: 6px 8px; }
a.ghost.small.dash-pick { display: inline-flex; align-items: center; text-decoration: none; }
.dash-tasks-more { font-size: 13px; }
.dash-card .rail-empty, .dash > .rail-empty { color: var(--muted); }

/* Jobb-kortet: skole og kino side om side (under hverandre på mobil) */
.dash-card.dash-jobs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0; }
.dash-job { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; min-width: 0; }
.dash-job + .dash-job { border-left: 1px solid rgba(255, 255, 255, 0.18); }
.dash-job .dash-label { padding-right: 44px; }
.dash-job .dash-refresh { top: 14px; right: 14px; }
.dash-card.dash-jobs .dash-label { padding-right: 44px; }
.dash-note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (max-width: 700px) {
  .dash-card.dash-jobs { grid-template-columns: minmax(0, 1fr); }
  .dash-job + .dash-job { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.18); }
}
/* «Fra Teams» i oppgavekortet */
.dash-teams { margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(127, 127, 127, 0.22); display: flex; flex-direction: column; gap: 4px; }
.dash-teams-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dash-teams-h .late { color: var(--orange); }
.dash-teams-all { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; white-space: nowrap; }
.dash-teams-all:hover { color: var(--text); }

/* Været henger fra toppen av forsiden og svaier; klikk gir timevarsel */
.wx-hang { position: relative; z-index: 30; flex: none; margin: -40px 0 -12px; display: flex; flex-direction: column; align-items: center; }
/* PC: hilsen | skyen i midten (kan stikke litt ut i mellomrommene) | knappene */
@media (min-width: 701px) {
  .home-head:has(.wx-hang:not([hidden])) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
  .home-head .wx-hang { min-width: 0; }
}
.wx-hang[hidden] { display: none; }
.wx-swing { transform-origin: 50% 0; animation: wx-sway 6s ease-in-out infinite; }
.wx-hang.open .wx-swing { animation: none; }
@keyframes wx-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .wx-swing { animation: none; } }
.wx-btn { display: flex; flex-direction: column; align-items: center; padding: 0; margin: 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; border-radius: 16px; }
.wx-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.wx-btn svg { width: 110px; height: 117px; display: block; }
.wx-thread { stroke: var(--muted); }
.wx-body { fill: var(--bg); stroke: var(--teal); transition: fill .2s; }
.wx-line { stroke: var(--teal); }
.wx-sun { fill: var(--bg); stroke: var(--orange); }
.wx-clear-day .wx-body { stroke: var(--orange); }
.wx-clear-day .wx-line { stroke: var(--orange); }
.wx-temp { fill: var(--text); font-family: inherit; }
.wx-hang.open .wx-body { fill: var(--teal); }
.wx-hang.open.wx-clear-day .wx-body { fill: var(--orange); }
.wx-hang.open .wx-temp { fill: var(--ink); }
.wx-cap { margin-top: -6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.wx-warn { color: var(--orange); }
.wx-btn:hover .wx-cap { color: var(--text); }
.wx-panel { position: absolute; top: 134px; left: 50%; transform: translateX(-50%); width: 340px; box-sizing: border-box; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 14px; background: var(--teal); color: var(--ink); border-radius: 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); }
.wx-panel[hidden] { display: none; }
.wx-panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; }
.wx-credit { font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .8; }
.wx-hours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.wx-hour { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; border-radius: 14px; }
.wx-hour.now { background: rgba(255, 255, 255, 0.45); }
.wx-h { font-size: 13px; font-weight: 600; }
.wx-hour b { font-size: 17px; }
.wx-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wx-tags .badge { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: var(--orange); font-size: 12px; }
.wx-advice { margin: 0; font-size: 14px; line-height: 1.4; }
@media (max-width: 700px) {
  .home-head > div:first-child { flex: 1 1 0; min-width: 0; }
  .wx-hang { margin: -26px 0 -8px; }
  .home-actions { flex-basis: 100%; }
  .wx-btn svg { width: 92px; height: 98px; }
  .wx-cap { font-size: 11px; }
  .wx-panel { top: 112px; left: auto; right: -4px; transform: none; width: min(340px, calc(100vw - 32px)); }
}
.wx-morning { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.wx-morning b { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
svg.ic.wx-micon { width: 30px; height: 30px; }
.wx-hours-h { font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; opacity: .75; margin-bottom: -6px; }
/* Oppgaver til venstre over to rader, Frister og Pågående under hverandre til høyre */
.dash { grid-auto-flow: row dense; }
.dash-card.dash-tasks:has(~ .dash-progress) { grid-row: span 2; }
.dash-card.dash-deadlines, .dash-card.dash-progress { grid-column: 2; }
@media (max-width: 700px) {
  .dash-card.dash-tasks:has(~ .dash-progress) { grid-row: auto; }
  .dash-card.dash-deadlines, .dash-card.dash-progress { grid-column: auto; }
}

/* Hilsenen over begge kolonnene, så Kommende starter på linje med første kort */
.home > .home-head { grid-column: 1 / -1; }
.home { row-gap: 28px; }
.home-main > .dash:first-child { margin-top: 0; }

/* Dagens oversikt (KI) */
.dash-card.dash-brief { grid-column: 1 / -1; }
.dash-brief-text { font-size: 15px; line-height: 1.5; }
.dash-brief-text .md-root > :first-child { margin-top: 0; }
.dash-brief-text .md-root > :last-child { margin-bottom: 0; }
.dash-brief-text ul { margin: 0; padding-left: 20px; }
.dash-card.dash-brief .dash-refresh { background: rgba(127, 127, 127, 0.15); }

/* Ukens dyd under hilsenen */
.home > .virtue { grid-column: 1 / -1; margin: -14px 0 -6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 16px; font-style: italic; color: var(--text); }
.virtue-word { position: relative; font-weight: 600; color: var(--teal); cursor: help; border-bottom: 1px dotted currentColor; outline: none; }
:root[data-theme="light"] .virtue-word { color: #2F7A82; }
.virtue-word:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.virtue-tip { position: absolute; z-index: 40; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: min(320px, 80vw); box-sizing: border-box;
  padding: 14px 16px; display: none; flex-direction: column; gap: 6px; background: var(--teal); color: var(--ink); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); font-style: normal; font-weight: 400; font-size: 14px; line-height: 1.45; cursor: auto; }
.virtue-tip::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; } /* bro, så hover ikke slipper */
.virtue-tip b { font-size: 15px; font-weight: 700; color: var(--ink); }
.virtue-tip a { color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.virtue-word:hover .virtue-tip, .virtue-word:focus .virtue-tip, .virtue-word:focus-within .virtue-tip { display: flex; }
@media (max-width: 700px) {
  .home > .virtue { position: relative; }
  .virtue-word { position: static; }
  .virtue-tip { top: 100%; left: 0; right: 0; width: auto; transform: none; margin-top: 8px; }
}
.virtue-label { font-style: normal; font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }

/* Undersider i en post */
.rec-pages { margin: 18px 0 8px; }
.rec-pages-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rec-pages-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.rec-pages-list { display: grid; gap: 2px; }
.rec-page { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--strong); font-weight: 500; }
.rec-page:hover { background: var(--soft); }
.rec-page-ic { flex: none; display: grid; place-items: center; width: 22px; font-size: 18px; }
.rec-page-ic .ico-tile { font-size: 18px; }
.rec-pages-empty { margin: 0; }

/* Klassekart i Apper: aktive kart med utløp (selve appen ligger på klassekart.frodewerner.no) */
.kk-open { margin: 0 0 24px; }
.kk-list { display: grid; gap: 10px; max-width: 640px; }
.kk-row { display: grid; gap: 4px; padding: 14px 18px; border-radius: 18px; background: var(--card); border-left: 4px solid var(--teal, #8CCBD1); }
.kk-row.soon { border-left-color: var(--orange, #F08A4B); }
.kk-row b { font-size: 16px; }

/* Fokus (#/fokus): Dagens 3, ring og oppgaveliste */
.fokus { max-width: 760px; }
.fokus-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.fokus-head .page-title { margin-bottom: 2px; }
.fokus-ring { position: relative; flex: none; width: 84px; height: 84px; }
.fokus-ring-svg { width: 100%; height: 100%; display: block; }
.fokus-ring-bg { fill: none; stroke: var(--soft); stroke-width: 7; }
.fokus-ring-fg { fill: none; stroke: var(--teal); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
:root[data-theme="light"] .fokus-ring-fg { stroke: var(--purple); }
.fokus-ring-n { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.fokus-ring-n b { font-size: 24px; font-weight: 600; color: var(--strong); }
.fokus-ring-n small { font-size: 11px; color: var(--muted); }
.fokus-sec { margin-top: 22px; }
.fokus-sec .section-title { margin-bottom: 8px; }
.fokus-sec > .ghost.small { margin-top: 12px; }
.fokus-slots { gap: 8px; }
.fokus-item { align-items: flex-start; }
.fokus-item.slot { background: var(--soft); padding: 14px 14px; margin: 0; border-radius: 18px; }
.fokus-item.slot:hover { background: var(--soft); }
.fokus-open { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; }
.fokus-plan { font-size: 13px; color: var(--teal); overflow-wrap: anywhere; }
:root[data-theme="light"] .fokus-plan { color: var(--purple); }
.fokus-link { flex: none; align-self: center; color: var(--faint); padding: 4px 6px; border-radius: 8px; }
.fokus-link:hover { color: var(--text); background: var(--hover); }
.fokus-star { flex: none; align-self: center; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; color: var(--faint); }
.fokus-star:hover { background: var(--hover); color: var(--accent); }
.fokus-star.on { color: var(--accent); }
.fokus-star.on svg { fill: currentColor; }
.fokus-empty { display: flex; align-items: center; gap: 12px; padding: 16px 14px; border: 1.5px dashed var(--dash); border-radius: 18px; color: var(--faint); font-size: 14px; }
.fokus-empty-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--dash); font-size: 12px; font-weight: 600; }
.fokus-cheer { margin: 10px 0 0; color: var(--teal); font-weight: 500; }
.fokus-inbox { margin-left: 8px; }
.fokus .chk-new { margin: 22px 0 0; }
.fokus-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fokus-rels { display: grid; gap: 8px; }
.fokus-relrow { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 8px; font-size: 14px; }
.fokus-rellabel { color: var(--muted); }
.fokus-relrow .chips { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 520px) {
  .fokus-two { grid-template-columns: 1fr; }
  .fokus-relrow { grid-template-columns: 1fr auto; }
  .fokus-rellabel { grid-column: 1 / -1; }
}
.fokus-msg { max-height: 150px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--muted); background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.fokus-src { font-size: 11px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: var(--faint); }

/* Kreditering på toppbilder fra en bildetjeneste */
.cover-credit { position: absolute; right: 16px; top: 12px; max-width: calc(100% - 32px); padding: 3px 10px; border-radius: 999px;
  background: rgba(15, 13, 24, 0.55); backdrop-filter: blur(6px); color: rgba(255, 255, 255, 0.88); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 860px) { .cover-credit { right: 10px; top: 10px; max-width: calc(100% - 20px); font-size: 11px; } }

/* Finn et gratis bilde */
.img-dialog { max-width: 760px; }
.img-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.img-head h2 { margin: 0; }
.img-search { display: flex; gap: 8px; }
.img-search input { flex: 1; min-width: 0; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 56vh; overflow-y: auto; }
.img-grid:empty { display: none; }
.img-grid { grid-auto-rows: max-content; align-content: start; }
.img-pick { position: relative; display: block; min-height: 0; height: auto; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--soft); cursor: pointer; }
.img-pick img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; transition: transform .2s; }
.img-pick:hover img, .img-pick:focus-visible img { transform: scale(1.04); }
.img-pick:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.img-author { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  color: #fff; font-size: 11px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .15s; }
.img-pick:hover .img-author, .img-pick:focus-visible .img-author { opacity: 1; }
@media (hover: none) { .img-author { opacity: 1; } }
.img-pick:disabled { cursor: wait; opacity: .5; }
.img-pick.img-loading { opacity: 1; outline: 3px solid var(--orange); outline-offset: -3px; }
.img-status, .img-note { margin: 0; }
@media (max-width: 860px) { .img-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pop-menu { display: grid; gap: 2px; }
.img-missing { display: grid; place-content: center; gap: 4px; aspect-ratio: 16 / 10; padding: 8px; color: var(--muted); font-size: 12px; text-align: center; }
.img-missing small { font-size: 11px; opacity: .8; overflow-wrap: anywhere; }

/* Feltene på postsiden som en veksel: «Felt ▾» lukker hele lista */
.props-head { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 4px 8px 4px 4px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .02em; cursor: pointer; }
.props-head:hover { background: var(--soft); color: var(--strong); }
.props-head .fold-ic { width: 14px; height: 14px; transition: transform .15s; }
.props.folded .props-head .fold-ic { transform: rotate(-90deg); }
.props-count { font-weight: 500; opacity: .7; }
.props-body { display: grid; gap: 4px; }
.props.folded .props-body { display: none; }
.props.folded { padding-block: 8px; }

/* Sikkerhet og drift (#/sikkerhet) */
.sec-grid { display: grid; gap: 18px; max-width: 760px; }
.sec-card { padding: 22px 24px; border-radius: 22px; background: var(--card); }
.sec-card h2 { margin: 0 0 10px; font-size: 18px; }
.sec-card .muted { margin: 0 0 14px; }
.sec-row { display: flex; gap: 10px; align-items: center; }
.sec-row.wrap { flex-wrap: wrap; }
.sec-on { color: var(--teal); font-weight: 600; }
.sec-setup ol { padding-left: 20px; margin: 0 0 14px; line-height: 1.6; }
.sec-secret { font-size: 14px; letter-spacing: .04em; word-break: break-all; }
.sec-qr { display: block; width: 200px; height: 200px; margin: 0 0 16px; border-radius: 14px; }
.sec-code-in { max-width: 180px; font-size: 18px; letter-spacing: .15em; text-align: center; }
.sec-codes { margin-top: 16px; padding: 16px 18px; border-radius: 14px; background: var(--rail); }
.sec-codes ol { columns: 2; padding-left: 22px; margin: 10px 0 14px; }
.sec-codes code { font-size: 15px; letter-spacing: .05em; }
.sec-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.sec-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--rail); }
.sec-list li.fail { outline: 1.5px solid var(--error); }
.sec-list .badge { margin-left: 8px; }
.login-totp { display: grid; gap: 10px; }
.dash-drift { border-left: 4px solid var(--orange); }
.dash-drift-list { margin: 4px 0 10px; padding-left: 18px; }
.dash-more { font-size: 14px; color: var(--muted); }
.login-card .login-totp label.check { display: flex; align-items: center; gap: 10px; }
.login-card .login-totp label.check input { width: 18px; height: 18px; margin: 0; flex: none; }
.login-totp .small-text { margin: 0; font-size: 13px; }

/* Papirkurv (#/papirkurv) */
.trash-top { display: flex; justify-content: flex-end; max-width: 760px; margin: -12px 0 8px; }
.trash { display: grid; gap: 22px; max-width: 760px; }
.trash-group { display: grid; gap: 8px; }
.trash-group .section-title { margin: 0 0 4px; }
.trash-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 18px; background: var(--card); }
.trash-icon { font-size: 20px; display: grid; place-items: center; }
.trash-text { display: grid; gap: 2px; min-width: 0; }
.trash-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .trash-row { grid-template-columns: 28px 1fr; } .trash-actions { grid-column: 1 / -1; justify-content: flex-start; } }

/* Versjonshistorikk (dialog) */
.dialog:has(.hist) { max-width: 920px; }
.hist { display: grid; grid-template-columns: 240px 1fr; gap: 16px; min-height: 320px; max-height: 62vh; }
.hist-list { display: grid; gap: 6px; align-content: start; overflow-y: auto; padding-right: 4px; }
.hist-list button { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--frame); color: var(--text); }
.hist-list button span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-list button.on { outline: 2px solid var(--accent); }
.hist-view { overflow-y: auto; padding: 4px 8px; border-radius: 14px; background: var(--frame); }
.hist-view h3 { margin: 10px 0 2px; }
.hist-md { margin-top: 10px; }
@media (max-width: 700px) { .hist { grid-template-columns: 1fr; max-height: none; } .hist-list { max-height: 30vh; } }
.sec-checks { display: grid; gap: 8px; margin: 4px 0 16px; }
.sec-howto ol { padding-left: 20px; margin: 8px 0 0; line-height: 1.6; }
