/* Anbudsverktygets gemensamma skal: designvärden, typsnitt, knappar, statusmärken, header, sidfot.
   Följer docs/design/DESIGN.md. Varje sida laddar den här filen först och skriver inga egna färger. */

@font-face { font-family: "Public Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/PublicSans-Regular.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/PublicSans-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/PublicSans-Bold.woff2) format("woff2"); }

:root {
  --bg: #F3F3EF; --panel: #FFFFFF; --panel2: #F6F6F3; --border: #E3E3DE; --border-strong: #D4D4CE; --divider: #ECECE8;
  --text: #18181B; --text-2: #45453F; --muted: #5B5B57;
  --primary: var(--brand, #1F4FD1); --primary-hover: #163A9E; --primary-text: #FFFFFF; --link: var(--brand, #1F4FD1); --link-hover: #163A9E;
  --ok: #1E6B3A; --ok-bg: #E6F2EA; --warn: #7A3F06; --warn-bg: #FBEBD5; --warn-panel: #FFF6E9; --warn-border: #F0D6B0;
  --wait: #45453F; --wait-bg: #EFEFEC; --bad: #A3261B; --bad-bg: #F9E4E1; --support: #6B4410;
  --sel: #EAF0FD; --current: #FFFBF4;
  --mark: #E07400; --mark-fill: rgba(224,116,0,0.22); --mark-2: #1F4FD1; --mark-2-fill: rgba(31,79,209,0.12);
  --paper: #FFFFFF; --canvas: #ECECE8; --shadow: 0 8px 28px rgba(0,0,0,.12); --shadow-sm: 0 1px 2px rgba(24,24,27,.06), 0 1px 3px rgba(24,24,27,.04);
  --side: #FFFFFF; --side-hover: #F3F3EF;
  --radius: 8px; --radius-lg: 12px;
  --sq-admin: #E8C84A; --sq-anbud: #5B8DEF; --sq-aktiv: #1F7A4D; --sq-klar: #7FB89A; --sq-avslutat: #B9BEC6; --sq-ingen: #D4D7DC;  /* Nexts statusfärger */
  /* äldre namn som sidorna använder tills de är omskrivna */
  --accent: var(--primary); --accent-soft: var(--sel); --ok-soft: var(--ok-bg); --warn-soft: var(--warn-bg);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #161614; --panel: #1F1F1C; --panel2: #262623; --border: #34342F; --border-strong: #3F3F3A; --divider: #2A2A26;
  --text: #ECECE7; --text-2: #C4C4BC; --muted: #A3A39B;
  --primary: var(--brand, #3D68E8); --primary-hover: #5A80EE; --link: #8FA9F5; --link-hover: #B3C5F8;
  --ok: #8FD4A6; --ok-bg: #17321F; --warn: #F2B26B; --warn-bg: #3A2710; --warn-panel: #2E2113; --warn-border: #4A3519;
  --wait: #BDBDB5; --wait-bg: #2A2A26; --bad: #F08A7E; --bad-bg: #3B1E1A;
  --sel: #22304F; --current: #262218; --mark: #F08A1E; --mark-fill: rgba(240,138,30,0.3); --mark-2: #8FA9F5; --mark-2-fill: rgba(143,169,245,0.18);
  --canvas: #111110; --shadow: 0 8px 28px rgba(0,0,0,.5); --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --side: #1A1A18; --side-hover: #242421;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #161614; --panel: #1F1F1C; --panel2: #262623; --border: #34342F; --border-strong: #3F3F3A; --divider: #2A2A26;
  --text: #ECECE7; --text-2: #C4C4BC; --muted: #A3A39B;
  --primary: var(--brand, #3D68E8); --primary-hover: #5A80EE; --link: #8FA9F5; --link-hover: #B3C5F8;
  --ok: #8FD4A6; --ok-bg: #17321F; --warn: #F2B26B; --warn-bg: #3A2710; --warn-panel: #2E2113; --warn-border: #4A3519;
  --wait: #BDBDB5; --wait-bg: #2A2A26; --bad: #F08A7E; --bad-bg: #3B1E1A;
  --sel: #22304F; --current: #262218; --mark: #F08A1E; --mark-fill: rgba(240,138,30,0.3); --mark-2: #8FA9F5; --mark-2-fill: rgba(143,169,245,0.18);
  --canvas: #111110; --shadow: 0 8px 28px rgba(0,0,0,.5); --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --side: #1A1A18; --side-hover: #242421;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* hidden means hidden on every page, also where a class sets display (.nextstep) */
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; display: flex; flex-direction: column; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 32px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
small, .small { font-size: 14px; }
.muted { color: var(--muted); }
.text2 { color: var(--text-2); }
.lead { color: var(--text-2); font-size: 18px; max-width: 760px; }
.kicker { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.num { font-variant-numeric: tabular-nums; }

/* Knappar: en primär per skärm, resten sekundära, text eller i meny. */
button, .btn { font: inherit; font-size: 15px; color: var(--text); background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 16px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--text-2); color: var(--text); }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-text); }
button.big, .btn.big { min-height: 52px; padding: 0 28px; font-size: 18px; border-radius: 10px; }
button.link, .btn.link, button.quiet, .btn.quiet { background: none; border-color: transparent; color: var(--link); padding: 0 6px; }
button.link:hover, .btn.link:hover, button.quiet:hover { color: var(--link-hover); border-color: transparent; }
button.quiet { color: var(--muted); }
button.danger, .btn.danger { background: none; border-color: transparent; color: var(--bad); }
button.danger:hover { color: var(--bad); border-color: var(--bad); }
button.small, .btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
button.on, .btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

select, input[type=search], input[type=text], input[type=number], input[type=email], input[type=password], input[type=url], textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 9px 12px; min-height: 44px; }
textarea { min-height: 88px; line-height: 1.45; }
select { padding-right: 32px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-2); }
label.field > input, label.field > select, label.field > textarea { width: 100%; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; min-height: 44px; cursor: pointer; }

/* Ikoner (shell.icon): linje, ärver textfärgen */
svg.i { width: 18px; height: 18px; flex: 0 0 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.seg { display: inline-flex; gap: 4px; }
.seg button { min-height: 36px; padding: 0 12px; font-size: 14px; }

/* Status i ord, färg som stöd. */
.status { display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 6px; background: var(--wait-bg); color: var(--wait); white-space: nowrap; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
.status.run { background: var(--sel); color: var(--link); }
.stepnum { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 16px; background: var(--wait-bg); color: var(--wait); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.stepnum.ok { background: var(--ok-bg); color: var(--ok); }
.stepnum.now { background: var(--primary); color: var(--primary-text); }
.chip { display: inline-flex; align-items: center; font-size: 14px; padding: 3px 10px; border-radius: 6px; background: var(--wait-bg); color: var(--text-2); border: 1px solid transparent; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.tag { display: inline-block; font-size: 14px; padding: 2px 8px; border-radius: 5px; background: var(--wait-bg); color: var(--text-2); }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.warn { background: var(--warn-bg); color: var(--warn); } .tag.bad { background: var(--bad-bg); color: var(--bad); }

/* Ytor */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.card h2 { font-size: 18px; margin-bottom: 12px; }
.notice { background: var(--warn-panel); border: 1px solid var(--warn-border); border-radius: 10px; padding: 16px; }
.notice h3 { color: var(--warn); margin-bottom: 6px; }
.critical { color: var(--bad); font-weight: 600; }
hr, .rule { border: 0; border-top: 1px solid var(--divider); margin: 16px 0; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th { text-align: left; font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--border); }
table.list td { padding: 12px; border-bottom: 1px solid var(--divider); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.n, table.list th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
dl.facts { margin: 0; display: grid; grid-template-columns: 1fr auto; row-gap: 8px; column-gap: 16px; font-size: 15px; }
dl.facts dt, dl.facts dd { margin: 0; } dl.facts dd { text-align: right; font-variant-numeric: tabular-nums; }
dl.facts .sum { font-weight: 600; padding-top: 8px; border-top: 1px solid var(--divider); }

/* Menyer (details) */
details.menu { position: relative; }
details.menu > summary { list-style: none; display: inline-flex; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: " ▾"; margin-left: 2px; }
details.menu > .menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 50; display: flex; flex-direction: column; }
details.menu.left > .menu-list { right: auto; left: 0; }
.menu-list > a, .menu-list > button, .menu-list > label { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 15px; text-decoration: none; text-align: left; cursor: pointer; }
.menu-list > a:hover, .menu-list > button:hover, .menu-list > label:hover { background: var(--panel2); color: var(--text); border-color: transparent; }
.menu-list > .menu-head { font-size: 14px; color: var(--muted); padding: 10px 12px 4px; text-transform: uppercase; letter-spacing: .04em; }
.menu-list > hr { margin: 6px 0; }
.menu-list > .menu-note { font-size: 14px; color: var(--muted); padding: 6px 12px 10px; }
.menu-list .seg { display: flex; gap: 4px; }
.menu-list .seg button { min-height: 32px; padding: 0 10px; font-size: 14px; }

/* Skalet: sidomenyn till vänster (logga, Nytt projekt, Hem, Projekt; längst ner Hjälp, Inställningar och
   kontokortet), en smal topprad bara i projektets steg, innehållet i en bredd. */
:root { --side-w: 264px; --content-w: 1200px; }
#supportBar { background: var(--support); color: #fff; font-size: 14px; padding: 8px 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
#supportBar button { font-size: 14px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.6); border-radius: 6px; min-height: 32px; padding: 2px 12px; }
#supportBar button:hover { background: rgba(255,255,255,.12); }
body.has-side { padding-left: var(--side-w); }
body.has-side.side-folded { padding-left: 0; }
aside.shellnav { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; padding: 16px 12px 14px; z-index: 35; overflow: visible; }  /* under the guided tour (38–40), dialogs and toasts */
body.side-folded aside.shellnav { display: none; }
body.side-folded.side-over aside.shellnav { display: flex; box-shadow: var(--shadow); }
aside.shellnav .logo { display: flex; align-items: center; gap: 6px; padding: 2px 4px 12px; }
aside.shellnav .brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; color: var(--text); text-decoration: none; padding: 4px; border-radius: var(--radius); }
aside.shellnav .brand:hover { background: var(--side-hover); }
aside.shellnav .brand b { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside.shellnav .mark { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; }
aside.shellnav .mark svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
aside.shellnav .collapse { flex: 0 0 auto; width: 32px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--muted); border-radius: 6px; }
aside.shellnav .collapse:hover { background: var(--side-hover); color: var(--text); }
aside.shellnav .newbtn { margin: 2px 0 12px; min-height: 42px; width: 100%; }
aside.shellnav nav.main, aside.shellnav nav.lower { display: flex; flex-direction: column; gap: 2px; }
aside.shellnav nav a, aside.shellnav nav summary { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; cursor: pointer; }
aside.shellnav nav a:hover, aside.shellnav nav summary:hover { background: var(--side-hover); color: var(--text); }
aside.shellnav nav a.on { background: var(--sel); color: var(--link); font-weight: 600; }
aside.shellnav nav a .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside.shellnav [hidden] { display: none !important; }  /* the menu's flex rules must not bring hidden items back */
aside.shellnav .grow { flex: 1 1 auto; min-height: 16px; }
aside.shellnav nav.lower { padding-top: 8px; }
aside.shellnav nav.main { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
aside.shellnav .ptree { margin: 2px 0 6px; display: flex; flex-direction: column; }
aside.shellnav .trow { display: flex; align-items: center; border-radius: 8px; min-height: 34px; padding-right: 6px; }
aside.shellnav .trow:hover { background: var(--side-hover); }
aside.shellnav .trow.on { background: var(--side-active, var(--sel)); }
aside.shellnav .trow.on a { color: var(--primary); font-weight: 600; }
aside.shellnav .trow .tog { flex: 0 0 22px; width: 22px; min-height: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 6px; }
aside.shellnav .trow button.tog:hover { background: var(--divider); color: var(--text); }
aside.shellnav .trow .tog svg.i { width: 15px; height: 15px; flex-basis: 15px; }
aside.shellnav nav .trow a { flex: 1 1 auto; min-width: 0; min-height: 34px; padding: 0 4px; font-size: 14.5px; font-weight: 500; background: none; }
aside.shellnav nav a.parent { color: var(--text); font-weight: 600; }
aside.shellnav .pnest { margin: 0 0 6px 20px; padding-left: 8px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
aside.shellnav .pnest .pntitle { font-size: 14px; font-weight: 600; padding: 6px 10px 4px; line-height: 1.3; color: var(--text-2); }
aside.shellnav nav a.pitem { min-height: 36px; font-size: 14.5px; }
aside.shellnav .backlink { color: var(--muted); font-size: 14px; min-height: 36px; }
aside.shellnav .pntitle { font-weight: 700; font-size: 17px; line-height: 1.3; padding: 8px 10px 14px; overflow-wrap: anywhere; }
aside.shellnav nav.main a.pitem { justify-content: space-between; gap: 8px; }
aside.shellnav .pst { font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--wait); }
aside.shellnav .pst.ok { color: var(--ok); } aside.shellnav .pst.warn { color: var(--warn); } aside.shellnav .pst.bad { color: var(--bad); } aside.shellnav .pst.run { color: var(--primary); }
aside.shellnav details.menu > summary::after { content: none; }
aside.shellnav details.menu.up > .menu-list { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; min-width: 240px; }
aside.shellnav .menu-list > a svg.i, aside.shellnav .menu-list > button svg.i { margin-right: 8px; color: var(--muted); }
/* the account card: initials, name, company; the menu above it */
aside.shellnav .usermenu { margin-top: 8px; }
aside.shellnav .usermenu > summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 52px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; }
aside.shellnav .usermenu > summary:hover { background: var(--side-hover); }
aside.shellnav .usermenu .av { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 17px; background: var(--sel); color: var(--link); font-weight: 700; font-size: 14px; display: grid; place-items: center; }
aside.shellnav .usermenu .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1 1 auto; }
aside.shellnav .usermenu .who b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside.shellnav .usermenu .who span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside.shellnav .usermenu > summary > svg.i { color: var(--muted); flex: 0 0 18px; }
header.shell { background: var(--panel); border-bottom: 1px solid var(--border); padding: 0 24px; flex: 0 0 auto; }
header.shell > .inner { min-height: 60px; display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 20px; }
header.shell .sideopen { display: none; flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--border-strong); font-weight: 600; min-height: 40px; }
body.side-folded header.shell .sideopen { display: inline-flex; }
header.shell nav.bar { display: flex; align-items: center; gap: 16px; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; }
header.shell .brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
header.shell .back { color: var(--text); text-decoration: none; font-weight: 600; font-size: 17px; flex: 0 1 auto; min-width: 60px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.shell .sep { color: var(--border-strong); flex: 0 0 auto; }
header.shell .steptitle { font-weight: 600; font-size: 17px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.shell .count { flex: 0 0 auto; white-space: nowrap; }
/* inside a project: the way back, then the steps in one row (the open one marked, done ones ticked, a number where
   something waits); the names shorten to fit, the row never wraps */
header.shell .back { color: var(--link); font-weight: 600; font-size: 16px; padding: 8px 10px; margin-left: -10px; border-radius: var(--radius); min-height: 40px; display: inline-flex; align-items: center; flex: 0 1 auto; }
header.shell .back:hover { background: var(--panel2); color: var(--link-hover); }
header.shell nav.bar { flex-wrap: wrap; row-gap: 4px; }
header.shell nav.bar ol.stepper { flex: 1 0 100%; margin: 0 0 0 -10px; order: 9; }
header.shell > .inner { padding-top: 6px; }
header.shell ol.stepper .sdot { width: 7px; height: 7px; border-radius: 4px; background: #E08A2E; }
header.shell ol.stepper .sdot.bad { background: var(--bad); }
header.shell ol.stepper { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; gap: 2px; flex: 0 1 auto; min-width: 0; }
header.shell ol.stepper li { min-width: 0; flex: 0 1 auto; }
header.shell ol.stepper a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; border-radius: var(--radius); color: var(--text-2); text-decoration: none; font-size: 15px; white-space: nowrap; max-width: 100%; }
header.shell ol.stepper a .sl { overflow: hidden; text-overflow: ellipsis; }
header.shell ol.stepper a:hover { background: var(--panel2); color: var(--text); }
header.shell ol.stepper a.on { background: var(--sel); color: var(--text); font-weight: 600; box-shadow: inset 0 -3px 0 var(--primary); }
header.shell ol.stepper .sd { color: var(--ok); font-weight: 700; }
header.shell ol.stepper .sb { font-size: 14px; font-weight: 600; background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 0 7px; line-height: 20px; }
body.side-folded.side-over::before { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 34; }
header.shell .progress { display: inline-block; flex: 0 0 140px; width: 140px; height: 6px; background: var(--divider); border-radius: 3px; overflow: hidden; }
header.shell .progress > span { display: block; height: 6px; background: var(--primary); border-radius: 3px; }
header.shell .right { display: flex; align-items: center; gap: 20px; flex: 0 0 auto; white-space: nowrap; }
header.shell #stepLinks { display: inline-flex; gap: 20px; }
header.shell .right a { color: var(--muted); text-decoration: none; font-size: 15px; }
header.shell .right a:hover { color: var(--text); }
@media (max-width: 1320px) { header.shell .progress { display: none; } }
main.page { flex: 1 1 auto; width: 100%; max-width: var(--content-w); margin: 0 auto; padding: 32px 32px 48px; }
main.page.wide { max-width: var(--content-w); }
nav.crumbs { font-size: 15px; color: var(--muted); margin-bottom: 20px; }
nav.crumbs a { color: var(--muted); }
footer.shell { display: none; }
.pagehead { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.pagehead .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nextstep { margin-top: 32px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 32px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.nextstep h2 { font-size: 26px; margin: 0 0 6px; }
.nextstep .what { flex: 999 1 480px; min-width: 0; }
.nextstep .do { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.cols { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.cols > .main { flex: 999 1 560px; min-width: 0; }
.cols > .side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
ol.steps { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
ol.steps > li { border-bottom: 1px solid var(--divider); }
ol.steps > li:last-child { border-bottom: 0; }
ol.steps > li > a, ol.steps > li > div { display: flex; gap: 20px; align-items: center; padding: 20px 24px; text-decoration: none; color: var(--text); }
ol.steps > li > a:hover { background: var(--panel2); }
ol.steps > li.now > a { background: var(--current); }
ol.steps .what { flex: 1 1 auto; min-width: 0; }
ol.steps .what b { display: block; font-weight: 600; font-size: 18px; }
ol.steps .what span { display: block; color: var(--muted); font-size: 15px; }

/* Toast och feedback */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-size: 15px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 200; max-width: 80vw; }
#toast.show { opacity: 1; }
#fbBox { position: fixed; right: 24px; bottom: 24px; width: 360px; max-width: calc(100vw - 48px); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 16px; z-index: 150; display: flex; flex-direction: column; gap: 10px; }
#fbBox textarea { width: 100%; }

/* Dialog */
dialog.sheet { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); padding: 0; box-shadow: var(--shadow); max-width: min(96vw, 1100px); width: 100%; }
dialog.sheet::backdrop { background: rgba(0,0,0,.45); }

@media (max-width: 900px) { body.has-side { padding-left: 0; } body.has-side:not(.side-over) aside.shellnav { display: none; } body.has-side header.shell { display: block !important; } body.has-side header.shell .sideopen { display: inline-flex; } header.shell > .inner { gap: 10px; } main.page { padding: 20px 16px 40px; } h1 { font-size: 26px; } }

/* Projektmappen (platform.js folder): sidan mapp.html och steget Underlag i projektvyn */
.pfolder .lead-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.pfolder section.card { margin-top: 24px; }
.pfolder section.card h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 18px; margin-bottom: 12px; }
.pfolder section.card h2 .count { color: var(--muted); font-weight: 400; font-size: 15px; }
.pfolder section.card .tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pfolder section.card .tools .btn, .pfolder section.card .tools button { min-height: 40px; font-size: 14px; }
.pfolder .empty { color: var(--muted); padding: 4px 0; }
.pfolder .nums { display: flex; gap: 28px; flex-wrap: wrap; margin: 4px 0 12px; }
.pfolder .nums div { font-size: 14px; color: var(--muted); }
.pfolder .nums b { display: block; font-size: 26px; color: var(--text); font-weight: 700; }
.pfolder .ata-desc { color: var(--muted); font-size: 14px; max-width: 520px; }
.pfolder .timeline { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.pfolder .timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.pfolder .timeline li:last-child { border-bottom: 0; }
.pfolder .timeline .when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .pfolder .timeline li { grid-template-columns: 1fr; } }

aside.shellnav nav .trow a { display: flex; align-items: center; gap: 8px; }
.sq { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 11px; display: inline-block; }

/* Pipelinen överst i ett projekt: de sex stegen i ordning, klara med bock, det aktuella markerat, resten väntar */
header.shell .pipewrap { flex: 1 0 100%; order: 9; display: flex; align-items: center; gap: 18px; padding: 6px 0 10px; margin-left: 0; }
.pipe { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.pipe .ps { display: flex; align-items: center; flex: 1 1 0; min-width: 0; }
.pipe .ps:last-child { flex: 0 0 auto; }
.pipe .ps::after { content: ""; flex: 1 1 12px; height: 2px; background: var(--border-strong); margin: 0 8px; min-width: 12px; border-radius: 1px; }
.pipe .ps:last-child::after { display: none; }
.pipe .ps.ok::after { background: var(--ok); }
.pipe .pstep { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); font-size: 14.5px; font-weight: 500; white-space: nowrap; border-radius: 999px; padding: 3px 10px 3px 3px; min-height: 36px; }
.pipe .pstep:hover { background: var(--panel2); color: var(--text); }
.pipe .pstep.off { pointer-events: none; }
.pipe .pn { width: 28px; height: 28px; border-radius: 14px; flex: 0 0 28px; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--wait-bg); color: var(--wait); }
.pipe .pn svg.i { width: 15px; height: 15px; flex-basis: 15px; stroke-width: 2.6; }
.pipe .ps.ok .pn { background: var(--ok-bg); color: var(--ok); } .pipe .ps.ok .pstep { color: var(--text-2); }
.pipe .ps.now .pn { background: var(--primary); color: var(--primary-text); } .pipe .ps.now .pstep { color: var(--text); font-weight: 600; }
.pipe .ps.warn .pn { box-shadow: 0 0 0 3px var(--warn-bg); }
.pipe .pstep.on { background: var(--sel); color: var(--text); font-weight: 600; }
.pipewrap .plink { color: var(--text-2); text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 6px 10px; border-radius: var(--radius); white-space: nowrap; }
.pipewrap .plink:hover { background: var(--panel2); color: var(--text); }
.pipewrap .plink.on { background: var(--sel); color: var(--text); font-weight: 600; }
.pipewrap .pextra { display: flex; gap: 2px; padding-left: 12px; border-left: 1px solid var(--border); }
@media (max-width: 1250px) { .pipe .pstep .sl { display: none; } .pipe .ps.now .pstep .sl, .pipe .pstep.on .sl { display: inline; } }

header.shell .pipewrap { max-width: calc(var(--content-w) - 64px); width: 100%; margin: 0 auto; }
.pipecard { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 12px 20px; margin: 20px 0 0; }
.pipecard .pipewrap { padding: 0; }
