:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #18212f;
  --ink-2: #3b4658;
  --muted: #6a7486;
  --line: #e3e7ee;
  --line-2: #d3d9e3;
  --brand: #17375e;
  --brand-2: #2453c7;
  --focus: #2453c7;

  --c-inr: #0b6e8f;  --c-inr-bg: #e2f2f7;
  --c-res: #2453c7;  --c-res-bg: #e9effc;
  --c-proc: #b02a78; --c-proc-bg: #fbe8f2;
  --c-del: #7445c0;  --c-del-bg: #f0eafb;
  --c-ind: #b86400;  --c-ind-bg: #fdf1e1;
  --c-akt: #23803a;  --c-akt-bg: #e6f4e9;
  --c-dakt: #4a7f24; --c-dakt-bg: #eef5e6;
  --c-proj: #17375e; --c-proj-bg: #e6ecf4;
  --c-pakt: #9b30b8; --c-pakt-bg: #f6e9fa;

  --good: #1f9a55; --good-bg: #e3f5ea;
  --warn: #e3a008; --warn-bg: #fdf4dc;
  --bad: #d4483f;  --bad-bg: #fbe8e6;
  --none: #c9ced8; --none-bg: #eef0f4;
  --info: #2453c7;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .05), 0 2px 8px rgba(20, 30, 50, .04);
  --shadow-lg: 0 20px 50px rgba(15, 25, 45, .22);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.only-mobile { display: none !important; }

/* Typfärger */
.t-inriktningsmal { --tc: var(--c-inr); --tbg: var(--c-inr-bg); }
.t-resultatmal { --tc: var(--c-res); --tbg: var(--c-res-bg); }
.t-processmal { --tc: var(--c-proc); --tbg: var(--c-proc-bg); }
.t-delmal { --tc: var(--c-del); --tbg: var(--c-del-bg); }
.t-indikator { --tc: var(--c-ind); --tbg: var(--c-ind-bg); }
.t-aktivitet { --tc: var(--c-akt); --tbg: var(--c-akt-bg); }
.t-delaktivitet { --tc: var(--c-dakt); --tbg: var(--c-dakt-bg); }
.t-projekt { --tc: var(--c-proj); --tbg: var(--c-proj-bg); }
.t-procakt { --tc: var(--c-pakt); --tbg: var(--c-pakt-bg); }
.act.t-procakt { border-left: 4px solid var(--c-pakt); }
.ticon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--tbg, var(--c-proj-bg)); color: var(--tc, var(--brand)); flex: none; }
.ticon .ic { width: 20px; height: 20px; }
.ticon.sm { width: 28px; height: 28px; border-radius: 8px; }
.ticon.sm .ic { width: 16px; height: 16px; }
.ticon.xs { width: 22px; height: 22px; border-radius: 6px; }
.ticon.xs .ic { width: 14px; height: 14px; }

/* Toppfält */
.topbar { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 20px; padding: 0 20px; background: var(--brand); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; }
.brand .logo svg { width: 22px; height: 22px; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 12px; opacity: .7; }
.mainnav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.navtab { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: rgba(255, 255, 255, .78); padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 14.5px; }
.navtab:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.navtab.on { background: #fff; color: var(--brand); }
.top-right { display: flex; align-items: center; gap: 8px; min-width: 210px; justify-content: flex-end; }
.year-sel { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .12); border-radius: 10px; padding: 0 10px; height: 38px; }
.year-sel select { background: transparent; border: 0; color: #fff; font-weight: 700; font-size: 15px; padding: 6px 2px; cursor: pointer; }
.year-sel select option { color: var(--ink); }
.topbar .icon-btn { color: #fff; }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.menu-wrap { position: relative; }
.menu { display: none; position: absolute; right: 0; top: 44px; background: var(--surface); color: var(--ink); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; }
.menu-wrap.open .menu { display: block; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; }
.menu button:hover { background: var(--surface-2); }
.menu .danger { color: var(--bad); }

/* Layout */
.layout { display: grid; grid-template-columns: 104px 1fr; height: calc(100vh - 60px); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 10px; }
.main { overflow-y: auto; }
.page { max-width: 1080px; margin: 0 auto; padding: 24px 28px 80px; }

/* Sidomeny */
.seg-switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-switch button { border: 0; background: none; padding: 7px; border-radius: 8px; font-weight: 600; color: var(--muted); font-size: 14px; }
.seg-switch button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.side-hint { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 12px 4px 8px; }
.side-hint .ic { width: 15px; height: 15px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 13px; padding-left: 8px; border-left: 1px solid var(--line); }
.tnode { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 2px; border-radius: 8px; cursor: pointer; font-size: 13.8px; color: var(--ink-2); }
.tnode:hover { background: var(--surface-2); }
.tnode.on { background: var(--c-res-bg); color: var(--c-res); font-weight: 650; }
.tname { flex: 1; min-width: 0; }
.tcaret { border: 0; background: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); padding: 0; flex: none; }
.tcaret:hover { background: var(--line); }
.tcaret .ic { width: 14px; height: 14px; transition: transform .15s; }
.tcaret.open .ic { transform: rotate(90deg); }
.tcaret-sp { width: 22px; flex: none; }
.tcount { font-size: 11.5px; font-weight: 700; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); border-radius: 20px; padding: 0 7px; line-height: 18px; }
.tnode.on .tcount { border-color: transparent; background: var(--c-res); color: #fff; }
.legend { margin-top: 22px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.legend-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; color: var(--ink-2); }

/* Knappar */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { border-color: #b9c1ce; background: var(--surface-2); }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.primary:hover { background: #1d45a8; }
.btn.big { padding: 11px 18px; font-size: 15px; }
.btn.tiny { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.tiny .ic { width: 15px; height: 15px; }
.icon-btn { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--muted); padding: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }

/* Sidhuvud */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-bottom: 10px; }
.crumb { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 3px 6px; border-radius: 6px; }
.crumb:hover { background: var(--surface); color: var(--ink); }
.crumb.on { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--line-2); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-2); }
h1 { margin: 4px 0 0; font-size: 28px; letter-spacing: -.02em; line-height: 1.15; }
.lead { color: var(--ink-2); max-width: 680px; margin: 8px 0 10px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sec { margin-top: 28px; }
.sec-head { margin-bottom: 12px; }
.sec-head h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0; }
.sec-head h2 .ic { color: var(--muted); }
.sec-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 720px; }

