/* MemPem */
:root {
  --fs: 1;
  --ink: #1A1A1A;
  --grey: #5E5E5E;
  --line: #BDBDBD;
  --bg: #F4F4F4;
  --dark: #2B2B2B;
  --btn: #4A4A4A;
  --red: #C8102E;
  --green: #2E8B3A;
  --kvall: #D3DBEC;
  --head: #333333;
  --headink: #FFFFFF;
}
* { box-sizing: border-box; }
html { font-size: calc(16px * var(--fs)); -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; background: var(--dark); }
body {
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
}
[hidden] { display: none !important; }
button { font-family: inherit; color: inherit; cursor: pointer; }
svg { display: block; }
.muted { color: #CFCFCF; }
.light .muted, .kort .muted { color: #555; }
.small { font-size: 0.95rem; }
.msg { min-height: 1.2em; margin: 6px 0 0; font-size: 1rem; }
.msg.err { color: #FF8A80; }
.light .msg.err, .kort .msg.err { color: #B00020; }
.msg.ok { color: #1B5E20; }

/* ---------- knappar ---------- */
.btn { border: 2px solid transparent; border-radius: 14px; padding: 0 18px; min-height: 52px; font-size: 1.15rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn.big { width: 100%; min-height: 66px; font-size: 1.5rem; }
.btn.green { background: var(--green); color: #fff; }
.btn.white { background: #fff; color: var(--ink); border-color: #fff; }
.btn.ghost { background: transparent; color: #fff; border-color: #8A8A8A; }
.btn.ghostdark { background: #fff; color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .5; }
.arr { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.arr.mork { stroke: var(--ink); }

/* ---------- inloggning ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: auto; }
.dark { background: var(--dark); color: #fff; }
.login-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-logo img { border-radius: 22px; }
.login-box h1 { margin: 0; font-size: 2.6rem; letter-spacing: 1px; }
.login-box p { margin: 0; font-size: 1.1rem; }
#loginForm { display: flex; flex-direction: column; gap: 12px; text-align: left; margin-top: 10px; }
#loginForm label { font-weight: 700; font-size: 1.1rem; }
#loginForm input { height: 60px; border-radius: 14px; border: 2px solid #8A8A8A; font: inherit; font-size: 1.3rem; padding: 0 16px; user-select: text; -webkit-user-select: text; }

/* ---------- appens ram ---------- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; background: #fff; }
#top { background: var(--head); color: var(--headink); padding: calc(12px + env(safe-area-inset-top)) 14px 14px; display: flex; flex-direction: column; gap: 10px; transition: background .2s; }
.row1, .row2 { display: flex; align-items: center; gap: 12px; }
.schema { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; background: #fff; color: var(--ink); border: 3px solid #D7D7D7; border-radius: 15px; padding: 5px 13px 5px 5px; min-height: 63px; }
.schema img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.schema img:not([src]) { display: none; }
.schema span { font-size: 1.93rem; font-weight: 700; letter-spacing: 1px; }
.schema small { font-size: 1rem; font-weight: 700; color: var(--grey); margin-left: auto; text-align: right; line-height: 1.15; }
.klocka { width: 74px; height: 74px; flex: none; padding: 0; border: 0; background: none; touch-action: manipulation; }
.klocka svg { width: 74px; height: 74px; }
.datum { flex: 1; line-height: 1.1; }
.r1 { font-size: 1.75rem; font-weight: 700; }
.r2 { font-size: 1.38rem; }
.idag { width: 59px; height: 59px; flex: none; border-radius: 16px; border: 2px solid #8E0E1E; background: var(--red); display: flex; align-items: center; justify-content: center; }
.idag svg { width: 31px; height: 31px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.idag.av { visibility: hidden; }

.heldag { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; background: #FFF7D6; border-bottom: 2px solid #E8D27A; }
.hd { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 6px 12px 6px 6px; font-size: 1.25rem; font-weight: 700; }
.hd img { width: 40px; height: 40px; }
.hd.varit { background: #E3E3E3; color: var(--grey); }

#main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; position: relative; background: var(--bg); touch-action: pan-y; }

#nav { background: var(--dark); padding: 12px 10px calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.nb { flex: 1; height: 68px; border-radius: 14px; border: 2px solid #6A6A6A; background: var(--btn); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 1.1rem; font-weight: 700; padding: 0; max-width: 160px; }
#nav { justify-content: center; }
.nb .ic { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nb .alt { width: 36px; height: 36px; }
.nb.on { background: #fff; color: var(--ink); border-color: #fff; }
.nb.on .ic { stroke: var(--ink); }
.nb:disabled { opacity: .4; background: #3A3A3A; border-color: #4A4A4A; }

.offline { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100px + env(safe-area-inset-bottom)); background: #333; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: .95rem; font-weight: 700; z-index: 5; }

/* ---------- dagvy: lista ---------- */
.lista { padding: 14px; display: flex; flex-direction: column; gap: 12px; max-width: 820px; margin: 0 auto; }
.kortH { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 18px; border: 3px solid var(--line); background: #fff; text-align: left; width: 100%; }
.kortH .bild { position: relative; width: 80px; height: 80px; flex: none; }
.kortH .bild img { width: 80px; height: 80px; object-fit: contain; border-radius: 10px; }
.kortH .txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.kortH .t { font-size: 1.65rem; font-weight: 700; overflow-wrap: anywhere; }
.kortH .s { font-size: 1.4rem; }
.kortH .tag { position: absolute; top: 10px; right: 12px; display: flex; gap: 6px; align-items: center; }
.nu { background: var(--red); color: #fff; font-size: .95rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.klock { width: 26px; height: 26px; fill: none; stroke: var(--grey); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kortH.pagar { border: 4px solid var(--red); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.varit { background: #E3E3E3 !important; border-color: #C4C4C4 !important; color: var(--grey); }
.varit .bild img, .varit img.ik { opacity: .5; }
.kryss { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.kryss path { stroke: #4A4A4A; stroke-width: 3; }
.tom { padding: 40px 20px; text-align: center; font-size: 1.4rem; color: var(--grey); }

/* ---------- dagvy: prickar (tidslinje) ---------- */
.tl { position: relative; background: #fff; }
.band { position: absolute; left: 0; right: 0; }
.band.kvall { background: var(--kvall); }
.band.natt { background: #000; }
.bandtxt { position: absolute; right: 8px; max-width: 84px; font-size: .85rem; font-weight: 700; text-align: right; line-height: 1.25; z-index: 1; }
.timme { position: absolute; left: 0; width: 84px; border-top: 2px solid #B8B8B8; padding: 2px 0 0 12px; font-size: 1.65rem; font-weight: 700; line-height: 1.2; }
.timme.n { color: #fff; border-color: #555; }
.prick { position: absolute; left: 66px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: var(--ink); }
.prick.v { background: #fff; }
.prick.n { background: #1E88E5; border-color: #1E88E5; }
.prick.nu { background: var(--red); border-color: var(--red); }
.tlh { position: absolute; border-radius: 16px; border: 3px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; overflow: hidden; z-index: 2; }
.tlh .t { font-size: 1.2rem; font-weight: 700; text-align: center; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tlh .bild { position: relative; width: 72px; height: 72px; flex: none; }
.tlh { justify-content: flex-start; }
.tlh .bild img { width: 100%; height: 100%; object-fit: contain; }
.tlh.pagar { border: 4px solid var(--red); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.stapel { position: absolute; width: 8px; border-radius: 4px; background: #6E6E6E; z-index: 2; }
.stapel.pagar { background: var(--green); }
.nulinje { position: absolute; left: 0; right: 0; height: 3px; background: var(--red); z-index: 3; pointer-events: none; }
.nutid { position: absolute; right: 10px; background: var(--red); color: #fff; font-size: .95rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; z-index: 3; }

/* ---------- veckovy ---------- */
.vecka { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 8px 6px; min-height: 100%; background: #fff; }
.vd { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; min-width: 0; }
.vd.today { outline: 3px solid var(--ink); outline-offset: -3px; }
.vd.ons { box-shadow: inset 0 0 0 1px #C4C4C4; }
.vdh { text-align: center; padding: 6px 0; line-height: 1.05; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vdh .n { font-size: 1.3rem; font-weight: 700; }
.vdh .w { font-size: 1rem; font-weight: 700; }
.vdh img { width: 36px; height: 36px; border-radius: 8px; border: 2px solid #fff; object-fit: cover; }
.vdh .sch { font-size: .8rem; font-weight: 700; }
.vdi { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 12px; }
.vb { position: relative; width: min(48px, 92%); aspect-ratio: 1; padding: 3px; border-radius: 9px; border: 2px solid #9E9E9E; background: #fff; }
.vb img { width: 100%; height: 100%; object-fit: contain; }
@media (min-width: 700px) { .vb { width: min(76px, 92%); } .vdh img { width: 52px; height: 52px; } }

/* ---------- mat ---------- */
.mat { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 100%; max-width: 820px; margin: 0 auto; }
.mr { flex: 1; min-height: 92px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 16px; border-radius: 16px; }
.mr.today { outline: 3px solid var(--ink); outline-offset: -3px; }
.mr .d { align-self: flex-start; font-size: 1.05rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.mr .f { font-size: 1.75rem; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- detalj och inställningar ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: #fff; }
.overlay.dark { background: var(--dark); align-items: center; justify-content: center; padding: 24px; }
#dHead { padding: calc(18px + env(safe-area-inset-top)) 20px 18px; }
.dbody { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 28px 24px 20px; }
.dbody h1 { margin: 0; font-size: 2.5rem; text-align: center; overflow-wrap: anywhere; }
.dbild { width: min(280px, 70vw); aspect-ratio: 1; border-radius: 28px; border: 4px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.dbild img { width: 82%; height: 82%; object-fit: contain; }
.dtider { display: flex; gap: 12px; width: 100%; max-width: 520px; }
.dtid { flex: 1; background: #fff; border: 2px solid #D0D0D0; border-radius: 16px; padding: 10px 12px; text-align: center; }
.dtid .lbl { font-size: 1rem; font-weight: 700; color: #555; }
.dtid .val { font-size: 2.1rem; font-weight: 700; }
.dtext { margin: 0; font-size: 1.4rem; line-height: 1.4; text-align: center; white-space: pre-line; max-width: 600px; overflow-wrap: anywhere; }
.foot { background: var(--dark); padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }

.light { background: var(--bg); }
.insthead { background: var(--head); color: #fff; padding: calc(20px + env(safe-area-inset-top)) 20px 18px; }
.insthead h1 { margin: 0; font-size: 1.9rem; }
.instbody { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; max-width: 640px; width: 100%; margin: 0 auto; }
.kort { background: #fff; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.kort h2 { margin: 0; font-size: 1.25rem; }
.kort p { margin: 0; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg button { height: 56px; border-radius: 14px; border: 3px solid var(--line); background: #fff; font-size: 1.35rem; font-weight: 700; }
.seg button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.fsrow { display: flex; align-items: center; gap: 10px; }
.fsb { width: 60px; height: 60px; border-radius: 14px; border: 3px solid var(--line); background: #fff; font-size: 20px; font-weight: 700; }
.fsb.big { font-size: 28px; }
.fssteg { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fssteg span { height: 12px; border-radius: 6px; background: #D0D0D0; }
.fssteg span.on { background: var(--ink); }
.fsprov { border: 2px dashed #C4C4C4; border-radius: 14px; padding: 10px 14px; }
.fsprov .t { font-size: 1.65rem; font-weight: 700; }
.fsprov .s { font-size: 1.4rem; }
.swrow { display: flex; align-items: center; gap: 14px; }
.swrow > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.switch { width: 72px; height: 42px; border-radius: 999px; border: 0; background: #9E9E9E; position: relative; flex: none; }
.switch span { position: absolute; left: 4px; top: 4px; width: 34px; height: 34px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"] span { left: 34px; }
.tidrow { display: flex; align-items: center; gap: 10px; }
.tidrow label { flex: 1; font-size: 1.15rem; font-weight: 700; }
.tidrow select { width: 130px; height: 50px; border-radius: 12px; border: 2px solid var(--line); font: inherit; font-size: 1.35rem; font-weight: 700; padding: 0 10px; background: #fff; color: var(--ink); }
.knapprad { display: flex; flex-wrap: wrap; gap: 8px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom)); background: #111; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; z-index: 40; }

/* 0.2 */
#top.matvy .row1 { display: none; }
.band.morgon { background: #F4C7CC; }
.vd { position: relative; }
.vdh { position: relative; border: 0; width: 100%; font: inherit; cursor: pointer; }
.vd.bred .vb { width: min(76px, 80%); }
.vd.bred .vdh img { width: 48px; height: 48px; }
.vd.bred .vdh .n { font-size: 1.6rem; }
.dagkryss { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dagkryss path { stroke: #7A7A7A; stroke-width: 2.5; }
.dagkryss path { stroke: #4A4A4A; }

/* 0.4: utan Sover-kalender (ingen PEM/MEM-ruta) står klockan på datumraden, Idag till vänster om den */
#top.utanSover .row1 { display: none; }
#top.utanSover .row2 .klocka { width: 66px; height: 66px; }
#top.utanSover .row2 .klocka svg { width: 66px; height: 66px; }
#top.matvy.utanSover .row2 .klocka { display: none; }
.mr .d small { font-weight: 700; opacity: .8; margin-left: 6px; }
#loginForm input[type=email] { text-transform: none; }

/* 0.3 */
.kortH .tag { position: static; align-self: flex-start; flex: none; }
.kortH .t, .tlh .t, .dbody h1 { text-wrap: balance; }
.tlh .t { flex: none; }
.tlh .bild { flex: 0 1 auto; min-height: 0; }
.vhel { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; background: #FFF7D6; border-bottom: 2px solid #E8D27A; }
.dnotis { margin: -8px 0 0; display: flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 700; color: #444; }
.dnotis svg { width: 28px; height: 28px; fill: none; stroke: #444; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 0.4 b10: mat sju dagar */
.mr { min-height: 72px; }
.mr .f { font-size: 1.5rem; }

/* 0.4 b10: timers */
#navTimer { position: relative; }
#navTimer .prick { position: absolute; top: 6px; left: calc(50% + 7px); right: auto; }   /* på timglaset (stilen står också i index.html) */
#timerBody { gap: 10px; }
.tkort-rad { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 16px; padding: 12px 14px; border: 2px solid #E2E2E2; }
.tkort-rad.aktiv { border-color: #B5001F; cursor: pointer; }
.tk-bild img { width: 64px; height: 64px; object-fit: contain; display: block; }
.tk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-text b { font-size: calc(1.35rem * var(--fs)); overflow-wrap: break-word; word-break: normal; hyphens: manual; line-height: 1.2; }
.tk-text small { font-size: 1rem; color: #555; font-weight: 700; }
.tkort-rad.aktiv .tk-text small { color: #B5001F; }
.tk-kvar { font-weight: 700; color: #B5001F; font-size: 1.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-last { display: flex; align-items: center; gap: 6px; color: #666; font-weight: 700; }
.tk-last svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.tkort-rad .btn { min-width: 110px; }

#timer.tvy { background: #FFC98B; color: #1A1A1A; }
#timer.larm { animation: tlarm 2s ease-in-out infinite; }
@keyframes tlarm { 0%, 100% { background: #FFC98B; } 50% { background: #FF8F5E; } }
.tkort { flex: 1; min-height: 0; margin: 16px 16px 12px; border: 1.5px solid rgba(0, 0, 0, .35); border-radius: 22px; display: flex; flex-direction: column; align-items: center; overflow: auto; }
.thuvud { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px 20px; border-bottom: 1px solid rgba(0, 0, 0, .3); }
#tImg { width: min(26vmin, 150px); height: min(26vmin, 150px); object-fit: contain; }
#tNamn { margin: 0; font-size: calc(2.2rem * var(--fs)); font-weight: 400; text-align: center; overflow-wrap: anywhere; }
.tring { position: relative; width: min(80vw, 52vh, 520px); aspect-ratio: 1; margin: 3vh 0 1vh; flex: none; }
.tring svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tring path.pa { fill: #B5001F; stroke: #FFC98B; stroke-width: 1.5; }
.tring path.av { fill: rgba(160, 100, 50, .28); stroke: #FFC98B; stroke-width: 1.5; }
.tring path.streck { stroke: rgba(0, 0, 0, .55); stroke-width: 1.5; fill: none; }
.tring text { font-size: 11px; text-anchor: middle; fill: #1A1A1A; font-family: inherit; }
.ttid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(min(80vw, 52vh, 520px) * .085); font-weight: 700; font-variant-numeric: tabular-nums; }
.tinfo { min-height: 1.5em; font-size: 1.4rem; font-weight: 700; text-align: center; padding: 6px 16px 16px; }
#timer.larm .tring path.av { stroke: transparent; }

/* b11 */
.btn.red { background: #B5001F; color: #fff; }
.tfot { display: flex; gap: 12px; }
.tfot .btn { flex: 1; }
.tkort-rad .btn.red { min-width: 96px; }
.insttimers { display: flex; flex-direction: column; gap: 8px; }
.it-rad { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid #E2E2E2; border-radius: 12px; }
.it-rad .tk-bild img { width: 48px; height: 48px; }
.it-rad .btn { min-width: 100px; }
@media (max-width: 440px) { #nav { gap: 5px; padding-left: 6px; padding-right: 6px; } .nb { font-size: .9rem; } }

/* Bytesdag: [bild] MEM → [bild] PEM, det första gråmarkerat */
.schema.byte { gap: 6px; padding-right: 10px; overflow: hidden; }
.schema .bdel { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; }
.schema .bdel span { font-size: 1.5rem; font-weight: 700; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.schema .bdel.fore { opacity: .4; filter: grayscale(1); }
.schema.byte .bdel img { width: 44px; height: 44px; flex: none; }
.schema .pil { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.schema.byte small { white-space: nowrap; flex: none; margin-left: auto; padding-left: 4px; }
@media (max-width: 480px) {
  .schema.byte { padding: 4px 8px 4px 4px; gap: 4px; }
  .schema .bdel { gap: 4px; }
  .schema .bdel span { font-size: 1.05rem; letter-spacing: 0; }
  .schema.byte .bdel img { width: 32px; height: 32px; border-radius: 7px; }
  .schema .pil { width: 16px; height: 16px; }
  .schema.byte small { font-size: .85rem; }
}
.vdh .vbyte { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.9); color: #222; display: flex; align-items: center; justify-content: center; }
.vdh .vbyte svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Timerlistan: namnet får hela bredden och bryts bara mellan ord, status under, knappen till höger */
.tkort-rad { align-items: center; }
.tk-text small { font-variant-numeric: tabular-nums; }
.tkort-rad > .btn, .tkort-rad > .tk-last { flex: none; }
.tfot2 { display: flex; gap: 10px; }
.tfot2 .btn { flex: 1; }
.skapa .falt { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.skapa .falt input { font: inherit; font-size: 1.3rem; min-height: 56px; padding: 0 14px; border: 2px solid #D0D0D0; border-radius: 12px; }
.btn .snurr { width: 20px; height: 20px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: snurr .8s linear infinite; }
@keyframes snurr { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .snurr { animation-duration: 2.4s; } }
.toast { max-width: calc(100vw - 40px); text-align: center; font-size: calc(1.1rem * var(--fs, 1)); padding: 14px 20px; }
.schema.byte { cursor: pointer; }
.toast { width: max-content; }

/* 0.7: bytesrutan mitt på skärmen, skärm, ignorera notiser, timertid, händelsekortet skalas */
.byteruta { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 40; background: #111; color: #fff; border-radius: 18px; padding: 22px 28px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.35); max-width: calc(100vw - 40px); cursor: pointer; }
.byteruta span:first-child { font-size: calc(1.45rem * var(--fs, 1)); font-weight: 700; }
.byteruta span:last-child { font-size: calc(1.3rem * var(--fs, 1)); }
.seg5 { flex-wrap: wrap; }
.seg5 button { flex: 1 1 auto; min-width: 70px; }
.vaxel { margin-top: 14px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: none; border: 0; padding: 8px 0; font: inherit; font-weight: 700; color: inherit; text-align: left; cursor: pointer; }
.vaxel i { width: 52px; height: 30px; border-radius: 15px; background: #C8C8C8; position: relative; flex: none; transition: background .15s; }
.vaxel i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.vaxel[aria-checked="true"] i { background: #2E7D32; }
.vaxel[aria-checked="true"] i::after { left: 25px; }
.tidrad { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tidb { width: 40px; height: 36px; border-radius: 10px; border: 2px solid #C8C8C8; background: #fff; font: inherit; font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer; }
.tidrad small { min-width: 64px; text-align: center; }
#detalj { --dsk: 1; }
.dbody { overflow: hidden; gap: calc(20px * var(--dsk)); padding: calc(28px * var(--dsk)) 24px calc(20px * var(--dsk)); }
.dbody h1 { font-size: calc(2.5rem * var(--dsk)); }
.dbild { width: min(calc(280px * var(--dsk)), 70vw); border-radius: calc(28px * var(--dsk)); }
.dtid .val { font-size: calc(2.1rem * var(--dsk)); }
.dtid .lbl { font-size: calc(1rem * var(--dsk)); }
.dtext { font-size: calc(1.4rem * var(--dsk)); }
.dnotis { font-size: calc(1.3rem * var(--dsk)); font-weight: 600; margin: 0; text-align: left; }
.seg.seg5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.seg.seg5 button { font-size: 1.05rem; min-width: 0; padding: 0 4px; }
@media (max-width: 520px) { .seg.seg5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 0.7.1: bytespilen i sovplatsens bild (veckovyn), rutan Ändra tid */
.vsov { position: relative; display: inline-flex; }
.vdh .vsov .vbyte { position: absolute; top: auto; left: auto; right: -4px; bottom: -4px; width: 15px; height: 15px; background: #fff; color: #222; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.vdh .vsov .vbyte svg { width: 10px; height: 10px; }
.tidlank { background: none; border: 0; padding: 4px 0 0; font: inherit; font-size: .95rem; color: #555; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.tidruta-bak { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tidruta-bak[hidden] { display: none; }
.tidruta { background: #fff; color: #111; border-radius: 20px; padding: 22px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.tidruta h2 { margin: 0; font-size: 1.4rem; }
.tidnamn { margin: 0; font-weight: 700; font-size: 1.15rem; }
.tidstep { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 6px 0; }
.tidb.stor { width: 64px; height: 64px; border-radius: 16px; font-size: 2rem; }
.tidvarde { min-width: 110px; font-size: 1.7rem; font-weight: 800; }
.tidknappar { display: flex; gap: 10px; }
.tidknappar .btn { flex: 1; }

/* 0.8: inloggning, val efter Google, Följ, nu-strecket */
.loginval { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
#loginGoogle { display: flex; align-items: center; justify-content: center; gap: 12px; }
#loginGoogle .g { width: 26px; height: 26px; }
#loginForm .btn.ghost, #valSkarm .btn.ghost { margin-top: 8px; }
#valSkarm .login-box { display: flex; flex-direction: column; gap: 10px; }
.valbrukare { display: flex; flex-direction: column; gap: 8px; }
.vaxla { display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 16px; margin-right: 10px; border-radius: 16px; border: 3px solid rgba(255,255,255,.85); background: rgba(255,255,255,.12); color: #fff; font: inherit; font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.vaxla svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vaxla[hidden] { display: none; }
.row2 { align-items: center; }
.doldikon { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: #666; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nulinje { height: 3.15px; }
.nutid { right: auto; left: 50%; transform: translateX(-50%); }

/* 0.8.2: länk till integritetspolicyn på inloggningen */
.integritet { margin-top: 22px; text-align: center; }
.integritet a { color: inherit; opacity: .75; }
