/* =====================================================================
   SEKO Klubb 104 — Design System
   Fonts: Archivo (headings), DM Sans (body)
   Colors: SEKO Red #e2231a, Navy #0d2a4a
   ===================================================================== */

/* --- Variables -------------------------------------------------------- */
:root {
  --red:        #e2231a;
  --red-dark:   #b51810;
  --red-light:  #fde8e6;
  --navy:       #0d2a4a;
  --navy-2:     #123963;
  --navy-light: #e8eef6;
  --ink:        #1b2230;
  --ink-2:      #3d4b60;
  --muted:      #7a8899;
  --border:     #e4e8ef;
  --bg:         #f4f6f9;
  --white:      #ffffff;
  --green:      #16a34a;
  --green-light:#e6f7ed;
  --blue:       #2563eb;
  --blue-light: #e3edff;
  --amber:      #d97706;
  --amber-light:#fef3e2;
  --purple:     #7c3aed;
  --purple-light:#f0e9ff;

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;

  --shadow-sm:  0 1px 4px rgba(13,42,74,.06);
  --shadow:     0 2px 12px rgba(13,42,74,.09);
  --shadow-lg:  0 4px 24px rgba(13,42,74,.13);

  --nav-h:      64px;
  --top-h:      60px;

  font-size: 16px;
}

/* --- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select {
  font: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  width: 100%;
  background: var(--white);
  color: var(--ink);
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--navy); }
textarea { resize: vertical; min-height: 120px; }
img { max-width: 100%; display: block; }

/* --- App shell -------------------------------------------------------- */
#app {
  position: fixed;
  inset: 0;
  bottom: var(--nav-h);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}
body.no-nav #app { bottom: 0; }

/* --- Views ------------------------------------------------------------ */
.view { min-height: 100%; }

/* --- Topbar ----------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--navy);
  color: var(--white);
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.topbar-mark {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: white;
}
.topbar-mark img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: rgba(255,255,255,.8);
  transition: background .15s;
}
.topbar-btn:active { background: rgba(255,255,255,.12); }
.topbar-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  padding: 6px 2px;
}

/* --- Bottom navigation ------------------------------------------------ */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: transparent;   /* vita baren ritas av #nav-bg bakom (delad skugga) */
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  z-index: 100;
}

/* Bakgrundslager: vit bar + våg som EN form med EN gemensam skugga.
   Får navbaren + bulan att se ut som en och samma navbar. */
#nav-bg {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: var(--white);
  z-index: 99;
  overflow: visible;
  pointer-events: none;
  /* En tunn ramlinje (hårfin) + mjuk skugga som följer HELA silhuetten
     (bar + våg) → ser ut som en och samma navbar avskild från sidan. */
  filter:
    drop-shadow(0 -1px 0 rgba(13,42,74,.16))
    drop-shadow(0 -5px 16px rgba(13,42,74,.13));
}
#nav-bg.hidden { display: none; }

/* Vågen — del av samma vita silhuett, basen nere i baren → sömlös, delad skugga */
.nav-wave {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 22px);   /* basen (y48) vid navbarens överkant */
  transform: translateX(-50%);
  width: 210px;
  height: 70px;
  display: block;
}
.nav-wave.hidden { display: none; }
#bottom-nav.hidden { display: none; }
#bottom-nav a.hidden { display: none; }
#bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: .65rem;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 0;
  transition: color .15s, transform .2s;
  cursor: pointer;
  position: relative;
}
#bottom-nav a::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(13,42,74,.12) 0%, rgba(232,238,246,.92) 58%, rgba(226,35,26,.10) 100%);
  opacity: 0;
  transform: translateY(4px) scale(.92);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
