/* stenkista.css – Infiltration av dagvatten. Allt ligger under .stk-sida, och färgerna i egna variabler, så att inget påverkar sajtens header.
   Sidan bryter medvetet mot mall.php (se CLAUDE.md): den är en arbetsyta med tre spalter, som Fördröjningsmagasin, med 3D-bilden i mitten.
   --stk-hojd sätts av skriptet (matHojd()), så att arbetsytan fyller fönstret. */

.stk-sida {
    --stk-primar: #2563eb;
    --stk-primar-hover: #1d4ed8;
    --stk-mork: #1e293b;
    --stk-morkast: #0f172a;
    --stk-kort: #ffffff;
    --stk-text: #333333;
    --stk-dampad: #64748b;
    --stk-kant: #e2e8f0;
    color: var(--stk-text);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.4;
}
.stk-sida [hidden] { display: none !important; }
.stk-sida *, .stk-sida *::before, .stk-sida *::after { box-sizing: border-box; }

/* Raden överst */
.stk-topp {
    background: linear-gradient(135deg, var(--stk-morkast), var(--stk-primar));
    color: #fff; padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
}
.stk-topp h1 { font-size: 1.05rem; font-weight: 700; margin: 0; white-space: nowrap; }
.stk-topp h1 span { font-weight: 400; font-size: 0.8rem; opacity: 0.85; margin-left: 6px; }
.stk-namnruta { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; }
.stk-status {
    flex: 0 1 auto; min-width: 0; font-size: 0.76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; line-height: 1.3;
    background: rgba(255,255,255,0.14); color: #fff; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 8px;
}
.stk-status.sparat { background: #ecfdf5; color: #065f46; }
.stk-status.sparar { background: #eff6ff; color: #1e40af; }
.stk-status.osparat { background: #fffbeb; color: #92400e; }
.stk-status.fel { background: #fef2f2; color: #991b1b; }
.stk-status a { color: inherit; }
.stk-knappar { display: flex; flex-wrap: wrap; gap: 5px; }
.stk-tk {
    border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.12); color: #fff; padding: 5px 9px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.stk-tk:hover { background: rgba(255,255,255,0.24); }
.stk-tk:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.stk-tk-primar { background: #fff; border-color: #fff; color: var(--stk-primar-hover); }
.stk-tk-primar:hover { background: #dbeafe; }
.stk-meddelande { margin: 8px 12px 0; padding: 8px 12px; border-radius: 8px; font-size: 0.86rem; background: #ecfdf5; color: #065f46; }
.stk-meddelande.varning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.stk-meddelande a { color: inherit; font-weight: 600; }

/* Arbetsytan */
.stk-yta {
    display: grid; grid-template-columns: 350px minmax(0, 1fr) 320px; gap: 10px;
    height: var(--stk-hojd, 640px); padding: 10px 12px 0;
}
.stk-spalt, .stk-mitt { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.stk-spalt { background: var(--stk-kort); border: 1px solid var(--stk-kant); border-radius: 8px; }
.stk-mitt { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-bottom: 34px; }
.stk-remsa { display: none; }

/* Vänsterspalten */
.stk-del { border-bottom: 1px solid var(--stk-kant); }
.stk-del:last-child { border-bottom: none; }
.stk-del summary { position: sticky; top: 0; z-index: 3; background: #f8fafc; padding: 8px 12px; font-weight: 700; font-size: 0.86rem; color: var(--stk-mork); cursor: pointer; }
.stk-del[open] summary { border-bottom: 1px solid var(--stk-kant); }
.stk-del-inne { padding: 10px 12px; }
.stk-sum-text { font-weight: 500; font-size: 0.74rem; color: var(--stk-dampad); margin-left: 4px; overflow-wrap: anywhere; }
.stk-rad { display: grid; grid-template-columns: minmax(0, 1fr) 20px 96px; gap: 3px 6px; align-items: center; margin-bottom: 8px; }
.stk-rad:last-child { margin-bottom: 0; }
.stk-rad label { font-size: 0.82rem; font-weight: 600; margin: 0; line-height: 1.25; }
.stk-rad .stk-hint { grid-column: 1 / -1; margin: 2px 0 0; }
.stk-rad-bred { grid-template-columns: minmax(0, 1fr) 20px; }
.stk-rad-bred select { grid-column: 1 / -1; }
.stk-sida input[type="number"], .stk-sida input[type="text"], .stk-sida input[type="search"], .stk-sida input[type="date"], .stk-sida select, .stk-sida textarea {
    padding: 5px 6px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 0.85rem; font-family: inherit; background: #fff; color: var(--stk-text); min-width: 0; width: 100%;
}
.stk-sida textarea { resize: vertical; }
.stk-sida .stk-namnruta input[type="text"] {
    flex: 1 1 auto; width: auto; min-width: 120px; max-width: 360px; padding: 5px 9px; border: 1px solid rgba(255,255,255,0.35); border-radius: 6px;
    background: rgba(255,255,255,0.12); color: #fff; font-size: 0.9rem;
}
.stk-sida .stk-namnruta input[type="text"]::placeholder { color: rgba(255,255,255,0.7); }
.stk-sida .stk-namnruta input[type="text"].fel { border-color: #fca5a5; }
.stk-sida input:disabled, .stk-sida select:disabled { background: #f1f5f9; color: #94a3b8; }
.stk-sida input.stk-last { background: #f1f5f9; color: #94a3b8; cursor: pointer; }
.stk-i {
    width: 18px; height: 18px; border-radius: 50%; border: 1px solid #94a3b8; background: #fff; color: var(--stk-dampad); font-size: 0.7rem; font-weight: 700;
    font-style: italic; line-height: 1; padding: 0; cursor: pointer;
}
.stk-i:hover, .stk-i[aria-expanded="true"] { background: var(--stk-primar); border-color: var(--stk-primar); color: #fff; }
.stk-hint {
    font-size: 0.78rem; color: var(--stk-dampad); line-height: 1.4; background: #f8fafc; padding: 6px 9px; border-radius: 4px;
    border-left: 3px solid #cbd5e1; margin: 0 0 8px;
}
.stk-kryss { display: flex; align-items: center; gap: 7px; font-size: 0.84rem; font-weight: 600; margin: 4px 0 8px; cursor: pointer; }
.stk-kryss input { margin: 0; }
.stk-premium-falt { border-top: 1px dashed var(--stk-kant); padding-top: 8px; margin-top: 4px; }
.stk-last-del { opacity: 0.75; }
.stk-liten { font-size: 0.74rem; color: var(--stk-dampad); line-height: 1.4; margin: 5px 0 0; }
.stk-liten.stk-fel, .stk-fel { color: #b91c1c; }

/* Projektinformation */
.stk-projekt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 8px; }
.stk-projekt label { display: block; font-size: 0.74rem; font-weight: 600; color: var(--stk-dampad); margin: 0; }
.stk-projekt input, .stk-projekt textarea { margin-top: 1px; }
.stk-projekt-bred { grid-column: 1 / -1; }

/* Ytorna och stenkistan */
.stk-kort { background: #f8fafc; border: 1px solid var(--stk-kant); border-radius: 6px; padding: 6px; margin-bottom: 6px; }
.stk-kort-las { opacity: 0.6; }
.stk-kort-rad { display: grid; grid-template-columns: auto minmax(0, 1fr) 24px; gap: 5px; align-items: center; margin-bottom: 6px; }
.stk-kort-typ { font-size: 0.7rem; font-weight: 700; color: var(--stk-primar); text-transform: uppercase; letter-spacing: 0.03em; }
.stk-kort-rad2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.stk-kort-rad2 label, .stk-kista-grid label, .stk-leds { display: block; font-size: 0.7rem; font-weight: 600; color: var(--stk-dampad); margin: 0; }
.stk-kort-rad3 { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.stk-ange-yta { font-size: 0.74rem; font-weight: 500; margin: 6px 0 0; }
.stk-yt-knapp { font-size: 0.74rem; color: var(--stk-primar); white-space: nowrap; }
/* Räkna ut ytan: en rad per rektangel, längd × bredd = yta. */
.stk-ytrader { margin: 10px 0 4px; }
.stk-ytrad { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 92px 24px; gap: 6px; align-items: end; margin-bottom: 8px; }
.stk-ytrad label { display: block; font-size: 0.74rem; font-weight: 600; color: var(--stk-dampad); margin: 0; }
.stk-ytrad-x { padding-bottom: 7px; font-weight: 600; color: var(--stk-dampad); }
.stk-ytrad-yta { padding-bottom: 7px; font-size: 0.86rem; font-weight: 600; color: var(--stk-mork); white-space: nowrap; }
.stk-ytrad .stk-ta-bort { margin-bottom: 4px; }
.stk-ytrad-ny { font-size: 0.85rem; color: var(--stk-primar); margin: 2px 0 10px; }
.stk-dlg-inre p.stk-ytsumma { margin: 6px 0 0; padding: 8px 10px; border-left: 3px solid var(--stk-primar); background: #eff6ff; border-radius: 4px; }
.stk-ytsumma strong { font-size: 1.15rem; color: var(--stk-mork); }
.stk-leds select { width: auto; }
.stk-ta-bort { background: #fff; color: #b91c1c; border: 1px solid #fca5a5; border-radius: 4px; cursor: pointer; font-weight: 700; width: 24px; height: 26px; padding: 0; line-height: 1; font-size: 0.72rem; }
.stk-ta-bort:hover { background: #fef2f2; }
.stk-lagg-rad { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stk-lagg-till { width: 100%; background: #f1f5f9; color: var(--stk-mork); border: 1px dashed #94a3b8; border-radius: 6px; padding: 6px; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.stk-lagg-till:hover { background: #e2e8f0; }
.stk-lagg-till:disabled { opacity: 0.5; cursor: not-allowed; }
.stk-kistflikar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.stk-kistflik { border: 1px solid #cbd5e1; background: #f1f5f9; color: #475569; border-radius: 6px; padding: 4px 9px; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.stk-kistflik.aktiv { background: var(--stk-primar); border-color: var(--stk-primar); color: #fff; }
.stk-kistflik-ny { border-style: dashed; background: #fff; }
#stk-kista > label { display: block; font-size: 0.74rem; font-weight: 600; color: var(--stk-dampad); margin: 4px 0 8px; }
#stk-kista > .stk-kort-rad { grid-template-columns: minmax(0, 1fr) 24px; }
.stk-kista-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 8px; margin-bottom: 8px; }

/* Mitten: 3D-bilden */
.stk-vy { background: var(--stk-kort); border: 1px solid var(--stk-kant); border-top: 4px solid var(--stk-primar); border-radius: 8px; padding: 6px; flex: 0 0 auto; }
.stk-3d { position: relative; height: calc(var(--stk-hojd, 640px) - 70px); min-height: 420px; overflow: hidden; border-radius: 6px; background: #dde8f1; }
.stk-3d canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stk-3d-laddar { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--stk-dampad); font-size: 0.9rem; }
.stk-etiketter { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stk-etikett { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px; line-height: 1.3; color: #17212b;
    background: rgba(255,255,255,.93); border: 1px solid #c3ccd5; border-radius: 4px; padding: 2px 6px; }
.stk-etikett.stk-namn { font-weight: 600; }
.stk-etikett.stk-matt { background: rgba(255,255,255,.8); border: none; padding: 0 3px; font-weight: 600; }
.stk-etikett.stk-not { font-size: 11px; color: #3b4651; background: rgba(255,255,255,.82); }
.stk-3d-status { position: absolute; top: 8px; left: 8px; max-width: min(520px, 62%); background: rgba(255,255,255,.94); border: 1px solid var(--stk-kant);
    border-radius: 6px; padding: 5px 9px; font-size: 0.8rem; color: var(--stk-mork); }
.stk-3d-vyval { position: absolute; top: 8px; right: 8px; display: flex; border: 1px solid var(--stk-kant); border-radius: 6px; overflow: hidden; background: #fff; }
.stk-3d-vyval button { border: 0; background: #fff; padding: 5px 9px; font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; color: var(--stk-mork); }
.stk-3d-vyval button + button { border-left: 1px solid var(--stk-kant); }
.stk-3d-vyval button[aria-pressed=true] { background: var(--stk-primar); color: #fff; }
.stk-3d-rubrik { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); font-size: 0.76rem; font-weight: 700; color: #475569;
    background: rgba(255,255,255,.85); padding: 1px 8px; border-radius: 10px; pointer-events: none; }
.stk-delare { position: absolute; left: 0; right: 0; top: 50%; border-top: 3px solid #fff; pointer-events: none; }
.stk-3d-verktyg { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.stk-3d-knapp { border: 1px solid var(--stk-primar); background: var(--stk-primar); color: #fff; border-radius: 6px; padding: 6px 11px; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.stk-3d-knapp.stk-3d-sek { background: #fff; color: var(--stk-primar); }
.stk-3d-tips { position: absolute; right: 8px; bottom: 8px; font-size: 0.7rem; color: var(--stk-dampad); background: rgba(255,255,255,.85); padding: 3px 7px; border-radius: 5px; }
.stk-3d-fel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; background: #f8fafc; color: var(--stk-mork); font-size: 0.9rem; }
.stk-visa { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 4px 0; }
.stk-visa .stk-kryss { margin: 0; font-weight: 500; font-size: 0.8rem; }

/* Tabellerna */
.stk-tabellruta { background: var(--stk-kort); border: 1px solid var(--stk-kant); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.stk-tabellruta h3 { font-size: 0.85rem; font-weight: 700; color: var(--stk-mork); margin: 0 0 4px; }
.stk-premium-marke { font-size: 0.66rem; font-weight: 700; color: #7c3aed; background: #f3e8ff; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.stk-tabell-rull { overflow-x: auto; }
.stk-tabell { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.stk-tabell th, .stk-tabell td { padding: 5px 6px; text-align: left; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.stk-tabell th { background: #f8f9fa; font-weight: 600; font-size: 0.74rem; line-height: 1.2; }
.stk-tabell tr.stk-aktiv { background: #d4edda; font-weight: 600; }
.stk-tabell .stk-pris { width: 110px; }
.stk-las-text { margin: 4px 0; font-size: 0.84rem; color: #475569; }
.stk-las-text a { font-weight: 600; }

/* Högerspalten */
.stk-resultat { padding: 10px 12px 34px; }
.stk-resultat h2 { font-size: 1rem; font-weight: 700; color: var(--stk-mork); margin: 0; }
.stk-resultat h3 { font-size: 0.82rem; font-weight: 700; color: var(--stk-mork); margin: 12px 0 4px; }
.stk-res-under { margin: 0 0 8px; }
.stk-varning {
    background: #fffbeb; border: 1px solid #fde68a; border-left: 4px solid #d97706; padding: 8px 10px; border-radius: 6px; margin-bottom: 8px;
    font-size: 0.78rem; color: #92400e; line-height: 1.4;
}
.stk-varning strong { color: #b45309; display: block; margin-bottom: 2px; font-size: 0.82rem; }
.stk-varning a { color: inherit; font-weight: 600; }
.stk-varning-info { background: #eff6ff; border-color: #bfdbfe; border-left-color: var(--stk-primar); color: #1e40af; }
.stk-varning-info strong { color: #1e40af; }
.stk-lank-knapp { font-size: inherit; font-weight: 600; color: inherit; cursor: pointer; text-decoration: underline; background: none; border: none; padding: 0; }
.stk-summa { background: #d4edda; border: 1px solid #c3e6cb; border-top: 4px solid #28a745; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.stk-summa span { display: block; font-size: 0.8rem; color: #334155; }
.stk-summa strong { font-size: 1.6rem; font-weight: 800; color: var(--stk-morkast); }
.stk-summa b { font-weight: inherit; }
.stk-summa .stk-summa-under { font-size: 0.74rem; color: #475569; margin-top: 2px; }
.stk-tal-rutnat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.stk-tal { background: #f1f5f9; border-radius: 6px; padding: 4px 8px; min-width: 0; font-variant-numeric: tabular-nums; }
.stk-tal span { display: block; font-size: 0.7rem; color: var(--stk-dampad); line-height: 1.25; }
.stk-tal strong { font-size: 0.9rem; color: var(--stk-mork); overflow-wrap: anywhere; }
.stk-tal strong.stk-las { color: #94a3b8; font-weight: 600; }
.stk-bor { font-size: 0.82rem; color: var(--stk-mork); background: #f8fafc; border-left: 3px solid var(--stk-primar); padding: 6px 9px; border-radius: 4px; margin: 8px 0 0; }
.stk-rad-lista { margin: 0; padding-left: 18px; font-size: 0.78rem; color: #475569; line-height: 1.4; }
.stk-rad-lista li { margin-bottom: 3px; }
.stk-over .stk-summa { opacity: 0.5; }

/* Texterna under arbetsytan */
.stk-om { max-width: 1000px; margin: 0 auto; padding: 16px 12px 0; }
.stk-info { background: #f8fafc; border: 1px solid #cbd5e1; border-left: 4px solid var(--stk-primar); padding: 14px; border-radius: 6px; font-size: 0.85rem; color: #475569; line-height: 1.5; }
.stk-info > strong:first-child { color: var(--stk-mork); font-size: 0.9rem; }
.stk-info p { margin: 6px 0; }
.stk-info ol { margin: 8px 0 0; padding-left: 20px; }
.stk-info sub { font-size: 0.75em; }
.stk-kallor { margin-top: 14px; padding: 12px 14px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.82rem; color: #475569; line-height: 1.5; }
.stk-kallor ul { margin: 4px 0 0 18px; padding: 0; }

.stk-utskrift, .stk-utskrift-las { display: none; }

/* Dialogerna och Mina beräkningar */
.stk-knapp {
    display: inline-block; border: 1px solid #cbd5e1; background: #f1f5f9; color: var(--stk-mork); padding: 6px 11px; border-radius: 6px; font-size: 0.84rem;
    font-weight: 600; line-height: 1.3; cursor: pointer; text-decoration: none; text-align: center;
}
.stk-knapp:hover { background: #e2e8f0; color: var(--stk-mork); text-decoration: none; }
.stk-knapp-primar { background: var(--stk-primar); border-color: var(--stk-primar); color: #fff; }
.stk-knapp-primar:hover { background: var(--stk-primar-hover); color: #fff; }
.stk-knapp-fara { background: #fff; border-color: #fca5a5; color: #b91c1c; }
.stk-knapp-fara:hover { background: #fef2f2; color: #991b1b; }
.stk-dlg { border: none; border-radius: 12px; padding: 0; color: var(--stk-text); width: min(640px, calc(100% - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.stk-dlg::backdrop { background: rgba(15, 23, 42, 0.55); }
.stk-dlg-inre { padding: 20px; }
.stk-dlg-inre h2 { margin: 0 0 10px; font-size: 1.2rem; color: var(--stk-mork); }
.stk-dlg-inre p { margin: 8px 0; font-size: 0.9rem; line-height: 1.45; }
.stk-dlg-inre p.stk-liten { font-size: 0.8rem; }
.stk-dlg-etikett { display: block; font-weight: 600; font-size: 0.88rem; margin: 10px 0 4px; }
.stk-dlg-falt { display: block; font-weight: 600; font-size: 0.86rem; margin: 10px 0; }
.stk-dlg-falt input { margin-top: 4px; max-width: 200px; }
.stk-dlg-knappar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.stk-dlg-hoger { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.stk-mina-rad { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--stk-kant); }
.stk-mina-inne { flex: 1; min-width: 0; }
.stk-mina-namn { font-weight: 700; color: var(--stk-mork); overflow-wrap: anywhere; }
.stk-mina-knappar { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }
.stk-mina-sok { margin: 8px 0; }

/* Laptop och surfplatta: indata till vänster, resultaten överst till höger och 3D-bilden under dem. */
@media screen and (max-width: 1250px) {
    .stk-yta {
        grid-template-columns: 340px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas: "indata resultat" "indata mitt";
    }
    .stk-indata { grid-area: indata; }
    .stk-mitt { grid-area: mitt; }
    .stk-resultat { grid-area: resultat; padding-bottom: 10px; max-height: 42vh; }
    .stk-tal-rutnat { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .stk-3d { height: calc(var(--stk-hojd, 640px) * 0.62); min-height: 380px; }
}

/* Mobil: en spalt. 3D-bilden kommer först, och storleken ligger kvar överst medan man ändrar. */
@media screen and (max-width: 900px) {
    .stk-yta { display: flex; flex-direction: column; height: auto; padding: 8px 8px 0; }
    .stk-mitt { order: 1; padding-bottom: 0; }
    .stk-resultat { order: 2; max-height: none; }
    .stk-indata { order: 3; }
    .stk-spalt, .stk-mitt { overflow: visible; }
    .stk-del summary { position: static; }
    .stk-3d { height: 62vh; min-height: 340px; }
    .stk-3d-tips { display: none; }
    .stk-3d-status { top: auto; bottom: 46px; max-width: calc(100% - 16px); font-size: 0.74rem; }
    .stk-topp h1 { white-space: normal; flex: 1 1 100%; }
    .stk-topp h1 span { display: block; margin: 0; }
    .stk-namnruta { flex: 1 1 100%; }
    .stk-tk { flex: 1 1 auto; }
    .stk-knappar { width: 100%; }
    .stk-mina-rad { flex-direction: column; align-items: stretch; }
    .stk-mina-knappar { justify-content: flex-start; }
    .stk-remsa { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; background: #d4edda; border-bottom: 1px solid #c3e6cb; padding: 5px 12px; font-size: 0.8rem; color: #334155; }
    .stk-remsa strong { font-size: 1.05rem; color: var(--stk-morkast); font-variant-numeric: tabular-nums; }
}
@media screen and (max-width: 900px) and (min-height: 600px) {
    .stk-remsa { position: sticky; top: 60px; z-index: 20; }
}

/* ---------- Utskrift ---------- */
@media print {
    @page { size: A4 portrait; margin: 10mm 12mm; }
    header, footer, nav, .stk-topp, .stk-meddelande, .stk-dlg, .stk-indata, .stk-remsa, .stk-info, .stk-vy, #stk-jamfor-ruta, #stk-mangd-ruta { display: none !important; }
    body { background: #fff !important; color: #000; font-size: 9pt; }
    .stk-yta { display: flex; flex-direction: column; height: auto; padding: 0; gap: 3mm; }
    .stk-spalt, .stk-mitt { height: auto; overflow: visible; border: none; }
    .stk-resultat { order: 1; padding: 0; }
    .stk-mitt { order: 2; padding: 0; gap: 3mm; }
    .stk-utskrift { display: block; margin-bottom: 3mm; }
    .stk-utskrift h2 { font-size: 13pt; margin: 0; border-bottom: 2px solid #000; padding-bottom: 1mm; }
    .stk-utskrift p { margin: 1mm 0 0; font-size: 9pt; }
    .stk-utskrift h3 { font-size: 9.5pt; margin: 3mm 0 1mm; }
    .stk-utskrift table { border-collapse: collapse; width: 100%; font-size: 8pt; }
    .stk-utskrift td, .stk-utskrift th { border: 1px solid #bbb; padding: 0.6mm 1.5mm; text-align: left; background: none; }
    .stk-ut-bild { display: block; width: 100%; margin-top: 3mm; border: 1px solid #bbb; break-inside: avoid; }
    .stk-ut-projekt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1mm 4mm; margin: 0; }
    .stk-ut-projekt dt { font-size: 7pt; color: #444; }
    .stk-ut-projekt dd { margin: 0; font-size: 8.5pt; white-space: pre-wrap; overflow-wrap: anywhere; }
    .stk-varning, .stk-summa, .stk-tabell tr.stk-aktiv { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .stk-summa { margin: 1mm 0; padding: 1.5mm 3mm; }
    .stk-summa strong { font-size: 14pt; }
    .stk-tal-rutnat { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1mm; }
    .stk-tal { padding: 1mm; background: none; border: 1px solid #ccc; }
    .stk-tal strong { font-size: 9.5pt; }
    .stk-tabellruta { break-inside: avoid; border: 1px solid #bbb; padding: 1mm; }
    .stk-tabell { font-size: 7.5pt; }
    .stk-om { max-width: 100%; padding: 0; margin-top: 3mm; }
    .stk-kallor { font-size: 7.5pt; border: none; border-top: 1px solid #000; border-radius: 0; margin-top: 2mm; padding: 1mm 0 0; color: #333; }
    .stk-gast .stk-yta, .stk-gast .stk-utskrift, .stk-gast .stk-om { display: none !important; }
    .stk-gast .stk-utskrift-las { display: block; font-size: 12pt; }
}
