/* ─────────────────────────────────────────────────────────────────
   kortkoll — komponenter för publika sajten
   panel · chip · pill · statistik · prisrad · telefonram · uppslag
   kortbricka · setknapp · filterrad
   ───────────────────────────────────────────────────────────────── */

/* ─── Panel (grundkortet) ────────────────────────────────────── */
.panel {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radie-stor);
  box-shadow: var(--panel-inset), var(--shadow);
  padding: clamp(20px, 3vw, 32px);
}
.panel-infalld {
  background: var(--raise);
  border: 1px solid var(--line-soft);
  border-radius: var(--radie);
  padding: 16px 18px;
}

/* kortgrid för features/världar */
.kortgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(14px, 2vw, 24px); }
.kortgrid .panel h3 { font-family: var(--display); font-weight: 400; font-size: 21px; margin: 14px 0 6px; }
.kortgrid .panel p  { color: var(--ink-2); font-size: 15px; }

/* ikonbricka i hörnet av ett kort */
.ikonbricka {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--raise);
  border: 1px solid var(--line-soft);
  color: var(--accent);
}

/* ─── Chips & badges ─────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; text-transform: lowercase;
  color: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radie-pill);
  padding: 8px 16px;
  background: var(--paper);
}
.chip .prick { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }
.chip.vald { border-color: var(--accent); color: var(--ink); background: var(--slime-bg); }

/* typprick — energityp som innehållsfärg, aldrig tillstånd */
.typprick { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ─── CTA-pill (glansig) ─────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-weight: 700; font-size: 16px;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-mjuk), var(--accent) 45%, var(--accent-d));
  border-radius: var(--radie-pill);
  padding: 14px 28px;
  box-shadow: inset 0 1px rgba(255,255,255,0.55), inset 0 -6px 12px rgba(0,0,0,0.12), var(--glow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.pill:hover  { transform: translateY(-1px); }
.pill:active { transform: translateY(0); box-shadow: inset 0 1px rgba(255,255,255,0.4), var(--glow); }
.pill.spok {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  box-shadow: var(--panel-inset), var(--shadow);
}

/* ─── Fältrad (inmatning + knapp) ────────────────────────────── */
.faltrad {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radie-pill);
  padding: 8px 8px 8px 24px;
  box-shadow: var(--panel-inset), var(--shadow);
  max-width: 560px;
}
.faltrad input {
  flex: 1; min-width: 0;
  font: inherit; color: var(--ink);
  background: none; border: 0; outline: none;
}
.faltrad input::placeholder { color: var(--ink-3); }