#bottom-nav a > span {
  position: relative;
  z-index: 1;
}
#bottom-nav a .nav-icon { font-size: 1.3rem; line-height: 1; }
#bottom-nav a.active {
  color: var(--navy);
  transform: translateY(-1px);
}
#bottom-nav a.active::before {
  opacity: 1;
  transform: translateY(0) scale(1);
}
#bottom-nav a.active > span:not(.nav-icon):not(.badge) {
  background: linear-gradient(135deg, #0d2a4a 0%, #1f4a75 62%, #c8342b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#bottom-nav a.active .nav-icon { animation: pop .2s ease; }
#bottom-nav a .badge {
  position: absolute;
  top: 0; right: calc(50% - 18px);
  background: var(--red);
  color: white;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
@keyframes pop { 0%,100%{transform:scale(1)} 50%{transform:scale(1.25)} }

/* --- View body -------------------------------------------------------- */
.view-body {
  padding: 16px 16px 24px;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Section headings ------------------------------------------------- */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 10px;
}
.section-row:first-child { margin-top: 8px; }
.section-head {
  font-family: 'Archivo', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-more {
  font-size: .82rem;
  font-weight: 600;
  color: var(--red);
  cursor: pointer;
}

/* --- Motto banner ----------------------------------------------------- */
.motto-banner {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 4px;
}
.motto-banner p {
  font-family: 'Archivo', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  line-height: 1.5;
  font-style: italic;
}
.motto-banner .motto-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

/* --- Quick grid ------------------------------------------------------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.quick-tile {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s;
  cursor: pointer;
  border: 1px solid transparent;
}
.quick-tile:active { transform: scale(.96); box-shadow: none; }
.quick-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.quick-tile strong {
  font-family: 'Archivo', sans-serif;
  font-size: .7rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.quick-tile span {
  font-size: .62rem;
  color: var(--muted);
  text-align: center;
  display: none;
}

/* --- Post card -------------------------------------------------------- */
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  border: 1px solid transparent;
}
.post-card:active { transform: scale(.98); box-shadow: none; }
.post-card.pinned { border-color: var(--red); }
.post-thumb {
  width: 48px; height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.post-meta {
  font-size: .7rem;
  color: var(--muted);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.post-tag {
  background: var(--red);
  color: white;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.post-card h5 {
  font-family: 'Archivo', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.3;
}
.post-card p {
  font-size: .8rem;
  color: var(--ink-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Article view ----------------------------------------------------- */
.article-wrap {
  padding: 20px 16px 40px;
  max-width: 640px;
  margin: 0 auto;
}
.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  letter-spacing: .04em;
}
.article-wrap h2 {
  font-family: 'Archivo', sans-serif;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 8px;
}
.article-byline {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.article-content h3 {
  font-family: 'Archivo', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--navy);
  margin: 20px 0 8px;
}
.article-content h4 {
  font-family: 'Archivo', sans-serif;
  font-size: .96rem;
  font-weight: 700;
  color: var(--ink);
  margin: 16px 0 6px;
}
.article-content p {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.article-content ul {
  margin: 8px 0 12px 18px;
}
.article-content li {
  font-size: .9rem;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.article-content strong { color: var(--ink); font-weight: 700; }
.article-content em { font-style: italic; }
.article-content a { color: var(--red); text-decoration: underline; }
.article-content code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .85em;
  font-family: 'Space Mono', monospace;
}

/* --- Event card ------------------------------------------------------- */
.event-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid transparent;
}
.event-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}
.event-cal {
  background: var(--navy);
  border-radius: 10px;
  width: 52px; height: 52px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0;
}
.event-cal .mo {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--red);
  letter-spacing: .08em;
}
.event-cal .dy {
  font-family: 'Archivo', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: white;
  line-height: 1;
}
.event-head h5 {
  font-family: 'Archivo', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.event-info {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
}
.event-foot {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  gap: 8px;
}
.btn-yes {
  background: var(--green);
  color: white;
  font-weight: 700;
  font-size: .82rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background .15s, transform .1s;
}
.btn-yes:active { background: #15803d; transform: scale(.97); }
.btn-yes.done { background: var(--navy); cursor: default; }
.btn-maybe {
  background: var(--bg);
  color: var(--ink-2);
  font-weight: 600;
  font-size: .82rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background .15s;
}
.btn-maybe:active { background: var(--border); }
.btn-ics {
  margin-left: auto;
  background: none;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 10px;
  text-decoration: underline;
  cursor: pointer;
}
.rsvp-done {
  font-size: .85rem;
  color: var(--green);
  font-weight: 600;
  padding: 6px 0;
}

/* --- Benefit row ------------------------------------------------------ */
.benefit-row {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform .12s;
}
.benefit-row:active { transform: scale(.98); }
.benefit-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.benefit-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
.benefit-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.benefit-row h5 {
  font-family: 'Archivo', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.benefit-source-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: .58rem;
  letter-spacing: .04em;
  color: #7a4a05;
  background: linear-gradient(135deg, #fff2cc 0%, #f4cc6b 100%);
  vertical-align: middle;
}
.benefit-row p {
  font-size: .78rem;
  color: var(--muted);
}
.benefit-arr {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--border);
  flex-shrink: 0;
}

/* --- Document row ----------------------------------------------------- */
.doc-row {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform .12s;
}
.doc-row:active { transform: scale(.98); }
.doc-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--red-light);
  color: var(--red);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.doc-row h5 {
  font-family: 'Archivo', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.doc-meta { font-size: .72rem; color: var(--muted); }
.doc-arr {
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--border);
  flex-shrink: 0;
}

/* --- Board card ------------------------------------------------------- */
.board-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 8px;
}
.board-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--navy-light);
  color: var(--navy);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Archivo', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  overflow: hidden;
}
.board-avatar img { width: 100%; height: 100%; object-fit: cover; }
.board-card h5 {
  font-family: 'Archivo', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.board-role { font-size: .78rem; color: var(--muted); margin-bottom: 3px; }
.board-links { display: flex; gap: 8px; }
.board-link {
  font-size: .72rem;
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
}

/* --- Contact form ----------------------------------------------------- */
.contact-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-top: 8px;
}
.contact-form h4 {
  font-family: 'Archivo', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 14px;
}
.form-group { margin-bottom: 12px; }
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.form-success {
  background: var(--green-light);
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
}

/* --- Profile ---------------------------------------------------------- */
.profile-hero {
  background: var(--navy);
  padding: 28px 16px 24px;
  text-align: center;
  padding-top: calc(28px + env(safe-area-inset-top));
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-family: 'Archivo', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.profile-name {
  font-family: 'Archivo', sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  color: white;
  margin-bottom: 4px;
}
.profile-role { font-size: .82rem; color: rgba(255,255,255,.65); }
.profile-list { padding: 8px 16px; max-width: 600px; margin: 0 auto; }
.profile-row {
  background: var(--white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s;
}
.profile-row:active { transform: scale(.98); }
.profile-icon { font-size: 1.2rem; width: 28px; text-align: center; }
.profile-label { font-size: .92rem; font-weight: 500; color: var(--ink); flex: 1; }
.profile-arr { color: var(--border); font-size: 1.1rem; }
.profile-row.danger .profile-label { color: var(--red); }
.install-row .btn-sm {
  margin-left: auto;
}
.install-hint {
  font-size: .76rem;
  color: var(--muted);
  margin: -2px 4px 8px 40px;
  line-height: 1.4;
}
.push-row { align-items: flex-start; flex-direction: column; gap: 4px; }
.push-row .push-head { display: flex; align-items: center; gap: 12px; width: 100%; }
.push-desc { font-size: .78rem; color: var(--muted); padding-left: 40px; }
.toggle {
  width: 44px; height: 26px;
  border-radius: 13px;
  background: var(--border);
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
  margin-left: auto;
  cursor: pointer;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(18px); }

/* --- Login ------------------------------------------------------------ */
.login-view {
  min-height: 100vh;
  background: var(--navy);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}
.login-mark {
  width: 100px; height: 100px;
  border-radius: 50%;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.login-mark img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.login-title {
  font-family: 'Archivo', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
  text-align: center;
}
.login-sub {
  font-size: .88rem;
  color: rgba(255,255,255,.6);
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 360px;
}
.login-card label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 4px;
  margin-top: 12px;
}
.login-card label:first-child { margin-top: 0; }
.login-note {
  font-size: .75rem;
  color: rgba(255,255,255,.45);
  text-align: center;
  margin-top: 16px;
  max-width: 280px;
  line-height: 1.5;
}
.login-install-pill {
  position: absolute;
  left: 50%;
  bottom: calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  width: auto;
  max-width: min(88vw, 360px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  padding: 8px 12px;
  text-align: center;
  animation: pwa-nudge 2.4s ease-in-out infinite;
}
.login-install-pill-title {
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.2;
}
.login-install-pill-text {
  font-size: .68rem;
  color: rgba(255,255,255,.72);
  line-height: 1.2;
}
@keyframes pwa-nudge {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-2px); }
}


/* --- Buttons ---------------------------------------------------------- */
.btn-primary {
  width: 100%;
  background: var(--red);
  color: white;
  font-family: 'Archivo', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  transition: background .15s, transform .1s;
}
.btn-primary:active { background: var(--red-dark); transform: scale(.98); }
.btn-secondary {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background .15s;
}
.btn-secondary:active { background: var(--border); }
.btn-sm {
  font-size: .8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
}

/* --- Loading / empty / error states ---------------------------------- */
.state-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 14px;
  color: var(--muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  gap: 10px;
  text-align: center;
}
.state-empty .empty-icon { font-size: 2.5rem; }
.state-empty p { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.state-error {
  background: #fff0f0;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .85rem;
  color: #b91c1c;
  margin: 12px 0;
}

/* --- Toasts ----------------------------------------------------------- */
#toast-area {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 340px;
}
.toast {
  background: var(--ink);
  color: white;
  font-size: .85rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
  pointer-events: auto;
}
.toast.success { background: var(--green); }
.toast.error { background: #b91c1c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- Responsive -------------------------------------------------------- */
@media (min-width: 420px) {
  .quick-tile span { display: block; }
}
@media (min-width: 600px) {
  #bottom-nav { max-width: 600px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border: 1px solid var(--border); }
  #app { max-width: 600px; left: 50%; transform: translateX(-50%); }
  body { background: #dde3ec; }
}

/* ── Contest bump — halvknapp ovanför Kalender ─────────────────────── */

/* Tävlings-bula: separat fast element, centrerad (ovanför mittenknappen
   Kalender). z-index 99 < navbar 100 → nedre halvan göms BAKOM navbaren. */
/* HELA assemblyt (kulle + knapp) ligger BAKOM navbaren (z-index 99 < navbar 100).
   Navbaren är därför helt fri på toppen. Allt under navbarens kant göms av den,
   så bara kullen + pokalens topp sticker upp ovanför kanten — pokalen "bakas in"
   i kullen, med nederdelen gömd bakom navbaren. */
/* Overlay med pokal + text, ovanpå vågen (z över navbaren) */
.contest-overlay {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));  /* botten = navbarens kant */
  transform: translateX(-50%);
  width: 150px;
  height: 46px;
  z-index: 101;
  cursor: pointer;
}
.contest-overlay.hidden { display: none; }

.nav-wave path {
  transition: fill .22s ease;
}

.nav-wave.active path {
  fill: url(#nav-wave-active-gradient);
}

/* Pokalen i vågen — nedflyttad, med luft ovanför */
.cb-trophy {
  position: absolute;
  left: calc(50% - 1px);
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 1.25rem;
  line-height: 1;
  z-index: 1;
  pointer-events: none;
  filter:
    drop-shadow(0 0 0.5px rgba(122,74,5,.4))
    drop-shadow(0 2px 4px rgba(212,160,24,.22));
}

/* Texten vilar på navbarens kant */
.cb-label {
  position: absolute;
  left: 50%;
  bottom: 1px;
  transform: translateX(-50%);
  font-family: 'Archivo', sans-serif;
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .09em;
  z-index: 1;
  background: linear-gradient(135deg, #7a4a05 0%, #d4a018 45%, #f8de7a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 1px rgba(122,74,5,.18);
  white-space: nowrap;
  pointer-events: none;
}

.contest-overlay:active .cb-trophy { transform: translateX(-50%) scale(.92); }

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .25; }
}

/* ── Contest view ──────────────────────────────────────────────────── */
.contest-hero {
  background: linear-gradient(160deg, #1c1007 0%, #78350f 55%, #b45309 100%);
  padding: 28px 20px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contest-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 70%, rgba(251,191,36,.18) 0%, transparent 65%);
}
.contest-trophy-big {
  font-size: 3.8rem; line-height: 1; margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(251,191,36,.6));
  animation: trophy-float 3s ease-in-out infinite;
  position: relative;
}
.contest-hero h2 {
  font-family: 'Archivo', sans-serif; font-size: 1.4rem; font-weight: 900;
  color: white; line-height: 1.2; margin-bottom: 6px; position: relative;
}
.contest-hero .contest-sub { font-size: .85rem; color: rgba(255,255,255,.7); position: relative; }
.contest-countdown { display: flex; justify-content: center; gap: 10px; margin-top: 20px; position: relative; }
.countdown-unit {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px; padding: 10px 14px; text-align: center; min-width: 60px;
  backdrop-filter: blur(4px);
}
.countdown-num { font-family: 'Archivo', sans-serif; font-size: 1.6rem; font-weight: 900; color: #fbbf24; line-height: 1; display: block; }
.countdown-lbl { font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.6); margin-top: 3px; display: block; }
.contest-prize-card {
  background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 2px solid #fbbf24;
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 14px;
}
.contest-prize-icon { font-size: 2rem; flex-shrink: 0; }
.contest-prize-card h4 { font-family: 'Archivo', sans-serif; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #92400e; margin-bottom: 3px; }
.contest-prize-card p { font-size: .95rem; font-weight: 700; color: #78350f; font-family: 'Archivo', sans-serif; }
.contest-how-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 12px; }
.contest-how-card h4 { font-family: 'Archivo', sans-serif; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.contest-how-card p { font-size: .9rem; color: var(--ink-2); line-height: 1.55; }
.contest-description { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 12px; }
.contest-description h3 { font-family: 'Archivo', sans-serif; font-size: 1rem; font-weight: 800; color: var(--navy); margin: 14px 0 6px; }
.contest-description h3:first-child { margin-top: 0; }
.contest-description p { font-size: .88rem; color: var(--ink-2); line-height: 1.6; margin-bottom: 8px; }
.contest-description ul { margin: 6px 0 10px 18px; }
.contest-description li { font-size: .88rem; color: var(--ink-2); line-height: 1.55; margin-bottom: 3px; }
.contest-description strong { color: var(--ink); font-weight: 700; }
.contest-ended-banner { background: var(--bg); border-radius: var(--radius); padding: 16px; text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
@keyframes trophy-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
