/*
 * Panelen på app.styrt.se. Förslag C, Svaret först, valt av William i del 2.
 * Alla värden finns som variabler här, så att ett byte bara görs på ett ställe
 * (DESIGN.md). Storlekar i rem, så att webbläsarens textstorlek följs (M25).
 */

@font-face {
    font-family: "Instrument Sans";
    src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
    font-weight: 400 700;
    font-stretch: 75% 100%;
    font-display: swap;
}

:root {
    --bg: #FFFFFF;
    --surface: #FAFBF8;
    --line: #ECECEC;
    --line-strong: #DEDFDC;
    --card-edge: #EBEBEB;
    /* Kanten på textrutor: 3,2:1 mot vitt, så att rutan syns (WCAG 1.4.11). */
    --field-edge: #8C908D;
    --ink: #212423;
    --ink-body: #2D2D2D;
    --ink-soft: #686C6D;
    --action: #282A2C;
    --action-hover: #111213;
    --action-soft: #F0F0F0;
    --action-soft-hover: #E4E5E2;
    --bad: #A44A39;
    --bad-tint: #FDF0ED;
    --good: #33705E;
    --good-tint: #EEF8F5;
    --mint: #ABD9C9;

    --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --radius: 6px;
    --page: 1144px;
    --gutter: 40px;
    --focus: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink);

    /* Ramen (del 3). Loggan och menyns text börjar vid --edge, innehållet vid
       --side + --main-x, och både menyn och rubriken --top-gap under toppraden. */
    --top: 64px;
    --side: 248px;
    --edge: 28px;
    --item-x: 12px;
    --main-x: 40px;
    --top-gap: 24px;
    --medium: 500;
    --tip-bg: #1D201F;
}

*, *::before, *::after { box-sizing: border-box; }

/* 18 px när webbläsaren står på 16. Webbläsarens zoom och textstorlek följs (del 4). */
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink-body);
    font: 400 1rem/1.55 var(--font);
    font-variant-numeric: lining-nums;
}

::selection { background: var(--mint); color: var(--ink); }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 400; text-wrap: balance; }
h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.222rem; line-height: 1.3; }
p { margin: 0; }
b, strong { font-weight: 600; color: var(--ink); }

.skip {
    position: absolute; left: 16px; top: -100px; z-index: 10;
    padding: 12px 20px; background: var(--action); color: #fff; border-radius: var(--radius);
}
.skip:focus { top: 12px; }

.linkish {
    padding: 0; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer;
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
.linkish:hover { text-decoration-thickness: 2px; }

.page { max-width: var(--page); margin: 0 auto; padding: 40px var(--gutter) 96px; }
.narrow { max-width: calc(760px + 2 * var(--gutter)); }
.page > h1 + p, .lead { margin-top: 12px; color: var(--ink-soft); }

/* Två spalter: svaret i fältet, arbetet bredvid */
.split {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--gutter); align-items: stretch;
}
.field {
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    background: var(--surface); border-radius: var(--radius); padding: 40px;
}
.field h1 { font-size: 1.778rem; overflow-wrap: anywhere; }
.field .quiet { font-size: 0.944rem; color: var(--ink-soft); }

/* Formulär */
form.work { display: grid; gap: 24px; max-width: 520px; align-content: start; }
.page > form.work { margin-top: 32px; }
label, .label { display: block; margin-bottom: 8px; font-size: 0.944rem; color: var(--ink); }
.hint { display: block; margin: -2px 0 8px; font-size: 0.944rem; color: var(--ink-soft); }
input[type=email], input[type=password], input[type=text] {
    width: 100%; height: 48px; padding: 0 16px;
    font: inherit; color: var(--ink); background: var(--bg);
    border: 1px solid var(--field-edge); border-radius: var(--radius);
}
input[type=email]:focus, input[type=password]:focus, input[type=text]:focus {
    outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink);
}
.code { max-width: 240px; font-size: 1.444rem; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }

.password { position: relative; }
.password input { padding-right: 96px; }
.show {
    position: absolute; right: 5px; top: 5px; height: 38px; padding: 0 12px;
    display: inline-flex; align-items: center; gap: 6px;
    border: 0; border-radius: 999px; background: var(--action-soft); color: var(--ink);
    font: 400 0.889rem/1 var(--font); cursor: pointer;
}
.show:hover { background: var(--action-soft-hover); }
.show svg { width: 18px; height: 18px; }