/* ─── Statistikwidget ────────────────────────────────────────── */
.statkort {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radie);
  padding: 14px 18px;
  box-shadow: var(--panel-inset), var(--shadow);
  width: max-content;
}
.statkort .etikett { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.statkort .varde   { font-family: var(--mono); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.statkort .varde .prick { color: var(--accent); }
.statkort .trend   { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }

/* mini-staplar */
.stapelrad { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; font-family: var(--mono); font-size: 12px; }
.stapelrad .spar { height: 8px; border-radius: 4px; background: var(--raise); overflow: hidden; }
.stapelrad .fyll { height: 100%; border-radius: 4px; background: var(--accent); }

/* ─── Prisrad (butiksjämförelse) ─────────────────────────────── */
.prisrad {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.prisrad:last-child { border-bottom: 0; }
.prisrad .butik  { display: flex; align-items: center; gap: 10px; }
.prisrad .butik .logga { width: 22px; height: 22px; border-radius: 6px; background: var(--raise); }
.prisrad .lager  { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.prisrad .lager.i-lager { color: var(--ok); }
.prisrad .pris   { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.prisrad .pris .enhet { font-weight: 400; font-size: 11px; color: var(--ink-3); }

/* ─── Kortbricka — ett kort i ett rutnät ─────────────────────── */
.kortbricka {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--panel-inset), var(--shadow);
  transition: transform .12s ease;
}
.kortbricka:hover { transform: translateY(-2px); }
.kortbricka .bild {
  aspect-ratio: 63 / 88;
  border-radius: 8px;
  overflow: hidden;
  background: var(--raise);
}
.kortbricka .bild img { width: 100%; height: 100%; object-fit: cover; }
.kortbricka .namn { font-size: 13px; font-weight: 600; line-height: 1.2; }
.kortbricka .rad  { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kortbricka .kod  { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.kortbricka .pris { font-family: var(--mono); font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kortbricka.agd    { border-color: var(--accent); }
.kortbricka.agd .bild::after { content: none; }
.kortbricka.saknad .bild img { filter: grayscale(1) brightness(.55); }
/* typfärgad platta när bild saknas */
.kortbricka .bild.typplatta { display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: rgba(0,0,0,.55); }

/* rutnät för kortbrickor */
.kortnat { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }

/* ─── Setknapp — symbol + namn + hur långt du kommit ─────────── */
.setknapp {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radie);
  padding: 12px 16px;
  box-shadow: var(--panel-inset), var(--shadow);
  text-align: left;
  width: 100%;
  transition: border-color .12s ease;
}
.setknapp:hover { border-color: var(--line); }
.setknapp.vald  { border-color: var(--accent); background: var(--slime-bg); }
.setknapp .symbol { width: 30px; height: 30px; border-radius: 8px; background: var(--raise); display: grid; place-items: center; font-family: var(--mono); font-size: 9px; color: var(--ink-3); }
.setknapp .symbol img { width: 22px; height: 22px; object-fit: contain; }
.setknapp .namn   { font-size: 14px; font-weight: 600; }
.setknapp .kod    { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.setknapp .langd  { font-family: var(--mono); font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.setknapp .ny     { font-family: var(--mono); font-size: 9px; color: var(--accent); margin-left: 6px; }

/* ─── Filterrad — klistrad, sidledsdragbar på telefon ────────── */
.filterrad {
  display: flex; gap: 8px; align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 10px;
  -webkit-overflow-scrolling: touch;
}
.filterrad::-webkit-scrollbar { display: none; }
.filterrad .chip { flex-shrink: 0; }
.filterrad .antal { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: auto; flex-shrink: 0; }

/* ─── Telefonram (mockup i ren CSS — aldrig skärmbilder) ─────── */
.telefon {
  width: min(360px, 88vw);
  aspect-ratio: 9 / 19;
  border-radius: 44px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  box-shadow: var(--panel-inset), var(--shadow), 0 30px 60px -30px rgba(9,3,17,0.8);
  padding: 14px;
  position: relative;
}
.telefon::before {
  content: "";
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 34%; height: 22px; border-radius: 12px;
  background: var(--ground);
}
.telefon .skarm {
  width: 100%; height: 100%;
  border-radius: 32px;
  background: var(--ground);
  overflow: hidden;
  padding: 44px 14px 14px;
  display: flex; flex-direction: column; gap: 10px;
}

/* ─── Pärmuppslag (två sidor, 3×3 fickor) ────────────────────── */
.uppslag { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.parmsida {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: var(--raise);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 8px;
}
.ficka {
  aspect-ratio: 63 / 88;               /* riktiga kortproportioner */
  border-radius: 5px;
  background: var(--raise-2);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.ficka img { width: 100%; height: 100%; object-fit: cover; }
.ficka.agd    { background: linear-gradient(160deg, var(--purple), var(--raise-2)); border-color: transparent; }
.ficka.saknad { opacity: .55; }
.ficka.saknad img { filter: grayscale(1) brightness(.6); }
.ficka.saknad:not(:has(img)) { background: repeating-linear-gradient(45deg, var(--raise), var(--raise) 4px, var(--raise-2) 4px, var(--raise-2) 8px); }
.ficka.tom    { background: none; border: 1.5px dashed var(--ink-4); }
.ficka.hjalte { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Header/nav för landningssidan ──────────────────────────── */
.topp {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 18px;
}
.topp .marke { font-family: var(--display); font-weight: 400; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.topp .marke .prick { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }
.topp nav { display: flex; gap: clamp(12px, 3vw, 32px); }
.topp nav a { font-family: var(--mono); font-size: 13px; text-transform: lowercase; text-decoration: none; color: var(--ink-2); }
.topp nav a:hover { color: var(--ink); }
@media (max-width: 640px) { .topp nav { display: none; } }
/* På en telefon radbröt "öppna appen →" mitt i pillen och fältradens platshållare
   sprang in under knappen. Båda är trängsel, inte design. */
@media (max-width: 560px) {
  .topp { padding-block: 12px; }
  .topp .marke { font-size: 19px; }
  .topp .pill { white-space: nowrap; padding: 9px 16px !important; font-size: 13px !important; }
  .topp .chip { padding: 7px 11px; }
  .faltrad { padding-left: 16px; }
  .faltrad input { font-size: 14px; }
  .faltrad .pill { white-space: nowrap; padding: 11px 18px !important; font-size: 14px !important; }
}