/* Kom igång */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.step { display: flex; gap: 12px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 14px; font-size: 13.5px; color: var(--muted); }
.step > span { width: 28px; height: 28px; border-radius: 50%; background: var(--c-res-bg); color: var(--c-res); font-weight: 800; display: grid; place-items: center; flex: none; }
.step b { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 2px; }
.empty { text-align: center; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 36px 20px; color: var(--muted); }
.empty > .ic { width: 36px; height: 36px; color: var(--line-2); }
.empty p { margin: 8px 0 14px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.3px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px 2px 7px; max-width: 100%; }
.chip .ic { width: 13px; height: 13px; color: var(--muted); }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-inherit { background: var(--c-proj-bg); border-color: transparent; color: var(--brand); font-weight: 600; }
.chip-inherit .ic, .chip-origin .ic { color: inherit; }
.chip-origin { background: #fff6dd; border-color: #f1dd9e; color: #7a5600; font-weight: 600; }
.chip-linked { background: var(--good-bg); border-color: transparent; color: #17703f; font-weight: 600; }
.chip-linked .ic { color: inherit; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; }
.badge .ic { width: 12px; height: 12px; }
.badge.nat { background: #fff4d6; color: #8a5a00; }

/* Länkgrupper */
.link-group { margin-bottom: 18px; }
.link-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px 12px 0 0; border-bottom: 0; font-size: 13.5px; flex-wrap: wrap; }
.link-head .lh-arrow { color: var(--tc); }
.link-head .lh-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.link-head .lh-name { font-weight: 600; flex: 1; min-width: 200px; }
.link-head .lh-org { font-size: 12.5px; color: var(--muted); }
.link-chain { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 6px; font-size: 12.5px; width: 100%; min-width: 0; }
.link-head .link-chain { flex-basis: 100%; margin-top: 2px; }
.link-chain .lc-label, .link-preview .lc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.link-preview .lc-label { display: block; margin-top: 8px; }
.lc-step { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg, #fff); max-width: 100%; min-width: 0; box-sizing: border-box; }
.lc-step .lc-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.lc-step .lc-org { color: var(--muted); white-space: nowrap; flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.lc-step .lc-org::before { content: '· '; }
.lc-sep { display: inline-flex; color: var(--muted); padding-left: 9px; }
.lc-sep svg { width: 12px; height: 12px; transform: rotate(180deg); }
.parent-ref .link-chain { margin-top: 8px; }
.link-head.plain { background: transparent; border: 0; padding: 0 0 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.link-body { border: 1px solid var(--line); border-radius: 0 0 12px 12px; padding: 12px; background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(0, 0, 0, .012) 10px 20px), var(--surface-2); display: grid; gap: 12px; }
.standalone .link-body { border: 0; padding: 0; background: none; }
.standalone .link-head.plain + .link-body { border: 0; }

/* Målkort */
.node { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: var(--radius); box-shadow: var(--shadow); }
.sec > .node, .sec > .inh-wrap { margin-bottom: 12px; }
.node.is-ro { background: linear-gradient(var(--surface), var(--surface)) padding-box; border-style: solid; }
.node-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 12px 8px; }
.collapse { border: 0; background: none; width: 24px; height: 36px; display: grid; place-items: center; color: var(--muted); padding: 0; flex: none; border-radius: 6px; }
.collapse:hover { background: var(--surface-2); }
.collapse .ic { width: 16px; height: 16px; transition: transform .15s; }
.collapse.open .ic { transform: rotate(90deg); }
.node-main { flex: 1; min-width: 0; }
.type-label { font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--tc); }
.node-name { font-size: 16.5px; font-weight: 650; line-height: 1.3; margin-top: 1px; }
.node-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.node-head:hover .node-actions, .act-head:hover .node-actions, .ind-top:hover .node-actions, .node-actions:focus-within { opacity: 1; }
.node-body { padding: 0 16px 16px 42px; display: grid; gap: 12px; }
.sub-goals { display: grid; gap: 10px; position: relative; }
.sub-goals > .node { box-shadow: none; }
.sub-goals .node-name { font-size: 15.5px; }
.assess { display: flex; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13.8px; color: var(--ink-2); }
.assess .ic { color: var(--muted); margin-top: 2px; }
.assess span { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Lägg till-knappar */
.add-bar { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.add-pill { display: inline-flex; align-items: center; gap: 6px; border: 1.5px dashed color-mix(in srgb, var(--tc) 45%, transparent); background: transparent; color: var(--tc); padding: 5px 12px 5px 8px; border-radius: 20px; font-size: 13.3px; font-weight: 650; }
.add-pill > .ic { width: 14px; height: 14px; }
.add-pill .ticon.xs { width: 20px; height: 20px; }
.add-pill:hover { background: var(--tbg); border-style: solid; }
.add-bar.small { padding-top: 0; }

/* Indikatorer */
.ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ind { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ind-top { display: flex; align-items: flex-start; gap: 8px; }
.ind-name { flex: 1; font-weight: 600; font-size: 14px; line-height: 1.3; }
.ind-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.ind-targets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.ind-targets div { background: var(--tbg); border-radius: 8px; padding: 6px 9px; }
.ind-targets span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ind-targets b { font-size: 15px; color: var(--ink); }
.ind.follow { border-top: 3px solid var(--none); }
.ind.follow.lvl-good { border-top-color: var(--good); }
.ind.follow.lvl-warn { border-top-color: var(--warn); }
.ind.follow.lvl-bad { border-top-color: var(--bad); }
.ind.follow .ind-targets div { background: var(--surface-2); padding: 4px 8px; }
.ind.follow .ind-targets b { font-size: 13.5px; }
.ind-gauge { display: flex; align-items: center; gap: 12px; }
.ind-res { min-width: 0; }
.ind-val { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.ind-res-text { font-size: 13px; font-weight: 600; }
.lvl-text-good { color: #17803f; }
.lvl-text-warn { color: #9a6a00; }
.lvl-text-bad { color: var(--bad); }
.lvl-text-none { color: var(--muted); font-weight: 500; }
.ind-input span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.inp-unit { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); overflow: hidden; }
.inp-unit:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(36, 83, 199, .15); }
.inp-unit input, .inp-unit select { flex: 1; border: 0; padding: 8px 10px; background: transparent; min-width: 0; font-weight: 600; outline: none; }
.inp-unit .unit { padding: 0 10px; color: var(--muted); font-size: 13px; background: var(--surface-2); align-self: stretch; display: grid; place-items: center; border-left: 1px solid var(--line); }
.ind-comment { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 13px; background: var(--surface-2); }
.ind-comment:focus { outline: none; border-color: var(--focus); background: var(--surface); }

/* Visare */
.gauge { flex: none; }
.gauge-md { width: 104px; height: 60px; }
.gauge-xs { width: 46px; height: 27px; }
.gauge .z { fill: none; stroke-width: 9; }
.gauge .z-good { stroke: var(--good); }
.gauge .z-warn { stroke: var(--warn); }
.gauge .z-bad { stroke: var(--bad); }
.gauge .z-none { stroke: var(--none-bg); }
.gauge .needle { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.gauge .hub { fill: var(--ink); }
.yn { display: grid; place-items: center; border-radius: 50%; color: #fff; flex: none; }
.yn-md { width: 56px; height: 56px; margin: 2px 24px; }
.yn-md .ic { width: 30px; height: 30px; stroke-width: 2.6; }
.yn-xs { width: 26px; height: 26px; margin: 0 10px; }
.yn-xs .ic { width: 15px; height: 15px; stroke-width: 2.8; }
.lvl-bg-good { background: var(--good); }
.lvl-bg-warn { background: var(--warn); }
.lvl-bg-bad { background: var(--bad); }
.lvl-bg-none { background: var(--none); }
.lvl-bg-info { background: var(--info); }

/* Aktiviteter */
.acts, .subacts { display: grid; gap: 8px; }
.act { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.subacts .act { background: var(--surface-2); }
.act-head { display: flex; align-items: flex-start; gap: 12px; padding: 10px 10px 10px 12px; }
.act-main { flex: 1; min-width: 0; }
.act-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.act-desc { font-size: 13.3px; color: var(--muted); margin-top: 2px; }
.act-body { padding: 0 12px 12px 58px; display: grid; gap: 10px; }
.subacts { margin-top: 2px; }
.ring { position: relative; width: 36px; height: 36px; flex: none; color: var(--tc); }
.ring svg { width: 36px; height: 36px; }
.ring .ring-bg { fill: none; stroke: var(--line); stroke-width: 3; }
.ring > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10.5px; color: var(--ink-2); }
.ring > span b { font-weight: 750; }
.ring > span .ic { width: 15px; height: 15px; stroke-width: 3; }
.ring.st-done > span { color: var(--good); }
.ring.st-notdone > span { color: var(--bad); }
.checklist { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.subacts .checklist { background: var(--surface); }
.cl-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 4px; }
.cl-title span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.checklist ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: 13.8px; padding: 2px 0; }
.checklist li.done span { color: var(--muted); text-decoration: line-through; }
.cbox { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; padding: 0; flex: none; color: #fff; }
.cbox:hover:not(:disabled) { border-color: var(--c-akt); }
.cbox:disabled { cursor: default; }
li.done .cbox { background: var(--c-akt); border-color: var(--c-akt); }
.cbox .ic { width: 13px; height: 13px; stroke-width: 3; }

/* Uppföljning */
.fu-box { display: grid; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.act-fu { background: var(--surface); }
.periods { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-2); background: var(--surface); padding: 3px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.pill:hover { border-color: var(--brand-2); }
.pill.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill.static { cursor: default; }
.pill .ic { width: 13px; height: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.d-good { background: var(--good); }
.d-warn { background: var(--warn); }
.d-bad { background: var(--bad); }
.d-none { background: var(--none); }
.d-info { background: var(--info); }
.pill.on .dot { box-shadow: 0 0 0 2px #fff; }
.fu-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.fu-label .ic { width: 15px; height: 15px; color: var(--muted); }
.saved { margin-left: auto; font-weight: 600; color: var(--good); font-size: 12px; }
.fu-text { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; resize: vertical; background: var(--surface); font-size: 14px; }
.fu-text:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(36, 83, 199, .15); }
.status-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sbtn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.sbtn .ic { width: 17px; height: 17px; stroke-width: 2.6; }
.sbtn.good .ic { color: var(--good); }
.sbtn.bad .ic { color: var(--bad); }
.sbtn.good:hover { border-color: var(--good); }
.sbtn.bad:hover { border-color: var(--bad); }
.sbtn.good.on { background: var(--good); border-color: var(--good); color: #fff; }
.sbtn.bad.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.sbtn.on .ic { color: #fff; }
.underlag { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 10px; }
.u-title { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.u-title .ic { width: 15px; height: 15px; }
.u-inds { display: grid; gap: 6px; }
.u-ind { display: flex; align-items: center; gap: 8px; font-size: 13.3px; }
.u-ind b { display: block; font-weight: 600; }
.u-ind span { color: var(--muted); font-size: 12.5px; }
.u-ind em { font-style: normal; font-weight: 600; }
.u-acts { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.u-acts .ic { width: 16px; height: 16px; color: var(--c-akt); }
.u-texts { display: grid; gap: 8px; }
.u-text { border-left: 3px solid var(--tc); background: var(--surface-2); border-radius: 0 8px 8px 0; padding: 7px 10px; }
.u-text-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); flex-wrap: wrap; }
.u-text-head em { font-style: normal; color: var(--muted); font-weight: 500; }
.u-text p { margin: 4px 0 0; font-size: 13.5px; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.sum-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.sum-top { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; }
.sum-num { font-size: 28px; font-weight: 800; margin: 8px 0 6px; letter-spacing: -.02em; }
.sum-num small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.sbar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--none-bg); }
.sbar i { display: block; }
.sum-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.sum-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* Projekt */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.proj-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.proj-card:hover { border-color: var(--line-2); box-shadow: 0 6px 18px rgba(20, 30, 50, .08); }
.proj-card-top { display: flex; gap: 10px; align-items: center; }
.proj-card-top b { display: block; font-size: 16px; }
.proj-card-top span { font-size: 13px; color: var(--muted); }
.proj-card p { margin: 0; color: var(--ink-2); font-size: 13.8px; }
.proj-prog > div:first-child { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.proj-prog b { color: var(--ink); }
.pbar { position: relative; height: 8px; border-radius: 6px; background: var(--none-bg); margin: 5px 0 6px; }
.pbar i { display: block; height: 100%; border-radius: 6px; background: var(--c-akt); }
.pbar em { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--bad); border-radius: 2px; }
.proj-nums { font-size: 12.5px; color: var(--muted); }
.proj-mini { display: grid; gap: 8px; }
.proj-mini-card { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; }
.proj-mini-card:hover { border-color: var(--line-2); }
.proj-mini-card > .ic:first-child { color: var(--brand); }
.proj-mini-card div { flex: 1; }
.proj-mini-card b { display: block; }
.proj-mini-card span { font-size: 13px; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--brand-2); font-weight: 600; padding: 4px 6px 4px 0; margin-bottom: 8px; }
.participants { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 16px; font-size: 13px; color: var(--muted); }
.participants .chip { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 10px 14px; font-weight: 650; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand-2); border-bottom-color: var(--brand-2); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filter { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.filter select { border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 10px; background: var(--surface); color: var(--ink); font-weight: 600; max-width: 320px; }
.page > .node { margin-bottom: 12px; }

/* Gantt */
.gantt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend i { width: 22px; height: 10px; border-radius: 4px; background: var(--tc); display: inline-block; }
.gantt-legend i.thin { height: 4px; }
.gantt-legend .st-done-sw { background: var(--good); }
.gantt-legend .st-notdone-sw { background: var(--bad); }
.gantt-legend .today-sw { width: 2px; height: 14px; background: var(--bad); }
.gantt-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.gantt { display: grid; }
.g-row { display: grid; grid-template-columns: 290px 1fr; min-height: 40px; border-bottom: 1px solid var(--line); }
.g-row:last-child { border-bottom: 0; }
.g-row.is-goal { background: var(--surface-2); }
.g-label { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 8px; text-align: left; border: 0; border-right: 1px solid var(--line); background: inherit; background-color: var(--surface); padding: 6px 10px; font-size: 13.3px; min-width: 0; }
.g-row.is-goal .g-label { background-color: var(--surface-2); font-weight: 650; }
.g-label:hover .g-name { color: var(--brand-2); }
.g-label.head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); cursor: default; }
.g-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.g-name small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--months)) 100%; }
.g-track.months { display: grid; grid-template-columns: repeat(var(--months), 1fr); background: none; }
.g-month { font-size: 11.5px; color: var(--muted); padding: 6px 6px; border-left: 1px solid var(--line); text-transform: capitalize; display: flex; flex-direction: column; justify-content: flex-end; }
.g-month b { color: var(--ink); font-size: 12px; }
.g-head { position: sticky; top: 0; z-index: 3; background: var(--surface); }
.g-bar { position: absolute; top: 9px; height: 22px; border-radius: 6px; border: 0; padding: 0; background: color-mix(in srgb, var(--tc) 35%, white); overflow: hidden; display: flex; align-items: center; }
.g-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--tc); }
.g-bar span { position: relative; font-size: 11px; font-weight: 700; color: #fff; padding: 0 7px; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); white-space: nowrap; }
.g-bar.st-done { --tc: var(--good); }
.g-bar.st-notdone { --tc: var(--bad); }
.g-bar:hover { filter: brightness(1.05); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.g-sum { position: absolute; top: 17px; height: 6px; border-radius: 4px; background: var(--tc); opacity: .8; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .7; z-index: 1; pointer-events: none; }
.g-undated { position: absolute; left: 8px; top: 11px; font-size: 12px; color: var(--muted); font-style: italic; }

/* Modal */
body.modal-open { overflow: hidden; }
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(16, 24, 40, .45); display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal { width: min(680px, 100%); max-height: calc(100vh - 40px); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .18s ease; border-top: 5px solid var(--tc, var(--brand)); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 19px; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.field { display: grid; gap: 6px; min-width: 0; }
.flabel { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13.8px; }
.flabel .ic { width: 15px; height: 15px; color: var(--muted); }
.field input[type=text], .field input[type=date], .field textarea, .field select { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; background: var(--surface); font-size: 14.5px; }
.field textarea { resize: vertical; }
.invalid { border-color: var(--bad) !important; box-shadow: 0 0 0 3px rgba(212, 72, 63, .15) !important; }
.hint { margin: 0; font-size: 12.8px; color: var(--muted); }
.hint.inline { display: flex; align-items: flex-start; gap: 6px; margin-top: -6px; }
.hint .ic { width: 15px; height: 15px; margin-top: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.seg-ctl { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-ctl label { cursor: pointer; }
.seg-ctl input { position: absolute; opacity: 0; pointer-events: none; }
.seg-ctl label > span { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 7px 13px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg-ctl label:hover > span { border-color: #aeb7c6; }
.seg-ctl input:checked + span { border-color: var(--tc, var(--brand-2)); background: var(--tbg, var(--c-res-bg)); color: var(--tc, var(--brand-2)); }
.seg-ctl input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.parent-ref { display: flex; align-items: center; gap: 10px; background: var(--tbg); border-radius: 10px; padding: 9px 12px; }
.parent-ref > div > span:not(.ticon) { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tc); }
.parent-ref b { font-size: 14px; }
.parent-ref .lc-step { background: var(--surface, #fff); }
.parent-ref > div, .node-main { min-width: 0; }
.parent-ref > div { flex: 1; }
.parent-ref { min-width: 0; max-width: 100%; box-sizing: border-box; }
.modal-body > * { min-width: 0; }
.check-card { display: flex; align-items: flex-start; gap: 10px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 11px 12px; cursor: pointer; }
.check-card:has(input:checked) { border-color: var(--brand); background: var(--c-proj-bg); }
.check-card input { margin-top: 7px; width: 17px; height: 17px; accent-color: var(--brand); }
.check-card b { display: block; font-size: 14px; }
.check-card span:not(.ticon) { font-size: 13px; color: var(--muted); }
.model-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.model-card { cursor: pointer; }
.model-card input { position: absolute; opacity: 0; pointer-events: none; }
.model-card > span { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 8px 10px; height: 100%; }
.model-card .gauge, .model-card .yn { grid-row: span 2; }
.model-card b { font-size: 13.3px; }
.model-card small { font-size: 12px; color: var(--muted); }
.model-card input:checked + span { border-color: var(--c-ind); background: var(--c-ind-bg); }
.model-card input:focus-visible + span { outline: 2px solid var(--focus); }
.modal-body:not([data-source="nationell"]) .only-nat { display: none; }
.modal-body:not([data-model="narvarde"]) .only-narvarde { display: none; }
.modal-body:not([data-model="intervall"]) .only-intervall { display: none; }
.modal-body[data-model="janej"] .t-num, .modal-body[data-model="janej"] .not-yn, .modal-body[data-model="intervall"] .t-num { display: none; }
.modal-body:not([data-model="janej"]) .t-yn { display: none; }
.cl-edit { display: grid; gap: 6px; }
.cl-edit:empty { display: none; }
.cl-row { display: flex; align-items: center; gap: 8px; }
.cl-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--c-akt); flex: none; }
.cl-row input[type=text] { flex: 1; border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 10px; }
.cl-row input[type=text]:focus { outline: none; border-color: var(--focus); }
.field .btn.tiny { justify-self: start; }
.pchecks { max-height: 260px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; }
.pcheck { display: flex; align-items: center; gap: 8px; padding-top: 5px; padding-bottom: 5px; border-radius: 7px; cursor: pointer; font-size: 13.8px; }
.pcheck:hover { background: var(--surface-2); }
.pcheck input { width: 16px; height: 16px; accent-color: var(--brand); }
.pcheck span { flex: 1; }
.pcheck small { color: var(--muted); font-size: 11.5px; padding-right: 6px; }
.type-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-tile { display: grid; justify-items: start; gap: 4px; text-align: left; border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 12px; padding: 14px; }
.type-tile:hover { border-color: var(--tc); background: var(--tbg); }
.type-tile b { font-size: 15px; margin-top: 4px; }
.type-tile small { color: var(--muted); font-size: 12.8px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 200; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Mobil */
@media (max-width: 960px) {
  .brand { min-width: 0; }
  .brand small { display: none; }
  .top-right { min-width: 0; }
  .steps, .summary { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .brand b { display: none; }
  .page { padding: 16px 16px 60px; }
  h1 { font-size: 23px; }
  .node-body { padding: 0 12px 12px 12px; }
  .act-body { padding: 0 10px 10px 10px; }
  .row2, .row3, .model-grid, .type-tiles { grid-template-columns: 1fr; }
  .ind-grid { grid-template-columns: 1fr; }
  .head-actions .btn.big { padding: 9px 14px; font-size: 14px; }
  .g-row { grid-template-columns: 170px 1fr; }
  .modal-body { padding: 4px 14px 14px; }
}

/* Förhindra att innehåll trycker ut korten på smala skärmar */
.node-body, .act-body, .fu-box, .acts, .subacts, .sub-goals, .link-body, .underlag { grid-template-columns: minmax(0, 1fr); }
.node-body > *, .act-body > *, .link-body > * { min-width: 0; }
@media (max-width: 640px) {
  .node-head, .act-head { flex-wrap: wrap; }
  .node-main { flex-basis: calc(100% - 80px); }
  .node-head > .btn.tiny { margin-left: 34px; }
  .node-actions { opacity: 1; }
  .ind-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Tidsindelning: läsår / kalenderår */
.mode-switch { display: flex; background: rgba(255, 255, 255, .12); border-radius: 10px; padding: 3px; }
.mode-switch button { border: 0; background: none; color: rgba(255, 255, 255, .8); font-weight: 600; font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.mode-switch button:hover { color: #fff; }
.mode-switch button.on { background: #fff; color: var(--brand); }
.menu-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 12px 2px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-mode.on { font-weight: 650; color: var(--brand-2); }
@media (max-width: 1100px) { .mode-switch { display: none; } }

/* Målträd */
.page.wide { max-width: none; }
.tree-tools { margin-bottom: 10px; }
.tree-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.tgl { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 5px 12px 5px 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.tgl input { width: 16px; height: 16px; accent-color: var(--brand-2); margin: 0; }
.tgl:has(input:checked) { border-color: var(--brand-2); background: var(--c-res-bg); }
.gt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.gt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gt-legend .ic { width: 14px; height: 14px; color: var(--brand); }
.lg-zone { width: 16px; height: 12px; border-radius: 4px; display: inline-block; border: 1.5px solid var(--line-2); }
.lg-zone.z-up { background: repeating-linear-gradient(135deg, #f1f3f7 0 3px, #fff 3px 6px); border-style: dashed; }
.lg-zone.z-sel { background: var(--c-res-bg); border-color: var(--c-res); }
.lg-zone.z-down { background: var(--surface); }
.lg-line { width: 22px; border-top: 2px solid #9aa5b8; display: inline-block; }
.lg-line.dashed { border-top-style: dashed; border-color: var(--brand-2); }

.gt-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; max-height: calc(100vh - 290px); min-height: 300px; }
.gtree, .gt-kids { list-style: none; margin: 0; padding: 0; }
.gtree { display: flex; flex-direction: column; gap: 14px; width: max-content; }
.gt-li { display: flex; align-items: center; position: relative; }
.gt-kids { position: relative; margin-left: 22px; display: flex; flex-direction: column; }
.gt-kids::before { content: ""; position: absolute; left: -22px; top: 50%; width: 22px; border-top: 2px solid #9aa5b8; }
.gt-kids > .gt-li { padding: 5px 0 5px 22px; }
.gt-kids > .gt-li::before { content: ""; position: absolute; left: 0; top: 50%; width: 22px; border-top: 2px solid #9aa5b8; }
.gt-kids > .gt-li::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid #9aa5b8; }
.gt-kids > .gt-li:first-child::after { top: 50%; }
.gt-kids > .gt-li:last-child::after { bottom: 50%; }
.gt-kids > .gt-li:only-child::after { display: none; }
.gt-kids > .gt-li.is-link::before { border-top-style: dashed; border-color: var(--brand-2); }
.gt-node { position: relative; display: flex; align-items: center; flex: none; }
.gt-card { display: flex; gap: 9px; align-items: flex-start; width: 250px; text-align: left; background: var(--surface); border: 1.5px solid var(--line-2); border-left: 4px solid var(--tc); border-radius: 11px; padding: 9px 10px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.gt-card:hover { box-shadow: 0 6px 16px rgba(20, 30, 50, .12); transform: translateY(-1px); }
.z-up .gt-card { background: repeating-linear-gradient(135deg, #f6f7fa 0 6px, #fff 6px 12px); border-style: dashed; border-left-style: solid; }
.z-sel .gt-card { background: var(--c-res-bg); border-color: color-mix(in srgb, var(--c-res) 45%, white); border-left-color: var(--tc); }
.gt-body { min-width: 0; flex: 1; }
.gt-type { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--tc); }
.gt-flag .ic { width: 12px; height: 12px; color: var(--brand); }
.gt-name { font-size: 13.3px; font-weight: 650; line-height: 1.28; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gt-org { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.gt-org .ic { width: 12px; height: 12px; flex: none; }
.gt-status { display: flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.gt-status .gauge-xs { width: 34px; height: 20px; }
.gt-status .yn-xs { width: 20px; height: 20px; margin: 0 6px 0 0; }
.gt-status em { font-style: normal; font-weight: 600; }
.gt-status span { margin-left: 2px; }
.gt-toggle { position: absolute; right: -11px; top: 50%; transform: translateY(-50%); z-index: 1; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; border: 1.5px solid #9aa5b8; background: var(--surface); font-size: 11.5px; font-weight: 750; color: var(--ink-2); line-height: 1; }
.gt-toggle:hover { border-color: var(--brand-2); color: var(--brand-2); }
.gt-li:has(> .gt-kids) > .gt-node .gt-toggle { right: -11px; }
.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px rgba(36, 83, 199, .35); } 100% { box-shadow: var(--shadow); } }
@media (max-width: 640px) { .gt-card { width: 210px; } .gt-wrap { padding: 12px; max-height: none; } }

/* Resurser i projekt */
.av { --av: var(--brand); width: 28px; height: 28px; border-radius: 50%; background: var(--av); color: #fff; font-size: 11px; font-weight: 750; letter-spacing: .02em; display: inline-grid; place-items: center; border: 2px solid var(--surface); flex: none; line-height: 1; }
.av.sm { width: 22px; height: 22px; font-size: 9px; border-width: 1.5px; }
.av.more { background: var(--ink-2); }
.av.demo { --av: #7445c0; }
.av-stack { display: inline-flex; align-items: center; }
.av-stack .av + .av { margin-left: -7px; }
.chip-res { padding: 1px 9px 1px 2px; }
.gantt-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.gantt-main { min-width: 0; }
.res-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 12px; position: sticky; top: 0; display: grid; gap: 8px; }
.res-head { display: flex; align-items: center; justify-content: space-between; }
.res-head h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 15px; }
.res-head h3 .ic { color: var(--muted); }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.res-item { display: flex; align-items: center; gap: 9px; padding: 6px 4px 6px 7px; border-radius: 10px; cursor: pointer; border: 1.5px solid transparent; }
.res-item:hover { background: var(--surface-2); }
.res-item.on { border-color: var(--av); background: color-mix(in srgb, var(--av) 9%, white); }
.res-txt { flex: 1; min-width: 0; }
.res-txt b { display: block; font-size: 13.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-txt span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-n { font-size: 11.5px; font-weight: 750; min-width: 22px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 1px 6px; color: var(--ink-2); }
.res-item .icon-btn { opacity: 0; }
.res-item:hover .icon-btn, .res-item.on .icon-btn, .res-item .icon-btn:focus-visible { opacity: 1; }
.res-add { justify-self: start; }
.res-detail { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; display: grid; gap: 8px; }
.res-detail-head { display: flex; align-items: center; gap: 9px; }
.res-detail-head b { display: block; font-size: 14px; }
.res-detail-head span { font-size: 12px; color: var(--muted); }
.res-detail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.res-detail li button { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--av); background: var(--surface-2); border-radius: 0 8px 8px 0; padding: 6px 8px; }
.res-detail li button:hover { background: color-mix(in srgb, var(--av) 9%, white); }
.res-detail li b { display: block; font-size: 12.8px; font-weight: 600; line-height: 1.25; }
.res-detail li small { font-size: 11.5px; color: var(--muted); }
.res-detail > .btn { justify-self: start; }
.g-label { gap: 6px; }
.g-name-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; text-align: left; flex: 1; min-width: 0; font: inherit; color: inherit; }
.g-name-btn:hover .g-name { color: var(--brand-2); }
.g-assign { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--av); background: var(--surface); color: var(--av); display: grid; place-items: center; padding: 0; }
.g-assign .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.g-assign:hover { background: color-mix(in srgb, var(--av) 12%, white); }
.g-assign.on { background: var(--av); border-style: solid; color: #fff; }
.g-row.dim .g-track, .g-row.dim .g-name-btn { opacity: .35; }
.g-row.hl .g-label { box-shadow: inset 4px 0 var(--av); }
.g-row.hl .g-bar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--av); }
.g-bar-av { position: absolute; top: 9px; z-index: 1; white-space: nowrap; }
.g-load { background: var(--surface-2); }
.g-load .g-label.head { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink-2); gap: 7px; }
.g-load-cell { border-left: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 750; margin: 6px 0; }
.g-load-cell.l1 { background: color-mix(in srgb, var(--av) 22%, white); }
.g-load-cell.l2 { background: color-mix(in srgb, var(--av) 50%, white); color: #fff; }
.g-load-cell.l3 { background: var(--bad); color: #fff; }
.res-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.res-pick { cursor: pointer; }
.res-pick input { position: absolute; opacity: 0; pointer-events: none; }
.res-pick > span { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-2); border-radius: 20px; padding: 3px 11px 3px 3px; font-size: 13.5px; font-weight: 600; }
.res-pick input:checked + span { border-color: var(--av); background: color-mix(in srgb, var(--av) 12%, white); }
.res-pick input:focus-visible + span { outline: 2px solid var(--focus); }
.danger-zone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.danger-btn { color: var(--bad); border-color: #f0c4c0; }
.danger-btn:hover { background: var(--bad-bg); border-color: var(--bad); }
@media (max-width: 960px) { .gantt-layout { grid-template-columns: minmax(0, 1fr); } .res-panel { position: static; } }

/* Vänstermeny med stora knappar */
.rail { display: grid; gap: 8px; }
.rail-btn { display: grid; justify-items: center; gap: 6px; border: 0; background: transparent; border-radius: 14px; padding: 12px 4px 10px; color: var(--muted); font-weight: 650; font-size: 12.5px; }
.rail-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); transition: background .15s, color .15s; }
.rail-ic .ic { width: 24px; height: 24px; }
.rail-btn:hover { color: var(--ink); }
.rail-btn:hover .rail-ic { background: var(--c-res-bg); color: var(--brand-2); border-color: transparent; }
.rail-btn.on { color: var(--brand-2); }
.rail-btn.on .rail-ic { background: var(--brand-2); color: #fff; border-color: var(--brand-2); box-shadow: 0 4px 12px rgba(36, 83, 199, .3); }
.legend-row-inline { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -8px 0 8px; font-size: 12.5px; color: var(--ink-2); }
.legend-row-inline > span { display: inline-flex; align-items: center; gap: 6px; }

/* Organisationsväljare i toppfältet */
.org-pick { position: relative; flex: 1; max-width: 460px; min-width: 0; }
.org-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); color: #fff; border-radius: 12px; padding: 5px 12px 5px 6px; text-align: left; height: 46px; }
.org-btn:hover, .org-pick.open .org-btn { background: rgba(255, 255, 255, .18); }
.org-btn-ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: none; }
.org-btn-txt { flex: 1; min-width: 0; display: grid; }
.org-btn-txt small { font-size: 11px; opacity: .75; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-btn-txt b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-btn-chev { transform: rotate(90deg); opacity: .8; transition: transform .15s; }
.org-pick.open .org-btn-chev { transform: rotate(-90deg); }
.op-panel { display: none; position: absolute; top: 52px; left: 0; width: max(100%, 440px); max-width: calc(100vw - 24px); background: var(--surface); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; }
.org-pick.open .op-panel { display: block; animation: pop .15s ease; }
.op-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.op-search input { flex: 1; border: 0; outline: none; font-size: 14.5px; background: transparent; color: var(--ink); }
.op-list { max-height: min(60vh, 520px); overflow-y: auto; padding: 6px; }
.op-group + .op-group { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.op-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 4px; }
.op-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left; border-radius: 9px; padding: 7px 10px 7px calc(10px + var(--d) * 18px); font-size: 14px; color: var(--ink-2); position: relative; }
.op-item::before { content: ""; position: absolute; left: calc(var(--d) * 18px - 4px); top: 50%; width: 8px; border-top: 1px solid var(--line-2); }
.op-item[style*="--d:0"]::before { display: none; }
.op-item:hover, .op-item:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.op-item.on { background: var(--c-res-bg); color: var(--c-res); font-weight: 650; }
.op-name { flex: 1; min-width: 0; }
.op-level { font-size: 11.5px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.op-empty { display: none; text-align: center; color: var(--muted); font-size: 13.5px; margin: 14px 0; }

@media (max-width: 960px) {
  .brand { min-width: 0; }
  .brand > div { display: none; }
}
@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; height: calc(100vh - 60px - 64px); }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 64px; padding: 4px 6px; border-right: 0; border-top: 1px solid var(--line); z-index: 40; overflow: visible; box-shadow: 0 -2px 10px rgba(20, 30, 50, .06); }
  .rail { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .rail-btn { padding: 4px 2px; gap: 2px; font-size: 11px; }
  .rail-ic { width: 36px; height: 30px; border-radius: 10px; border: 0; background: transparent; }
  .rail-ic .ic { width: 21px; height: 21px; }
  .rail-btn.on .rail-ic { box-shadow: none; }
  .org-btn { height: 42px; }
  .org-btn-ic { display: none; }
  .year-sel { padding: 0 6px; }
  .year-sel .ic { display: none; }
  .year-sel select { font-size: 13px; max-width: 120px; }
  .op-panel { position: fixed; left: 12px; right: 12px; top: 62px; width: auto; }
}
.op-item[hidden], .op-group[hidden] { display: none; }

/* Sidans höjd styrs av flex så att toppfältet kan bli två rader på mobil */
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar { flex: none; }
.layout { flex: 1; min-height: 0; height: auto; }
@media (max-width: 700px) {
  .layout { height: auto; padding-bottom: 64px; }
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; row-gap: 8px; }
  .top-right { margin-left: auto; }
  .org-pick { order: 3; flex-basis: 100%; max-width: none; }
  .op-panel { top: 112px; }
}

/* Växel mellan förvaltningens och skolans projekt */
.proj-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; max-width: 720px; }
.ps-btn { display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.ps-btn:hover { border-color: #aeb7c6; }
.ps-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.ps-ic .ic { width: 24px; height: 24px; }
.ps-btn b { display: block; font-size: 15px; }
.ps-btn small { display: block; font-size: 12.5px; color: var(--muted); }
.ps-btn.on { border-color: var(--brand-2); background: var(--c-res-bg); }
.ps-btn.on .ps-ic { background: var(--brand-2); color: #fff; }
.ps-btn.on b { color: var(--brand-2); }
@media (max-width: 640px) { .proj-switch { grid-template-columns: 1fr; } }
.pgroup { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 8px 4px; } .pgroup:not(:first-child) { border-top: 1px solid var(--line); margin-top: 6px; }

/* Tidslinje: bredare schema och resurspanel som inte flyter över */
.page.wide { max-width: 1680px; }
.gantt-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 16px; }
.gantt-layout.no-res { grid-template-columns: minmax(0, 1fr); }
.res-panel { grid-template-columns: minmax(0, 1fr); min-width: 0; overflow: hidden; position: sticky; top: 12px; max-height: calc(100vh - 120px); overflow-y: auto; }
.res-panel > *, .res-item, .res-detail, .res-list { min-width: 0; }
.res-head h3 .tcount { margin-left: 2px; }
.res-show { margin-right: 6px; }
.g-row { grid-template-columns: 320px 1fr; min-height: 48px; }
.g-label { padding: 7px 12px; font-size: 13.8px; }
.g-month { font-size: 12px; padding: 8px 8px; }
.g-bar { top: 11px; height: 26px; border-radius: 7px; }
.g-bar span { font-size: 11.5px; }
.g-sum { top: 21px; height: 7px; }
.g-bar-av { top: 13px; }
.g-undated { top: 15px; }
.gantt-wrap { min-height: 360px; }
@media (max-width: 1200px) { .gantt-layout { grid-template-columns: 240px minmax(0, 1fr); } }
@media (max-width: 960px) { .gantt-layout { grid-template-columns: minmax(0, 1fr); } .res-panel { position: static; max-height: none; } }
@media (max-width: 640px) { .g-row { grid-template-columns: 190px 1fr; } }

/* Inställningar */
.rail { grid-template-rows: repeat(4, auto) 1fr; height: 100%; }
.rail-settings { align-self: end; }
.se-tree { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; }
.se-tree ul { list-style: none; margin: 0; padding: 0; }
.se-tree ul ul { margin-left: 16px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.se-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; flex-wrap: wrap; }
.se-row:hover { background: var(--surface-2); }
.se-row.on .se-name { color: var(--brand-2); }
.se-level { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; min-width: 92px; text-align: center; }
.se-name { font-weight: 600; font-size: 14.5px; flex: 1; min-width: 180px; }
.se-meta { font-size: 12px; color: var(--muted); }
.se-actions { display: flex; align-items: center; gap: 2px; opacity: .55; }
.se-row:hover .se-actions, .se-actions:focus-within { opacity: 1; }
.del-sum { margin: 0; padding: 10px 14px 10px 30px; background: var(--surface-2); border-radius: 10px; font-size: 14px; display: grid; gap: 2px; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 11px 12px; cursor: pointer; }
.choice input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand-2); flex: none; }
.choice > span { display: grid; gap: 4px; flex: 1; min-width: 0; }
.choice b { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
.choice b .ic { width: 16px; height: 16px; }
.choice small { color: var(--muted); font-size: 13px; }
.choice select { margin-top: 4px; width: 100%; border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--brand-2); background: var(--c-res-bg); }
.choice.danger:has(input:checked) { border-color: var(--bad); background: var(--bad-bg); }
.choice.danger input { accent-color: var(--bad); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-solid:hover { background: #b93a32; }
@media (max-width: 700px) {
  .rail { grid-template-columns: repeat(5, 1fr); grid-template-rows: none; height: auto; }
  .se-level { min-width: 0; }
  .se-actions { opacity: 1; }
}
.se-row { flex-wrap: nowrap; } .se-name { min-width: 0; } .se-meta { white-space: nowrap; } @media (max-width: 700px) { .se-row { flex-wrap: wrap; } }

/* Större skrivläge för uppföljning av mål */
.fu-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fu-label-row .fu-label { flex: 1; }
.modal.modal-xl { width: min(1280px, 100%); height: calc(100vh - 40px); max-height: none; }
.modal-xl .modal-body { padding: 0; overflow: hidden; display: block; flex: 1; min-height: 0; }
.focus { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); height: 100%; }
.focus-left { border: 0; border-radius: 0; background: var(--surface); padding: 6px 22px 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 0; }
.focus-title { display: flex; gap: 12px; align-items: flex-start; }
.focus-title h3 { margin: 2px 0 0; font-size: 19px; line-height: 1.3; }
.focus-text { flex: 1; min-height: 280px; font-size: 15.5px; line-height: 1.6; padding: 14px 16px; resize: none; }
.focus-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.focus-right { background: var(--surface-2); border-left: 1px solid var(--line); padding: 16px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.focus-right-title { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14.5px; }
.focus-right-title .ic { color: var(--muted); }
.focus-right .underlag { padding: 12px 14px; }
.focus-right .u-text p { font-size: 14px; line-height: 1.5; }
@media (max-width: 860px) {
  .modal.modal-xl { height: auto; max-height: calc(100vh - 20px); }
  .modal-xl .modal-body { overflow-y: auto; }
  .focus { grid-template-columns: 1fr; height: auto; }
  .focus-left, .focus-right { overflow: visible; }
  .focus-right { border-left: 0; border-top: 1px solid var(--line); }
  .focus-text { min-height: 220px; }
}

/* Rapporter */
.rail { grid-template-rows: repeat(7, auto) 1fr; }
.rep-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.rep-form { display: grid; gap: 14px; min-width: 0; }
.rep-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.rep-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15.5px; }
.rep-card h3 .ic { color: var(--muted); }
.rep-card.sticky { position: sticky; top: 12px; }
.rep-text-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rep-text textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.5; resize: vertical; background: var(--surface); }
.rep-text textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(36, 83, 199, .15); }
.rep-outline { list-style: none; margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; display: grid; gap: 3px; max-height: 46vh; overflow-y: auto; font-size: 13px; }
.rep-outline li { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-outline li.l0 { color: var(--muted); font-style: italic; }
.rep-outline li.l1 { font-weight: 700; color: var(--brand); margin-top: 5px; }
.rep-outline li.l2 { padding-left: 14px; }
.rep-outline li.l3 { padding-left: 28px; color: var(--muted); font-size: 12.5px; }
.rep-make { justify-content: center; }
.rep-step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-2); color: #fff; font-size: 12.5px; font-weight: 700; flex: none; }
.rep-kinds { margin: 0; max-width: none; }
.rep-out { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: var(--surface-2); }
.rep-out-head { display: flex; gap: 10px; align-items: flex-start; }
.rep-out-head b { display: block; font-size: 14.5px; }
.rep-out-head small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.rep-out-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: none; color: #fff; }
.rep-out-ic.word { background: #2453c7; }
.rep-out-ic.ppt { background: #c4501c; }
.rep-details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rep-details[open] summary { margin-bottom: 8px; }
.rep-slides { list-style: none; margin: 0; padding: 10px 12px; background: var(--surface); border-radius: 10px; display: grid; gap: 4px; max-height: 40vh; overflow-y: auto; font-size: 13px; }
.rep-slides li { display: flex; gap: 8px; align-items: baseline; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-slides li span { flex: none; min-width: 20px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.rep-make.ppt { background: #c4501c; border-color: #c4501c; color: #fff; }
.rep-make.ppt:hover { background: #a8431a; }
.rep-make:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 1000px) { .rep-grid { grid-template-columns: minmax(0, 1fr); } .rep-card.sticky { position: static; } }
.rail-short { display: none; }
@media (max-width: 700px) {
  /* Mobilens meny: sju lika breda knappar med korta etiketter, så att alla får plats */
  .rail { grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: none; gap: 0; }
  .rail-btn { font-size: 10px; min-width: 0; padding: 4px 0; }
  .rail-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* kvar för skärmläsare */
  .rail-btn { position: relative; }
  .rail-short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
}

/* Inloggning och roller */
#login-root:empty { display: none; }
body.locked .topbar, body.locked .layout { display: none; }
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #17375e 0%, #1f4a7d 55%, #2453c7 100%); z-index: 50; }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 28px; display: grid; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand .logo { width: 38px; height: 38px; border-radius: 11px; background: var(--c-res-bg); color: var(--brand-2); display: grid; place-items: center; }
.login-brand .logo .ic { width: 22px; height: 22px; }
.login-brand b { display: block; font-size: 16px; }
.login-brand small { color: var(--muted); font-size: 12.5px; }
.login-card h1 { font-size: 24px; margin: 6px 0 0; }
.login-card input { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(36, 83, 199, .15); }
.login-card .btn { justify-content: center; }
.login-err { margin: 0; min-height: 18px; color: var(--bad); font-size: 13.5px; font-weight: 600; }
.login-err:empty { min-height: 0; }
.login-msg { margin: 0; background: var(--warn-bg); color: #7a5600; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; }
.user-wrap { margin-left: 4px; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: rgba(255, 255, 255, .1); color: #fff; border-radius: 12px; padding: 4px 10px 4px 4px; height: 42px; position: relative; max-width: 240px; }
.user-btn:hover { background: rgba(255, 255, 255, .18); }
.user-btn .av { border-color: rgba(255, 255, 255, .35); width: 32px; height: 32px; }
.user-txt { display: grid; text-align: left; min-width: 0; }
.user-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-txt small { font-size: 11px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sync-state { position: absolute; left: 28px; top: 28px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--brand); background: var(--good); }
#sync-state[data-state="saving"] { background: var(--warn); }
#sync-state[data-state="error"] { background: var(--bad); }
.menu-note { margin: 0; padding: 2px 12px 6px; font-size: 12.5px; color: var(--muted); max-width: 260px; }
.user-wrap .menu { min-width: 260px; }
.local-badge { font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 8px; padding: 5px 9px; white-space: nowrap; }
.perm-note { display: flex; align-items: flex-start; gap: 8px; background: var(--c-res-bg); color: var(--ink-2); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.perm-note .ic { color: var(--brand-2); margin-top: 1px; }
.chip-owner { background: #eef2ff; border-color: transparent; color: #3341a3; font-weight: 600; }
.chip-owner .ic { color: inherit; }
.fu-text:disabled, .inp-unit input:disabled, .inp-unit select:disabled, .ind-comment:disabled, .rep-text textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.sbtn:disabled { opacity: .55; cursor: not-allowed; }
.sbtn.on:disabled { opacity: .85; }
.mode-switch button:disabled, .menu button:disabled, .ps-btn:disabled { opacity: .5; cursor: not-allowed; }
.role-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.role-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12.8px; color: var(--muted); display: grid; gap: 3px; }
.role-card b { color: var(--ink); font-size: 14px; }
.users-head { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.users-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.users-table table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.users-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.users-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users-table tr:last-child td { border-bottom: 0; }
.users-table tr.inactive td { color: var(--muted); }
.users-actions { white-space: nowrap; text-align: right; }
.role-pill { font-size: 12px; font-weight: 700; border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
.r-superadmin { background: #17375e; color: #fff; }
.r-admin { background: var(--c-del-bg); color: var(--c-del); }
.r-chef { background: var(--c-res-bg); color: var(--c-res); }
.r-rapportor { background: var(--c-akt-bg); color: var(--c-akt); }
.role-pick { display: grid; gap: 8px; }
.modal-body[data-role="superadmin"] .user-org { display: none; }
.pw-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.pw-box span { display: block; font-size: 12px; color: var(--muted); }
.pw-box b { font-size: 17px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.empty.setup h2 { margin: 10px 0 4px; color: var(--ink); }
.se-actions[hidden] { display: none; }
@media (max-width: 960px) { .role-cards { grid-template-columns: 1fr 1fr; } .user-txt { display: none; } .user-btn { padding: 4px; } }
@media (max-width: 640px) { .role-cards { grid-template-columns: 1fr; } }

/* Utfällbar organisationsväljare */
.op-row { display: flex; align-items: center; gap: 2px; padding-left: calc(var(--d) * 18px); border-radius: 9px; }
.op-row[hidden] { display: none; }
.op-row .op-item { padding-left: 6px; }
.op-row .op-item::before { display: none; }
.op-caret { flex: none; width: 26px; height: 30px; border: 0; background: none; border-radius: 7px; display: grid; place-items: center; color: var(--muted); padding: 0; }
.op-caret:hover { background: var(--surface-2); color: var(--ink); }
.op-caret .ic { width: 15px; height: 15px; transition: transform .15s; }
.op-row.open > .op-caret .ic { transform: rotate(90deg); }
.op-caret-sp { flex: none; width: 26px; }
.op-kids { font-size: 11px; color: var(--muted); white-space: nowrap; }
.op-row[style*="--d:0"] .op-item { font-weight: 650; color: var(--ink); }
.op-row[style*="--d:1"] .op-item { font-weight: 600; }
.se-tools { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 4px; }
.se-row .tcaret { flex: none; }

/* Nivåsymboler i organisationsträdet */
.oicon { flex: none; width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; }
.oicon .ic { width: 15px; height: 15px; }
.oicon.od0 { background: #17375e; color: #fff; }
.oicon.od1 { background: var(--c-res-bg); color: var(--c-res); }
.oicon.od2 { background: #e2f4f2; color: #0b8079; }
.oicon.od3 { background: #fdebdd; color: #c2410c; }
.oicon.on-dark { background: transparent; color: #fff; width: 100%; height: 100%; }
.oicon.on-dark .ic { width: 19px; height: 19px; }
.op-row { gap: 4px; }
.op-row > .oicon { margin-left: 2px; }
.se-row > .oicon { margin-right: -4px; }
.domain-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.domain-box b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.domain-box b .ic { color: var(--muted); }
.domain-box span { display: block; font-size: 12.8px; color: var(--muted); margin-top: 2px; }
.domain-edit { display: flex; gap: 8px; }
.domain-edit input { border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; min-width: 220px; font-size: 14px; }
.domain-edit input:focus { outline: none; border-color: var(--focus); }
/* Utbildningsområde och skolenhet i organisation 2 */
.oicon.od1[title="Utbildningsområde"] { background: #f0eafb; color: #7445c0; }
.oicon.od2[title="Skolenhet"] { background: var(--c-res-bg); color: var(--c-res); }
.oicon.od3[title="Programlag/stadium"] { background: #e2f4f2; color: #0b8079; }

/* Nytt läsår och historik */
.rollover-banner { display: flex; align-items: center; gap: 14px; background: linear-gradient(90deg, #fff6dd, #fffbee); border: 1px solid #f1dd9e; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.rollover-banner > .ic { width: 26px; height: 26px; color: #9a6a00; }
.rollover-banner > div { flex: 1; min-width: 240px; }
.rollover-banner b { display: block; font-size: 15px; }
.rollover-banner span { font-size: 13.5px; color: var(--ink-2); }
.ro-item { display: flex; align-items: flex-start; gap: 10px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 9px 11px; cursor: pointer; margin-bottom: 6px; }
.ro-item input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand-2); flex: none; }
.ro-item b { display: block; font-size: 14px; }
.ro-item small { font-size: 12.5px; color: var(--muted); }
.ro-item:has(input:checked) { border-color: var(--brand-2); background: var(--c-res-bg); }
.ro-auto { display: flex; flex-wrap: wrap; gap: 6px; }
.hist { border-top: 1px dashed var(--line-2); padding-top: 8px; margin-top: 2px; }
.hist summary { cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12.8px; font-weight: 650; color: var(--ink-2); list-style: none; }
.hist summary::-webkit-details-marker { display: none; }
.hist summary .ic { width: 15px; height: 15px; color: var(--muted); }
.hist summary span { color: var(--muted); font-weight: 500; }
.hist[open] summary { margin-bottom: 8px; }
.h-year { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.h-year-title { font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); margin-bottom: 4px; }
.h-year ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.h-year li { font-size: 13.3px; }
.h-year li p { margin: 2px 0 0; color: var(--ink-2); }
.h-ind { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.h-ind em { font-style: normal; font-weight: 600; font-size: 12.5px; }
.h-ind small { width: 100%; color: var(--muted); }
.h-per { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--muted); min-width: 92px; }
.h-st { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; }
.h-st .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.h-st.good { color: #17803f; }
.h-st.bad { color: var(--bad); }
#test-date { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); background: #7a5600; color: #fff; font-size: 12.5px; font-weight: 650; padding: 5px 12px; border-radius: 20px; z-index: 300; }
#test-date[hidden] { display: none; }

/* AI-sammanfattning */
.ai-wrap { display: grid; gap: 8px; }
.ai-btn { justify-self: start; border-color: #c9b8f0; color: #5b34a8; background: #f6f1ff; }
.ai-btn:hover { background: #ede4ff; border-color: #a98ae6; }
.ai-btn .ic { color: #7445c0; }
.ai-btn:disabled { opacity: .7; cursor: progress; }
.ai-result { border: 1px solid #d9cbf6; background: linear-gradient(180deg, #faf7ff, #fff); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; }
.ai-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.ai-head .ic { color: #7445c0; width: 16px; height: 16px; }
.ai-head span { color: var(--muted); font-size: 12px; }
.ai-text { white-space: pre-wrap; font-size: 13.8px; line-height: 1.55; color: var(--ink); }
.ai-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.ai-settings input[type=text], .ai-settings input[type=password], .ai-settings select { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; background: var(--surface); font-size: 14.5px; }
.ai-settings[data-prov="none"] .ai-f-model, .ai-settings[data-prov="builtin"] .ai-f-model,
.ai-settings[data-prov="none"] .ai-f-key, .ai-settings[data-prov="builtin"] .ai-f-key,
.ai-settings:not([data-prov="azure"]):not([data-prov="compatible"]):not([data-prov="openai"]) .ai-f-endpoint,
.ai-settings:not([data-prov="azure"]) .ai-f-apiversion { display: none; }
.ai-settings .perm-note { margin: 0; }
.ai-settings[data-prov="builtin"] [data-action="ai-test"], .ai-settings[data-prov="none"] [data-action="ai-test"] { display: none; }

/* Projektdirektiv */
.directive-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin: -4px 0 18px; }
.directive-card.empty-dir { border-style: dashed; box-shadow: none; }
.directive-card.empty-dir > .ic { width: 22px; height: 22px; color: var(--muted); }
.directive-card.empty-dir > div { flex: 1; min-width: 200px; }
.directive-card.empty-dir b { display: block; font-size: 14.5px; }
.directive-card.empty-dir span { font-size: 13px; color: var(--muted); }
.file-ic { width: 40px; height: 46px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: #5b6b85; flex: none; position: relative; }
.file-ic.ext-docx, .file-ic.ext-doc { background: #2b579a; font-size: 18px; }
.file-ic.ext-pdf { background: #c0392b; }
.file-ic.ext-odt { background: #1e88c7; }
.dir-main { flex: 1; min-width: 220px; display: grid; }
.dir-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dir-name { border: 0; background: none; padding: 0; text-align: left; font-weight: 650; font-size: 15px; color: var(--brand-2); cursor: pointer; word-break: break-word; }
.dir-name:hover { text-decoration: underline; }
.dir-meta { font-size: 12.5px; color: var(--muted); }
.dir-date { display: grid; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.dir-date input { border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 8px; font-size: 13.5px; background: var(--surface); color: var(--ink); }
.dir-date input:disabled { background: var(--surface-2); }
.dir-actions { display: flex; align-items: center; gap: 6px; }
.proj-nums .ic { width: 13px; height: 13px; vertical-align: -2px; }
.logo-img { width: 40px; height: 40px; flex: none; display: block; }
.login-brand .logo-img { width: 52px; height: 52px; }

/* Intern kontroll */
:root { --r1: #3fae6b; --r1-bg: #dcf2e4; --r2: #e7b416; --r2-bg: #fdf1c8; --r3: #f08a24; --r3-bg: #fde1c6; --r4: #d64545; --r4-bg: #f9d3d0; }
.page.wide-ic { max-width: 1280px; }
.ic-year { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; background: var(--surface); height: 40px; }
.ic-year select { border: 0; background: transparent; font-weight: 650; font-size: 14px; color: var(--ink); cursor: pointer; }
.ic-top { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 8px; }
.ic-matrix-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 10px; }
.ic-matrix-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15.5px; }
.ic-matrix-card h3 .ic { color: var(--muted); }
.ic-stats { display: grid; gap: 12px; }
.rmatrix { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr auto; gap: 4px 6px; }
.rm-axis-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rm-axis-x { grid-column: 2; text-align: center; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rm-grid { display: grid; grid-template-columns: 92px repeat(4, 1fr); gap: 5px; }
.rm-ylab, .rm-xlab { display: grid; align-content: center; font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.rm-ylab { justify-items: end; text-align: right; padding-right: 4px; }
.rm-xlab { justify-items: center; text-align: center; padding-top: 4px; }
.rm-ylab b, .rm-xlab b { font-size: 14px; color: var(--ink); }
.rm-cell { position: relative; min-height: 84px; border-radius: 10px; padding: 6px; display: flex; align-items: center; justify-content: center; }
.rm-cell.r1 { background: var(--r1-bg); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r1) 35%, transparent); }
.rm-cell.r2 { background: var(--r2-bg); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r2) 40%, transparent); }
.rm-cell.r3 { background: var(--r3-bg); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r3) 40%, transparent); }
.rm-cell.r4 { background: var(--r4-bg); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r4) 40%, transparent); }
.rm-v { position: absolute; top: 4px; right: 7px; font-size: 11px; font-weight: 700; color: rgba(0, 0, 0, .35); }
.rm-dots { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.rm-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: #1f2a3d; color: #fff; font-weight: 750; font-size: 12px; display: grid; place-items: center; padding: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); cursor: pointer; }
.rm-dot.in-plan { background: var(--brand-2); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--brand-2); }
.rm-dot:hover { transform: scale(1.1); }
.rm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.rm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rm-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.rm-legend i.r1, .lvl-sq.r1 { background: var(--r1); } .rm-legend i.r2, .lvl-sq.r2 { background: var(--r2); }
.rm-legend i.r3, .lvl-sq.r3 { background: var(--r3); } .rm-legend i.r4, .lvl-sq.r4 { background: var(--r4); }
.rm-legend i.dot-plan { border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--brand-2); }
.lvl-sq { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rv { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 7px; border-radius: 8px; font-weight: 800; font-size: 13.5px; color: #fff; }
.rv.sm { min-width: 24px; height: 22px; font-size: 12px; }
.rv.r1 { background: var(--r1); } .rv.r2 { background: var(--r2); color: #4a3a00; } .rv.r3 { background: var(--r3); } .rv.r4 { background: var(--r4); }
.risk-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.risk-table table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.risk-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.risk-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.risk-table tr:last-child td { border-bottom: 0; }
.risk-table tr.in-plan td:first-child { box-shadow: inset 4px 0 var(--brand-2); }
.r-no { font-weight: 800; color: var(--muted); white-space: nowrap; }
.r-title { border: 0; background: none; padding: 0; text-align: left; font-weight: 650; font-size: 14px; color: var(--ink); cursor: pointer; }
.r-title:hover { color: var(--brand-2); text-decoration: underline; }
.r-sub { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.r-sub .ic { width: 13px; height: 13px; }
.r-sel { border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 6px; font-weight: 700; background: var(--surface); }
.r-sel:disabled { background: var(--surface-2); color: var(--ink-2); }
.r-lvl { font-size: 12px; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.r-plan { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.r-plan input { width: 18px; height: 18px; accent-color: var(--brand-2); }
.r-plan span { font-weight: 650; }
.r-suggest { font-style: normal; font-size: 11px; font-weight: 700; color: #9a4b00; background: var(--r3-bg); border-radius: 20px; padding: 1px 8px; }
.r-owner, .r-org { font-size: 13px; color: var(--ink-2); }
.r-actions { white-space: nowrap; text-align: right; }
.ic-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.ic-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--none); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px; }
.ic-card.st-ok { border-left-color: var(--good); } .ic-card.st-deviation { border-left-color: var(--bad); }
.ic-head { display: flex; gap: 10px; align-items: flex-start; }
.ic-head b { display: block; font-size: 15px; line-height: 1.3; }
.ic-no { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.ic-control { background: var(--surface-2); border-radius: 10px; padding: 9px 11px; display: grid; gap: 4px; font-size: 13.3px; }
.ic-control span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ic-status { display: flex; flex-wrap: wrap; gap: 6px; }
.ic-status .sbtn { font-size: 12.5px; padding: 6px 10px; }
.ic-status .sbtn:not(.good):not(.bad).on { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.ic-reassess { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.ic-reassess > span { font-weight: 700; color: var(--ink-2); }
.ic-reassess select { border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 6px; margin-left: 4px; }
.ic-reassess em { font-style: normal; font-size: 12.5px; color: var(--ink-2); }
.risk-scale label > span { flex-direction: column; align-items: flex-start; gap: 0; min-width: 110px; padding: 6px 12px; }
.risk-scale label > span b { font-size: 16px; }
.risk-preview { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.risk-preview b { display: block; font-size: 14px; }
.risk-preview span:not(.rv) { font-size: 12.5px; color: var(--muted); }
.modal-body[data-inplan="0"] .control-fields { display: none; }
@media (max-width: 1000px) { .ic-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .rm-grid { grid-template-columns: 64px repeat(4, 1fr); } .rm-cell { min-height: 60px; } .ic-cards { grid-template-columns: 1fr; } }
.mode-switch.is-hidden, .year-sel.is-hidden { display: none !important; }

/* Politisk organisation – nämnden */
.oicon.od0[title="Nämnd"] { background: #5b2a86; color: #fff; }
.chip-pol { background: #f1e7fb; border-color: #d9c2f2; color: #5b2a86; font-weight: 700; }
.chip-pol .ic { color: inherit; }
.badge.pol { background: #f1e7fb; color: #5b2a86; }
.pol-sec .sec-head h2 .ic { color: #5b2a86; }
.pol-sec > .node { border-left-color: #5b2a86; box-shadow: 0 0 0 1px #e6d6f6, var(--shadow); }
.pol-note { display: flex; align-items: flex-start; gap: 8px; background: #f6effc; border: 1px solid #e6d6f6; color: #3d1d5a; border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.pol-note .ic { color: #5b2a86; margin-top: 1px; }
.op-group:first-child .op-group-title { color: #5b2a86; }

/* Driftsäkerhet */
#net-banner { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 250; display: flex; align-items: center; gap: 10px; max-width: min(640px, calc(100vw - 24px));
  background: #fff4e5; border: 1px solid #f3c27a; color: #6b3d00; border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-lg); font-size: 14px; }
#net-banner[hidden] { display: none; }
#net-banner .ic { color: #b86400; flex: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--surface-2); border-radius: 5px; padding: 1px 5px; }

/* ---------- Indikator: resultat över tid ---------- */
.trend summary { flex-wrap: wrap; }
.t-delta { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--ink-2) !important; }
.trend-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 2px; }
.trend-chart { display: block; max-width: none; height: auto; font-family: var(--font); }
.trend-chart .tb { opacity: .9; }
.trend-chart .lvl-fill-good { fill: var(--good); }
.trend-chart .lvl-fill-warn { fill: var(--warn); }
.trend-chart .lvl-fill-bad { fill: var(--bad); }
.trend-chart .lvl-fill-none { fill: var(--none); }
.trend-chart .tv { font-size: 11px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.trend-chart .tv.none { fill: var(--muted); font-weight: 500; }
.trend-chart .ty { font-size: 10.5px; fill: var(--muted); text-anchor: middle; }
.trend-chart .ty.cur { fill: var(--brand); font-weight: 750; }
.trend-chart .tt { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 3; }
.trend-chart .tbase { stroke: var(--line-2); }
.trend-chart .tband { fill: var(--good-bg); }
.trend .hint { margin: 6px 0 8px; font-size: 12px; }
.hist.trend { min-width: 0; }
.trend-wrap { overflow-x: auto; max-width: 100%; }  /* tabellen rullar i sidled på smala skärmar */
@media (max-width: 700px) { .trend-table th, .trend-table td { padding: 5px 6px; } }
.trend-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.trend-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 10px; background: var(--surface-2); }
.trend-table td { padding: 6px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.trend-table tr.cur td { background: #f2f6fd; }
.trend-table tr.cur td:first-child { font-weight: 750; color: var(--brand); }
.trend-table em { font-style: normal; font-weight: 600; }
.t-per { display: inline-flex; flex-direction: column; margin-right: 12px; font-weight: 650; }
.t-per small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.t-in { display: inline-flex; flex-direction: column; margin: 0 8px 4px 0; }
.t-in small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.t-in input, .t-in select { width: 70px; padding: 4px 6px; font-size: 13px; font-weight: 650; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); font-family: inherit; }
.t-in input:focus, .t-in select:focus { border-color: var(--focus); outline: none; }
.trend summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); margin: 0 4px 0 8px; transition: transform .15s; }
.trend:not(:has(.t-delta)) summary::after { margin-left: auto; }
.trend[open] summary::after { transform: rotate(45deg); }
.trend summary:hover { color: var(--brand); }

/* ---------- Händelselogg och säkerhetskopior ---------- */
.bk-status { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-bottom: 10px; }
.bk-status .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.bk-status.good { background: var(--good-bg); color: #17703f; }
.bk-status.warn { background: var(--warn-bg); color: #7a5600; }
.bk-status.bad { background: var(--bad-bg); color: #a3302a; }
.bk-act { white-space: nowrap; text-align: right; }
.bk-act .btn + .btn { margin-left: 4px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.ev-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ev-filters input[type=search] { flex: 1 1 220px; }
.ev-filters input, .ev-filters select { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 13.5px; background: var(--surface); }
.ev-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ev { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.ev-ic .ic { width: 16px; height: 16px; }
.ev.t-undo .ev-ic { background: #e9effc; color: var(--brand-2); }
.ev-main { flex: 1; min-width: 0; }
.ev-title { all: unset; cursor: pointer; font-weight: 650; font-size: 14px; color: var(--ink); }
.ev-title:hover:not([disabled]) { color: var(--brand-2); text-decoration: underline; }
.ev-title[disabled] { cursor: default; }
.ev-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ev-tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--none-bg); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.ev.is-undone .ev-title { color: var(--muted); text-decoration: line-through; }
.ev-act { flex: none; }
.ev-act .btn .ic { width: 14px; height: 14px; }
.ev-changes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.ev-changes li { display: flex; gap: 8px; align-items: flex-start; }
.ev-changes small { display: block; color: var(--muted); font-size: 12px; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--none); }
.ev-dot.a-create { background: var(--good); }
.ev-dot.a-update { background: var(--warn); }
.ev-dot.a-delete { background: var(--bad); }
.modal .ev-changes { max-height: 260px; overflow: auto; }
.ev-more { padding: 10px; text-align: center; }

/* ---------- Intern kontroll: samlad plan för förvaltningsledning och nämnd ---------- */
.ic-overview { border-top: 3px solid var(--brand); padding-top: 14px; }
.ic-ov-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.ic-ov-stats span { display: inline-flex; align-items: center; gap: 5px; }
.ic-ov-stats .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ic-ov-stats .dot:not(.d-good):not(.d-bad) { background: var(--none); }
.ic-ov-grid { display: grid; grid-template-columns: minmax(0, 520px); margin-bottom: 12px; }
.ic-overview .rm-dot { width: auto; min-width: 30px; border-radius: 15px; padding: 0 6px; font-size: 11px; }
.ic-st { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--none-bg); color: var(--ink-2); white-space: nowrap; }
.ic-st.st-ok { background: var(--good-bg); color: #17703f; }
.ic-st.st-deviation { background: var(--bad-bg); color: #a3302a; }
.ic-ov-org td { background: var(--surface-2); font-weight: 750; color: var(--brand); font-size: 13px; }
.ic-ov-org span { font-weight: 500; color: var(--muted); margin-left: 6px; font-size: 12px; }
.ic-ov-txt { font-size: 12.5px; color: var(--ink-2); max-width: 260px; }

/* Kommunfullmäktige: fördelning av mål och uppdrag till nämnder */
.assign-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.check-card.sm { align-items: center; padding: 8px 10px; }
.check-card.sm input { margin-top: 0; }
.assign-fu { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.assign-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.assign-row + .assign-row { border-top: 1px dashed var(--line-2); }
.assign-row .dot { margin-top: 6px; flex: none; }
.assign-row b { display: block; font-size: 14px; }
.assign-row span { font-size: 13px; color: var(--muted); }
.assign-row p { margin: 4px 0 0; font-size: 13.5px; }
.assign-row .dot:not([class*="d-"]) { background: var(--line-2); }
.field > .choice + .choice { margin-top: 6px; }
.scope-picks { margin-top: 8px; padding-left: 27px; }
.scope-picks .check-card span:not(.ticon):not(.oicon) { display: block; }
.scope-picks[hidden] { display: none; }

/* Delprojekt */
.sub-of { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sub-of .ic { width: 14px; height: 14px; }
.sub-of b { color: var(--ink-2); }
.proj-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sub-projects { margin: 12px 0 4px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sub-head b { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; }
.sub-projects .hint { margin: 0; }
.proj-grid { align-items: start; }
.proj-group { display: flex; flex-direction: column; min-width: 0; }
.proj-group > .proj-card { position: relative; z-index: 1; }
.proj-subs { --sub-line: color-mix(in srgb, var(--brand-2) 50%, var(--surface)); display: grid; gap: 8px; margin-left: 26px; padding: 10px 0 0 24px; }
.proj-sub { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px 8px; display: grid; gap: 3px; box-shadow: var(--shadow); }
.proj-sub:hover { border-color: var(--brand-2); }
/* Linjen från huvudprojektet till varje delprojekt */
.proj-sub::before { content: ''; position: absolute; left: -25px; top: -11px; width: 24px; height: calc(50% + 11px); border-left: 2px solid var(--sub-line); border-bottom: 2px solid var(--sub-line); border-bottom-left-radius: 10px; }
.proj-sub:not(:last-child)::after { content: ''; position: absolute; left: -25px; top: 50%; bottom: -9px; border-left: 2px solid var(--sub-line); }
.ps-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ps-top b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-tag { flex: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-2); background: var(--c-res-bg); border-radius: 6px; padding: 2px 6px; }
.ps-meta { font-size: 12.5px; color: var(--muted); }
.pbar.sm { height: 5px; margin: 3px 0 0; }

/* Händelseloggen är hopfälld från början */
.ev-details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 0; }
.ev-details > summary::-webkit-details-marker { display: none; }
.ev-details > summary h2 { margin: 0; }
.ev-sum-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--brand-2); white-space: nowrap; }
.ev-sum-hint::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.ev-details[open] .ev-sum-hint::after { transform: rotate(-135deg) translateY(-2px); }
.ev-details[open] > summary { margin-bottom: 10px; }
.ev-lead { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

/* Användarlistan: sök och filter */
.users-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
.users-head input[type=search] { flex: 1 1 220px; }
.users-head input, .users-head select { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 13.5px; background: var(--surface); color: var(--ink); }
.users-count { margin: 8px 0 6px; font-size: 13px; color: var(--muted); }

/* Lista eller målträd i planering och uppföljning */
.view-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: -6px 0 14px; }
.view-row .legend-row-inline { margin: 0; }
.view-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.vs-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.vs-btn .ic { width: 15px; height: 15px; }
.vs-btn:hover { color: var(--brand-2); }
.vs-btn.on { background: var(--brand); color: #fff; }
.toolbar .view-switch { margin-right: auto; }
.tree-hint { margin: -4px 0 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tree-hint .ic { width: 14px; height: 14px; }
.gt-add { position: absolute; right: 16px; bottom: -10px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--tc); background: var(--surface); color: var(--tc); display: grid; place-items: center; padding: 0; box-shadow: var(--shadow); }
.gt-add .ic { width: 13px; height: 13px; }
.gt-add:hover { background: var(--tc); color: #fff; }
.gt-add.link { border-color: var(--brand-2); color: var(--brand-2); }
.gt-add.link:hover { background: var(--brand-2); color: #fff; }
.modal.modal-lg { width: min(760px, 100%); }
.focus.focus-item { display: block; height: auto; }
.focus-item .focus-where { margin-bottom: 12px; }
.focus-item > .ind, .focus-item > .act { box-shadow: none; }
.focus-item .focus-foot { margin-top: 14px; }

/* Organisationsträdet: delar där man inte ser målen */
.op-lock { display: inline-flex; color: var(--muted); }
.op-lock .ic { width: 12px; height: 12px; }
.check-card.sub { margin-left: 22px; }

/* Projekt över förvaltningar */
.x-badge { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; background: #eef3ff; color: var(--brand); border: 1px solid #d3defb; border-radius: 20px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; }
.x-badge .ic { width: 12px; height: 12px; }
.x-note { display: flex; align-items: flex-start; gap: 8px; background: #eef3ff; border: 1px solid #d3defb; color: var(--ink); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; }
.x-note .ic { color: var(--brand); margin-top: 2px; flex: none; }
.pt-fv { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 6px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.pill-row .pill { padding: 5px 12px; font-size: 13px; }
.pgroup-x > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.pgroup-x > summary::-webkit-details-marker { display: none; }
.pgroup-x > summary::before { content: '▸'; font-size: 11px; }
.pgroup-x[open] > summary::before { content: '▾'; }
.pgroup-x > summary small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.pgroup-x { border-top: 1px solid var(--line); margin-top: 6px; }

/* ================= Processer ================= */
.t-process { --tc: #0e7490; --tbg: #e0f2f6; }
.t-event { --tc: #1f9a55; --tbg: #e3f5ea; }
.t-activity { --tc: #2453c7; --tbg: #e9effc; }
.t-decision { --tc: #b86400; --tbg: #fdf1e1; }
.chip-proc { background: #e0f2f6; border-color: transparent; color: #0e7490; font-weight: 600; }
.chip-proc .ic { color: inherit; }

/* Processkartan */
.pl-canvas { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; padding: 8px; }
.pl-canvas.view { margin-bottom: 18px; }
.pl-svg { display: block; font-family: var(--font); }
.pl-svg.mini { pointer-events: none; }
.pl-bg { fill: transparent; cursor: default; }
.pl-lane { fill: #f7f9fc; stroke: var(--line); }
.pl-lane.odd { fill: #eff3f8; }
.pl-lane-sep { stroke: var(--line-2); stroke-dasharray: 3 4; }
.pl-lane-name { font-size: 12.5px; font-weight: 700; fill: var(--ink-2); }
.pl-edge { fill: none; stroke: #8a95a8; stroke-width: 1.6; }
.pl-arrow { fill: #8a95a8; }
.pl-edge-label { font-size: 11.5px; font-weight: 700; fill: #8a5a00; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.pl-edge.open { stroke-dasharray: 5 4; }
.pl-edge.sel { stroke: var(--brand-2); stroke-width: 2.6; }
.pl-edge-label.sel { fill: var(--brand-2); }
.pl-edge-hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; pointer-events: stroke; }
.pl-edge-hit:hover { stroke: rgba(36, 83, 199, .12); }
.pl-open { cursor: pointer; }
.pl-open-c { fill: var(--surface); stroke: #9aa6ba; stroke-width: 2; stroke-dasharray: 5 4; }
.pl-open-plus { stroke: #7b879c; stroke-width: 2.4; stroke-linecap: round; }
.pl-open:hover .pl-open-c, .pl-open.sel .pl-open-c { stroke: var(--brand-2); fill: rgba(36, 83, 199, .08); stroke-dasharray: none; }
.pl-open:hover .pl-open-plus, .pl-open.sel .pl-open-plus { stroke: var(--brand-2); }
.pl-open-name { font-size: 11.5px; font-weight: 600; fill: var(--muted); }
.pl-open.sel .pl-open-name { fill: var(--brand-2); }
.pe-branch-add { display: grid; gap: 6px; }
.pe-branch-add .btn { justify-content: flex-start; }
.pe-branch-l { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #fff3d6; color: #8a5a00; font-size: 12.5px; margin-left: 4px; }
.pe-dec-hint { margin: 0 0 8px; }
.pl-act { fill: var(--surface); stroke: #b9c6e4; stroke-width: 1.4; filter: drop-shadow(0 1px 2px rgba(20, 30, 50, .08)); }
.pl-act-bar { fill: #2453c7; }
.pl-name { font-size: 12.5px; font-weight: 650; fill: var(--ink); }
.pl-name.sm { font-size: 11.5px; }
.pl-resp { font-size: 10.5px; fill: var(--muted); }
.pl-dec { fill: #fdf4e3; stroke: #d99a2b; stroke-width: 1.5; filter: drop-shadow(0 1px 2px rgba(20, 30, 50, .08)); }
.pl-ev { fill: #fff; stroke-width: 2.5; }
.pl-ev.start { stroke: #1f9a55; fill: #f1faf4; }
.pl-ev.end { stroke: #b42318; stroke-width: 4; fill: #fdf3f2; }
.pl-ev.mid { stroke: #b86400; fill: #fffaf0; }
.pl-ev-in { fill: none; stroke: #b86400; stroke-width: 1.5; }
.pl-ev-ic path, .pl-ev-ic rect { fill: #6a7486; }
.pl-ev-name { font-size: 11.5px; font-weight: 650; fill: var(--ink-2); }
.pl-res text { font-size: 11px; font-weight: 800; fill: #fff; }
.pl-res-ic { fill: #fff; }
.pl-doc rect { fill: #fff; stroke: #0b8079; stroke-width: 1.4; }
.pl-doc path { fill: none; stroke: #0b8079; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pl-doc text { font-size: 11px; font-weight: 800; fill: #0b8079; }
.pl-legend .t-doc { color: #0b8079; }
.pdoc-links { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.pdoc { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 12px; font-weight: 650; color: #0b6b65; background: #e3f4f2; border: 1px solid #bfe3df; border-radius: 12px; padding: 2px 9px 2px 6px; cursor: pointer; max-width: 100%; }
.pdoc:hover { background: #cdeee9; }
.pdoc .ic, .pdoc svg { width: 14px; height: 14px; flex: none; }
.pdoc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-marks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.pb-marks .pb-res { margin-bottom: 0; }
.pb-ev .pdoc-links { margin-left: 8px; }
.pe-docs { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.pe-docs li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pe-doc-name { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--brand-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-doc-name:hover { text-decoration: underline; }
.pl-st { stroke: #fff; stroke-width: 2; }
.pl-st.good { fill: var(--good); }
.pl-st.bad { fill: var(--bad); }
.pl-node[data-action] { cursor: pointer; }
.pl-node[data-action]:hover .pl-act, .pl-node[data-action]:hover .pl-dec, .pl-node[data-action]:hover .pl-ev { stroke: var(--brand-2); }
.pl-node.sel .pl-act, .pl-node.sel .pl-dec, .pl-node.sel .pl-ev { stroke: var(--brand-2); stroke-width: 3; filter: drop-shadow(0 0 6px rgba(36, 83, 199, .35)); }
.pl-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.pl-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.pl-legend .ic { width: 16px; height: 16px; color: var(--tc); }
.pl-legend .t-res i { width: 22px; height: 12px; border-radius: 6px; background: #2453c7; display: inline-block; }
.pv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

/* Listan */
.proc-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.proc-search { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 520px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; }
.proc-search .ic { color: var(--muted); width: 18px; height: 18px; }
.proc-search input { border: 0; outline: 0; background: transparent; padding: 10px 0; width: 100%; font-size: 14.5px; }
.proc-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(36, 83, 199, .15); }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pc-card { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0; overflow: hidden; transition: border-color .15s, transform .15s; }
.pc-card:hover { border-color: #aeb7c6; transform: translateY(-1px); }
.pc-card[hidden] { display: none; }
.pc-thumb { height: 130px; background: linear-gradient(180deg, #f7f9fc, #eef2f8); border-bottom: 1px solid var(--line); padding: 10px; }
.pc-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.pc-body b { font-size: 15px; }
.pc-org { font-size: 12.5px; color: var(--muted); }
.pc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pc-meta span { font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 10px; }
.pc-meta .t-ev { background: #e3f5ea; color: #17803f; }
.pc-meta .t-act { background: #e9effc; color: #2453c7; }
.pc-meta .t-dec { background: #fdf1e1; color: #8a5a00; }
.pc-use { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.pc-use .ic { width: 14px; height: 14px; color: var(--muted); }
.proc-empty { display: none; }

/* Visning av en process */
.pv-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .pv-grid { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { overflow-x: auto; }
.pv-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13.5px; }
.pv-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-2); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pv-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pv-table td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pv-table tr.has-res td:first-child { box-shadow: inset 4px 0 0 #2453c7; }
.pv-n { color: var(--muted); font-weight: 700; width: 28px; }
.ps-type { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--tc); background: var(--tbg); padding: 2px 8px 2px 5px; border-radius: 10px; white-space: nowrap; }
.ps-type .ic { width: 14px; height: 14px; }
.pv-res { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.pv-uses { display: grid; gap: 8px; }
.pv-use { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.pv-use:hover { border-color: #aeb7c6; }
.pv-use b { display: block; font-size: 14px; }
.pv-use small { color: var(--muted); font-size: 12.5px; }
.pv-reslist, .pe-reslist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pv-reslist li, .pe-reslist li { display: flex; align-items: center; gap: 10px; }
.pv-reslist b, .pe-reslist b { display: block; font-size: 14px; }
.pv-reslist span, .pe-reslist span { font-size: 12.5px; color: var(--muted); }
.pe-reslist li > div { flex: 1; min-width: 0; }

/* Ritverktyget */
.pe-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow); }
.pe-tools-label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.pe-tools .pl-legend { margin-left: auto; }
.pe-add { border-color: color-mix(in srgb, var(--tc) 35%, transparent); color: var(--tc); background: var(--tbg); font-weight: 650; }
.pe-add .ic { color: var(--tc); }
.pe-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .pe-grid { grid-template-columns: minmax(0, 1fr); } }
.pl-canvas.edit { min-height: 420px; }
.pe-side { position: sticky; top: 12px; display: grid; gap: 12px; }
.pe-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px; border-top: 4px solid var(--tc, var(--brand-2)); }
.pe-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15.5px; color: var(--tc, var(--ink)); }
.pe-card-head { display: flex; align-items: center; justify-content: space-between; }
.pe-card .field { margin: 0; }
.pe-card input[type=text], .pe-card textarea, .pe-card select { width: 100%; }
.pe-type label span { display: inline-flex; align-items: center; gap: 4px; }
.pe-type .ic { width: 15px; height: 15px; }
.pe-edge { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.pe-edge select { flex: 1 1 60%; min-width: 0; }
.pe-edge input { flex: 1 1 30%; min-width: 0; }
.pe-arrow { color: var(--muted); font-weight: 700; }
.pe-res-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-res-pick { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-2); border-radius: 18px; padding: 3px 10px 3px 4px; font-size: 13px; cursor: pointer; }
.pe-res-pick input { display: none; }
.pe-res-pick.on { border-color: var(--av); background: color-mix(in srgb, var(--av) 10%, transparent); font-weight: 650; }
.pe-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-actions .btn { color: var(--tc); }
.proc-note { margin-bottom: 12px; }

/* Processer under ett mål eller i ett projekt */
.proc-blocks { display: grid; gap: 10px; margin: 10px 0; }
.proc-block { border: 1px solid #b7dce6; background: #f4fafc; border-radius: 12px; overflow: hidden; }
.proc-block.missing { border-style: dashed; background: var(--surface-2); }
.pb-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; flex-wrap: wrap; }
.pb-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #0e7490; color: #fff; flex: none; }
.pb-ic .ic { width: 18px; height: 18px; }
.pb-main { flex: 1 1 220px; min-width: 0; display: grid; text-align: left; background: none; border: 0; padding: 0; }
.pb-main .type-label { color: #0e7490; }
.pb-main b { font-size: 14.5px; }
.pb-main > span:last-child { font-size: 12.5px; color: var(--muted); }
.pb-prog { width: 90px; height: 8px; border-radius: 4px; background: var(--none-bg); overflow: hidden; }
.pb-prog i { display: block; height: 100%; background: var(--good); }
.btn.tiny.warn { border-color: #f0c36a; background: #fff8e6; color: #8a5a00; }
.pb-body { border-top: 1px solid #cfe6ee; padding: 10px 12px 12px 22px; display: grid; gap: 0; background: var(--surface); position: relative; }
.pb-body::before { content: ''; position: absolute; left: 33px; top: 14px; bottom: 14px; width: 2px; background: #cfe6ee; }
.pb-ev { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 650; color: var(--ink-2); padding: 6px 0; position: relative; }
.pb-ev-dot { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid #b86400; background: #fff; flex: none; z-index: 1; }
.pb-ev-dot.start { border-color: #1f9a55; }
.pb-ev-dot.end { border-color: #b42318; border-width: 4px; }
.pb-step { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; position: relative; }
.pb-step-ic { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--tbg); color: var(--tc); flex: none; z-index: 1; margin-top: 8px; }
.pb-step-ic .ic { width: 15px; height: 15px; }
.pb-step-main { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.pb-step-main.t-procakt { border-color: color-mix(in srgb, var(--c-pakt) 35%, white); background: var(--c-pakt-bg); }
.pb-step-main.t-procakt .type-label { color: var(--c-pakt); }
.pb-step.has-res .pb-step-main { border-color: #9db4ea; box-shadow: inset 4px 0 0 #2453c7; }
.pb-step-main > .act { border: 0; padding: 0; margin: 0; box-shadow: none; background: transparent; }
.pb-step-txt b { display: block; font-size: 14px; }
.pb-step-txt small { display: block; font-size: 12.5px; color: var(--muted); }
.pb-step-txt .chips { margin-top: 4px; }
.pb-res { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: #2453c7; background: #e9effc; border-radius: 12px; padding: 2px 10px 2px 3px; margin-bottom: 6px; }
.proj-procs { margin-bottom: 14px; }

/* Koppla processer */
.lp-list { display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; margin: 10px 0; }
.lp-item { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 8px 12px; cursor: pointer; }
.lp-item[hidden] { display: none; }
.lp-item:has(input:checked) { border-color: #0e7490; background: #f0f8fb; }
.lp-thumb { width: 120px; height: 56px; flex: none; background: var(--surface-2); border-radius: 8px; padding: 4px; }
.lp-txt b { display: block; font-size: 14px; }
.lp-txt small { color: var(--muted); font-size: 12.5px; }
.modal-search { max-width: none; }
.lead.sm { font-size: 14px; margin: 0 0 10px; }
.modal.modal-map { width: min(1240px, 100%); }
.modal-map .pl-canvas { box-shadow: none; max-height: 62vh; }
.modal-map .focus-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pe-docs .file-ic { width: 24px; height: 28px; font-size: 10px; border-radius: 5px; }
.pe-docs .file-ic.ext-docx, .pe-docs .file-ic.ext-doc { font-size: 12px; }

/* Val av del i organisationen i processerna, hopfällt per förvaltning */
.otp { position: relative; }
.otp-btn { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; cursor: pointer; color: var(--ink); }
.otp-btn:hover { border-color: var(--brand-2); }
.otp-btn > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.otp-btn b { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otp-btn small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otp-btn em { color: var(--muted); font-style: normal; }
.otp-chev { width: 16px; height: 16px; transform: rotate(90deg); color: var(--muted); flex: none; }
.otp-panel { margin-top: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 24px rgba(20, 30, 60, .12); padding: 8px; }
.otp-panel[hidden] { display: none; }
.otp-search { margin-bottom: 6px; max-width: none; }
.otp-search input { padding: 7px 0; font-size: 13.5px; }
.otp-list { max-height: 320px; overflow: auto; }
.otp-list .op-item { padding-top: 5px; padding-bottom: 5px; font-size: 13.5px; }
.otp-list .op-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otp-list em { font-style: normal; color: var(--muted); }
.otp-empty { display: none; }
.lp-list.sm { max-height: 220px; margin: 6px 0; gap: 6px; }
.lp-list.sm .lp-item { padding: 6px 10px; }
.proc-link-btn { color: #0e7490; border-color: color-mix(in srgb, #0e7490 35%, transparent); white-space: nowrap; }
.proc-link-btn .ic { width: 15px; height: 15px; }

/* Sökbar rullista för processer */
.pcb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pcb-chips:not(:empty) { margin-bottom: 8px; }
.pcb-chip { display: inline-flex; align-items: center; gap: 6px; background: #e6f3f7; color: #0b5f74; border: 1px solid #bfdfe8; border-radius: 16px; padding: 3px 4px 3px 10px; font-size: 13px; font-weight: 650; max-width: 100%; }
.pcb-chip > .ic { width: 14px; height: 14px; flex: none; }
.pcb-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcb-x { border: 0; background: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: inherit; padding: 0; cursor: pointer; flex: none; }
.pcb-x:hover { background: rgba(11, 95, 116, .14); }
.pcb-x .ic { width: 13px; height: 13px; }
.pcb-box { position: relative; }
.pcb-search { max-width: none; }
.pcb-search input { padding: 8px 0; }
.pcb-drop { display: flex; flex-direction: column; margin-top: 6px; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 32px rgba(20, 30, 60, .18); padding: 6px; }
.pcb-drop[hidden] { display: none; }
.pcb-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 0; background: none; border-radius: 8px; padding: 7px 10px; font: inherit; cursor: pointer; }
.pcb-opt[hidden] { display: none; }
.pcb-opt b { font-size: 14px; font-weight: 650; color: var(--ink); }
.pcb-opt small { font-size: 12px; color: var(--muted); }
.pcb-opt:hover, .pcb-opt.hl { background: #eef6f9; }
.pcb-none, .pcb-more { order: 100000; }
.pcb-none { display: none; margin: 8px 10px; font-size: 13px; color: var(--muted); }
/* Processer som är kopplade till mål */
.pc-thumb { position: relative; }
.pc-goal-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #1d4ed8; background: #e8efff; border: 1px solid #c7d6fb; border-radius: 12px; padding: 2px 9px 2px 6px; white-space: nowrap; }
.pc-goal-badge .ic { width: 14px; height: 14px; }
.pc-thumb .pc-goal-badge { position: absolute; top: 8px; left: 8px; z-index: 1; box-shadow: 0 1px 3px rgba(20, 30, 60, .12); }
.pc-goal-badge.none { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.pc-goal-badge.proj { color: #0b5f74; background: #e6f3f7; border-color: #bfdfe8; }
.pv-linked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.pv-goal-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 2px 10px 2px 4px; cursor: pointer; }
.pv-goal-chip:hover { border-color: #1d4ed8; color: #1d4ed8; }
.proc-note.linked { background: #eef3ff; border-color: #c7d6fb; color: #1e3a8a; }
.pcb-more { margin: 6px 10px 2px; font-size: 12px; color: var(--muted); }
.pcb-more[hidden] { display: none; }

/* Tid och kritiska delar i processerna */
.pl-time { font-size: 11px; font-weight: 650; fill: #4b5568; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.pl-crit path:not(.pl-crit-x) { fill: #d64545; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.pl-crit-x { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.pl-node.crit .pl-act, .pl-node.crit .pl-dec, .pl-node.crit .pl-ev { stroke: #d64545; }
.pl-node.crit .pl-act-bar { fill: #d64545; }
.pl-legend .t-crit { color: #c03030; }
.pcrit { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: #9b1c1c; background: #fdecec; border: 1px solid #f5c2c2; border-radius: 10px; padding: 4px 10px 4px 6px; margin-top: 4px; max-width: 100%; }
.pcrit .ic { width: 16px; height: 16px; flex: none; color: #fff; fill: #d64545; margin-top: 1px; }
.pcrit b { font-weight: 750; }
.ptime { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; color: #374151; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 2px 9px 2px 6px; }
.ptime .ic { width: 14px; height: 14px; color: var(--muted); }
.pb-marks .pcrit { margin-top: 0; flex-basis: 100%; }
.pb-step.crit .pb-step-ic { background: #fdecec; color: #c03030; }
.pv-table tr.crit td:first-child { box-shadow: inset 3px 0 0 #d64545; }
.pv-table .pcrit { display: flex; width: fit-content; }
.pv-time { white-space: nowrap; font-size: 13px; }
.pe-crit-tgl { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.pe-crit-tgl > .ic { width: 22px; height: 22px; flex: none; color: #9aa3b2; }
.pe-crit-tgl span { display: flex; flex-direction: column; }
.pe-crit-tgl small { font-size: 11.5px; color: var(--muted); }
.pe-crit.on .pe-crit-tgl { border-color: #f0a8a8; background: #fdf2f2; }
.pe-crit.on .pe-crit-tgl > .ic { color: #fff; fill: #d64545; }
.pe-crit textarea { margin-top: 6px; border-color: #f0a8a8; }
.pe-tkind { margin-bottom: 8px; }
.pe-tkind span { display: inline-block; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 16px; font-size: 13px; font-weight: 600; }
.pe-tkind input:checked + span { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.pe-tkind input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.pe-month { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.pe-month > select:last-child { grid-column: 1 / -1; }
.pe-month span { font-size: 13px; color: var(--muted); }
.pe-time-sum { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pe-time-sum .ic { width: 14px; height: 14px; }

/* Ruta med innehållet i en del när man hovrar i processkartan */
svg.tipped .pl-node[data-step] { cursor: help; }
svg.tipped .pl-node[data-step]:hover .pl-act, svg.tipped .pl-node[data-step]:hover .pl-dec, svg.tipped .pl-node[data-step]:hover .pl-ev { stroke: var(--brand-2); stroke-width: 2.4; }
.ptip { position: fixed; z-index: 1000; width: 340px; max-width: calc(100vw - 20px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px rgba(20, 30, 60, .22); padding: 12px 14px; font-size: 13px; color: var(--ink-2); pointer-events: none; }
.ptip[hidden] { display: none; }
.ptip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.ptip-type { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ptip-head.t-activity .ptip-type { color: #2453c7; }
.ptip-head.t-decision .ptip-type { color: #b06d00; }
.ptip-head.t-event .ptip-type { color: #23803a; }
.ptip-type .ic { width: 14px; height: 14px; }
.ptip-st { font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 1px 8px; }
.ptip-st.good { background: #e3f5ea; color: #1d7a45; }
.ptip-st.bad { background: #fdecec; color: #b42323; }
.ptip-name { display: block; font-size: 15px; color: var(--ink); line-height: 1.3; }
.ptip-desc { margin: 6px 0 0; line-height: 1.45; }
.ptip .pcrit { margin-top: 8px; }
.ptip-rows { display: grid; gap: 7px; margin-top: 10px; }
.ptip-rows:empty { display: none; }
.ptip-row { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.ptip-row > .ic { width: 15px; height: 15px; color: var(--muted); flex: none; margin-top: 2px; }
.ptip-row small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.ptip-res { display: flex; align-items: center; gap: 6px; }

/* Notiser */
.bell-btn { position: relative; width: 42px; height: 42px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.bell-btn:hover { background: rgba(255, 255, 255, .18); }
.bell-btn .ic { width: 21px; height: 21px; }
.bell-n { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; box-shadow: 0 0 0 2px #1d3d8f; }
.bell-panel { width: 380px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; z-index: 60; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-perm { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #f3f7ff; color: var(--brand-2); font: inherit; font-size: 13px; font-weight: 650; padding: 9px 14px; cursor: pointer; text-align: left; }
.bell-perm .ic { width: 16px; height: 16px; }
.bell-list { list-style: none; margin: 0; padding: 4px; max-height: 60vh; overflow-y: auto; }
.bell-item { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; font: inherit; color: var(--ink-2); border-radius: 10px; padding: 9px 10px; cursor: pointer; }
.bell-item:hover { background: var(--surface-2); }
.bell-item.unread { background: #eef3ff; }
.bell-item.unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2453c7; margin-right: 6px; vertical-align: 1px; }
.bell-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; background: #e6f3f7; color: #0b5f74; display: grid; place-items: center; }
.bell-ic .ic { width: 16px; height: 16px; }
.bell-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; line-height: 1.4; }
.bell-txt b { color: var(--ink); font-size: 13.5px; }
.bell-txt small { color: var(--muted); font-size: 11.5px; }
.bell-empty { padding: 18px 16px; margin: 0; font-size: 13px; color: var(--muted); }
/* Välj användare till en resurs */
.upk-chip { display: flex; align-items: center; gap: 10px; border: 1.5px solid #c7d6fb; background: #eef3ff; border-radius: 12px; padding: 6px 6px 6px 8px; }
.upk-chip > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.upk-chip small { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: #1d7a45; }
.upk-chip small .ic { width: 12px; height: 12px; }
.upk-search { max-width: none; }
.upk-search input { padding: 8px 0; }
.upk-list { margin-top: 6px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; background: var(--surface); }
.upk-list[hidden] { display: none; }
.upk-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; font: inherit; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.upk-opt[hidden] { display: none; }
.upk-opt:hover { background: #eef3ff; }
.upk-opt > span:last-child { display: flex; flex-direction: column; }
.upk-opt b { font-size: 13.5px; color: var(--ink); }
.upk-opt small { font-size: 11.5px; color: var(--muted); }
.upk-none { display: none; margin: 8px; font-size: 13px; color: var(--muted); }
.res-user-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #e3f5ea; color: #1d7a45; margin-left: 5px; vertical-align: -2px; }
.res-user-mark .ic { width: 11px; height: 11px; }
.perm-note.ok { background: #eaf7ef; border-color: #bfe5cd; }
.perm-note.warn { background: #fff4e0; border-color: #f3d29a; }
.mail-settings .row2 { align-items: start; }
/* Språkval */
.lang-switch { display: inline-flex; gap: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.lang-switch button { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 650; padding: 8px 16px; color: var(--ink-2); cursor: pointer; }
.lang-switch button + button { border-left: 1px solid var(--line-2); }
.lang-switch button.on { background: var(--brand-2); color: #fff; }
.login-card .lang-switch { margin: -4px 0 14px; }
.login-card .lang-switch button { padding: 5px 12px; font-size: 13px; }
/* Skapa eget konto och verksamhetstyp */
.login-signup { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.login-signup[hidden] { display: none; }
.signup-card { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.su-types, .ed-grid { display: grid; gap: 8px; }
.ed-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 12px; }
.su-type { cursor: pointer; position: relative; }
.su-type input { position: absolute; opacity: 0; pointer-events: none; }
.su-type > span { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.su-type > span > .ic { grid-row: span 2; width: 22px; height: 22px; color: var(--brand-2); margin-top: 2px; }
.su-type b { font-size: 14.5px; color: var(--ink); }
.su-type small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.ed-grid .su-type > span { grid-template-columns: 1fr; }
.su-type input:checked + span { border-color: var(--brand-2); background: #eef3ff; box-shadow: 0 0 0 2px rgba(36, 83, 199, .15); }
.su-type input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.su-sector[hidden], .ed-sector[hidden] { display: none; }
.signup-card select { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 10px; font-size: 15px; background: var(--surface); }
.ed-sector { max-width: 360px; }
.ed-signup { margin: 4px 0 12px; }

/* ================= Startsidan ================= */
.land { --land-ink: #0f1b2d; --land-navy: #0e2240; --land-blue: #2453c7; --land-sky: #8fb4ff; --land-display: "Avenir Next", "Avenir", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column; background: #f6f8fc; color: var(--land-ink); font-family: var(--land-display); position: relative; }
.land button { font-family: inherit; cursor: pointer; }
.land-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 48px); background: rgba(14, 34, 64, .72); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.land-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 700; font-size: 21px; letter-spacing: .01em; }
.land-brand img { border-radius: 10px; }
.land-nav { display: flex; align-items: center; gap: 6px; }
.lang-mini { display: inline-flex; margin-left: 6px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 8px; overflow: hidden; }
.lang-mini button { border: 0; background: none; color: #c9d6ee; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 4px 8px; line-height: 1.4; cursor: pointer; }
.lang-mini button + button { border-left: 1px solid rgba(255, 255, 255, .28); }
.lang-mini button:hover { color: #fff; }
.lang-mini button.on { background: rgba(255, 255, 255, .18); color: #fff; }
.lang-mini button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.land-link { border: 0; background: none; color: #e7eefc; font-size: 15px; font-weight: 600; padding: 9px 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 4px; }
.land-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.land-link .ic { width: 15px; height: 15px; transform: rotate(90deg); transition: transform .15s; }
.land-menu-wrap.open .land-menu-btn .ic { transform: rotate(-90deg); }
.land-cta { border: 0; background: linear-gradient(135deg, #3b6cf0, #2453c7); color: #fff; font-size: 15px; font-weight: 650; padding: 9px 18px; border-radius: 999px; box-shadow: 0 6px 18px rgba(36, 83, 199, .35); transition: transform .15s, box-shadow .15s; }
.land-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(36, 83, 199, .45); }
.land-cta.big, .land-ghost.big { font-size: 16.5px; padding: 13px 26px; }
.land-ghost { border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .06); color: #fff; font-weight: 600; border-radius: 999px; }
.land-ghost:hover { background: rgba(255, 255, 255, .14); }
.land-menu-wrap { position: relative; }
.land-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border-radius: 14px; box-shadow: 0 18px 48px rgba(10, 20, 40, .25); padding: 6px; }
.land-menu-wrap.open .land-menu { display: block; }
.land-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 9px; font-size: 15px; color: var(--land-ink); }
.land-menu button:hover { background: #eef3ff; color: var(--land-blue); }
.land-menu hr { border: 0; border-top: 1px solid #e3e7ee; margin: 6px 4px; }
.land-main { flex: 1; }
.land.is-home .land-head { position: absolute; left: 0; right: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: transparent; }
.land-hero { position: relative; overflow: hidden; min-height: min(760px, 100vh); display: grid; place-items: center; padding: 120px 20px 90px; color: #fff;
  background: radial-gradient(1200px 600px at 75% 15%, rgba(80, 130, 255, .35), transparent 60%), radial-gradient(900px 500px at 10% 90%, rgba(46, 158, 140, .25), transparent 60%), linear-gradient(165deg, #0b1a33 0%, #10284d 45%, #1a3f86 100%); }
.land-art { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(190, 210, 255, .5); opacity: .42; pointer-events: none; }
.land-art g { fill: none; stroke: rgba(190, 210, 255, .55); stroke-width: 2; }
.land-art .land-tree { stroke: rgba(160, 230, 215, .5); }
.land-art .land-bars rect { fill: rgba(190, 210, 255, .12); stroke: none; }
.land-art .land-bars rect.fill { fill: rgba(190, 210, 255, .28); }
.land-art .land-proc, .land-art .land-tree, .land-art .land-bars { animation: land-drift 18s ease-in-out infinite alternate; }
.land-art .land-tree { animation-duration: 22s; animation-direction: alternate-reverse; }
@keyframes land-drift { from { transform: translate(0, 0); } to { transform: translate(-14px, 8px); } }
@media (prefers-reduced-motion: reduce) { .land-art g { animation: none !important; } }
.land-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 340px at 50% 48%, rgba(11, 26, 51, .7), transparent 70%); pointer-events: none; }
.land-hero-in { position: relative; z-index: 1; text-align: center; max-width: 820px; }
.land-logo { border-radius: 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); margin-bottom: 18px; }
.land-eyebrow { margin: 0 0 10px; font-size: 14px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: #9fc0ff; }
.land-hero h1 { margin: 0; font-size: clamp(38px, 6.4vw, 72px); line-height: 1.04; font-weight: 700; letter-spacing: -.02em; }
.land-lead { margin: 20px auto 0; max-width: 640px; font-size: clamp(17px, 2.1vw, 21px); line-height: 1.5; color: #d6e2fb; }
.land-hero-btns { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.land-sec { padding: clamp(56px, 8vw, 96px) clamp(16px, 5vw, 64px); max-width: 1180px; margin: 0 auto; }
.land-sec.alt { max-width: none; background: #fff; }
.land-sec.alt > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.land-sec h2 { margin: 0; text-align: center; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.01em; font-weight: 700; }
.land-sec-lead { margin: 14px auto 0; max-width: 680px; text-align: center; font-size: 17.5px; line-height: 1.55; color: #4a5568; }
.land-feats { margin-top: 44px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.land-feat { background: #fff; border: 1px solid #e3e8f2; border-radius: 18px; padding: 24px; box-shadow: 0 6px 24px rgba(15, 27, 45, .05); }
.land-feat h3, .land-who h3 { margin: 14px 0 6px; font-size: 18px; }
.land-feat p, .land-who p { margin: 0; color: #4a5568; line-height: 1.55; font-size: 15.5px; }
.land-feat-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #eaf0ff, #dfe8ff); color: var(--land-blue); flex: none; }
.land-feat-ic .ic { width: 22px; height: 22px; }
.land-whos { margin-top: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.land-who { display: flex; gap: 14px; align-items: flex-start; padding: 22px; border-radius: 18px; background: #f6f8fc; border: 1px solid #e8ecf4; }
.land-whos { row-gap: 16px; }
.land-who-col { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
.land-who-col > h2 { font-size: clamp(24px, 2.6vw, 30px); align-self: end; }
.land-who-col > .land-who { align-items: center; }
.land-center { margin-top: 40px; text-align: center; }
.land-doc { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) clamp(16px, 5vw, 32px) 80px; font-size: 16.5px; line-height: 1.65; color: #2a3445; }
.land-doc h1 { font-size: clamp(32px, 4.4vw, 46px); margin: 0 0 10px; letter-spacing: -.015em; color: var(--land-ink); }
.land-doc h2 { font-size: 21px; margin: 34px 0 8px; color: var(--land-ink); }
.land-doc p { margin: 0 0 12px; }
.land-doc ul { padding-left: 22px; margin: 0 0 12px; }
.land-doc li { margin-bottom: 6px; }
.land-doc-lead { font-size: 19px; color: #3b4658; }
.land-doc-meta { color: #6a7486; font-size: 14px; margin-bottom: 18px !important; }
.land-contact { display: grid; gap: 14px; margin-top: 28px; }
.land-contact > div { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid #e3e8f2; border-radius: 16px; padding: 18px; }
.land-contact b { display: block; color: var(--land-ink); }
.land-contact span:not(.land-feat-ic) { color: #4a5568; }
.land-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 28px clamp(16px, 5vw, 48px); background: var(--land-navy); color: #c9d6ee; }
.land-foot-brand { display: flex; align-items: center; gap: 10px; }
.land-foot-brand img { border-radius: 8px; }
.land-foot-brand span { color: #fff; font-weight: 700; font-size: 17px; }
.land-foot-brand small { color: #9fb2d6; font-size: 14px; }
.land-foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.land-foot nav button { border: 0; background: none; color: #c9d6ee; font-size: 14.5px; padding: 4px 0; }
.land-foot nav button:hover { color: #fff; text-decoration: underline; }
.land-foot .lang-switch { background: transparent; border-color: rgba(255, 255, 255, .25); }
.land-foot .lang-switch button { color: #c9d6ee; padding: 6px 12px; font-size: 13px; }
.land-foot .lang-switch button + button { border-left-color: rgba(255, 255, 255, .25); }
.land-foot .lang-switch button.on { background: rgba(255, 255, 255, .16); color: #fff; }
/* Inloggning och nytt konto ovanpå startsidan */
.login.dlg { background: rgba(8, 18, 36, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 60; overflow-y: auto; }
.login.dlg .login-card { position: relative; }
.land-x { position: absolute; top: 14px; right: 14px; }
@media (max-width: 640px) {
  .land-head { padding: 10px 12px; gap: 8px; }
  .land-brand span { display: none; }
  .land-nav { gap: 2px; }
  .land-link { padding: 8px 9px; font-size: 14px; }
  .land-cta { padding: 8px 13px; font-size: 14px; }
  .land-hero { padding-top: 100px; min-height: 620px; }
  .land-foot { flex-direction: column; align-items: flex-start; }
}
.land.is-page .land-head { background: linear-gradient(90deg, #0b1a33, #15336b); }
.land-motto { margin: 0 0 12px; font-size: clamp(16px, 1.8vw, 19px); font-weight: 500; font-style: italic; letter-spacing: .04em; color: #a9c4ff; }
.verify-card { text-align: center; justify-items: center; }
.verify-card p { margin: 0; }
.verify-card .btn { width: 100%; }
.verify-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: #eaf0ff; color: #2453c7; }
.verify-ic .ic { width: 28px; height: 28px; }
.login-err.ok { color: #1d7a45; }
.login-err .btn { margin-left: 6px; }
.su-terms { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.su-terms input { width: 18px !important; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--brand-2); }
.su-terms a { color: var(--brand-2); font-weight: 600; }
/* Rundvandring */
.tour-fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand-2); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(36, 83, 199, .35); cursor: pointer; transition: transform .15s; }
.tour-fab:hover { transform: scale(1.06); }
.tour-fab .ic { width: 24px; height: 24px; }
body.locked .tour-fab { display: none; }
#tour { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.tour-dim { position: fixed; inset: 0; background: rgba(10, 20, 40, .5); pointer-events: auto; }
.tour-dim[hidden], .tour-spot[hidden] { display: none; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10, 20, 40, .5), 0 0 0 3px #8fb4ff; transition: all .25s ease; pointer-events: none; }
.tour-card { position: fixed; width: min(380px, calc(100vw - 24px)); background: var(--surface); border-radius: 16px; box-shadow: 0 20px 50px rgba(10, 20, 40, .35); padding: 18px 20px; pointer-events: auto; transition: left .25s ease, top .25s ease; }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); }
.tour-top { display: flex; align-items: center; justify-content: space-between; }
.tour-step { font-size: 12px; font-weight: 700; color: var(--brand-2); letter-spacing: .06em; }
.tour-card h2 { margin: 6px 0 8px; font-size: 19px; }
.tour-card p { margin: 0; line-height: 1.55; color: var(--ink-2); font-size: 14.5px; }
.tour-dots { display: flex; gap: 4px; margin: 14px 0; flex-wrap: wrap; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.tour-dots i.done { background: #9fb8f0; }
.tour-dots i.on { background: var(--brand-2); width: 18px; border-radius: 4px; }
.tour-btns { display: flex; justify-content: space-between; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } }
/* Genomgångar av modulerna */
.guide-sym { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 10px; vertical-align: middle; border: 0; border-radius: 50%; background: #eaf0ff; color: var(--brand-2); cursor: pointer; transition: background .15s, transform .15s; }
.guide-sym:hover { background: var(--brand-2); color: #fff; transform: scale(1.06); }
.guide-sym .ic { width: 17px; height: 17px; }
.tour-fab-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 40; }
.tour-fab-wrap .tour-fab { position: static; }
body.locked .tour-fab-wrap { display: none; }
@media (max-width: 700px) { .tour-fab-wrap { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } .tour-fab { width: 40px; height: 40px; } }  /* ovanför mobilens meny */
.tour-menu { position: absolute; right: 0; bottom: 54px; width: 270px; background: var(--surface); border-radius: 14px; box-shadow: 0 18px 44px rgba(10, 20, 40, .25); padding: 6px; }
.tour-menu[hidden] { display: none; }
.tour-menu-title { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.tour-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; font: inherit; font-size: 14px; padding: 9px 10px; border-radius: 9px; cursor: pointer; color: var(--ink); }
.tour-menu button:hover { background: #eef3ff; color: var(--brand-2); }
.tour-menu .ic { width: 17px; height: 17px; color: var(--brand-2); }
.land-burger { width: 42px; height: 40px; justify-content: center; padding: 0; }
.land-burger svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.land-menu-wrap.open .land-burger { background: rgba(255, 255, 255, .14); }

/* Inte uppföljt i tid */
.late-mark, .late-under i { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 800; font-style: normal; line-height: 1; vertical-align: 1px; }
.late-mark { margin-right: 6px; }
.late-under { display: inline-flex; align-items: center; gap: 3px; margin-left: 7px; font-size: 11.5px; font-weight: 700; color: var(--bad); vertical-align: 1px; }
.late-under i { width: 13px; height: 13px; font-size: 9.5px; }
.gt-type .late-mark { margin: 0 0 0 5px; width: 14px; height: 14px; font-size: 10px; }

/* Dashboard */
.db-page { max-width: 1320px; display: grid; gap: 16px; }
.db-page > * { min-width: 0; }
.db-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 26px 28px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 160% at 100% 0%, #3468dd 0%, rgba(52, 104, 221, 0) 58%), linear-gradient(120deg, #17375e 0%, #1d4688 100%); box-shadow: 0 10px 28px rgba(23, 55, 94, .22); }
.db-hero-txt { min-width: 0; }
.db-date { font-size: 13px; font-weight: 600; opacity: .78; }
.db-date::first-letter { text-transform: uppercase; }
.db-hero h1 { margin: 2px 0 6px; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; color: #fff; }
.db-hero p { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; opacity: .92; }
.db-focus { display: flex; gap: 10px; flex-wrap: wrap; }
.db-focus-btn { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 8px; min-width: 132px; padding: 11px 14px; text-align: left; color: #fff;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; transition: background .15s, transform .15s; }
.db-focus-btn:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.db-focus-btn:focus-visible { outline-color: #fff; }
.db-focus-btn b { font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.db-focus-btn span { grid-column: 1 / -1; margin-top: 4px; font-size: 12.5px; font-weight: 600; opacity: .86; }
.db-focus-btn .ic { opacity: .8; }
.db-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.db-tile { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 15px 16px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; }
.db-tile:hover, .db-proj:hover { border-color: var(--line-2); }
.db-tile:hover { box-shadow: 0 8px 22px rgba(20, 30, 50, .09); transform: translateY(-1px); }
.db-tile-top { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.db-tile-top > span:nth-child(2) { flex: 1; min-width: 0; }
.db-go-ic { width: 15px; height: 15px; color: var(--muted); opacity: .55; transition: opacity .15s, transform .15s; }
button:hover > .db-go-ic, button:hover > .db-tile-top .db-go-ic { opacity: 1; transform: translateX(2px); }
.db-num { font-size: 30px; font-weight: 750; line-height: 1.05; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.db-num small { font-size: 13px; font-weight: 550; letter-spacing: 0; color: var(--muted); }
.db-bar { display: flex; gap: 2px; height: 7px; border-radius: 4px; overflow: hidden; }
.db-legend { display: flex; flex-wrap: wrap; gap: 3px 11px; font-size: 12px; color: var(--muted); }
.db-legend span { display: inline-flex; align-items: center; gap: 5px; }
.db-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.db-cols.one { grid-template-columns: minmax(0, 1fr); }
.db-col { display: grid; gap: 16px; min-width: 0; }
.db-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.db-foot.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.db-panel { min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.db-panel header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.db-panel h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; min-width: 0; }
.db-more { display: inline-flex; align-items: center; gap: 3px; flex: none; padding: 3px 4px; border: 0; background: none; font-size: 12.5px; font-weight: 650; color: var(--brand-2); border-radius: 6px; }
.db-more:hover { text-decoration: underline; }
.db-more .ic { width: 14px; height: 14px; }
.db-list { display: grid; margin: 0 -6px; }
.db-row, .db-ind { display: flex; align-items: center; gap: 11px; width: 100%; min-width: 0; padding: 9px 6px; text-align: left; border: 0; background: none; border-radius: 10px; border-top: 1px solid var(--line); transition: background .12s; }
.db-list > :first-child { border-top-color: transparent; }
.db-row:hover, .db-ind:hover, .db-proj:hover { background: var(--surface-2); }
.db-row-main { flex: 1; display: grid; gap: 1px; min-width: 0; }
.db-row-main b { font-size: 13.5px; font-weight: 620; color: var(--ink); overflow-wrap: anywhere; }
.db-row-main span { font-size: 12.5px; color: var(--muted); }
.db-tag { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 2px 8px 2px 6px; border-radius: 20px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.db-tag .ic { width: 12px; height: 12px; }
.db-tag.warn { background: var(--warn-bg); color: #7a5500; }
.db-tag.bad { background: var(--bad-bg); color: #a12d25; }
.db-tag.info { background: var(--c-res-bg); color: var(--brand-2); }
.db-tag.mine { background: var(--c-proj-bg); color: var(--brand); }
.db-ind-g { flex: none; width: 46px; display: grid; place-items: center; }
.db-ind-g .yn { transform: scale(.7); }
.db-ind-val { display: grid; justify-items: end; gap: 1px; flex: none; max-width: 40%; font-size: 12px; }
.db-ind-val b { font-size: 15px; font-weight: 720; font-variant-numeric: tabular-nums; color: var(--ink); }
.db-ind-val span { display: inline-flex; align-items: center; gap: 3px; font-weight: 620; }
.db-ind-val .ic { width: 12px; height: 12px; }
.db-proj { display: grid; gap: 1px; width: 100%; padding: 9px 6px; text-align: left; border: 0; background: none; border-radius: 10px; border-top: 1px solid var(--line); }
.db-proj-top { display: flex; align-items: center; gap: 8px; }
.db-proj-top b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 620; color: var(--ink); }
.db-pct { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.db-proj .pbar { display: block; }
.db-proj-sub { font-size: 12.5px; color: var(--muted); }
.db-empty { display: flex; align-items: center; gap: 10px; padding: 14px 4px 6px; color: var(--muted); font-size: 13.5px; }
.db-empty p { margin: 0; }
.db-rep { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
.t-risk { --tc: var(--c-ind); --tbg: var(--c-ind-bg); }
.t-rapport { --tc: var(--c-res); --tbg: var(--c-res-bg); }
.t-process { --tc: var(--c-pakt); --tbg: var(--c-pakt-bg); }
@media (max-width: 1040px) { .db-cols { grid-template-columns: minmax(0, 1fr); } .db-foot, .db-foot.two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .db-hero { padding: 20px; border-radius: 16px; }
  .db-hero h1 { font-size: 25px; }
  .db-focus { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; }
  .db-focus-btn { min-width: 0; padding: 9px 10px; }
  .db-focus-btn span { font-size: 11.5px; }
  .db-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-num { font-size: 25px; }
  .db-row { flex-wrap: wrap; }
  .db-row .db-row-main { flex-basis: 60%; }
}

/* ---------- Guide för den första organisationen ---------- */
.osw { max-width: 1120px; }
.osw-steps { display: flex; align-items: center; gap: 6px; margin: 4px 0 16px; }
.osw-steps span { width: 28px; height: 5px; border-radius: 3px; background: var(--line-2); }
.osw-steps span.done { background: var(--brand-2); opacity: .45; }
.osw-steps span.on { background: var(--brand-2); }
.osw-steps small { margin-left: 8px; color: var(--muted); font-size: 12.5px; }
.osw-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.osw-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px 22px; }
.osw-card h2 { margin: 0 0 6px; font-size: 22px; color: var(--ink); line-height: 1.25; }
.osw-lead { margin: 0 0 18px; color: var(--ink-2); font-size: 15px; line-height: 1.55; max-width: 620px; }
.osw-list { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: osw; display: grid; gap: 10px; }
.osw-list li { counter-increment: osw; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; }
.osw-list li::before { content: counter(osw); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: #eef3ff; color: var(--brand-2); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.osw-list b { color: var(--ink); font-size: 15px; }
.osw-list span { color: var(--muted); font-size: 13.5px; }
.osw-fixed { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.osw-fixed .ic { width: 18px; height: 18px; color: var(--good); }
.osw-why { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.osw-why .ic { flex: none; width: 17px; height: 17px; margin-top: 1px; color: var(--brand-2); }
.osw-tops { margin-bottom: 10px; }
.osw .field textarea { width: 100%; resize: vertical; font: inherit; }
.osw-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.osw-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.osw-levels input[readonly] { background: var(--surface-2); color: var(--muted); }
.osw-li-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.osw-li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 32px; align-items: center; gap: 8px; }
.osw-li-n { width: 24px; height: 24px; border-radius: 50%; background: #eef3ff; color: var(--brand-2); font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
.osw-li.is-new .osw-li-n { background: var(--surface-2); color: var(--muted); }
.osw-li input { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 9px; font: inherit; font-size: 14.5px; background: var(--surface); color: var(--ink); }
.osw-li.is-new input { border-style: dashed; }
.osw-li input:focus { outline: none; border-color: var(--brand-2); border-style: solid; box-shadow: 0 0 0 3px rgba(36, 83, 199, .15); }
.osw-li .icon-btn .ic { width: 16px; height: 16px; }
.osw-li-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.osw-li-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.osw-li-hint kbd { font: inherit; font-size: 11.5px; font-weight: 700; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--ink-2); }
.osw-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; }
.osw-chips-l { font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.osw-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 10px 4px 7px; font: inherit; font-size: 13px; cursor: pointer; }
.osw-chip .ic { width: 14px; height: 14px; color: var(--brand-2); }
.osw-chip:hover { border-color: var(--brand-2); color: var(--brand-2); background: #eef3ff; }
.osw-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.osw-next h3 { margin: 4px 0 8px; font-size: 15px; color: var(--ink); }
.osw-next ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.osw-next li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.osw-next li .ic { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--brand-2); }
.osw-prev { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 12px; }
.osw-prev-h { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: 14px; margin-bottom: 10px; }
.osw-prev-h .ic { width: 18px; height: 18px; color: var(--brand-2); }
.osw-tree, .osw-tree ul { list-style: none; margin: 0; padding: 0; }
.osw-tree ul { margin-left: 12px; padding-left: 12px; border-left: 1.5px solid var(--line-2); }
.osw-tree li { margin: 6px 0; }
.osw-node { display: grid; padding: 6px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.osw-node small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.osw-node b { font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.osw-node.kf { background: #eef3ff; border-color: #c9d7fb; }
.osw-node.root { border-color: var(--brand-2); }
.osw-prev-note { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.osw-prev-note .ic { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.osw-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.osw-restore { max-width: 1120px; margin: 16px auto 0; padding: 0 20px 20px; color: var(--muted); font-size: 13.5px; }
.osw-restore summary { cursor: pointer; }
.se-levels { margin: 6px 0 14px; }
.se-levels-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.se-levels-in input { width: 150px; padding: 6px 9px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 14px; background: var(--surface); color: var(--ink); }
.se-lv-arrow { color: var(--muted); }
@media (max-width: 900px) { .osw-grid { grid-template-columns: 1fr; } .osw-prev { position: static; } }
@media (max-width: 640px) {
  .osw-card { padding: 18px 16px 16px; }
  .osw-row, .osw-levels { grid-template-columns: 1fr; }
  .osw-steps span { width: 18px; }
}

.su-full { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--ink); }
.su-full .ic { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--warn); }
.su-full b { display: block; margin-bottom: 2px; }
.su-full p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