.check { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.check input { width: 28px; height: 28px; margin: 0; accent-color: var(--action); cursor: pointer; }
.check label { margin: 2px 0 0; cursor: pointer; }
.check .hint { margin: 2px 0 0; }

.invalid input { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.error-text { display: block; margin-top: 8px; color: var(--bad); font-size: 0.944rem; }

/* Knappar: en mörk för det viktigaste, ljusa för resten (DESIGN.md) */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
    font: 400 0.944rem/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn-dark { background: var(--action); color: #fff; }
.btn-dark:hover { background: var(--action-hover); }
.btn-light { background: var(--action-soft); color: var(--ink); }
.btn-light:hover { background: var(--action-soft-hover); }
.btn[disabled], .btn[aria-busy=true] { opacity: 0.7; cursor: progress; }
.more { display: grid; gap: 12px; justify-items: start; font-size: 0.944rem; }

/* Besked: fel, information och kvitto (M13, M16) */
.alert { border-radius: var(--radius); padding: 20px 24px; }
.alert:focus { box-shadow: var(--focus); }
.alert p + p { margin-top: 6px; }
.alert.bad { background: var(--bad-tint); }
.alert.bad h2 { color: var(--bad); font-size: 1rem; }
.alert.bad h2 + p { margin-top: 4px; }
.alert.info { background: var(--surface); border: 1px solid var(--line-strong); }
.alert.good { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; background: var(--good-tint); }
.alert.good p { color: var(--ink); }
.page > .alert { margin-bottom: 40px; }

/* Välj förening */
.choose { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.choose a {
    display: grid; grid-template-columns: 56px 1fr 24px; gap: 20px; align-items: center;
    min-height: 88px; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.choose a:hover { background: var(--surface); }
.choose .initials {
    width: 56px; height: 56px; display: grid; place-items: center;
    border-radius: var(--radius); background: var(--mint); color: var(--ink); font-weight: 600;
}
.choose .name { display: block; font-size: 1.222rem; line-height: 1.3; color: var(--ink); }
.choose .address { display: block; font-size: 0.944rem; color: var(--ink-soft); }
.choose svg { width: 20px; height: 20px; color: var(--ink); }

/* Mina uppgifter */
.section { margin-top: 64px; }
.section > h2 { margin-bottom: 8px; }
.section > p { margin-bottom: 16px; color: var(--ink-soft); }
.rows { margin-top: 16px; border-top: 1px solid var(--line); }
.row {
    display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 8px 24px; align-items: center;
    min-height: 64px; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.row .key { color: var(--ink-soft); font-size: 0.944rem; }
.row .value { color: var(--ink); overflow-wrap: anywhere; }
.row .value small { display: block; color: var(--ink-soft); font-size: 0.889rem; }
.row form { margin: 0; }
.edit { display: inline-flex; align-items: center; gap: 6px; font-size: 0.944rem; white-space: nowrap; }
.edit svg { width: 16px; height: 16px; }
.danger { color: var(--bad); }
.tag {
    display: inline-block; margin-left: 8px; padding: 1px 10px; border-radius: 999px;
    background: var(--good-tint); color: var(--good); font-size: 0.833rem; font-weight: var(--medium); vertical-align: 2px; white-space: nowrap;
}
.section .actions { margin-top: 24px; }

.back { display: inline-block; margin-bottom: 24px; font-size: 0.944rem; }

[hidden] { display: none !important; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ================= Ramen (del 3) ================= */

html { scroll-padding-top: var(--top); }

/* Toppraden: Styrt till vänster. Föreningen, Hjälp, Inställningar och kontot till höger */
.bar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
/* Lika bred överallt, också utan förening (del 4): Styrt vid kanten och kontot till höger. */
.bar-inner { display: flex; align-items: center; height: var(--top); padding: 0 var(--main-x) 0 var(--edge); }
.mark { display: flex; align-items: center; height: 40px; text-decoration: none; }
/* Den preliminära loggan. Höjden i px, så att den inte växer när texten förstoras. */
.mark img { display: block; width: auto; height: 30px; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.org {
    display: flex; align-items: center; height: 44px; max-width: 320px; padding: 0 12px;
    border-radius: 8px; color: var(--ink); text-decoration: none;
}
.org:hover { background: var(--action-soft); }
.org .name { font-size: 0.889rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.divider { width: 1px; height: 24px; margin: 0 8px; background: var(--line-strong); }

/* Ikonknappar med förklaring vid pekare och fokus */
.ib {
    position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px;
    border-radius: 999px; color: var(--ink); text-decoration: none;
}
.ib svg { width: 22px; height: 22px; }
.ib:hover, .ib[aria-current] { background: var(--action-soft); }
[data-tip]::after {
    content: attr(data-tip); position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
    padding: 7px 10px; border-radius: 6px; background: var(--tip-bg); color: #fff;
    font: 400 0.833rem/1 var(--font); white-space: nowrap; pointer-events: none;
    opacity: 0; visibility: hidden; transition: opacity 120ms ease-out;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; visibility: visible; transition-delay: 300ms; }
.tip-end::after { left: auto; right: 0; transform: none; }
.acct[open] .me::after { display: none; }

/* Kontot: avataren öppnar en meny med föreningarna, Mina uppgifter och Logga ut */
.acct { position: relative; margin-left: 4px; }
.me {
    position: relative; display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 8px 0 4px;
    border-radius: 999px; color: var(--ink); cursor: pointer; list-style: none;
}
.me::-webkit-details-marker { display: none; }
.me:hover, .acct[open] .me { background: var(--action-soft); }
.avatar {
    width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 999px;
    background: var(--mint); color: var(--ink); font-size: 0.778rem; font-weight: var(--medium); letter-spacing: 0.02em;
}
.me .chev { width: 16px; height: 16px; color: var(--ink-soft); transform-box: fill-box; transform-origin: center; transition: transform 150ms ease-out; }
.acct[open] .chev { transform: rotate(180deg); }

.menu {
    position: absolute; right: 0; top: calc(100% + (var(--top) - 44px) / 2 + 8px); z-index: 50; width: 328px; padding: 6px;
    border-radius: 12px; background: var(--bg);
    box-shadow: 0 0 0 1px var(--line-strong), 0 18px 44px -8px rgba(17, 18, 19, .22), 0 4px 10px rgba(17, 18, 19, .06);
}
.menu-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 12px 14px; }
.menu-head .avatar { width: 40px; height: 40px; font-size: 0.833rem; }
.menu-head b { display: block; font-weight: var(--medium); line-height: 1.3; }
.menu-head small { display: block; color: var(--ink-soft); font-size: 0.833rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
.menu-label { margin: 0; padding: 8px 12px 4px; font-size: 0.833rem; font-weight: var(--medium); color: var(--ink-soft); }
.menu form { margin: 0; }
.menu a, .menu button {
    display: grid; grid-template-columns: 28px minmax(0, 1fr) 20px; gap: 12px; align-items: center; width: 100%;
    min-height: 48px; padding: 6px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink);
    font: 400 0.944rem/1.3 var(--font); text-align: left; text-decoration: none; cursor: pointer;
}
.menu a:hover, .menu a:focus-visible, .menu button:hover, .menu button:focus-visible { background: var(--surface); }
.menu a:focus-visible, .menu button:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.menu svg { width: 20px; height: 20px; color: var(--ink-soft); justify-self: center; }
.org-ini {
    width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px;
    background: var(--action-soft); font-size: 0.667rem; font-weight: var(--medium); color: var(--ink);
}
.menu a[aria-current] { font-weight: var(--medium); }
.menu a[aria-current] .org-ini { background: var(--mint); }
.menu .tick { width: 18px; height: 18px; color: var(--good); }

/* Meny i mobilen. Knappen behåller bredden när ordet byts */
.menu-btn {
    display: none; align-items: center; gap: 8px; height: 44px; margin-left: 4px; padding: 0 14px;
    border: 0; border-radius: 999px; background: var(--action-soft); color: var(--ink); font: 400 0.944rem/1 var(--font); cursor: pointer;
}
.menu-btn:hover { background: var(--action-soft-hover); }
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn .lbl { display: inline-grid; }
.menu-btn .lbl > span { grid-area: 1 / 1; }
.menu-btn .ic-close, .menu-btn[aria-expanded=true] .ic-open { display: none; }
.menu-btn[aria-expanded=true] .ic-close { display: block; }
.menu-btn .txt-close, .menu-btn[aria-expanded=true] .txt-open { visibility: hidden; }
.menu-btn[aria-expanded=true] .txt-close { visibility: visible; }
.menu-org { display: none; }

/* Sidomenyn (del 3, steg 1): text utan ikoner, den aktiva i en ljusgrå ruta */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); align-items: start; }
.side {
    position: sticky; top: var(--top); height: calc(100vh - var(--top));
    display: flex; flex-direction: column; overflow-y: auto;
    padding: var(--top-gap) var(--item-x) 16px calc(var(--edge) - var(--item-x));
    font-size: 0.944rem;
}
.main-nav { display: flex; flex: 1; flex-direction: column; }
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side ul a {
    display: flex; align-items: center; min-height: 40px; padding: 0 var(--item-x);
    border-radius: 8px; color: var(--ink); text-decoration: none;
}
.side ul a:hover { background: var(--surface); text-decoration: underline; text-underline-offset: 0.2em; }
.side ul a[aria-current] { background: var(--action-soft); font-weight: var(--medium); text-decoration: none; }
.side .sep { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.side .only-small { display: none; }

/* Hemsidan längst ner, med luft ovanför */
.bottom { margin-top: auto; padding-top: 24px; }
.module {
    display: grid; grid-template-columns: minmax(0, 1fr) 18px; gap: 2px 8px; align-items: center;
    padding: 12px var(--item-x); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-strong); text-decoration: none;
}
.module:hover { background: var(--surface); }
.module:hover b { text-decoration: underline; text-underline-offset: 0.2em; }
.module b { font-weight: var(--medium); line-height: 1.3; }
.module small { grid-column: 1; color: var(--ink-soft); font-size: 0.833rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module svg { grid-row: 1 / span 2; grid-column: 2; width: 18px; height: 18px; color: var(--ink-soft); }

/* Sidans yta. Ingen största bredd, så att högra kanten följer avataren */
.main { min-width: 0; padding: var(--top-gap) var(--main-x) 96px; }
.main > .alert { margin-bottom: 32px; }

/* Sidans huvud (del 3, steg 3): brödsmulor, rubrik, mening och knapparna under */
.ph { margin-bottom: 40px; }
.ph h1 { line-height: 40px; overflow-wrap: break-word; }
.ph .lead { margin-top: 8px; max-width: 64ch; text-wrap: pretty; }
.ph-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 24px; }
.ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ph-actions:empty { display: none; }
.ph-actions .btn { white-space: nowrap; }

/* Brödsmulor: lågmälda, men länken syns som länk */
.crumbs ol {
    display: flex; flex-wrap: wrap; align-items: center; min-height: 40px; margin: 0 0 4px; padding: 0;
    list-style: none; font-size: 0.889rem; color: var(--ink-soft);
}
.crumbs li { display: inline-flex; align-items: center; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); text-decoration-color: var(--line-strong); }
.crumbs a:hover { color: var(--ink); text-decoration-color: currentColor; }
.crumb-sep { width: 14px; height: 14px; margin: 0 6px; color: var(--ink-soft); opacity: .7; }
.crumb-up { display: none; width: 16px; height: 16px; }

/* ================= Kvittot, frågan och krocken (del 3, steg 4 och 5) ================= */

/* Kvittot: en mörk remsa längst ner som står kvar tills man går vidare eller stänger den */
.snack {
    position: fixed; z-index: 55; bottom: 24px; width: min(520px, calc(100vw - 32px));
    left: max(var(--gutter), calc((100vw - var(--page)) / 2 + var(--gutter)));
    display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 12px 8px; align-items: start;
    padding: 16px 8px 16px 20px; border-radius: 12px; background: var(--tip-bg); color: #fff;
    box-shadow: 0 18px 44px -10px rgba(17, 18, 19, .45);
}
.framed .snack { left: calc(var(--side) + var(--main-x)); width: min(520px, calc(100vw - var(--side) - 2 * var(--main-x))); }
.snack .r-text { padding-top: 2px; grid-column: 1; }
.snack .r-title { color: #fff; font-weight: var(--medium); line-height: 1.4; }
.snack .r-meta { margin-top: 2px; color: rgba(255, 255, 255, .72); font-size: 0.889rem; line-height: 1.45; }
.snack .r-actions { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.snack .r-actions form { margin: 0; }
.snack .btn { min-height: 44px; padding: 0 18px; background: rgba(255, 255, 255, .12); color: #fff; }
.snack .btn:hover { background: rgba(255, 255, 255, .2); }
.snack .r-link { color: #fff; font-size: 0.944rem; white-space: nowrap; }
.snack-x { grid-column: 2; grid-row: 1; margin-top: -6px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 999px; background: none; color: #fff; cursor: pointer; }
.snack-x:hover { background: rgba(255, 255, 255, .12); }
.snack-x svg { width: 20px; height: 20px; }
.snack button:focus-visible, .snack a:focus-visible { box-shadow: 0 0 0 2px var(--tip-bg), 0 0 0 4px #fff; }

/* Ta bort är aldrig den mörka knappen (M4): ljusröd med röd text */
.btn-danger { background: var(--bad-tint); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(164, 74, 57, .28); }
.btn-danger:hover { background: #F9E2DC; }
.q-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Frågan före Ta bort: en ruta över sidan, i mobilen ett blad nerifrån */
.dialog {
    width: min(480px, calc(100vw - 32px)); max-width: none; padding: 32px; border: 0; border-radius: 14px;
    background: var(--bg); color: var(--ink-body); box-shadow: 0 24px 64px -12px rgba(17, 18, 19, .35);
}
.dialog::backdrop { background: rgba(17, 18, 19, .38); }
.dialog h2 { font-size: 1.444rem; line-height: 1.25; }
.dialog h2:focus, .dialog h2:focus-visible { outline: none; box-shadow: none; }
.dialog p { margin-top: 10px; color: var(--ink-soft); }
.dialog form { margin: 0; }
.dialog .q-actions { justify-content: flex-end; margin-top: 28px; }

/* Krocken: beskedet överst i formuläret och den andras värde vid rutan */
.notice {
    display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 16px; max-width: 640px; padding: 18px 20px;
    border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.notice:focus { outline: none; box-shadow: inset 0 0 0 1px var(--line-strong), var(--focus); }
.notice .r-icon { width: 24px; height: 24px; color: var(--ink); }
.notice .r-title { color: var(--ink); font-weight: var(--medium); }
.notice .r-meta { margin-top: 2px; font-size: 0.944rem; }
.n-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 16px; }
.clash-note {
    margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 0.944rem; line-height: 1.45;
}
.clash-note b { font-weight: var(--medium); }
.clash-note .linkish { margin-left: 4px; font-size: inherit; }

/* ================= Tomma lägen och felsidor (steg 9) ================= */
.blank { max-width: 640px; padding: 32px; border-radius: 10px; background: var(--surface); }
.blank h2 { margin-bottom: 8px; }
.blank p { max-width: 60ch; }
.blank-link { margin-top: 16px; }
.next-h { margin-bottom: 12px; }
.next { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--ink-soft); }
.err-contact { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); max-width: 640px; color: var(--ink-soft); font-size: 0.944rem; }
.ph-actions .r-link { margin-left: 12px; }
.solo { max-width: 600px; margin: 0 auto; padding: 64px var(--gutter) 0; text-align: center; }
.solo img { display: block; height: 30px; width: auto; margin: 0 auto 64px; }
.solo .lead { margin-top: 12px; }

/* ================= Papperskorgen och händelseloggen (steg 6 och 7) ================= */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters a {
    display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); text-decoration: none; font-size: 0.944rem;
}
.filters a:hover { background: var(--surface); }
.filters a[aria-current] { background: var(--action); color: #fff; box-shadow: none; }
.ph-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.sel { display: inline-flex; align-items: center; gap: 12px; margin: 0; font-size: 0.944rem; }
.sel label { margin: 0; }
.sel select {
    height: 44px; padding: 0 40px 0 14px; border: 1px solid var(--field-edge); border-radius: var(--radius); background: var(--bg)
    url("/images/chevron-down.svg") no-repeat right 12px center / 16px;
    appearance: none; font: inherit; color: var(--ink);
}
.sel .btn { min-height: 44px; }
.t-kind { display: block; color: var(--ink-soft); font-size: 0.833rem; }
.t-name { display: block; color: var(--ink); line-height: 1.35; }
.soon { color: var(--bad); }
.dtable, .ltable { width: 100%; border-collapse: collapse; }
.dtable thead th, .ltable thead th { padding: 0 16px 10px 0; color: var(--ink-soft); font-size: 0.833rem; font-weight: 400; text-align: left; white-space: nowrap; }
.dtable tr.g th, .ltable tr.g th { padding: 32px 0 8px; font-size: 1.222rem; font-weight: 400; color: var(--ink); text-align: left; border-bottom: 1px solid var(--line-strong); }
.dtable tbody:first-of-type tr.g th, .ltable tbody:first-of-type tr.g th { padding-top: 8px; }
.dtable tbody th, .dtable tbody td, .ltable td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-weight: 400; }
.dtable tbody th { width: 52%; }
.dtable .d-when { display: block; color: var(--ink); font-size: 0.944rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable .d-who { display: block; color: var(--ink-soft); font-size: 0.889rem; }
.dtable .d-until { color: var(--ink-body); font-size: 0.944rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable .d-soon { display: block; font-size: 0.889rem; }
.dtable td.c-act { padding-right: 0; text-align: right; width: 1%; }
.dtable td.c-act form { margin: 0; }
.dtable .c-act .btn { min-height: 44px; }
.ltable td { vertical-align: baseline; }
.l-time { width: 72px; color: var(--ink-soft); font-size: 0.944rem; font-variant-numeric: tabular-nums; }
.l-part { width: 1%; padding-right: 0 !important; color: var(--ink-soft); font-size: 0.944rem; white-space: nowrap; text-align: right !important; }
.ltable thead th:last-child { text-align: right; padding-right: 0; }
.ltable .sys .l-what { color: var(--ink-soft); }
.gone { color: var(--ink-soft); font-size: 0.889rem; }
.more-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 32px; color: var(--ink-soft); font-size: 0.944rem; }
.more-end { margin-top: 32px; color: var(--ink-soft); font-size: 0.944rem; }

/* ================= Hjälpen (steg 8): en panel till höger ================= */
.help-open .main { padding-right: calc(400px + var(--main-x)); }
.hpanel {
    position: fixed; z-index: 35; top: var(--top); right: 0; bottom: 0; width: 400px; display: flex; flex-direction: column;
    background: var(--bg); box-shadow: -1px 0 0 var(--line-strong), -16px 0 40px -24px rgba(17, 18, 19, .25);
}
.hp-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 24px; border-bottom: 1px solid var(--line); }
.hp-top h2 { font-size: 1.222rem; }
.hp-x { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; color: var(--ink); }
.hp-x:hover { background: var(--action-soft); }
.hp-x svg { width: 20px; height: 20px; }
.hp-body { flex: 1; overflow-y: auto; padding: 20px 24px 32px; overscroll-behavior: contain; }
.panel-sub { color: var(--ink-soft); font-size: 0.889rem; margin-bottom: 8px; }
.hp-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; font-size: 0.944rem; }
.all-list { display: grid; gap: 24px; }
.all-list h3 { font-size: 1rem; font-weight: var(--medium); color: var(--ink); margin: 0 0 4px; }
.acc { border-top: 1px solid var(--line-strong); }
.acc-i { border-bottom: 1px solid var(--line); }
.acc-i summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 8px 0;
    color: var(--ink); cursor: pointer; list-style: none;
}
.acc-i summary::-webkit-details-marker { display: none; }
.acc-i summary:hover span { text-decoration: underline; text-underline-offset: 0.2em; }
.acc-c { width: 18px; height: 18px; flex: none; color: var(--ink-soft); transform-box: fill-box; transform-origin: center; transition: transform 150ms ease-out; }
.acc-i[open] .acc-c { transform: rotate(180deg); }
.acc-i[open] summary { font-weight: var(--medium); }
.acc-b { padding: 4px 0 20px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; font-size: 0.944rem; }
.steps li { position: relative; counter-increment: s; padding-left: 38px; min-height: 26px; }
.steps li::before {
    content: counter(s); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; display: grid; place-items: center;
    border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); font-size: 0.778rem; font-variant-numeric: tabular-nums;
}
.steps b { font-weight: var(--medium); }
.tip { margin-top: 16px; padding: 12px 16px; border-radius: 8px; background: var(--surface); font-size: 0.944rem; }
.ask { margin-top: 28px; padding: 18px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 0.944rem; }
.ask h2 { font-size: 1.056rem; margin-bottom: 10px; }
.ask-grid { display: grid; gap: 12px; }
.ask-grid p { color: var(--ink-soft); }
.ask-n { color: var(--ink) !important; font-weight: var(--medium); }

/* Utskriften av hjälpen */
.print-page { background: var(--surface); }
.paper-tools { max-width: 720px; margin: 24px auto 16px; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.paper { max-width: 720px; margin: 0 auto 48px; padding: 56px 64px; background: var(--bg); box-shadow: 0 0 0 1px var(--line-strong); }
.paper-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 40px; padding-bottom: 16px; border-bottom: 1px solid var(--line-strong); font-size: 0.833rem; color: var(--ink-soft); text-align: right; }
.paper-top img { height: 24px; width: auto; }
.paper h1 { margin-bottom: 24px; }
.paper .acc-c { display: none; }
@media print {
    .print-page { background: none; }
    .paper-tools { display: none; }
    .paper { margin: 0; padding: 0; box-shadow: none; max-width: none; }
}

@media (max-width: 1100px) {
    :root { --main-x: 32px; }
    .hpanel { width: 360px; }
    .help-open .main { padding-right: calc(360px + var(--main-x)); }
}

@media (max-width: 860px) {
    :root { --gutter: 16px; --top: 60px; --edge: 16px; --item-x: 8px; --main-x: 16px; --top-gap: 20px; }
    html { font-size: 106.25%; }
    .page { padding-top: 24px; padding-bottom: 64px; }
    .split { grid-template-columns: 1fr; gap: 24px; }
    .field { padding: 24px; gap: 16px; }
    .field h1 { font-size: 1.556rem; }
    .row { grid-template-columns: minmax(0, 1fr) auto; }
    .row .key { grid-column: 1 / -1; margin-bottom: -6px; }
    .section { margin-top: 48px; }

    /* Toppraden: bara Styrt, Hjälp, avataren och Meny. Föreningen står överst i menyn */
    .mark img { height: 26px; }
    .org, .divider, .settings-ib, .me .chev { display: none; }
    .me { padding: 0 4px; }
    .menu-btn { display: inline-flex; }
    .menu { position: fixed; left: var(--edge); right: var(--edge); top: calc(var(--top) + 8px); width: auto; }

    /* Menyn täcker hela skärmen under toppraden, och sidan bakom rullar inte */
    .shell { grid-template-columns: minmax(0, 1fr); }
    .side {
        position: fixed; z-index: 30; inset: var(--top) 0 0 0; height: auto; display: none;
        padding: 8px calc(var(--edge) - var(--item-x)) 24px; background: var(--bg); overscroll-behavior: contain;
    }
    body.menu-open { overflow: hidden; }
    body.menu-open .side { display: flex; }
    .menu-org { display: block; padding: 12px var(--item-x) 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink); }
    .side ul a { min-height: 52px; font-size: 1rem; }
    .side .only-small { display: grid; }

    .ph { margin-bottom: 32px; }
    /* Brödsmulorna blir en länk till föräldern */
    .crumbs li { display: none; }
    .crumbs li:nth-last-child(2) { display: inline-flex; }
    .crumbs li:nth-last-child(2) .crumb-sep { display: none; }
    .crumb-up { display: block; }

    /* Del 3, steg 4–9 i mobilen */
    .snack, .framed .snack { left: 16px; right: 16px; width: auto; padding: 14px 8px 14px 16px; bottom: 16px; }
    .dialog { margin: auto 0 0; width: 100%; max-height: none; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; }
    .dialog .q-actions { flex-direction: column-reverse; }
    .q-actions .btn { flex: 1 1 100%; }
    .blank { padding: 24px 20px; }
    .help-open .main { padding-right: var(--main-x); }
    .hpanel { left: 0; width: auto; z-index: 45; }
    .hp-top { padding-left: 16px; }
    .hp-body { padding: 16px 16px 40px; }
    .paper { padding: 32px 20px; }
    .solo { text-align: left; padding-top: 32px; }
    .solo img { margin: 0 0 40px; }
    .dtable thead, .ltable thead { display: none; }
    .dtable, .dtable tbody, .dtable tr, .dtable th, .dtable td, .ltable, .ltable tbody, .ltable tr, .ltable td, .ltable th { display: block; width: auto; }
    .dtable tbody tr:not(.g) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--line); }
    .dtable tbody tr:not(.g) > * { padding: 0; border: 0; width: auto; }
    .dtable .d-when, .dtable .d-who { display: inline; color: var(--ink-soft); font-size: 0.889rem; }
    .dtable .d-who::before { content: " av "; }
    .dtable td.d-until { font-size: 0.889rem; color: var(--ink-soft); }
    .dtable td.d-until::before { content: "Finns kvar till "; }
    .dtable .d-soon { display: inline; }
    .dtable .d-soon::before { content: ", "; color: var(--ink-soft); }
    .dtable td.c-act { text-align: left; margin-top: 8px; }
    .dtable tr.g th, .ltable tr.g th { padding-top: 24px; }
    .ltable tbody tr:not(.g) { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
    .ltable tbody tr:not(.g) td { padding: 0; border: 0; }
    .ltable .l-what { grid-column: 1 / -1; grid-row: 2; }
    .ltable .l-part { text-align: left !important; }
    .ltable .l-part::before { content: "· "; }
}

@media (prefers-reduced-motion: no-preference) {
    .btn, .show, .choose a { transition: background-color 150ms ease-out; }
    body.menu-open .side { animation: menu-in 160ms ease-out; }
}

@media (prefers-reduced-motion: reduce) {
    [data-tip]::after, .me .chev { transition: none; }
}

@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.spaced { margin-top: 32px; }
.spaced-below { margin-bottom: 32px; }

/* ================= Personer och uppdrag (del 4) ================= */
.muted { color: var(--ink-soft); }
.pav {
    width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 999px;
    background: var(--action-soft); color: var(--ink); font-size: 0.778rem; font-weight: var(--medium); letter-spacing: 0.02em;
}
.pav-xl { width: 64px; height: 64px; font-size: 1.111rem; }
.pav-none { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-soft); }
.is-wait .pav { background: var(--bg); border: 1px dashed var(--field-edge); color: var(--ink-soft); }
.pname { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--ink); line-height: 1.35; }
.pname a { color: var(--ink); text-decoration: none; font-weight: var(--medium); }
.pname a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.psub { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 0.889rem; line-height: 1.45; overflow-wrap: anywhere; }
.psub a, .f-contact a { color: var(--ink-soft); text-decoration-color: var(--line-strong); }
.psub a:hover, .f-contact a:hover { color: var(--ink); text-decoration-color: currentColor; }
.ptag {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
    background: var(--action-soft); color: var(--ink); font-size: 0.778rem; font-weight: 400; white-space: nowrap;
}
.ptag-wait { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-soft); }

/* Personer: tabellen, som papperskorgen */
.ptable { width: 100%; border-collapse: collapse; }
.ptable thead th { padding: 0 16px 10px 0; color: var(--ink-soft); font-size: 0.833rem; font-weight: 400; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line-strong); }
.ptable tbody th, .ptable td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-weight: 400; color: var(--ink-body); }
.ptable tbody th { width: 38%; }
.ptable td.tlevel { white-space: nowrap; }
.ptable tbody td:last-child { padding-right: 0; }
.ptable .pcell { display: flex; align-items: center; gap: 14px; }
/* Hela raden leder till personen. Länken är namnet, och den sträcks över raden */
.ptable tr.prow { position: relative; }
.ptable tr.prow:hover { background: var(--surface); }
.ptable tr.prow:has(.prow-link:focus-visible) { box-shadow: inset 0 0 0 2px var(--ink); }
.prow-link::after { content: ""; position: absolute; inset: 0; }
.prow-link:focus-visible { outline: none; box-shadow: none; }
.ptable tr.prow:hover .prow-link { text-decoration: underline; text-underline-offset: 0.2em; }
.pwait { position: relative; z-index: 1; }
.ptable .pmain { min-width: 0; }
.ptable .tnum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptable .tnum a { color: var(--ink-body); text-decoration: none; }
.ptable .tnum a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.ptable tr.g th { width: auto; padding: 40px 0 10px; border-bottom: 1px solid var(--line-strong); color: var(--ink); font-size: 1.222rem; line-height: 1.3; }
.ptable .g-note { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 0.889rem; }
.ptable tr.vac td { padding: 14px 0; color: var(--ink-soft); font-size: 0.944rem; }
.pwait { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 0.889rem; }
.pwait form { display: inline; margin: 0; }
.pwait .linkish { font-size: inherit; }

