/* marknad.falufri.se – Falufri theme on top of Bootstrap 5.3.
   Source: design handoff (Claude Design), README section 2. Light theme is default,
   the menu is dark ink to set Marknad apart from falufri.se. */

/* ── Barlow, self-hosted ─────────────────────────────────────────────────── */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/barlow-400-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/barlow-400-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/barlow-500-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/barlow-500-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/barlow-600-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/barlow-600-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/barlow-700-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/barlow-700-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/barlow-800-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/barlow-800-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 900; font-display: swap;
  src: url('../fonts/barlow-900-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 900; font-display: swap;
  src: url('../fonts/barlow-900-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }

/* Reenie Beanie (OFL) – only for the handwritten "marknad" in the logo, self-hosted so no visitor data goes to Google */
@font-face { font-family: 'Reenie Beanie'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/reenie-beanie-400-latin.woff2') format('woff2'); }

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root, [data-bs-theme=light] {
  --mk-ink: #16363C; --mk-muted: #5A7479; --mk-cream: #FAF5EC; --mk-cream-2: #F3EAD9;
  --mk-petrol: #009BAC; --mk-petrol-dark: #005D6B; --mk-petrol-60: #66C4CD; --mk-petrol-30: #B3E1E6;
  --mk-petrol-10: #E6F5F7; --mk-petrol-dark-10: #E6EFF0; --mk-beige: #EACFA5; --mk-line: #E4D8C2;
  --mk-green: #92C581; --mk-orange: #F6AA42; --mk-orange-10: #FEF2E1; --mk-danger: #B42318;
  --mk-input-border: #7F9194;
  --mk-sidebar-w: 264px; --mk-topbar-h: 68px; --mk-bottombar-h: 0px;

  --bs-font-sans-serif: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: .9375rem;
  --bs-body-color: #16363C; --bs-body-color-rgb: 22,54,60; --bs-body-bg: #FAF5EC;
  --bs-emphasis-color: #16363C;
  --bs-secondary-color: #5A7479; --bs-tertiary-bg: #F3EAD9; --bs-tertiary-bg-rgb: 243,234,217;
  --bs-primary: #005D6B; --bs-primary-rgb: 0,93,107;
  --bs-primary-text-emphasis: #005D6B; --bs-primary-bg-subtle: #E6F5F7; --bs-primary-border-subtle: #B3E1E6;
  --bs-link-color: #005D6B; --bs-link-color-rgb: 0,93,107;
  --bs-link-hover-color: #16363C; --bs-link-hover-color-rgb: 22,54,60;
  --bs-border-color: #E4D8C2;
  --bs-success: #3D7A2A; --bs-success-rgb: 61,122,42; --bs-success-text-emphasis: #2C5A1E;
  --bs-success-bg-subtle: #F0F8EC; --bs-success-border-subtle: #C8E2BE;
  --bs-warning: #F6AA42; --bs-warning-rgb: 246,170,66; --bs-warning-text-emphasis: #7A4A00;
  --bs-warning-bg-subtle: #FEF2E1; --bs-warning-border-subtle: #F9CC8E;
  --bs-danger: #B42318; --bs-danger-rgb: 180,35,24; --bs-danger-text-emphasis: #8A1A12;
  --bs-danger-bg-subtle: #FBE9E7; --bs-danger-border-subtle: #F0B7B1;
  --bs-info: #009BAC; --bs-info-rgb: 0,155,172; --bs-info-text-emphasis: #005D6B;
  --bs-info-bg-subtle: #E6F5F7; --bs-info-border-subtle: #B3E1E6;
  --bs-secondary-bg-subtle: #F3EAD9; --bs-secondary-text-emphasis: #16363C;
  --bs-light-bg-subtle: #FDF9F2;
  --bs-border-radius: .625rem; --bs-border-radius-sm: .5rem; --bs-border-radius-lg: 1rem;
  --bs-border-radius-pill: 999px;
  --bs-box-shadow-sm: 0 2px 8px rgba(0,93,107,.08);
  --bs-box-shadow: 0 8px 24px rgba(0,93,107,.10);
  --bs-focus-ring-color: rgba(0,93,107,.6);
  --mk-focus: #005D6B;               /* the focus ring: 7:1 on the cream and white pages (WCAG 1.4.11 asks 3:1) */
  --bs-focus-ring-width: 3px;
}

body { font-weight: 400; }
::selection { background: var(--mk-petrol-30); }

/* Visible focus on everything focusable */
#sidebar, .mk-on-dark { --mk-focus: #FAF5EC; }        /* cream on the dark sidebar */
#main:focus { outline: none; }                        /* reached by the skip link: the container itself needs no ring */
/* search as you type (static/js/app.js): the results dim a little while the next ones come, the field doesn't */
#main[aria-busy=true] [data-live-results] { opacity: .6; transition: opacity .15s .2s; }
/* "Hoppa till innehållet": the first stop for the keyboard, visible only when focused (WCAG 2.4.1) */
.mk-skip:focus { position: fixed; left: 12px; top: 12px; z-index: 2000; padding: 8px 14px; border-radius: 10px;
  background: var(--mk-ink); color: var(--mk-cream); font-weight: 700; text-decoration: none; }
:focus-visible, .btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus,
.nav-link:focus-visible, .page-link:focus {
  outline: 3px solid var(--mk-focus); outline-offset: 2px; box-shadow: none;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { color: var(--mk-ink); }
.mk-h1 { font-size: 1.75rem; font-weight: 900; letter-spacing: -.015em; line-height: 1.15; margin: 0; }
.mk-h2 { font-size: 1.375rem; font-weight: 800; }
.mk-h3 { font-size: 1.125rem; font-weight: 800; }                 /* card title, 18/800 (A5) */
.mk-eyebrow { font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--mk-muted); }
.mk-meta { font-size: .75rem; color: var(--mk-muted); }
.text-muted, .text-body-secondary { color: var(--mk-muted) !important; }
mark, .mark { background: #FDE8C4; color: inherit; padding: 0 .1em; border-radius: 2px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { --bs-btn-border-radius: var(--bs-border-radius-pill); --bs-btn-font-weight: 700;
  --bs-btn-border-radius-sm: var(--bs-border-radius-pill); --bs-btn-border-radius-lg: var(--bs-border-radius-pill); }
.btn-primary {
  --bs-btn-bg: #005D6B; --bs-btn-border-color: #005D6B; --bs-btn-color: #fff;
  --bs-btn-hover-bg: #16363C; --bs-btn-hover-border-color: #16363C; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #16363C; --bs-btn-active-border-color: #16363C;
  --bs-btn-disabled-bg: #C9D3D4; --bs-btn-disabled-border-color: #C9D3D4; --bs-btn-disabled-color: #4D6266;
}
.btn-outline-primary, .btn-outline-secondary, .btn-light {
  --bs-btn-bg: #fff; --bs-btn-border-color: var(--mk-input-border); --bs-btn-color: #005D6B;
  --bs-btn-hover-bg: var(--mk-petrol-10); --bs-btn-hover-border-color: #005D6B; --bs-btn-hover-color: #005D6B;
  --bs-btn-active-bg: var(--mk-petrol-30); --bs-btn-active-border-color: #005D6B; --bs-btn-active-color: #005D6B;
  --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: #C9D3D4; --bs-btn-disabled-color: #7A8B8E;
}
.btn-outline-secondary { --bs-btn-color: var(--mk-ink); --bs-btn-hover-color: var(--mk-ink); --bs-btn-active-color: var(--mk-ink); }
.btn-check:checked + .btn-outline-primary, .btn-check:checked + .btn-outline-secondary {
  background: var(--mk-petrol-dark); border-color: var(--mk-petrol-dark); color: #fff; }
.btn-success { --bs-btn-bg: #3D7A2A; --bs-btn-border-color: #3D7A2A; --bs-btn-hover-bg: #2C5A1E; --bs-btn-hover-border-color: #2C5A1E; }
.btn-outline-success { --bs-btn-color: #2C5A1E; --bs-btn-border-color: #3D7A2A; --bs-btn-hover-bg: #3D7A2A; --bs-btn-hover-border-color: #3D7A2A; }
.btn-danger { --bs-btn-bg: #B42318; --bs-btn-border-color: #B42318; --bs-btn-hover-bg: #8A1A12; --bs-btn-hover-border-color: #8A1A12; }
.btn-outline-danger { --bs-btn-color: #B42318; --bs-btn-border-color: #B42318; --bs-btn-hover-bg: #B42318; --bs-btn-hover-border-color: #B42318; }
.btn-warning { --bs-btn-bg: #F6AA42; --bs-btn-border-color: #F6AA42; --bs-btn-color: #16363C; --bs-btn-hover-bg: #E99A2C; --bs-btn-hover-border-color: #E99A2C; }
.btn-link { --bs-btn-font-weight: 700; }
.btn-group > .btn { --bs-btn-border-radius: .625rem; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-control, .form-select { border-color: var(--mk-input-border); border-radius: .5rem; background-color: #fff; }
.form-control:hover, .form-select:hover { border-color: var(--mk-ink); }
.form-control:focus, .form-select:focus { border-color: var(--mk-petrol-dark); background-color: #fff; }   /* white everywhere, focus shown by the ring */
.form-control:disabled, .form-select:disabled { background: #F3F5F5; border-color: #C9D3D4; color: #7A8B8E; }
.form-control.is-invalid, .form-select.is-invalid { border: 2px solid var(--mk-danger); }
.form-check-input { border-color: var(--mk-input-border); }
.form-check-input:checked { background-color: var(--mk-petrol-dark); border-color: var(--mk-petrol-dark); }
.form-label { font-weight: 700; font-size: .8125rem; }
.form-text { color: var(--mk-muted); }
.input-group-text { background: var(--mk-cream-2); border-color: var(--mk-input-border); }

/* ── Cards, tables, nav ──────────────────────────────────────────────────── */
.card { --bs-card-border-color: var(--mk-line); --bs-card-border-radius: 1rem; --bs-card-inner-border-radius: calc(1rem - 1px);
  --bs-card-cap-bg: #fff; --bs-card-bg: #fff; }
.card.shadow-sm { box-shadow: none !important; }
.stat-card, .table-card { border: 1px solid var(--mk-line) !important; border-radius: 1rem; }
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--mk-line); --bs-table-hover-bg: var(--mk-petrol-10);
  --bs-table-striped-bg: #FDF9F2; }
/* A8: one table style – beige head 12/800 in sentence case, 48 px rows, object links 600 petrol, underlined on hover */
.table > thead th { font-size: .75rem; font-weight: 800; color: var(--mk-ink); text-transform: none; letter-spacing: 0;
  background: #F3E8D6 !important; border-bottom-color: var(--mk-line); }
.table > tbody > tr > td { height: 48px; }
.table > tbody > tr.mk-group-row > td { background: var(--mk-cream-2); height: auto; }   /* group rows are beige, like the plan list */
.table-sm > tbody > tr > td { height: 40px; }
.table td a:not(.btn):not(.mk-x):not(.mk-icon-btn):not(.mk-trash):not(.badge) { font-weight: 600; color: var(--mk-petrol-dark); text-decoration: none; }
.table td a:not(.btn):not(.mk-x):not(.mk-icon-btn):not(.mk-trash):not(.badge):hover { text-decoration: underline; }
.table-light { --bs-table-bg: var(--mk-cream-2); --bs-table-color: var(--mk-ink); --bs-table-border-color: var(--mk-line); }
.nav-tabs { --bs-nav-tabs-border-color: var(--mk-line); --bs-nav-tabs-link-active-bg: #fff;
  --bs-nav-tabs-link-active-border-color: var(--mk-line) var(--mk-line) #fff; --bs-nav-link-color: var(--mk-muted);
  --bs-nav-link-hover-color: var(--mk-ink); --bs-nav-link-font-weight: 700; }
.nav-tabs .nav-link.active { color: var(--mk-ink); box-shadow: inset 0 -3px 0 var(--mk-petrol-dark); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--mk-petrol-dark); --bs-nav-pills-border-radius: 999px; --bs-nav-link-font-weight: 700; }
.list-group { --bs-list-group-border-color: var(--mk-line); --bs-list-group-action-hover-bg: var(--mk-petrol-10);
  --bs-list-group-active-bg: var(--mk-petrol-dark); --bs-list-group-active-border-color: var(--mk-petrol-dark); }
.dropdown-menu { --bs-dropdown-border-color: var(--mk-line); --bs-dropdown-link-hover-bg: var(--mk-petrol-10);
  --bs-dropdown-link-active-bg: var(--mk-petrol-dark); --bs-dropdown-border-radius: .75rem; box-shadow: var(--bs-box-shadow); }
.pagination { --bs-pagination-color: var(--mk-petrol-dark); --bs-pagination-active-bg: var(--mk-petrol-dark);
  --bs-pagination-active-border-color: var(--mk-petrol-dark); --bs-pagination-border-color: var(--mk-line); }
.progress { --bs-progress-bg: var(--mk-petrol-dark-10); --bs-progress-bar-bg: var(--mk-petrol-dark); --bs-progress-border-radius: 999px; }
.modal { --bs-modal-border-radius: 1rem; --bs-modal-border-color: var(--mk-line); }
.offcanvas-end { --bs-offcanvas-width: 480px; }
.alert { --bs-alert-border-radius: .75rem; }
.alert-info { --bs-alert-bg: var(--mk-petrol-10); --bs-alert-border-color: var(--mk-petrol-30); --bs-alert-color: var(--mk-ink); }
.alert-warning { --bs-alert-bg: var(--mk-orange-10); --bs-alert-border-color: #F9CC8E; --bs-alert-color: var(--mk-ink); }
.bg-light { background-color: #FDF9F2 !important; }
.text-primary { color: var(--mk-petrol-dark) !important; }
.badge { --bs-badge-font-weight: 800; --bs-badge-border-radius: 999px; }
/* A7: "övrigt" and "Ej kopplad" are the same light grey everywhere; positions: top 3 green, top 10 petrol, the rest grey */
.badge.bg-secondary { background: #E8EEEF !important; color: var(--mk-ink) !important; }
.badge.bg-primary { background: var(--mk-petrol-dark) !important; }
.badge.bg-success { background: var(--mk-green) !important; color: var(--mk-ink) !important; }
.badge.bg-warning { background: var(--mk-orange) !important; color: var(--mk-ink) !important; }
.badge.bg-info { background: var(--mk-petrol-30) !important; color: var(--mk-ink) !important; }
.badge.bg-danger { background: var(--mk-danger) !important; }
.badge.bg-light { background: var(--mk-cream-2) !important; color: var(--mk-ink) !important; }

/* Status pill: colour + icon + text, never colour alone */
.mk-status { display: inline-flex; align-items: center; gap: .375rem; font-size: .75rem; font-weight: 800;
  line-height: 1.2; padding: .25rem .625rem; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.mk-status .bi { font-size: .8125rem; }

/* Filter chips */
.mk-chip { display: inline-flex; align-items: center; gap: .375rem; font-size: .8125rem; font-weight: 700;
  padding: .3125rem .75rem; border-radius: 999px; background: var(--mk-petrol-10); border: 1px solid var(--mk-petrol-dark);
  color: var(--mk-petrol-dark); text-decoration: none; }
.mk-chip:hover { background: var(--mk-petrol-30); color: var(--mk-petrol-dark); }
.mk-chip-add { background: transparent; border: 1px dashed var(--mk-input-border); color: var(--mk-ink); }

/* Segment – switch view or scale (Lista/Schema, Dag/Vecka, Tom/Från mall …), designgranskning A2 */
.mk-seg { display: inline-flex; background: #fff; border: 1px solid var(--mk-input-border); border-radius: 10px; padding: 2px; }
.mk-seg > button { border: 0; background: none; padding: 5px 11px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--mk-ink); }
.mk-seg > button:hover { background: var(--mk-petrol-10); }
.mk-seg > button[aria-checked=true], .mk-seg > button[aria-pressed=true] { background: var(--mk-petrol-dark); color: #fff; }
.mk-seg-icons > button { width: 32px; padding: 5px 0; }
.mk-seg > button.active, .mk-seg > button[aria-selected=true] { background: var(--mk-petrol-dark); color: #fff; }
.mk-seg > button:disabled { color: var(--mk-muted); opacity: .6; background: none; }
.mk-seg-fill { display: flex; }
.mk-seg-fill > button { flex: 1 1 0; padding: 8px 11px; font-size: 14px; }

/* Area tabs – the parts of one area (Hemsida), each its own page. Underlined like the sections of a detail page. */
.mk-area-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--mk-line); overflow-x: auto; scrollbar-width: none; }
.mk-area-tabs a { padding: 8px 0 9px; font-size: 15px; font-weight: 700; color: var(--mk-muted); text-decoration: none;
  white-space: nowrap; box-shadow: inset 0 -3px 0 transparent; }
.mk-area-tabs a:hover { color: var(--mk-ink); }
.mk-area-tabs a.active { color: var(--mk-ink); box-shadow: inset 0 -3px 0 var(--mk-petrol-dark); }

/* Stat – eyebrow, a big number in ink and one line; colour only on the change */
.mk-stat { background: #fff; border: 1px solid var(--mk-line); border-radius: 16px; padding: 16px 20px; height: 100%; }
.mk-stat-label { font-size: 12px; font-weight: 800; color: var(--mk-muted); text-transform: uppercase; letter-spacing: .08em; }
.mk-stat-value { font-size: 30px; font-weight: 900; color: var(--mk-ink); line-height: 1.15; margin-top: 4px; }
.mk-stat-sub { font-size: 13px; color: var(--mk-muted); margin-top: 2px; }
.mk-up { color: #3D7A2A; font-weight: 700; } .mk-down { color: var(--mk-danger); font-weight: 700; }

.mk-mtable .m-only { display: none; }      /* phone-only cell (e.g. call and mail buttons) */
.mk-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--mk-input-border); background: #fff; color: var(--mk-petrol-dark); text-decoration: none; font-size: 17px; }
/* Tables that become card lists on phones (designgranskning C1). The table keeps its markup; each cell says
   what it is on a phone: m-title (name, 15/700), m-right (the most important value, right), m-meta (the grey
   line under, joined with ·), m-full (a full-width part under, e.g. a form), m-hide (left out). The title's
   link (a.m-link) makes the whole card tappable; other links and buttons in the row stay clickable. */
@media (max-width: 767.98px), (pointer: coarse) and (max-height: 500px) {
  .mk-mtable, .mk-mtable tbody, .mk-mtable tfoot { display: block; width: 100%; }
  .mk-mtable thead { display: none; }
  .mk-mtable tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 2px; position: relative;
    padding: 12px 14px; border-bottom: 1px solid var(--mk-line); min-height: 56px; }
  .mk-mtable td, .mk-mtable th { display: block; border: 0 !important; padding: 0 !important; background: none !important; }
  .table.mk-mtable > tbody > tr > td { height: auto; }   /* the desktop's fixed row height made the parts of a card run into each other (feedback #37, #43) */
  .mk-mtable .m-title { order: 1; flex: 1 1 0; min-width: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
  .mk-mtable .m-right { order: 2; flex: 0 0 auto; text-align: right; }
  .mk-mtable tr::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
  .mk-mtable .m-meta { order: 4; font-size: 13px; color: var(--mk-muted); min-width: 0; overflow-wrap: anywhere; }
  .mk-mtable .m-meta ~ .m-meta::before { content: "·"; margin-right: 8px; }
  .mk-mtable .m-full { order: 5; flex-basis: 100%; margin-top: 8px; }
  .mk-mtable .m-hide { display: none; }
  .mk-mtable .m-only { display: flex; gap: 8px; }
  .mk-mtable .m-group { flex-basis: 100%; font-weight: 800; }
  .mk-mtable .mk-time-form input { flex: 1 1 7rem; width: auto !important; min-height: 44px; }
  .mk-mtable .mk-time-form .btn { min-height: 44px; flex: 1 1 100%; }
  .mk-mtable .mk-time-form .mk-duration { flex: 1 1 100%; width: auto; }
  .mk-mtable a.m-link::after { content: ""; position: absolute; inset: 0; }
  .mk-mtable tr a:not(.m-link), .mk-mtable tr button, .mk-mtable tr input, .mk-mtable tr select, .mk-mtable tr form { position: relative; z-index: 1; }
}

/* The Filter button and its panel (templates/_filter.html) */
.mk-filter { position: relative; display: inline-block; }
.mk-filter-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--mk-input-border); background: #fff; color: var(--mk-ink); font-size: 14px; font-weight: 700; white-space: nowrap; }
.mk-filter-btn:hover { background: var(--mk-petrol-10); }
.mk-filter-btn.is-on { border-color: var(--mk-petrol-dark); background: var(--mk-petrol-10); color: var(--mk-petrol-dark); }
.mk-filter-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 1050; width: 320px; max-width: 90vw;
  background: #fff; border: 1px solid var(--mk-line); border-radius: 14px; box-shadow: 0 12px 32px rgba(22,54,60,.16); padding: 14px 16px; }
.mk-filter-body { display: flex; flex-direction: column; gap: 12px; }
.mk-filter-body .form-label { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
/* several at once (Kommun, feedback #30): a short scrolling list of checkboxes */
.mk-checklist { margin: 0; min-width: 0; }
.mk-checklist legend { float: none; width: auto; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.mk-checklist-box { max-height: 11rem; overflow-y: auto; border: 1px solid var(--mk-line); border-radius: 10px; padding: 6px 10px; background: #fff; }
.mk-checklist-box .form-check { margin-bottom: 2px; }
/* "E-postadresser" (Partners, Kontakter): the choice in the box, and the addresses */
.mk-ee-filters { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--mk-cream); }
.mk-ee-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; align-items: start; }
.mk-ee-filter-grid .form-label { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.mk-ee-filter-grid .form-check { align-self: end; }
.mk-ee-list { max-height: 18rem; overflow-y: auto; border: 1px solid var(--mk-line); border-radius: 10px; padding: 8px 12px; }
.mk-ee-list .form-check { margin-bottom: 4px; }
.mk-filter-foot { border-top: 1px solid var(--mk-line); margin-top: 12px; padding-top: 10px; font-size: 14px; }
.mk-filter-sheet-head { display: none; }
@media (max-width: 767.98px), (pointer: coarse) and (max-height: 500px) {
  .mk-filter.open::before { content: ""; position: fixed; inset: 0; background: rgba(10,29,32,.45); z-index: 1049; }
  .mk-filter-panel { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 82vh; overflow-y: auto;
    border-radius: 16px 16px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
  .mk-filter-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 17px; }
  .mk-filter-body .form-select, .mk-filter-body .form-control { min-height: 44px; }
}

/* AI settings: which provider is used, in order */
.mk-ai-order { border: 1px solid var(--mk-line); border-radius: 12px; padding: 12px 16px; background: var(--mk-cream); }
.mk-ai-order ol { padding-left: 1.2rem; }
.mk-status-ok { color: #3D7A2A; font-weight: 700; }

/* Autosaved settings rows (data-autosave): the Spara button is only for browsers without JavaScript */
.mk-autosave-on [data-save-btn] { display: none !important; }
.mk-saved { font-size: 12px; font-weight: 700; color: var(--mk-muted); white-space: nowrap; min-width: 4.5rem; }
.mk-saved.is-ok { color: #3D7A2A; }
.mk-saved.is-error { color: var(--mk-danger); white-space: normal; }

/* Unsaved changes on a settings page (data-unsaved) */
.mk-dirty { box-shadow: 0 0 0 2px var(--mk-orange) !important; }
.mk-unsaved-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1080; display: flex; align-items: center;
  gap: 12px; padding: 10px 12px 10px 18px; background: var(--mk-ink); color: var(--mk-cream); border-radius: 999px;
  box-shadow: 0 10px 30px rgba(22,54,60,.3); font-size: 14px; font-weight: 700; max-width: calc(100vw - 32px); }
.mk-unsaved-bar[hidden] { display: none; }
.mk-unsaved-bar.is-error { background: var(--mk-danger); color: #fff; }   /* a card could not be saved (static/js/app.js) */
@media (min-width: 768px) { .mk-unsaved-bar { left: calc(50% + var(--mk-sidebar-w) / 2); } }

/* An e-mail conversation (planning/_macros.html conversation): closed a line, open one box per message */
.mk-convo { margin-top: 6px; }
.mk-convo > summary { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; cursor: pointer; font-size: 14px; position: relative;
  color: var(--mk-petrol-dark); list-style: none; padding: 6px 28px 6px 10px; border: 1px solid var(--mk-line); border-radius: 10px; background: #fff; }
.mk-convo > summary::-webkit-details-marker { display: none; }
.mk-convo > summary::after { content: "▾"; position: absolute; right: 10px; top: 7px; color: var(--mk-muted); }
.mk-convo[open] > summary::after { content: "▴"; }
.mk-convo-preview { color: var(--mk-muted); font-size: 13px; flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-convo[open] .mk-convo-preview { display: none; }
.mk-convo-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mk-msg { border: 1px solid var(--mk-line); border-radius: 12px; background: #fff; overflow: hidden; }
.mk-msg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 8px 12px; background: var(--mk-cream);
  border-bottom: 1px solid var(--mk-line); font-size: 13px; }
.mk-msg-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--mk-petrol-dark); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none; }
.mk-msg-who { font-weight: 800; color: var(--mk-ink); }
.mk-msg-when { color: var(--mk-muted); margin-left: auto; white-space: nowrap; }
.mk-msg-subject { flex-basis: 100%; color: var(--mk-muted); padding-left: 34px; }
.mk-msg-tag { font-size: 12px; color: var(--mk-muted); }
.mk-msg-body { padding: 10px 12px; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }

/* A value edited in place (a contact's title): looks like text until pointed at or focused */
.mk-inline-edit { display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.mk-inline-input { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 1px 6px; margin-left: -7px;
  font-size: 13px; color: var(--mk-muted); width: 100%; max-width: 16rem; min-height: 26px; }
.mk-inline-input:hover { border-color: var(--mk-line); }
.mk-inline-input:focus { border-color: var(--mk-petrol); color: var(--mk-ink); outline: 0; box-shadow: 0 0 0 3px rgba(0,155,172,.25); background: #fff; }
.mk-inline-input::placeholder { color: var(--mk-petrol-dark); opacity: .7; }
/* the role at a partner (feedback #31): "Roll" and a field that looks like one, a pencil inside */
.mk-role-edit { margin-top: 4px; flex-wrap: wrap; }
.mk-role-label { font-size: 12px; font-weight: 700; color: var(--mk-muted); text-transform: uppercase; letter-spacing: .06em; }
.mk-role-field { position: relative; flex: 1 1 12rem; max-width: 18rem; }
.mk-role-field .bi-pencil { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--mk-muted); pointer-events: none; }
.mk-role-field .form-control { padding-left: 28px; }
.mk-role-field .form-control::placeholder { color: var(--mk-orange-ink, #9a5b12); opacity: .9; }

/* A3: buttons are full width only in forms on a phone */
@media (max-width: 767.98px), (pointer: coarse) and (max-height: 500px) { .mk-btn-phone-block { width: 100%; } }

.mk-icon-btn-sm { width: 32px; height: 32px; font-size: 14px; }
/* A3: the trash can is the same everywhere – a round red icon button */
.mk-trash { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--mk-danger); background: #fff; color: var(--mk-danger); padding: 0; flex: none; }
.mk-trash:hover { background: #FDECEA; }

/* A5: long explanations sit behind "Så fungerar det ▾" */
.mk-howto { margin-top: 10px; font-size: 13px; color: var(--mk-muted); }
.mk-howto > summary { cursor: pointer; font-weight: 700; color: var(--mk-petrol-dark); list-style: none; display: inline-flex; gap: 4px; }
.mk-howto > summary::-webkit-details-marker { display: none; }
.mk-howto > summary::after { content: "▾"; }
.mk-howto[open] > summary::after { content: "▴"; }
.mk-howto > p { margin: 6px 0 0; }

/* Guide steps on a phone: "Steg 1 av 3 · Välj fil" with a thin bar instead of the wrapping step list */
.mk-steps-short { font-size: 14px; font-weight: 700; margin: 0 0 14px; }
.mk-steps-bar { display: block; height: 4px; border-radius: 4px; background: var(--mk-line); margin-top: 6px; overflow: hidden; }
.mk-steps-bar > span { display: block; height: 4px; background: var(--mk-petrol-dark); }

/* Plan view header (DESKTOP-PLANVY-FIX A): actions near the title on wide screens, compact sync pill */
.mk-plan-head { max-width: 1680px; margin-bottom: 12px; }
.mk-head-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.mk-head-progress .mk-progress { width: 120px; }
.mk-icon-btn-md { width: 38px; height: 38px; font-size: 16px; }
.mk-sync-pill { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 3px 12px; border: 1px solid var(--mk-line);
  border-radius: 999px; background: #fff; font-size: 13px; }
.mk-sync-pill > .bi-arrow-repeat { color: #3D7A2A; }
.mk-sync-pill.is-error > .bi-arrow-repeat, .mk-sync-pill.is-error strong { color: var(--mk-danger); }

/* A status row in the settings: preview · name · icon · colour · category · trash; wraps instead of spilling into the next card */
.mk-status-row > .form-select { max-width: 9.5rem; flex: 0 1 auto; }
.mk-status-row > .form-control { flex: 1 1 7rem; }
.mk-status-row > .form-control-color { flex: none; }

/* Combobox for a multi-select (app.js data-combobox): chosen ones as chips, type to search */
.mk-combobox { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 5px 8px;
  border: 1px solid var(--mk-input-border); border-radius: .5rem; background: #fff; }
.mk-combobox:focus-within { border-color: var(--mk-petrol-dark); box-shadow: 0 0 0 3px rgba(0,155,172,.35); }
.mk-combobox-chips { display: contents; }
.mk-combobox-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px;
  background: var(--mk-petrol-10); border: 1px solid var(--mk-petrol-30); font-size: 13px; font-weight: 700; color: var(--mk-petrol-dark); }
.mk-combobox-chip > button { border: 0; background: none; width: 22px; height: 22px; border-radius: 50%; color: inherit; font-size: 16px; line-height: 1; }
.mk-combobox-chip > button:hover { background: var(--mk-petrol-30); }
.mk-combobox-input { flex: 1 1 8rem; min-width: 8rem; border: 0; outline: 0; font-size: 15px; padding: 4px; background: transparent; }
.mk-combobox-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1060; max-height: 16rem; overflow-y: auto; margin: 0;
  padding: 4px; list-style: none; background: #fff; border: 1px solid var(--mk-line); border-radius: 10px; box-shadow: 0 10px 28px rgba(22,54,60,.14); }
.mk-combobox-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.mk-combobox-list li[aria-selected=true], .mk-combobox-list li:hover { background: var(--mk-petrol-10); }
.mk-combobox-list .mk-combobox-none { color: var(--mk-muted); cursor: default; }

/* C2: on a phone the header is one row – the title, the primary action and ⋯ */
@media (max-width: 767.98px), (pointer: coarse) and (max-height: 500px) {
  .mk-page-head.mk-page-head { flex-wrap: nowrap; align-items: center; }
  .mk-page-head.mk-page-head > :first-child { min-width: 0; flex: 1 1 auto; }
  .mk-page-head.mk-page-head > :last-child:not(:first-child) { flex: none; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
  .mk-page-head .mk-sub { overflow-wrap: anywhere; }
}

/* C3: a settings card closed in the phone accordion shows only its header */
.mk-acc-closed > :not(.card-header) { display: none !important; }
.mk-acc-btn { all: unset; display: flex; align-items: center; width: 100%; gap: 8px; cursor: pointer; }
.mk-acc-btn::after { content: "▾"; margin-left: auto; color: var(--mk-muted); font-size: 14px; }
.mk-acc-btn[aria-expanded="true"]::after { content: "▴"; }
.mk-acc-btn:focus-visible { outline: 3px solid var(--mk-focus); outline-offset: 2px; border-radius: 6px; }
/* C3: every tap target at least 44 × 44 on a phone */
@media (max-width: 767.98px), (pointer: coarse) and (max-height: 500px) {
  .mk-trash, .mk-x, .mk-icon-btn-sm, .mk-icon-btn-md { min-width: 44px; min-height: 44px; }
  .btn-sm { min-height: 40px; }
}

.mk-help-once { display: flex; align-items: flex-start; gap: 8px; }
.mk-help-once > span { flex: 1 1 auto; }
.mk-help-once[hidden] { display: none; }

/* C3: settings rows on a phone (app.js data-phone-sheet) */
.mk-sheet-summary, .mk-sheet-head { display: none; }
@media (max-width: 767.98px), (pointer: coarse) and (max-height: 500px) {
  .mk-sheet-summary { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; border: 0; background: none;
    padding: 4px 0; text-align: left; font-size: 15px; font-weight: 700; color: var(--mk-ink); }
  .mk-sheet-dot { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--mk-line); flex: none; }
  form.mk-sheet-form:not(.mk-sheet-open) { display: none !important; }
  form.mk-sheet-open { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1060; flex-wrap: wrap !important; gap: 10px !important;
    background: #fff; border-radius: 16px 16px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(22,54,60,.2); max-height: 85vh; overflow-y: auto; }
  form.mk-sheet-open > * { flex: 1 1 100% !important; max-width: none !important; }
  form.mk-sheet-open > .form-control-color, form.mk-sheet-open > .mk-trash, form.mk-sheet-open > .btn-sm { flex: 0 0 auto !important; }
  form.mk-sheet-open .form-control, form.mk-sheet-open .form-select { min-height: 44px; }
  form.mk-sheet-open .mk-sheet-head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; }
  .mk-sheet-backdrop { position: fixed; inset: 0; background: rgba(10,29,32,.45); z-index: 1055; }
  .mk-sheet-backdrop[hidden] { display: none; }
}

/* Toast */
.mk-toast { background: var(--mk-ink); color: var(--mk-cream); border-radius: .75rem; padding: .625rem .875rem;
  display: flex; align-items: center; gap: .625rem; font-size: .875rem; box-shadow: var(--bs-box-shadow); }
.mk-toast a, .mk-toast .btn-link { color: var(--mk-orange); font-weight: 700; }
.mk-toast-region { position: fixed; right: 0; bottom: 0; z-index: 1090; pointer-events: none; max-width: 100%; }
.mk-toast-region > * { pointer-events: none; }          /* a toast never catches a tap meant for what is under it */
.mk-toast-region button, .mk-toast-region a { pointer-events: auto; }
@media (max-width: 767.98px), (pointer: coarse) and (max-height: 500px) {
  .mk-toast-region { top: 0; bottom: auto; left: 0; align-items: stretch !important; padding-top: max(.75rem, env(safe-area-inset-top)) !important; }
}

/* Empty state */
.mk-empty { border: 1px dashed var(--mk-input-border); border-radius: .75rem; padding: .875rem 1rem;
  display: flex; align-items: center; gap: .75rem; }
.mk-empty > .bi { font-size: 1.375rem; color: var(--mk-petrol-dark); }

/* Avatar */
.mk-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--mk-beige); color: var(--mk-ink);
  font-weight: 800; font-size: .8125rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mk-avatar-sm { width: 26px; height: 26px; font-size: .6875rem; }

/* Read-only marker */
.mk-readonly { display: inline-flex; align-items: center; gap: .375rem; font-size: .75rem; font-weight: 800;
  padding: .25rem .625rem; border-radius: 999px; background: var(--mk-petrol-dark-10); color: #4D6266; }

/* ── Shell ───────────────────────────────────────────────────────────────── */
/* The menu (services/menu.py, templates/_shell.html): the dark ink sidebar of before, with group headings and the page
   you are on lit up; on phones a bottom bar with five places instead (the last is Mer). */
.mk-lu { flex: none; display: inline-block; vertical-align: -.15em; }
#sidebar {
  width: var(--mk-sidebar-w); position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
  height: 100vh; height: 100dvh;            /* dvh: the visible height on phones (address bar excluded) */
  background: var(--mk-ink); color: var(--mk-cream); display: flex; flex-direction: column;
  padding: 20px 14px 24px; gap: 14px;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(250,245,236,.3) transparent;
}
#sidebar > * { flex-shrink: 0; }
.mk-brand { display: flex; flex-direction: column; align-items: flex-start; padding: 0 12px 4px; text-decoration: none; }
.mk-brand img { height: 40px; display: block; }
.mk-brand-script { display: flex; flex-direction: column; align-items: flex-start; margin: -2px 0 0 40px;
  transform: rotate(-5deg); transform-origin: left center; color: var(--mk-orange); }
.mk-brand-script span { font-family: 'Reenie Beanie', cursive; font-size: 21px; line-height: .9; white-space: nowrap; }
.mk-brand-script svg { display: block; margin: -1px 0 0 -2px; }
.mk-nav-group { display: flex; flex-direction: column; gap: 2px; list-style: none; margin: 0; padding: 0; }
.mk-nav-heading { font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--mk-petrol-30);
  padding: 4px 12px 6px; text-transform: uppercase; }
.mk-nav-link { display: flex; align-items: center; gap: 12px; padding: 0 8px 0 12px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--mk-petrol-30); text-decoration: none; min-height: 38px; }
.mk-nav-link > span:not(.mk-nav-badge) { flex: 1 1 auto; min-width: 0; }
.mk-nav-link:hover { color: var(--mk-cream); background: rgba(250,245,236,.06); }
.mk-nav-link.active { background: rgba(250,245,236,.12); color: var(--mk-cream); }
#sidebar :focus-visible { outline-color: var(--mk-petrol-60); }
.mk-nav-badge { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--mk-ink); background: var(--mk-beige);
  border-radius: 999px; padding: 1px 8px; line-height: 18px; }
.mk-nav-link.active .mk-nav-badge { background: var(--mk-orange); }
/* Low screens (a laptop with the browser's bars): the menu tightens so it seldom has to scroll */
@media (min-width: 768px) and (max-height: 900px) {
  #sidebar { padding-top: 14px; gap: 8px; }
  .mk-brand img { height: 34px; }
  .mk-brand-script span { font-size: 18px; }
  .mk-nav-link { min-height: 32px; font-size: 14px; }
  .mk-nav-group { gap: 1px; }
  .mk-nav-heading { padding: 2px 12px 3px; }
}
@media (min-width: 768px) and (max-height: 740px) {
  .mk-nav-link { min-height: 28px; font-size: 13px; }
  .mk-nav-heading { font-size: 10px; padding-bottom: 1px; }
  /* "marknad" stays – a laptop with 125–150 % scaling is this low (feedback #29); logo and script a little smaller */
  .mk-brand img { height: 28px; }
  .mk-brand-script { margin: 2px 0 0 34px; }
  .mk-brand-script span { font-size: 15px; }
  .mk-brand-script svg { width: 40px; }
}

#topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--mk-topbar-h); margin-left: var(--mk-sidebar-w);
  background: #fff; border-bottom: 1px solid var(--mk-line); display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding: 0 28px;
}
.mk-topbar-logo { display: none; }
.mk-bell { position: relative; color: var(--mk-ink); width: 44px; height: 44px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.mk-bell:hover, .mk-bell[aria-expanded=true] { background: var(--mk-petrol-10); }
.mk-bell-count { position: absolute; top: 4px; right: 2px; background: var(--mk-orange); color: var(--mk-ink); font-size: 11px;
  font-weight: 800; border-radius: 999px; padding: 0 5px; line-height: 18px; min-width: 18px; text-align: center; }
.mk-bell-panel { width: 380px; max-width: calc(100vw - 24px); padding: 16px; border: 0; border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0,93,107,.14); }
.mk-bell-title { font-size: 18px; font-weight: 800; }
.mk-bell-list { max-height: min(60vh, 420px); overflow-y: auto; }
.mk-bell-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border-radius: 12px;
  color: var(--mk-ink); text-decoration: none; font-size: 14px; }
.mk-bell-item strong { font-weight: 600; }
.mk-bell-item.is-unread { background: var(--mk-orange-10); }
.mk-bell-item.is-unread strong { font-weight: 800; }
.mk-bell-item:hover { background: var(--mk-petrol-10); color: var(--mk-ink); }
.mk-bell-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; border-top: 1px solid var(--mk-line);
  margin-top: 8px; padding-top: 12px; font-size: 14px; font-weight: 600; }
.mk-bell-foot a { color: var(--mk-petrol-dark); }
.mk-account { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 10px 0 4px; border: 1px solid var(--mk-line);
  border-radius: 999px; background: #fff; color: var(--mk-ink); }
.mk-account:hover, .mk-account[aria-expanded=true] { border-color: var(--mk-input-border); background: var(--mk-petrol-10); }
.mk-account .mk-avatar { width: 36px; height: 36px; font-size: 14px; }
.mk-account-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.mk-account-name { font-size: 14px; font-weight: 700; }
.mk-account-role { font-size: 12px; font-weight: 500; color: var(--mk-muted); }
.mk-account-menu { width: 264px; padding: 8px; border: 0; border-radius: 18px; box-shadow: 0 18px 48px rgba(0,93,107,.14); }
.mk-account-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--mk-line); margin-bottom: 6px; }
.mk-account-head strong { font-size: 15px; }
.mk-account-head span { font-size: 13px; color: var(--mk-muted); }
.mk-account-menu .dropdown-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  font-size: 15px; font-weight: 600; color: var(--mk-ink); }
.mk-account-menu .dropdown-item > .mk-lu { color: var(--mk-petrol-dark); }
.mk-account-menu .dropdown-item:active, .mk-account-menu .dropdown-item:active > .mk-lu { color: #fff; }

#main { margin-left: var(--mk-sidebar-w); padding: 28px 28px 112px; min-height: calc(100vh - var(--mk-topbar-h)); }

/* Feedback on every page: a round orange button in the corner; the page leaves room for it at the bottom */
.mk-feedback-ball { position: fixed; right: 28px; bottom: 28px; z-index: 1035; height: 52px; padding: 0 22px 0 18px; border: 0;
  border-radius: 999px; background: var(--mk-orange); color: var(--mk-ink); box-shadow: 0 8px 24px rgba(0,93,107,.18);
  display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; }
.mk-feedback-ball:hover { background: #EF9A26; }
body.modal-open .mk-feedback-ball { visibility: hidden; }

#bottombar { display: none; }

.mk-page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.mk-page-head .mk-sub { color: var(--mk-muted); font-size: .875rem; margin: 4px 0 0; }
.breadcrumb { --bs-breadcrumb-font-size: .8125rem; --bs-breadcrumb-margin-bottom: .25rem; --bs-breadcrumb-divider-color: var(--mk-muted);
  --bs-breadcrumb-item-active-color: var(--mk-muted); }

/* SEO banners kept from the old shell, restyled */
.quota-banner, .cred-banner { border-radius: .75rem; padding: .75rem 1rem; margin-bottom: 1.25rem; font-size: .9rem; }
.quota-banner { background: #FBE9E7; border-left: 4px solid var(--mk-danger); color: var(--mk-ink); }
.cred-banner { background: var(--mk-orange-10); border-left: 4px solid var(--mk-orange); color: var(--mk-ink); }
.up { color: #3D7A2A; } .down { color: var(--mk-danger); } .same { color: var(--mk-muted); }
.dot-error { color: var(--mk-danger); } .dot-warning { color: #C77A0A; } .dot-info { color: var(--mk-petrol); }
.badge-pos { font-size: .8rem; min-width: 2.4rem; }

/* Phones – narrow, or a touch screen that is low (a phone on its side gets the phone layout too).
   The same query is PHONE in static/planning/planmobile.js. */
.mk-phone-only { display: none !important; }
@media (max-width: 767.98px), (pointer: coarse) and (max-height: 500px) {
  :root { --mk-topbar-h: 60px; --mk-bottombar-h: calc(72px + env(safe-area-inset-bottom)); }
  .mk-phone-only { display: block !important; }
  span.mk-phone-only { display: inline !important; }
  .mk-desk-only { display: none !important; }
  #sidebar { display: none; }
  #topbar { --mk-focus: #FAF5EC; margin-left: 0; padding: 0 8px 0 12px; gap: 4px; background: var(--mk-ink); border-bottom: 0; }
  .mk-topbar-logo { display: flex; align-items: flex-end; margin-right: auto; text-decoration: none; flex: none; }
  .mk-topbar-logo img { height: 28px; display: block; }
  .mk-topbar-logo .mk-brand-script { display: flex; margin: 0 0 -6px -10px; }
  .mk-topbar-logo .mk-brand-script span { font-size: 16px; }
  .mk-bell { color: var(--mk-cream); }
  .mk-bell:hover, .mk-bell[aria-expanded=true] { background: rgba(250,245,236,.1); }
  .mk-account, .mk-account:hover, .mk-account[aria-expanded=true] { height: 44px; padding: 0; border: 0; background: transparent; }
  .mk-account-text, .mk-account-chev { display: none; }
  #main { margin-left: 0; padding: 16px 16px calc(var(--mk-bottombar-h) + 88px); }
  #bottombar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: var(--mk-bottombar-h); padding: 8px 4px env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--mk-line); }
  #bottombar > a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; text-decoration: none;
    color: var(--mk-muted); font-size: 12px; font-weight: 600; }
  /* only the word may be cut short: the count sits above the icon's edge and must not be cut off with it (feedback #36) */
  .mk-bb-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #bottombar > a.active { color: var(--mk-ink); font-weight: 700; }
  .mk-bb-ic { position: relative; width: 56px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
  #bottombar > a.active .mk-bb-ic { background: var(--mk-petrol-10); color: var(--mk-petrol-dark); }
  .mk-bb-n { position: absolute; top: -3px; right: 4px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--mk-orange);
    color: var(--mk-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
  .mk-feedback-ball { height: 44px; padding: 0 16px 0 14px; gap: 8px; font-size: 14px; right: 16px; bottom: calc(var(--mk-bottombar-h) + 16px); }
  .mk-feedback-ball .mk-lu { width: 20px; height: 20px; }
  .mk-unsaved-bar { bottom: calc(var(--mk-bottombar-h) + 12px); }
  .mk-h1 { font-size: 1.5rem; }
  .btn, .form-control, .form-select { min-height: 44px; }
  .btn-sm { min-height: 36px; }
}

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

/* ── Generic fixes for the views that follow the same patterns ───────────── */
.btn { white-space: nowrap; }
.form-control-color { width: 2.5rem; min-width: 2.5rem; height: 2.25rem; padding: .25rem; border-radius: .5rem; flex: none; }
.form-control-color.form-control-sm { height: 2rem; }
.list-group-item > form.d-flex { flex-wrap: wrap; }
.list-group-item > form.d-flex > input.form-control:not(.form-control-color) { flex: 1 1 9rem; min-width: 9rem; }
.card-header .h6, .card-header h2.h6, .card-body > h2.h6, section.card h2.h6 { font-size: 1.125rem; font-weight: 800; }
/* A5: icons in card titles are petrol and 18 px – one look; brand logos (an inline colour) keep theirs */
.card h2 > .bi:not([style]), .card h2 > button > .bi:not([style]), .card h2 > span > .bi:not([style]) {
  color: var(--mk-petrol-dark) !important; font-size: 18px; }
.card-header { border-bottom-color: var(--mk-line); }
.card-footer { border-top-color: var(--mk-line); background: #fff; }
select[multiple].form-select { background-image: none; padding: .375rem .5rem; }
select[multiple].form-select option { padding: .25rem .5rem; border-radius: .375rem; }
select[multiple].form-select option:checked { background: var(--mk-petrol-30); color: var(--mk-ink); }
.form-switch .form-check-input { width: 2.25em; }
.mk-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--mk-muted); text-decoration: none; margin-bottom: 4px; }
.mk-back:hover { color: var(--mk-ink); }
.mk-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 13px; }
.mk-history li { padding: 8px 0; border-bottom: 1px solid var(--mk-line); display: flex; flex-direction: column; gap: 1px; }
.mk-history li:last-child { border-bottom: 0; }


/* ── Shared components (lists, search, facts, chips) ─────────────────────── */
.mk-searchfield { position: relative; width: 320px; max-width: 100%; }
.mk-searchfield > .bi-search { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mk-muted); }
.mk-searchfield .form-control { padding-left: 34px; padding-right: 34px; border-radius: 999px; height: 38px; }
.mk-search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--mk-muted); }
.mk-tool-select { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; border: 1px solid var(--mk-input-border);
  border-radius: 10px; background: #fff; font-size: 13px; }
.mk-tool-select label { color: var(--mk-muted); margin: 0; white-space: nowrap; }
.mk-tool-select select { border: 0; background-color: transparent; font-weight: 700; padding: 0 1.75rem 0 0; height: 30px; min-height: 0; box-shadow: none; }
.mk-tool-select select:focus { outline: 0; }
.mk-tool-select input { border: 0; background: transparent; font-weight: 700; height: 30px; padding: 0 4px 0 0; min-height: 0; box-shadow: none; width: auto; }
.mk-tool-select input:focus { outline: 0; box-shadow: none; }
.mk-tool-select:focus-within { outline: 3px solid var(--mk-focus); outline-offset: 2px; }
.mk-tool-select.mk-on { background: var(--mk-petrol-10); border-color: var(--mk-petrol-dark); }
.mk-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; font-weight: 700; }
th[aria-sort=ascending] .mk-sort::after { content: ' ↓'; }
th[aria-sort=descending] .mk-sort::after { content: ' ↑'; }
.mk-similar { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #9A5B00; margin-left: 6px; white-space: nowrap; }
.mk-archived-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #4D6266; background: var(--mk-petrol-dark-10);
  border-radius: 999px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; }
@media (max-width: 991.98px) { .mk-similar, .mk-archived-tag { display: flex; width: max-content; margin: 2px 0 0; } }
.mk-entity-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.mk-entity-head > .flex-grow-1 { flex: 1 1 0; min-width: 12rem; }   /* the name sits beside its icon, also when it is long (C3) */
.mk-entity-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--mk-petrol-10); color: var(--mk-petrol-dark); display: inline-flex;
  align-items: center; justify-content: center; font-size: 24px; flex: none; }
.mk-diamond { transform: rotate(45deg); border-radius: 3px; border: 2px solid; display: inline-block; }
.mk-tab-n { font-size: 11px; font-weight: 800; background: var(--mk-cream-2); color: var(--mk-ink); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.mk-log { list-style: none; margin: 0; padding: 8px 16px 12px; }
.mk-log > li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--mk-line); font-size: 14px; }
.mk-log > li:last-child { border-bottom: 0; }
.mk-log-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--mk-petrol-10); color: var(--mk-petrol-dark); display: inline-flex;
  align-items: center; justify-content: center; flex: none; }
button.mk-chip { cursor: pointer; }
.mk-facts { margin: 0; display: flex; flex-direction: column; }
.mk-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--mk-line); font-size: 14px; }
.mk-facts > div:last-child { border-bottom: 0; }
.mk-facts dt { font-weight: 400; color: var(--mk-muted); }
.mk-facts dd { margin: 0; font-weight: 700; text-align: right; }
.mk-contacts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mk-contacts > li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
/* a contact who has stopped working at the partner: red, with the date, kept as history */
.mk-contacts > li.mk-left-row { background: #FBE9E7; border-radius: 10px; padding: 6px 8px; }
.mk-contacts > li.mk-left-row a.fw-bold { color: var(--mk-danger); }
.mk-contacts > li.mk-left-head { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--mk-danger); margin-top: 6px; }
.mk-left-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--mk-danger);
  border: 1px solid var(--mk-danger); background: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.mk-left-text { color: var(--mk-danger); font-weight: 700; }
.mk-left-form summary { list-style: none; } .mk-left-form summary::-webkit-details-marker { display: none; }
.mk-x { border: 0; background: none; color: var(--mk-muted); width: 30px; height: 30px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; text-decoration: none; }
.mk-x:hover { background: var(--mk-petrol-10); color: var(--mk-ink); }
.mk-linkbtn { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 700; color: var(--mk-petrol-dark); }
.mk-pill-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-pill-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700;
  color: var(--mk-ink); text-decoration: none; border: 1px solid var(--mk-input-border); background: #fff; }
.mk-pill-tabs a:hover { background: var(--mk-petrol-10); }
.mk-pill-tabs a.active { background: var(--mk-petrol-dark); border-color: var(--mk-petrol-dark); color: #fff; }
.mk-pill-tabs a.active .mk-tab-n { background: rgba(255,255,255,.2); color: #fff; }
/* the same pills as buttons (a radiogroup that filters in place) and a small size */
.mk-pill-tabs > button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700;
  border: 1px solid var(--mk-input-border); background: #fff; color: var(--mk-ink); }
.mk-pill-tabs > button:hover { background: var(--mk-petrol-10); }
.mk-pill-tabs > button[aria-checked=true] { background: var(--mk-petrol-dark); border-color: var(--mk-petrol-dark); color: #fff; }
.mk-pill-tabs-sm > a, .mk-pill-tabs-sm > button { padding: 4px 12px; font-size: 13px; }
.mk-linkbtn:hover { color: var(--mk-ink); text-decoration: underline; }

/* Plan header meta row */
.mk-plan-meta { display: flex; align-items: center; gap: 22px; font-size: 14px; flex-wrap: wrap; margin-top: 8px; }
.mk-plan-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.mk-plan-meta .bi { color: var(--mk-petrol-dark); }
.mk-plan-meta .mk-lbl { color: var(--mk-muted); }
.mk-avatars { display: inline-flex; }
.mk-avatars .mk-avatar { border: 2px solid var(--mk-cream); }
.mk-avatars .mk-avatar + .mk-avatar { margin-left: -6px; background: var(--mk-petrol-30); }
.mk-progress { width: 90px; height: 8px; border-radius: 99px; background: var(--mk-petrol-10); display: inline-block; overflow: hidden; }
.mk-progress > span { display: block; height: 8px; border-radius: 99px; background: var(--mk-petrol-dark); }

.mk-log > li.mk-unread { background: var(--mk-petrol-10); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.mk-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mk-orange); flex: none; margin-top: 6px; }
.mk-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mk-partner-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1199.98px) { .mk-partner-grid { grid-template-columns: 1fr; } }
.mk-entity-icon { font-weight: 800; font-size: 18px; }

/* Inbox */
.mk-inbox-event { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; font-weight: 700; }
.mk-inbox-event .bi { color: var(--mk-petrol-dark); }
/* A table that scrolls sideways becomes a vertical scroller too (overflow-x: auto turns overflow-y into auto), and a
   table a pixel taller than its box then gets a second vertical scrollbar that catches the mouse wheel – only the page
   scrolls up and down (feedback #8) */
.table-responsive { overflow-y: hidden; }

/* a status pill that opens a menu of statuses (Mina aktiviteter, the start page) */
.mk-status-btn { border: 0; background: none; padding: 0; border-radius: 999px; }

/* time as whole hours + minutes; "Spara alla ifyllda" stays in view while the list scrolls */
.mk-duration { width: 11rem; flex-wrap: nowrap; }
.mk-duration .form-control { min-width: 0; text-align: right; }
.mk-time-savebar { position: sticky; bottom: var(--mk-bottombar-h); z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 10px 16px; background: #fff; border-top: 1px solid var(--mk-line); border-radius: 0 0 var(--bs-card-border-radius) var(--bs-card-border-radius); }
.mk-inbox-body { white-space: pre-line; max-height: 16rem; overflow: auto; font-size: 14px; background: var(--mk-cream); border-radius: 8px;
  padding: 10px 12px; margin-top: 6px; }
.mk-inbox-actions { background: #FDF9F2; border-top: 1px solid var(--mk-line); padding: 14px 16px; }
.mk-inbox-item .border-top.bg-light-subtle { background: var(--mk-petrol-10) !important; }

/* Steps (Excel import) */
.mk-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; counter-reset: step; }
.mk-steps li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--mk-muted); }
.mk-steps li::before { counter-increment: step; content: counter(step); width: 26px; height: 26px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; border: 1px solid var(--mk-input-border); background: #fff; color: var(--mk-ink); }
.mk-steps li + li::after { order: -1; content: ''; width: 24px; border-top: 2px solid var(--mk-line); }
.mk-steps li[aria-current=step] { color: var(--mk-ink); }
.mk-steps li[aria-current=step]::before { background: var(--mk-petrol-dark); border-color: var(--mk-petrol-dark); color: #fff; }
.mk-steps li.done::before { content: '✓'; background: var(--mk-green); border-color: var(--mk-green); }
.mk-dropzone { border: 2px dashed var(--mk-input-border); border-radius: 14px; background: #FDF9F2; padding: 28px 20px; text-align: center; }
.mk-dropzone > .bi { font-size: 32px; color: var(--mk-petrol-dark); }
.mk-dropzone.mk-over { border-color: var(--mk-petrol-dark); background: var(--mk-petrol-10); }
.mk-match { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.mk-score { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 0 7px; background: var(--mk-cream-2); }
.mk-score.hi { background: var(--mk-orange); }

/* Contrast: muted text on tinted backgrounds uses a darker shade (WCAG AA) */
.table > thead th, .table-light th, .mk-unread .mk-meta, .mk-inbox-actions .mk-meta, .bg-light .text-muted { color: #4D6266 !important; }
/* A switched-off section is shown dimmed by a background, not by transparency, so its text stays readable */
.mk-dimmed { background: #F3F5F5; border-radius: .75rem; padding: .5rem .75rem; }
.mk-dimmed::before { content: 'Avstängt – slå på ovan för att ändra.'; display: block; font-size: 12px; font-weight: 700; color: #4D6266; margin-bottom: .25rem; }

.mk-collapse-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.mk-collapse-btn .mk-collapse-ico { font-size: 12px; transition: transform .15s; }
.mk-collapse-btn[aria-expanded=true] .mk-collapse-ico { transform: rotate(180deg); }
.text-secondary { color: #4D6266 !important; }
.btn-outline-warning { --bs-btn-color: #7A4A00; --bs-btn-border-color: #F6AA42; --bs-btn-hover-bg: #F6AA42; --bs-btn-hover-color: #16363C;
  --bs-btn-hover-border-color: #F6AA42; --bs-btn-active-bg: #F6AA42; --bs-btn-active-color: #16363C; }
.mk-decision .mk-decision-select { width: auto; max-width: 22rem; }
@media (max-width: 575.98px) { .mk-decision { flex-wrap: wrap; } .mk-decision .mk-decision-select { max-width: 100%; width: 100%; } }
code { color: var(--mk-petrol-dark); }

/* Loading bar (static/js/app.js): shown only when the next page takes longer than the threshold */
.mk-loading { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; overflow: hidden;
  pointer-events: none; opacity: 0; transition: opacity .15s; }
.mk-loading.on { opacity: 1; }
.mk-loading > span { position: absolute; top: 0; bottom: 0; width: 40%; background: var(--mk-orange, #E8833A);
  border-radius: 0 3px 3px 0; animation: mk-loading 1.1s ease-in-out infinite; }
@keyframes mk-loading { from { left: -40%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .mk-loading > span { animation: none; left: 0; width: 100%; opacity: .7; } }

/* Startsidan (planning/start.html): the user's cards in two columns, compact lists and key figures */
/* columns that fill top to bottom (at most two): a short card never leaves a hole beside a tall one */
.mk-start-grid { columns: 2 420px; column-gap: 16px; }
.mk-start-grid > .card { break-inside: avoid; margin-bottom: 16px; width: 100%; display: inline-block; }
.mk-start-list { list-style: none; margin: 0; padding: 0; }
.mk-start-list > li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--mk-line); font-size: 14px; }
.mk-start-list > li:last-child { border-bottom: 0; }
.mk-start-when { width: 4.75rem; flex: none; font-size: 12px; font-weight: 700; color: var(--mk-petrol-dark); line-height: 1.25; }
.mk-start-ico { width: 1.25rem; flex: none; text-align: center; color: var(--mk-petrol-dark); }
.mk-start-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 8px; }
.mk-start-figs > a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--mk-line); border-radius: .625rem;
  color: inherit; text-decoration: none; min-width: 0; }
.mk-start-figs > a:hover { border-color: var(--mk-petrol-dark); }
.mk-start-figs strong { font-size: 1.25rem; line-height: 1.2; }
.mk-start-pick { list-style: none; margin: 0; padding: 0; }
.mk-start-pick > li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--mk-line); }
.mk-start-pick > li:last-child { border-bottom: 0; }
.mk-start-pick .form-check-input { margin: 0; flex: none; }
.mk-start-add { border-style: dashed; background: transparent; }
@media (max-width: 575.98px) {
  .mk-start-grid { column-gap: 12px; }
  .mk-start-grid > .card { margin-bottom: 12px; }
  .mk-start-when { width: 3.75rem; }
}

/* Feedback: confirm / dismiss open as small forms under their buttons; a confirmed one shows the admin's addition */
.mk-fb-act > summary { list-style: none; }
.mk-fb-act > summary::-webkit-details-marker { display: none; }
.mk-fb-act[open] { flex-basis: 100%; }
.mk-fb-act[open] > summary { display: none; }      /* the open form has its own button – not two of the same */
.mk-fb-act[open] > form { margin-top: 0 !important; }
.mk-fb-confirmed { border-left: 3px solid #9DBFE3; background: #F3F8FD; border-radius: 0 .5rem .5rem 0; padding: 8px 12px; }
.mk-fb-card { border-left-width: 5px; }
.mk-fbs-new { border-left-color: var(--mk-orange); }
.mk-fbs-confirmed { border-left-color: #9DBFE3; }
.mk-fbs-in_progress { border-left-color: var(--mk-petrol-60); }
.mk-fbs-done { border-left-color: #8DC07A; }
.mk-fbs-wontfix { border-left-color: var(--mk-beige); }
.mk-fb-section { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }

/* Lediga platser on a phone: one card per activity instead of the table */
.mk-vac-list { list-style: none; margin: 0; padding: 0 16px 8px; }
.mk-vac-list > li { padding: 12px 0; border-top: 1px solid var(--mk-line); font-size: 14px; }
.mk-vac-list .flex-none { flex: none; }

/* @ in comments: the mentioned person's name stands out a little */
.mk-mention { color: var(--mk-petrol-dark); }

/* Förslag från mejl (templates/planning/_mail_suggestion.html, panel.js): a card under the mail / on the activity */
.mk-mailcard { border: 1px solid var(--mk-line); border-left: 3px solid var(--mk-petrol); border-radius: 0 .75rem .75rem 0;
  background: var(--mk-petrol-10); padding: 10px 12px; margin-top: 8px; font-size: 14px; }
.mk-mailcard-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.mk-mailcard-head .bi { color: var(--mk-petrol-dark); }
.mk-ai-badge, .mk-rule-badge { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; }
.mk-ai-badge { background: var(--mk-ink); color: #fff; }
.mk-rule-badge { background: #fff; border: 1px solid var(--mk-line); color: var(--mk-muted); }
.mk-mailchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--mk-input-border);
  border-radius: 999px; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.mk-mailchip:has(input:checked) { border-color: var(--mk-petrol-dark); box-shadow: inset 0 0 0 1px var(--mk-petrol-dark); }
.mk-mailquote { margin: 4px 0 0; padding: 6px 10px; border-left: 2px solid var(--mk-line); background: #fff; border-radius: 0 6px 6px 0;
  font-size: 13px; white-space: pre-line; }
.mk-mailcards { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.mk-mailcards .mk-mailcard { margin-top: 0; }
.mk-fromlist { list-style: none; margin: 0; padding: 0; }
.mk-fromlist > li { padding: 6px 0; border-bottom: 1px solid var(--mk-line); font-size: 13px; }

/* Inbox: a mail whose sender our mail server couldn't verify */
.mk-unverified { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--mk-orange-10); border: 1px solid var(--mk-orange); }
.mk-unverified .bi { color: #a8650a; margin-right: 4px; }

/* ── Date picker (flatpickr) in the app's colours, with week numbers ─────────────────────────────────────── */
.flatpickr-calendar { font-family: inherit; box-shadow: 0 10px 30px rgba(22,54,60,.18); border-radius: 12px; }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus {
  background: var(--mk-petrol-dark); border-color: var(--mk-petrol-dark); color: #fff; }
.flatpickr-day.today { border-color: var(--mk-petrol-dark); }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--mk-petrol-10); border-color: var(--mk-petrol-10); }
.flatpickr-weekwrapper .flatpickr-weeks { box-shadow: 1px 0 0 var(--mk-line); }
.flatpickr-weekwrapper span.flatpickr-day, .flatpickr-weekwrapper .flatpickr-weekday {
  color: var(--mk-petrol-dark); font-weight: 700; font-size: 12px; }
.flatpickr-weekwrapper span.flatpickr-day:hover { background: none; border-color: transparent; }
span.flatpickr-weekday { color: var(--mk-muted); font-weight: 700; }

/* Informationsbrev: the mail as it will look, next to the texts */
.mk-letter-preview { width: 100%; height: 80vh; min-height: 520px; border: 1px solid var(--mk-line); border-radius: 12px; background: var(--mk-cream); }
.mk-letter-sec { border-top: 1px solid var(--mk-line); padding-top: 10px; }

/* Flera aktiviteter med partners (planning/plan_bulk.html) */
.mk-step { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--mk-petrol-dark); color: #fff; font-size: 13px; font-weight: 800; margin-right: 8px; vertical-align: 2px; }
.mk-token { border: 1px solid var(--mk-line); background: var(--mk-cream); border-radius: 6px; padding: 0 6px; margin: 0 2px;
  font: 600 12px/1.6 ui-monospace, monospace; color: var(--mk-petrol-dark); }
.mk-token:hover { border-color: var(--mk-petrol); }
.mk-partner-pick { max-height: 26rem; }
.mk-partner-pick [hidden] { display: none !important; }
.mk-bulk-preview { position: sticky; top: calc(var(--mk-topbar-h) + 16px); }
.mk-bulk-preview .card-body { max-height: calc(100vh - var(--mk-topbar-h) - 160px); overflow-y: auto; }
.mk-bulk-list { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.mk-bulk-list li > * { display: block; }
.mk-check-list { border: 1px solid var(--mk-line); border-radius: 10px; padding: 6px 10px; max-height: 14rem; overflow-y: auto; background: #fff; }
.mk-check-list .form-check { margin-bottom: 2px; }

/* Dokument */
.mk-chip-link { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--mk-line);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--mk-ink); text-decoration: none; }
.mk-chip-link:hover { border-color: var(--mk-petrol); color: var(--mk-ink); }
.mk-chip-link.active { background: var(--mk-petrol-dark); border-color: var(--mk-petrol-dark); color: #fff; }
.mk-doc-list > li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.mk-doc-list > li + li { border-top: 1px solid var(--mk-line); }
.mk-doc-ic { font-size: 22px; color: var(--mk-petrol-dark); flex: none; }
.mk-badge-cat { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--mk-cream-2);
  font-size: 12px; font-weight: 600; color: var(--mk-muted); vertical-align: 1px; }
.mk-doc-text { font-size: 16px; line-height: 1.6; max-width: 46rem; }
.mk-doc-text h3, .mk-doc-text h4, .mk-doc-text h5 { margin: 1.2em 0 .4em; font-weight: 800; }
.mk-doc-text h3:first-child, .mk-doc-text h4:first-child { margin-top: 0; }
.mk-doc-text ul, .mk-doc-text ol { padding-left: 1.4rem; }
.mk-doc-pdf { width: 100%; height: 80vh; border: 1px solid var(--mk-line); border-radius: 12px; background: #fff; }
/* the PDF drawn by the app (pdfview.js): the pages under each other, in a scrolling box like the old frame */
.mk-pdf-pages { max-height: 80vh; overflow-y: auto; border: 1px solid var(--mk-line); border-radius: 12px; background: var(--mk-cream-2, #f3ead9);
  padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.mk-pdf-page { width: 100%; height: auto; background: #fff; box-shadow: 0 1px 3px rgba(22,54,60,.15); }
.mk-pdf-pages .mk-doc-pdf { border: 0; }
/* One mail, many recipients: which partners, contacts and activities it belongs to (templates/planning/_mail_links.html) */
.mk-linkpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 12px 20px; margin-bottom: 10px; }
.mk-linkpick-group { min-width: 0; }
.mk-linkpick-list { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.mk-linkpick-list:empty { display: none; }

/* ── Badges: a small coloured label (the activity panel, Att hantera, the bell) ─────────────── */
.mk-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  white-space: nowrap; flex: none; }
.mk-badge-neu { background: var(--mk-petrol-10); color: var(--mk-petrol-dark); }
.mk-badge-warn, .mk-badge-news { background: #FEF6EA; color: #9A5B12; }
.mk-badge-ok { background: #F0F8EC; color: #3F6B32; }
.mk-badge-letter { background: var(--mk-beige); color: var(--mk-ink); }
.mk-pill-tabs > button[aria-pressed=true] { background: var(--mk-petrol-dark); border-color: var(--mk-petrol-dark); color: #fff; }
.mk-bell-panel .mk-pill-tabs > button { padding: 4px 12px; font-size: 13px; }

/* Att hantera: one list of everything waiting, a type label first and the action last */
.mk-todo-list > li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 20px; border-bottom: 1px solid var(--mk-line); }
.mk-todo-list > li:last-child { border-bottom: 0; }
.mk-todo-type { min-width: 6.5rem; justify-content: center; }
@media (max-width: 767.98px) { .mk-todo-list > li { padding: 12px 14px; } .mk-todo-type { min-width: 0; } }

/* Start › Att hantera: the sum, one line you can tap */
.mk-start-sum { display: block; padding: 10px 14px; margin-bottom: 8px; border-radius: 12px; background: var(--mk-petrol-10);
  color: var(--mk-ink); text-decoration: none; font-size: 15px; }
.mk-start-sum strong { font-size: 20px; font-weight: 900; color: var(--mk-petrol-dark); margin-right: 4px; }
.mk-start-sum:hover { background: var(--mk-petrol-30); color: var(--mk-ink); }
.mk-start-other a { color: var(--mk-petrol-dark); text-decoration: none; }

/* Mer (the phone's fifth place): the rest of the menu as white grouped lists */
.mk-more { display: flex; flex-direction: column; gap: 18px; max-width: 40rem; }
.mk-more h2.mk-eyebrow { padding: 0 6px 6px; }
.mk-more-list { list-style: none; margin: 0; padding: 4px 0; background: #fff; border: 1px solid var(--mk-line); border-radius: 18px; }
.mk-more-list a { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 16px; color: var(--mk-ink);
  text-decoration: none; font-size: 16px; font-weight: 600; }
.mk-more-list a > .mk-lu:first-child { color: var(--mk-petrol-dark); }
.mk-more-list a > span:not(.mk-nav-badge) { flex: 1 1 auto; }
.mk-more-list a:hover { background: var(--mk-petrol-10); }
.mk-more-list li + li a { border-top: 1px solid var(--mk-line); }
.mk-more-chev { color: var(--mk-muted); }

/* Inställningar: a menu of the parts on the left, the chosen part on the right */
.mk-settings { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.mk-settings-nav { flex: 0 0 240px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--mk-topbar-h) + 16px); }
.mk-settings-nav .mk-eyebrow { display: block; padding: 0 14px 6px; }
.mk-settings-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mk-settings-nav a { display: flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px; color: var(--mk-ink);
  text-decoration: none; font-size: 15px; font-weight: 500; }
.mk-settings-nav a:hover { background: var(--mk-petrol-10); }
.mk-settings-nav a.active { background: var(--mk-petrol-10); font-weight: 700; box-shadow: inset 3px 0 0 var(--mk-petrol-dark); }
.mk-settings-body { flex: 1 1 420px; min-width: 0; max-width: 56rem; }
/* the parts sat in the half-width columns of the page that showed them all at once: one part fills the width now */
.mk-settings-body > .row > [class*="col-"], .mk-settings-body > div > .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
@media (max-width: 767.98px), (pointer: coarse) and (max-height: 500px) {
  .mk-settings { gap: 16px; }
  .mk-settings-nav { position: static; flex: 1 1 100%; flex-direction: row; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .mk-settings-nav > div { display: contents; }
  .mk-settings-nav .mk-eyebrow { display: none; }
  .mk-settings-nav ul { flex-direction: row; gap: 6px; }
  .mk-settings-nav a { white-space: nowrap; min-height: 40px; border: 1px solid var(--mk-line); background: #fff; border-radius: 999px; }
  .mk-settings-nav a.active { background: var(--mk-petrol-dark); color: #fff; box-shadow: none; border-color: var(--mk-petrol-dark); }
}

/* A sent Informationsbrev, read in the app */
.mk-letter-frame { display: block; width: 100%; max-width: 52rem; height: 75vh; min-height: 30rem; border: 1px solid var(--mk-line);
  border-radius: 16px; background: #fff; }
