:root {
  --green: #2F7D4F;
  --green-dark: #1F5A37;
  --green-soft: #DCEFE3;
  --yellow: #F2C14E;
  --cream: #FBEFD2;
  --ink: #14211A;
  --muted: #4A5A50;
  --line: #D5DAD2;
  --bg: #F4F5F1;
  --white: #FFFFFF;
  --red: #8A3B2E;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); }
a:hover { color: var(--green-dark); }
h1, h2, h3 { margin: 0; letter-spacing: -0.4px; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 800; }
p { margin: 0; line-height: 1.5; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.wrap { max-width: 520px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.wrap.wide { max-width: 1100px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--white); border-bottom: 1px solid #E3E6E0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--green); color: var(--yellow); display: flex; align-items: center; justify-content: center; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 8px 10px; border-radius: 10px; }
.nav a.active { background: var(--green-soft); color: var(--green-dark); }

.card { background: var(--white); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card.green { background: var(--green); color: var(--white); }
.card.dark { background: var(--ink); color: var(--white); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.center { text-align: center; }
.big { font-size: 30px; font-weight: 800; }

label { font-size: 14px; font-weight: 700; }
input[type=text], input:not([type]), input[type=tel], input[type=email], input[type=number], input[type=url], input[type=search], input[type=password], select, textarea {
  width: 100%; height: 50px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0 14px;
  font-family: inherit; font-size: 16px; color: var(--ink); background: var(--white);
}
textarea { height: auto; padding: 12px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--green-soft); border-color: var(--green); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; line-height: 1.45; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); flex-shrink: 0; }

button, .btn {
  height: 50px; padding: 0 18px; border-radius: 12px; border: none; background: var(--green); color: var(--white);
  font-family: inherit; font-size: 16px; font-weight: 800; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:hover, .btn:hover { background: var(--green-dark); color: var(--white); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary, .btn.secondary { background: var(--white); color: var(--ink); border: 1.5px solid var(--line); }
button.secondary:hover { background: var(--bg); }
button.yellow { background: var(--yellow); color: var(--ink); }
button.danger { background: var(--white); color: var(--red); border: 1.5px solid #E2B4AA; }
button.small { height: 40px; font-size: 14px; padding: 0 14px; }

.stamps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.stamp { aspect-ratio: 1; border-radius: 99px; border: 2px dashed rgba(255,255,255,0.55); }
.stamp.on { background: var(--yellow); border: none; }
.card:not(.green) .stamp { border-color: #A9CDB6; }

.pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 99px; background: var(--green-soft); color: var(--green-dark); }
.pill.warn { background: var(--cream); color: #6B4800; }
.pill.red { background: #F6E1DC; color: var(--red); }

.msg { padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.msg.ok { background: var(--green-soft); color: var(--green-dark); }
.msg.err { background: #F6E1DC; color: var(--red); }

.qr { background: var(--white); padding: 12px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qr img, .qr canvas { width: 200px; height: 200px; image-rendering: pixelated; }
.code { font-size: 15px; font-weight: 800; letter-spacing: 2px; color: var(--ink); }

video.scanner { width: 100%; border-radius: 14px; background: #23362A; aspect-ratio: 1; object-fit: cover; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi .big { font-size: 28px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px; border-bottom: 1px solid #E3E6E0; }
td { padding: 10px 8px; border-bottom: 1px solid #F0F2EE; }
.scroll { overflow-x: auto; }

@media (max-width: 480px) {
  .wrap { padding: 16px 12px 40px; }
  h1 { font-size: 23px; }
}

/* ---------- Tryckmaterial ---------- */
.print-wrap { background: #E8EAE5; min-height: 100vh; padding: 20px 12px 60px; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.print-bar { max-width: 600px; width: 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sheet { background: var(--white); color: var(--ink); box-shadow: 0 2px 12px rgba(0,0,0,.08); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4mm; padding: 8mm; box-sizing: border-box; }
.sheet.a6 { width: 105mm; height: 148mm; }
.sheet.a4 { width: 210mm; height: 297mm; padding: 18mm; gap: 8mm; }
.sheet.sticker { width: 120mm; height: 120mm; background: transparent; box-shadow: none; padding: 0; }
.p-brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13pt; color: var(--green); }
.p-brand.inv { color: var(--yellow); }
.p-title { font-size: 19pt; line-height: 1.12; font-weight: 800; letter-spacing: -0.3px; }
.p-title.xl { font-size: 40pt; }
.p-qr { width: 58mm; height: 58mm; image-rendering: pixelated; }
.p-qr.xl { width: 120mm; height: 120mm; }
.p-big { font-size: 13pt; font-weight: 800; line-height: 1.3; }
.a4 .p-big { font-size: 22pt; }
.p-small { font-size: 9.5pt; color: var(--muted); line-height: 1.4; }
.a4 .p-small { font-size: 14pt; }
.p-circle { width: 120mm; height: 120mm; border-radius: 50%; background: var(--green); color: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2mm; border: 3mm solid var(--yellow); box-sizing: border-box; }
.p-sticker-top { font-size: 16pt; font-weight: 600; }
.p-sticker-name { font-size: 34pt; font-weight: 800; letter-spacing: -0.5px; }
.p-sticker-bottom { font-size: 13pt; color: var(--yellow); font-weight: 700; }
.staff { text-align: left; align-items: stretch; justify-content: flex-start; }
.staff h2 { font-size: 15pt; }
.staff ol { margin: 0; padding-left: 5mm; display: flex; flex-direction: column; gap: 2.5mm; font-size: 10.5pt; line-height: 1.4; }

@media print {
  @page { margin: 0; }
  body { background: #fff; }
  .no-print, .topbar { display: none !important; }
  .print-wrap { background: #fff; padding: 0; gap: 0; display: block; }
  .sheet { box-shadow: none; margin: 0 auto; page-break-after: always; break-after: page; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Runda QR-dekaler, 4 per A4 */
.sheet.sticker-sheet { width: 210mm; height: 297mm; display: grid; grid-template-columns: repeat(2, 80mm); gap: 20mm; align-content: center; justify-content: center; padding: 0; }
.p-round { width: 80mm; height: 80mm; border-radius: 50%; background: var(--white); border: 2.5mm solid var(--green); box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5mm; }
.p-round-top { display: flex; align-items: center; gap: 4px; font-size: 10pt; font-weight: 800; color: var(--green); }
.p-round-top svg { width: 14px; height: 14px; }
.p-round-qr { width: 40mm; height: 40mm; image-rendering: pixelated; }
.p-round-bottom { font-size: 8.5pt; font-weight: 800; color: var(--ink); }

/* Google Wallet-knapp */
a.gwallet { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; height: 48px; border-radius: 24px; background: #1F1F1F; color: #fff; font-weight: 600; text-decoration: none; }
a.awallet { display: flex; align-items: center; justify-content: center; margin-top: 12px; height: 48px; border-radius: 24px; background: #000; color: #fff; font-weight: 600; text-decoration: none; }
a.gwallet::before { content: ''; width: 22px; height: 16px; border-radius: 3px; background: linear-gradient(#EA4335 0 25%, #FBBC04 25% 50%, #34A853 50% 75%, #4285F4 75%); }

/* Annonser */
.ad { display: block; background: var(--white, #fff); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 0 0 14px; color: inherit; text-decoration: none; }
.ad-tag { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6B7A70; margin-bottom: 6px; }
.ad-row { display: flex; gap: 12px; align-items: center; }
.ad-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.ad-big { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }

/* Gamla papperskort i personalvyn */
.legacy { border-top: 1px solid rgba(0,0,0,.08); padding-top: 12px; }
.legacy-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legacy-list li { background: rgba(47,125,79,.06); border-radius: 10px; padding: 10px 12px; flex-wrap: nowrap; }

/* Flikar i panelen */
.subnav { display: flex; gap: 6px; overflow-x: auto; padding: 4px; background: #fff; border-radius: 14px; margin: 4px 0 14px; scrollbar-width: none; }
.subnav a { flex: 1 0 auto; text-align: center; padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; color: inherit; white-space: nowrap; }
.subnav a.active { background: var(--green); color: #fff; }
.subnav a:not(.active):hover { background: rgba(47,125,79,.08); }
.shop-index { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-index a { padding: 8px 12px; border-radius: 99px; background: rgba(47,125,79,.08); color: #1F5A37; font-weight: 600; text-decoration: none; }

/* Stadstips – tydlig fråga till kunden */
.city-promo { background: #FFF6DC; border: 2px solid var(--yellow, #F2C14E); }
.city-ask { background: #FFF6DC; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* Supportläge */
.support-bar { background: #FDECEA; color: #8A1F14; border: 1.5px solid #E8A39A; border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.support-bar a { color: #8A1F14; font-weight: 700; margin-left: 6px; }

/* ---------- Mobilappen ---------- */
button.link { background: none; border: 0; color: var(--green); height: auto; padding: 4px 0; font-weight: 700; text-decoration: underline; }
button.link:hover { background: none; color: var(--green-dark); }
.dirlist { display: flex; flex-direction: column; }
.dirrow { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid #ECEFE9; text-decoration: none; color: var(--ink); }
.dirrow:first-child { border-top: 0; }
.native body { -webkit-user-select: none; user-select: none; }
.native input, .native textarea { -webkit-user-select: text; user-select: text; }
.native .apptop { position: sticky; top: 0; z-index: 10; justify-content: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.native .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.apptabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--white); border-top: 1px solid #E3E6E0; padding-bottom: env(safe-area-inset-bottom); }
.apptabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; }
.apptabs a.active { color: var(--green); }
/* Ingen uppkoppling */
html.offline body::before { content: "Ingen uppkoppling – kontrollera ditt nät och försök igen."; position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: #8A3B2E; color: #fff; font-size: 13px; font-weight: 700; text-align: center; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; }

/* Notis i appen (push) */
.push-notice-bg{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:flex-end;justify-content:center;z-index:9999;padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom))}
.push-notice{background:#fff;color:#1d2a22;border-radius:18px;padding:20px;max-width:440px;width:100%;box-shadow:0 10px 30px rgba(0,0,0,.25);animation:pnUp .25s ease-out}
.push-notice-tag{color:#2F7D4F;font-weight:700;font-size:.85rem;margin-bottom:6px}
.push-notice h3{margin:0 0 6px;font-size:1.15rem}
.push-notice p{margin:0 0 16px;line-height:1.45;white-space:pre-line}
.push-notice .btn{width:100%}
@keyframes pnUp{from{transform:translateY(30px);opacity:0}to{transform:none;opacity:1}}
/* Rabatthäfte */
.hafte-link{display:flex;flex-direction:column;gap:2px;text-decoration:none;color:inherit;border:2px solid var(--green)}
.hafte-offer h2{margin:2px 0 6px}
.hafte-ticket-bg{align-items:center;background:rgba(0,0,0,.6)}
.hafte-ticket{position:relative;overflow:hidden;background:var(--green);color:#fff;border-radius:22px;padding:28px 22px;max-width:440px;width:100%;text-align:center;box-shadow:0 12px 40px rgba(0,0,0,.35);animation:pnUp .25s ease-out}
.hafte-ticket h2{color:#fff;font-size:1.6rem;margin:6px 0}
.hafte-ticket .small{color:#e8f5ec}
.hafte-ticket-tag{font-weight:800;letter-spacing:.04em;text-transform:uppercase;font-size:.85rem;margin:0}
.hafte-ticket-biz{font-weight:700;font-size:1.1rem;margin:0 0 10px}
.hafte-clock{font-size:2.6rem;font-weight:800;font-variant-numeric:tabular-nums;margin:6px 0}
.hafte-pulse{position:absolute;top:16px;right:16px;width:14px;height:14px;border-radius:50%;background:#FFE27A;animation:hPulse 1s ease-in-out infinite}
@keyframes hPulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.8);opacity:.4}}
@media (prefers-reduced-motion:reduce){.hafte-pulse{animation:none}}
.hafte-offer{position:relative;overflow:hidden}
.hafte-offer.unlocked{border-left:6px solid var(--green)}
.hafte-offer.locked{background:#ECEDEB;color:#6b746e;border:2px dashed #9aa39c;filter:grayscale(1)}
.hafte-offer.locked h2{color:#6b746e}
.hafte-offer.locked::after{content:'FÖRHANDSVISNING';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-18deg);font-weight:900;font-size:2rem;letter-spacing:.08em;color:rgba(0,0,0,.09);white-space:nowrap;pointer-events:none}
.hafte-badge{display:inline-block;font-size:.8rem;font-weight:800;padding:3px 10px;border-radius:999px;margin-bottom:6px}
.hafte-badge.ok{background:var(--green-soft);color:var(--green-dark)}
.hafte-badge.lock{background:#d9dcd8;color:#4a524c}
.hafte-offer h2{margin:4px 0 2px}
.hafte-row{border-top:1px solid var(--line);padding-top:12px;margin-top:12px}
.hafte-offer.locked .hafte-row{border-top-color:#c3c8c3}
.hafte-row h3{margin:0 0 4px;font-size:1.1rem}
.hafte-row p{margin:0 0 8px}
.hafte-filter{margin-bottom:12px}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.chip{width:auto;padding:7px 14px;border-radius:999px;background:#fff;color:var(--green-dark);border:1.5px solid var(--green);font-weight:700;font-size:14px}
.chip.on{background:var(--green);color:#fff}
.hafte-row > button{width:100%;display:block}
.shop-logo{border-radius:12px;object-fit:contain;background:#fff;border:1px solid var(--line);flex:none;vertical-align:middle}
.shop-logo.empty{display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--muted);text-align:center}
.shop-head{display:flex;align-items:center;gap:12px}
.shop-head h2{margin:0}
.partner-tag{display:inline-block;margin:8px 0 0;padding:4px 12px;border-radius:999px;background:#FFF3C4;color:#6B4E00;font-weight:800;font-size:.85rem}
.partner-tag span{font-weight:600}
.hafte-offer.locked .partner-tag{background:#e2e4e1;color:#555}
.hafte-offer.locked .shop-logo{filter:grayscale(1);opacity:.7}
.hafte-bonus{background:#FFF3C4;color:#6B4E00;border-radius:12px;padding:10px 12px;font-weight:700}
.hafte-soon{margin-top:12px;padding:12px;border-radius:12px;background:var(--green-soft)}
.hafte-soon p{margin:0 0 8px}
.bar{height:10px;border-radius:99px;background:#fff;overflow:hidden;margin:6px 0 10px}
.bar span{display:block;height:100%;background:var(--green);border-radius:99px}
/* Kupong */
.coupon{border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#fff;margin:6px 0 10px}
.coupon-img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover}
.coupon-body{display:flex;align-items:stretch}
.coupon-stub{flex:none;width:96px;display:flex;align-items:center;justify-content:center;color:#fff;position:relative;border-right:2px dashed rgba(255,255,255,.7)}
.coupon-stub::before,.coupon-stub::after{content:'';position:absolute;right:-9px;width:16px;height:16px;border-radius:50%;background:#fff;border:1px solid var(--line)}
.coupon-stub::before{top:-9px}.coupon-stub::after{bottom:-9px}
.coupon-badge{font-weight:900;font-size:1.35rem;line-height:1.05;text-align:center;padding:8px 6px;word-break:break-word}
.coupon-badge.long{font-size:1.05rem}
.coupon-text{padding:12px 14px;min-width:0}
.coupon-text h3{margin:0 0 4px;font-size:1.1rem}
.coupon-text p{margin:0 0 6px}
.coupon > button,.coupon > .pill{margin:0 12px 12px;width:calc(100% - 24px)}
.coupon > .pill{display:inline-block;width:auto}
.hafte-row{border-top:none;padding-top:0;margin-top:8px}
.hafte-offer.locked .coupon{background:#f3f4f2}
.hafte-join{background:#fff;color:#1d2a22;border-radius:14px;padding:12px;margin:10px 0}
.hafte-join p{color:#1d2a22;margin:0 0 8px}
.hafte-join canvas,.hafte-join img{margin:0 auto}
.hafte-ticket{max-height:calc(100vh - 32px);overflow:auto}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px}.grid2 select{width:100%;display:block;margin-top:2px}
.kiosk{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;background:var(--bg,#F7F5EF)}
.khead{display:flex;justify-content:space-between;align-items:center;padding:12px 18px}
.kbrand{font-weight:800;font-size:1.15rem}
.klink{background:none;color:inherit;opacity:.55;padding:6px 10px;font-size:.9rem;border:1px solid currentColor}
.kmain{flex:1;width:100%;max-width:520px;margin:0 auto;padding:8px 18px 28px;display:flex;flex-direction:column;gap:14px;text-align:center}
.kmain h1{font-size:1.6rem;margin:8px 0 0}
.kdisp{font-size:2rem;font-weight:700;letter-spacing:2px;padding:14px;border-radius:14px;background:var(--card,#fff);min-height:64px;font-variant-numeric:tabular-nums}
.kpad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.kkey{font-size:1.7rem;font-weight:700;padding:18px 0;border-radius:14px;min-height:68px}
.kok{grid-column:span 1}
.kinput{font-size:1.3rem;padding:14px}
.kcheck{text-align:left;font-size:1rem}
.kbig{font-size:2.6rem;font-weight:800;margin:0}
.kbig small{font-size:1.4rem;opacity:.6}
.kstamps{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:6px 0}
.kstamps span{width:34px;height:34px;border-radius:50%;border:3px solid #2F7D4F;opacity:.5}
.kstamps span.on{background:#2F7D4F;opacity:1}
.kstep{font-weight:600}
.kdone{font-size:4rem;width:110px;height:110px;line-height:110px;border-radius:50%;background:#2F7D4F;color:#fff;margin:10px auto 0}
.kn{justify-content:center;gap:6px;flex-wrap:wrap}
.kmain .row{justify-content:center}
.rgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px;margin:8px 0}
.rgrid>div{display:flex;flex-direction:column;gap:2px;padding:10px;border-radius:12px;background:var(--bg)}
.rgrid .big{font-size:1.5rem;font-weight:800}
.rup{color:#2F7D4F;font-weight:700}.rdown{color:#B3261E;font-weight:700}
.chat{display:flex;flex-direction:column;gap:8px;max-height:52vh;overflow-y:auto;padding:8px;border-radius:12px;background:var(--bg);margin:8px 0}
.cmsg{max-width:82%;padding:8px 12px;border-radius:14px;white-space:pre-wrap;word-break:break-word}
.cmsg span{display:block;font-size:.72rem;opacity:.6;margin-top:2px}
.cmsg.me{align-self:flex-end;background:#2F7D4F;color:#fff;border-bottom-right-radius:4px}
.cmsg.them{align-self:flex-start;background:#fff;color:#14211A;border:1px solid #DCE2DA;border-bottom-left-radius:4px}
.chatin{display:flex;gap:8px;align-items:flex-end}
.chatin textarea{flex:1;margin:0}
.chatin button{width:auto}
.chatbox{margin-top:10px;padding:10px;border-radius:14px;background:rgba(255,255,255,.92);color:#14211A}
.chatbtn{margin-top:10px}
.badge{display:inline-block;min-width:20px;padding:1px 7px;border-radius:999px;background:#B3261E;color:#fff;font-size:.75rem;font-weight:700;line-height:18px;text-align:center}
.threads{display:flex;flex-direction:column;gap:8px}
.thread{display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:2px;width:100%}
.thread.unread{border-color:#2F7D4F;border-width:2px}
.extras,.cextras{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.offer{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px;border-radius:12px;background:var(--bg)}
.coffer{padding:8px 10px;border-radius:12px;background:rgba(255,255,255,.18)}
.tier{display:inline-block;padding:2px 10px;border-radius:999px;font-weight:700;font-size:.85rem;margin-right:4px}
.tier.bronze{background:#E9D2BC;color:#5A3A1E}.tier.silver{background:#E3E6EA;color:#3B434C}.tier.gold{background:#F6DE8D;color:#5C4500}
.pospick{gap:6px}
.posbtn{text-align:left;display:block;width:100%}
.posbtn .small{opacity:.8}
/* Skraplott */
.scratch{margin:8px 0}
.scratch-box{position:relative;width:100%;max-width:320px;aspect-ratio:320/110;border-radius:12px;overflow:hidden;background:#fffbe9;border:1px solid #e8d58a}
.scratch-prize{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;padding:8px;color:#3d2f00}
.scratch-prize b{font-size:18px}
.scratch-box canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab}
/* Skrivhjälp */
.aiw{display:grid;gap:6px;margin:6px 0 10px;padding:10px;border-radius:10px;background:var(--bg2, #f4f7f3)}
.aiw-s{display:block;text-align:left;width:100%;background:#fff;color:inherit;border:1px solid var(--line, #dde3db);border-radius:10px;padding:10px;font-weight:400;line-height:1.4}
.aiw-s:hover{border-color:var(--green, #2e7d4f)}
/* Spara appen */
.nav a.saveapp{font-weight:700;white-space:nowrap}
.saveapp-bg{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:flex-end;justify-content:center;z-index:1000;padding:16px;padding-bottom:max(16px,env(safe-area-inset-bottom,0px))}
.saveapp-box{background:#fff;color:#1d2a22;border-radius:16px;padding:20px;max-width:420px;width:100%;display:grid;gap:10px}
.saveapp-box h2{margin:0;font-size:20px}
.saveapp-box ol{margin:0;padding-left:20px;display:grid;gap:6px}
@media (max-width:520px){.nav a.saveapp{font-size:13px}}
/* Dagens fynd */
.fynd-code{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid rgba(0,0,0,.08);padding-top:8px}
.fynd-big{font-family:ui-monospace,Menlo,monospace;font-size:28px;font-weight:700;letter-spacing:.12em;background:#fff;color:#1d2a22;border-radius:8px;padding:4px 10px}
.fynd-price{font-size:20px}
.fynd-thumb{width:44px;height:44px;border-radius:8px;object-fit:cover;flex:none}
.fynd-thumb.big{width:88px;height:88px}
.fynd-img{width:100%;aspect-ratio:16/10;object-fit:cover;border-radius:10px}
.fynd-prod{border-top:1px solid var(--line,#eee);padding-top:8px}
/* Nära mig */
.nearme{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 12px}
.km{margin-left:auto;font-size:13px;font-weight:600;color:var(--green,#2F7D4F);white-space:nowrap}
.maplink{display:inline-block;font-size:13px;font-weight:600;color:var(--green-dark,#1f5c3a);text-decoration:none;white-space:nowrap}
.maplink:hover{text-decoration:underline}
.dirwrap{display:flex;align-items:center;gap:10px}
.dirwrap .dirrow{flex:1;min-width:0}
.dirwrap{border-top:1px solid #ECEFE9}
.dirwrap:first-child{border-top:0}
.dirwrap .dirrow{border-top:0}
.card.nudge{border:2px solid var(--green,#2F7D4F)}
.smscount{display:flex;flex-direction:column;gap:2px;font-size:13px;color:var(--muted,#5d6b62);margin:-4px 0 10px}
.smscount.warn{color:#8a5a00}

/* ---------- Presentkort ---------- */
.gcard{position:relative;border-radius:20px;color:#fff;padding:22px 22px 18px;aspect-ratio:1.6/1;display:flex;flex-direction:column;box-shadow:0 14px 30px rgba(20,33,26,.22);margin:0 0 16px}
.gcard-shine{position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:
  radial-gradient(circle at 18% 22%,rgba(255,255,255,.55) 0 2px,transparent 3px),
  radial-gradient(circle at 72% 14%,rgba(255,255,255,.45) 0 1.5px,transparent 2.5px),
  radial-gradient(circle at 86% 62%,rgba(255,255,255,.5) 0 2px,transparent 3px),
  radial-gradient(circle at 34% 78%,rgba(255,255,255,.35) 0 1.5px,transparent 2.5px),
  radial-gradient(circle at 58% 44%,rgba(255,255,255,.3) 0 1px,transparent 2px),
  linear-gradient(115deg,transparent 35%,rgba(255,255,255,.28) 48%,transparent 60%);
  background-size:100% 100%,100% 100%,100% 100%,100% 100%,100% 100%,250% 100%;animation:gshine 5s ease-in-out infinite}
@keyframes gshine{0%,100%{background-position:0 0,0 0,0 0,0 0,0 0,120% 0}50%{background-position:0 0,0 0,0 0,0 0,0 0,-20% 0}}
@media (prefers-reduced-motion:reduce){.gcard-shine{animation:none}}
.gcard-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;position:relative}
.gcard-shop{font-weight:800;font-size:18px;text-shadow:0 1px 2px rgba(0,0,0,.2)}
.gcard-emoji{font-size:44px;line-height:1;filter:drop-shadow(0 2px 4px rgba(0,0,0,.25))}
.gcard-title{position:relative;font-weight:800;font-size:26px;line-height:1.15;margin-top:auto;text-shadow:0 1px 3px rgba(0,0,0,.2)}
.gcard-to{position:relative;font-size:15px;opacity:.95;margin-top:4px}
.gcard-amount{position:relative;font-weight:800;font-size:34px;margin-top:6px}
.gcard-foot{position:relative;font-size:11px;letter-spacing:3px;opacity:.8;margin-top:4px}
.gcard.small{padding:10px;border-radius:12px;margin:0;box-shadow:none}
.gcard.small .gcard-shop{display:none}
.gcard.small .gcard-emoji{font-size:22px}
.gcard.small .gcard-title{font-size:13px}
.gtheme-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
@media (max-width:520px){.gtheme-grid{grid-template-columns:repeat(2,1fr)}}
.gtheme{display:block;padding:3px;border-radius:15px;background:transparent;border:3px solid transparent;width:100%;min-height:0;height:auto;line-height:normal;box-shadow:none}
.gtheme:hover{background:transparent}
.gtheme.on{border-color:#F2C14E}

/* Belöning klar – stor ruta överst i personalvyn */
.reward-ready{background:#FFF4D6;border:3px solid #F2C14E;border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:8px;margin:6px 0 12px;animation:rrpulse 1.6s ease-in-out 3}
.reward-ready .rr-title{font-weight:800;font-size:22px}
.reward-ready .rr-what{font-size:17px}
.reward-ready .rr-btn{font-size:18px;padding:16px;width:100%}
@keyframes rrpulse{0%,100%{box-shadow:0 0 0 0 rgba(242,193,78,.6)}50%{box-shadow:0 0 0 10px rgba(242,193,78,0)}}
@media (prefers-reduced-motion:reduce){.reward-ready{animation:none}}