.former { margin-top: 40px; border-top: 1px solid var(--line-strong); }
.former summary { display: flex; align-items: center; gap: 10px; min-height: 56px; cursor: pointer; list-style: none; color: var(--ink); }
.former summary::-webkit-details-marker { display: none; }
.former summary > span:first-child { font-size: 1.056rem; }
.former summary:hover > span:first-child { text-decoration: underline; text-underline-offset: 0.2em; }
.former .count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--action-soft); font-size: 0.778rem; }
.former .acc-c { width: 20px; height: 20px; margin-left: auto; }
.former[open] .acc-c { transform: rotate(180deg); }
.former-list { margin: 0 0 8px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.former-list li {
    display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 200px) minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline;
    padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.944rem;
}
.f-name a { color: var(--ink); }
.f-role, .f-contact { color: var(--ink-soft); }
.f-act { white-space: nowrap; }
.f-act form { margin: 0; }

/* En person: två spalter */
.who-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; align-items: center; }
.who-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.ph .who-head .lead { margin-top: 4px; }
.pcols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.psec h2 { margin-bottom: 8px; }
.timeline { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.timeline li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); }
.tl-dot { width: 10px; height: 10px; margin-top: 7px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 2px var(--line-strong); align-self: start; }
.tl-now .tl-dot { background: var(--good); box-shadow: 0 0 0 3px var(--good-tint); }
.tl-role { color: var(--ink); }
.tl-now .tl-role { font-weight: var(--medium); }
.tl-when { color: var(--ink-soft); font-size: 0.889rem; }
.timeline .edit, .padd { font-size: 0.944rem; }
.timeline-empty { padding: 16px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.padd { margin-top: 16px; }
.pcard { position: sticky; top: calc(var(--top) + 24px); padding: 24px; border-radius: 10px; background: var(--surface); }
.pcard dl { margin: 0; display: grid; gap: 16px; }
.pcard dt { color: var(--ink-soft); font-size: 0.833rem; }
.pcard dd { margin: 2px 0 0; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.pcard dd a { color: var(--ink); }
.pcard small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 0.889rem; white-space: normal; }
.pcard .btn { margin-top: 24px; width: 100%; }
.pdanger { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.944rem; }
.pdanger .danger { font-size: inherit; }
.notice-soft { max-width: 880px; margin-bottom: 32px; padding: 18px 20px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.notice-soft b { font-weight: var(--medium); }
.n-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; font-size: 0.944rem; }
.n-links form { margin: 0; }
.n-links .linkish { font-size: inherit; }

/* Formulär i del 4: listor, textrutor och nivåerna som rutor */
.sel-in {
    width: 100%; height: 48px; padding: 0 44px 0 16px; border: 1px solid var(--field-edge); border-radius: var(--radius); background: var(--bg)
    url("/images/chevron-down.svg") no-repeat right 14px center / 16px;
    appearance: none; font: inherit; color: var(--ink);
}
textarea.ta { width: 100%; min-height: 96px; padding: 12px 16px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--field-edge); border-radius: var(--radius); resize: vertical; }
.sel-in:focus, textarea.ta:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.invalid .sel-in, .invalid textarea.ta { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
fieldset.f { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.f legend { padding: 0; margin-bottom: 8px; font-size: 0.944rem; color: var(--ink); }
.levels { display: grid; gap: 8px; }
.lvl { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0; padding: 14px 16px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; }
.lvl:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink); }
.lvl input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--action); }
.lvl b { display: block; color: var(--ink); font-weight: var(--medium); }
.lvl small { display: block; color: var(--ink-soft); font-size: 0.889rem; }
.lvl.is-off { cursor: not-allowed; opacity: .6; }
.lvl-line { color: var(--ink-soft); font-size: 0.944rem; }
.lvl-line b { color: var(--ink); font-weight: var(--medium); }
.lvl-line .linkish { font-size: inherit; margin-left: 4px; }
.picks { display: grid; gap: 8px; max-width: 560px; }

/* Bjud in: rutan över Personer */
.idialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; }
.idialog form { display: grid; gap: 20px; margin-top: 24px; }
.idialog .q-actions { margin-top: 4px; }
.idialog [hidden] { display: none; }

/* Ändra uppdragen */
.rolelist { max-width: 880px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.rolelist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rolelist .r-name { color: var(--ink); }
.rolelist .r-count { display: block; color: var(--ink-soft); font-size: 0.889rem; }
.rolelist .r-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 16px; font-size: 0.944rem; }
.rolelist .r-act form { margin: 0; }
.rolelist .r-act .linkish { font-size: inherit; }
.rolelist .r-act .linkish[disabled] { color: var(--line-strong); text-decoration: none; cursor: default; }
.rolelist details summary { cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; list-style: none; }
.rolelist details summary::-webkit-details-marker { display: none; }
.rename { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 8px 0 4px; }
.rename .f { flex: 1 1 240px; max-width: 400px; }
.addrole { max-width: 880px; display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 32px; }
.addrole .f { flex: 1 1 240px; max-width: 400px; }

/* Mina uppgifter: kontots meny (del 4, steg 4) */
.mu-back {
    display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: center;
    min-height: 40px; margin-bottom: 20px; padding: 0 var(--item-x); border-radius: 8px;
    color: var(--ink-soft); text-decoration: none; line-height: 1.3;
}
.mu-back svg { width: 18px; height: 18px; }
.mu-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-back:hover { background: var(--surface); color: var(--ink); }
.mu-navhead { margin: 0 0 6px; padding: 0 var(--item-x); color: var(--ink-soft); font-size: 0.833rem; }
.mu-col { max-width: 880px; }
.mu-col .rows { margin-top: 0; }
.mu-note { margin-top: 16px; color: var(--ink-soft); font-size: 0.889rem; max-width: 64ch; }
.mu-note a { color: var(--ink-soft); }
.mu-note a:hover { color: var(--ink); }
.row .edit, .row .linkish { justify-self: end; }
.row .value small a { color: var(--ink-soft); margin-right: 12px; }
.row-edit { align-items: start; padding: 16px 0; }
.row-edit .key { padding-top: 12px; color: var(--ink); }
.row-edit .value input { max-width: 400px; }
.row-edit .value small { margin-top: 8px; }
.row-edit .error-text { margin-top: 8px; }
.row-actions { display: flex; align-items: center; gap: 20px; height: 48px; font-size: 0.944rem; }
.btn-sm { min-height: 40px; padding: 0 20px; }

@media (max-width: 1100px) {
    .ptable td.tlevel { white-space: normal; }
    .pcols { grid-template-columns: minmax(0, 1fr); }
    .pcard { position: static; order: -1; }
    .former-list li { grid-template-columns: minmax(0, 1fr) auto; }
    .f-role, .f-contact { grid-column: 1; }
    .f-act { grid-column: 2; grid-row: 1; }
}

@media (max-width: 860px) {
    .ptable thead { display: none; }
    .ptable, .ptable tbody, .ptable tr, .ptable th, .ptable td { display: block; width: auto; }
    .ptable tbody tr { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
    .ptable tbody tr > * { padding: 0 !important; border: 0 !important; }
    .ptable tbody th { grid-column: 1 / -1; width: auto; }
    .ptable tbody tr.g { display: block; padding: 32px 0 10px; border-bottom: 1px solid var(--line-strong); }
    .ptable tbody tr.vac { display: block; }
    .ptable td { grid-column: 2; font-size: 0.889rem; color: var(--ink-soft); }
    .ptable td:empty { display: none; }
    .ptable td:has(> .dash:only-child) { display: none; }
    .who-head { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: start; }
    .pav-xl { width: 48px; height: 48px; font-size: 0.944rem; }
    .idialog { width: 100%; max-height: calc(100vh - 24px); }
    .idialog .q-actions .btn { flex: none; width: 100%; }
    .rolelist li { grid-template-columns: minmax(0, 1fr); }
    .rolelist .r-act { justify-content: flex-start; }
    .row-edit .key { padding-top: 0; }
    .row-edit .value, .row-actions { grid-column: 1 / -1; }
    .row-actions { height: auto; }
    .mu-back { margin-bottom: 12px; }
    .row .edit, .row .linkish { align-self: start; line-height: 1.6; }
}
.ro { margin: 0; padding: 4px 0; color: var(--ink); overflow-wrap: anywhere; }
.actions form { margin: 0; }
.spaced-sm { margin-top: 16px; }
.notice-soft p + p { margin-top: 8px; }
