/* ============================================================
   Jaktdagboken — "Gryning i granskogen"
   Mörkt, atmosfäriskt fältdagbokstema.
   ============================================================ */

:root {
  /* Grund */
  --night:      #0d1512;
  --night-2:    #0a110e;
  --bark:       #16221d;
  --bark-2:     #1d2c25;
  --raise:      #223228;

  /* Text */
  --birch:      #ece7d8;
  --birch-dim:  #a3ac9f;
  --birch-faint:#727b71;

  /* Accenter */
  --brass:      #d6a24e;
  --brass-br:   #ecc072;
  --moss:       #86a86e;   /* offentlig / positiv */
  --frost:      #8bb0c0;   /* delbar / info */
  --rust:       #c26a44;   /* privat / fara */

  --line:       rgba(236,231,216,0.10);
  --line-2:     rgba(236,231,216,0.16);
  --shadow:     0 18px 50px -22px rgba(0,0,0,0.75);

  --f-display: "Fraunces", Georgia, serif;
  --f-body:    "Hanken Grotesk", system-ui, sans-serif;
  --f-mono:    "Space Mono", ui-monospace, monospace;

  --wrap: 1080px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--f-body);
  color: var(--birch);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(214,162,78,0.10), transparent 60%),
    radial-gradient(80% 60% at 90% 0%, rgba(139,176,192,0.06), transparent 55%),
    var(--night);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

::selection { background: rgba(214,162,78,0.28); }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(to bottom, rgba(10,17,14,0.92), rgba(10,17,14,0.55));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark { width: 34px; height: 34px; overflow: visible; }
.brand__sun { fill: var(--brass); filter: drop-shadow(0 0 8px rgba(214,162,78,0.55)); }
.brand__ridge { fill: var(--bark-2); stroke: var(--brass); stroke-width: 0.6; stroke-opacity: 0.4; }
.brand__word {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.28rem;
  letter-spacing: 0.01em;
}

.topnav { display: flex; align-items: center; gap: 8px; }

/* ---------- Knappar ---------- */

.btn {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bark);
  color: var(--birch);
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-2); background: var(--bark-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.btn--primary {
  background: linear-gradient(180deg, var(--brass-br), var(--brass));
  color: #241a08;
  border-color: transparent;
  box-shadow: 0 8px 24px -12px rgba(214,162,78,0.7);
}
.btn--primary:hover { background: linear-gradient(180deg, #f4cd83, var(--brass-br)); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: rgba(236,231,216,0.06); }

.btn--danger { color: var(--rust); border-color: rgba(194,106,68,0.4); }
.btn--danger:hover { background: rgba(194,106,68,0.12); }

.btn--sm { padding: 6px 12px; font-size: 0.82rem; }
.btn--block { width: 100%; justify-content: center; }

/* ---------- Layout ---------- */

.app { flex: 1; width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass);
}

/* Horisont-avdelare (signatur upprepad) */
.ridge-rule {
  width: 100%;
  height: 26px;
  display: block;
  opacity: 0.5;
  margin: 8px 0;
}
.ridge-rule path { fill: none; stroke: var(--line-2); stroke-width: 1.2; }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; }
.hero__scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(56px, 12vw, 130px) clamp(16px, 4vw, 40px) clamp(140px, 20vw, 220px);
}
.hero__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 18px 0 0;
  max-width: 15ch;
}
.hero__title em {
  font-style: italic;
  color: var(--brass-br);
}
.hero__lede {
  margin: 22px 0 30px;
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  color: var(--birch-dim);
  max-width: 46ch;
}
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* animerad gryningsglöd */
.sun-glow { animation: breathe 9s ease-in-out infinite; transform-origin: center; }
@keyframes breathe {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* ---------- Sektioner ---------- */

.section { padding: clamp(40px, 7vw, 84px) 0; }
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.section__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
  margin: 6px 0 0;
}
.section__sub { color: var(--birch-dim); margin: 4px 0 0; max-width: 52ch; }

/* ---------- Jaktkort (fältdagbok) ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 40%),
    var(--bark);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .16s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--bark-2), var(--night-2));
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__media--empty { display: grid; place-items: center; }
.card__media--empty .ridge-mini { width: 60%; opacity: 0.35; }

.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card__date {
  font-family: var(--f-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--brass);
}
.card__place {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}
.card__meta {
  font-size: 0.86rem;
  color: var(--birch-dim);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.card__meta .dot { color: var(--birch-faint); }
.card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
}

/* Observationsbrickor (mässing) */
.coins { display: flex; flex-wrap: wrap; gap: 6px; }
.coin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: rgba(214,162,78,0.08);
  border: 1px solid rgba(214,162,78,0.28);
}
.coin__face {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.14), rgba(0,0,0,0.25));
}
.coin__n { font-family: var(--f-mono); font-size: 0.78rem; font-weight: 700; color: var(--brass-br); }
.coin__label { font-size: 0.8rem; color: var(--birch-dim); }

/* Synlighets-sigill */
.seal {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.seal::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.seal--private { color: var(--rust); }
.seal--shared  { color: var(--frost); }
.seal--public  { color: var(--moss); }

/* ---------- Formulär ---------- */

.panel {
  background: var(--bark);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 34px);
}
.panel + .panel { margin-top: 20px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field > label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--birch-dim);
  letter-spacing: 0.01em;
}
.field .hint { font-size: 0.76rem; color: var(--birch-faint); }

input, select, textarea {
  font-family: var(--f-body);
  font-size: 0.98rem;
  color: var(--birch);
  background: var(--night-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 11px 13px;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(214,162,78,0.18);
}
input::placeholder, textarea::placeholder { color: var(--birch-faint); }
select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--birch-dim) 50%),
  linear-gradient(135deg, var(--birch-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.form-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0 0 4px;
}
.form-section-label {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 14px;
}

/* Artväljare */
.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.species {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--night-2);
  transition: border-color .15s ease, background .15s ease;
}
.species[data-active="1"] { border-color: rgba(214,162,78,0.55); background: rgba(214,162,78,0.06); }
.species__emoji {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  font-size: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.14), rgba(0,0,0,0.3));
}
.species__name { flex: 1; font-size: 0.9rem; }
.stepper { display: flex; align-items: center; gap: 2px; flex: 1; }
.stepper button {
  width: 26px; height: 26px; flex: none;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--bark-2);
  color: var(--birch);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
}
.stepper button:hover { border-color: var(--brass); color: var(--brass-br); }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper .count { font-family: var(--f-mono); font-weight: 700; min-width: 22px; text-align: center; flex: none; }

/* Synlighetsval */
.vis-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.vis {
  cursor: pointer;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 14px;
  background: var(--night-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.vis:hover { transform: translateY(-2px); }
.vis input { position: absolute; opacity: 0; pointer-events: none; }
.vis__title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.vis__desc { font-size: 0.8rem; color: var(--birch-dim); }
.vis[data-checked="1"][data-kind="private"] { border-color: var(--rust); background: rgba(194,106,68,0.08); }
.vis[data-checked="1"][data-kind="shared"]  { border-color: var(--frost); background: rgba(139,176,192,0.08); }
.vis[data-checked="1"][data-kind="public"]  { border-color: var(--moss); background: rgba(134,168,110,0.08); }
.vis__dot { width: 9px; height: 9px; border-radius: 50%; }
.vis[data-kind="private"] .vis__dot { background: var(--rust); }
.vis[data-kind="shared"]  .vis__dot { background: var(--frost); }
.vis[data-kind="public"]  .vis__dot { background: var(--moss); }

/* Filuppladdning / förhandsvisning */
.dropzone {
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  color: var(--birch-dim);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone[data-drag="1"] { border-color: var(--brass); background: rgba(214,162,78,0.05); color: var(--birch); }
.dropzone strong { color: var(--brass-br); }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 14px; }
.preview { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(10,17,14,0.82); color: var(--birch);
  cursor: pointer; font-size: 0.9rem; line-height: 1; display: grid; place-items: center;
}
.preview button:hover { background: var(--rust); }

/* ---------- Detaljvy ---------- */

.detail-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.detail-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--birch-dim); }
.detail-meta .mono { font-family: var(--f-mono); font-size: 0.85rem; color: var(--brass); }

.detail-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; margin-top: 26px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery a { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.gallery a:hover img { transform: scale(1.04); }

.diary-text {
  font-family: var(--f-display);
  font-size: 1.12rem;
  line-height: 1.75;
  white-space: pre-wrap;
  color: #e6e1d2;
}
.diary-text.empty { font-style: italic; color: var(--birch-faint); }

.sidecard { position: sticky; top: 84px; }
.datarow { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.datarow:last-child { border-bottom: none; }
.datarow dt { color: var(--birch-dim); font-size: 0.86rem; }
.datarow dd { margin: 0; text-align: right; font-weight: 500; }

.obs-large { display: flex; flex-direction: column; gap: 8px; }
.obs-large .coin { padding: 6px 12px 6px 6px; }
.obs-large .coin__face { width: 26px; height: 26px; font-size: 15px; }

/* Delningsruta */
.share-box { display: flex; gap: 8px; margin-top: 10px; }
.share-box input { font-family: var(--f-mono); font-size: 0.78rem; }

/* ---------- Auth ---------- */

.auth-wrap { max-width: 420px; margin: clamp(40px, 9vw, 96px) auto; padding: 0 20px; }
.auth-card { background: var(--bark); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 5vw, 38px); box-shadow: var(--shadow); }
.auth-title { font-family: var(--f-display); font-weight: 500; font-size: 1.7rem; margin: 6px 0 4px; }
.auth-sub { color: var(--birch-dim); margin: 0 0 22px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--birch-dim); font-size: 0.9rem; }
.auth-switch button { background: none; border: none; color: var(--brass-br); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.auth-link { color: var(--brass-br); font-size: 0.85rem; text-decoration: none; }
.auth-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.code-input {
  text-align: center;
  letter-spacing: 0.5em;
  font-family: var(--f-mono);
  font-size: 1.5rem;
  font-weight: 700;
  padding: 14px;
  text-indent: 0.5em;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: clamp(40px, 9vw, 90px) 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--birch-dim);
}
.empty h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.5rem; color: var(--birch); margin: 0 0 8px; }

/* ---------- Statistik / översikt ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 45%), var(--bark);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat__num {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1;
  color: var(--birch);
  letter-spacing: -0.01em;
}
.stat__num .unit { font-size: 0.9rem; color: var(--birch-dim); font-family: var(--f-body); margin-left: 4px; }
.stat__label {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
}
.stat__sub { font-size: 0.8rem; color: var(--birch-faint); }

.stat-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }

.chart-panel { background: var(--bark); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.chart-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.2rem;
  margin: 0 0 2px;
}
.chart-note { font-size: 0.8rem; color: var(--birch-faint); margin: 0 0 18px; }

/* Horisontella staplar (magnitud, en färgton) */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-key { width: 128px; flex: none; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.bar-key .coin__face { width: 22px; height: 22px; font-size: 13px; flex: none; }
.bar-key span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 22px; background: rgba(236,231,216,0.06); border-radius: 7px; overflow: hidden; }
.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #b9822f, var(--brass-br));
  border-radius: 7px;
  transition: width .7s cubic-bezier(.2,.8,.2,1);
}
.bar-val { flex: none; width: 40px; text-align: right; font-family: var(--f-mono); font-weight: 700; font-size: 0.9rem; color: var(--brass-br); }

/* Kolumndiagram (aktivitet över tid) */
.cols {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 150px;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 0;
}
.col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.col__bar {
  width: 66%;
  max-width: 30px;
  height: 0;
  min-height: 3px;
  background: linear-gradient(180deg, var(--brass-br), #b9822f);
  border-radius: 6px 6px 0 0;
  transition: height .7s cubic-bezier(.2,.8,.2,1);
}
.col__bar[data-zero="1"] { background: rgba(236,231,216,0.09); }
.col__cap { font-family: var(--f-mono); font-size: 0.7rem; font-weight: 700; color: var(--brass-br); height: 12px; }
.cols-x { display: flex; gap: 6px; margin-top: 8px; }
.cols-x span { flex: 1; text-align: center; font-family: var(--f-mono); font-size: 0.64rem; color: var(--birch-faint); text-transform: uppercase; letter-spacing: 0.04em; min-width: 0; overflow: hidden; }
.cols-x span.year-mark { color: var(--brass); }

/* Synlighet – tre figurer, text bär identiteten (ej färgkodat fält) */
.vis-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.vis-fig { border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: var(--night-2); }
.vis-fig__n { font-family: var(--f-display); font-weight: 500; font-size: 1.7rem; line-height: 1; }
.vis-fig .seal { margin-top: 10px; }

.stat-list { display: flex; flex-direction: column; }
.stat-list .datarow dd { font-family: var(--f-mono); color: var(--brass-br); }

@media (max-width: 780px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat-cols { grid-template-columns: 1fr; }
  .bar-key { width: 108px; }
}

/* ---------- Admin-tabell ---------- */

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 520px; }
.tbl th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 400;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(236,231,216,0.03); }
.tbl .num { font-family: var(--f-mono); }
.tbl .btn { margin-left: 6px; }
.badge-admin {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-br);
  border: 1px solid rgba(214,162,78,0.45);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ---------- Raderingslogg ---------- */

.log-list { display: flex; flex-direction: column; }
.log-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.log-item:last-child { border-bottom: none; }
.log-time {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--birch-dim);
  white-space: nowrap;
  flex: none;
  width: 104px;
}
.log-tag {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  flex: none;
}
.log-tag--hunt { color: var(--frost); }
.log-tag--user { color: var(--rust); }
.log-msg { flex: 1; min-width: 220px; color: var(--birch); }
.log-ip { font-family: var(--f-mono); font-size: 0.72rem; color: var(--birch-faint); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--raise);
  border: 1px solid var(--line-2);
  color: var(--birch);
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  max-width: 90vw;
  font-size: 0.92rem;
}
.toast[data-show="1"] { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="error"] { border-color: rgba(194,106,68,0.6); }
.toast[data-kind="ok"] { border-color: rgba(134,168,110,0.5); }

/* ---------- Modal (lightbox) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6,10,8,0.9);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade .2s ease;
}
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: var(--shadow); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 22px clamp(16px, 4vw, 40px);
  color: var(--birch-faint);
  font-size: 0.85rem;
  display: flex; gap: 10px; align-items: center;
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}
.foot__sep { opacity: 0.5; }
.foot a { color: var(--brass); text-decoration: none; border-bottom: 1px solid var(--brass); }
.foot a:hover { color: var(--brass-br); border-bottom-color: var(--brass-br); }

/* ---------- Autocomplete ---------- */
.autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: var(--bark-2); border: 1px solid var(--line-2); border-top: none; border-radius: 0 0 8px 8px; max-height: 200px; overflow-y: auto; z-index: 10; }
.autocomplete-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); font-size: 0.95rem; color: var(--birch); }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--line-2); }

/* ---------- Skelett/laddning ---------- */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--brass); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { display: grid; place-items: center; padding: 80px 0; gap: 14px; color: var(--birch-dim); }

/* ---------- Responsivt ---------- */
@media (max-width: 780px) {
  .form-grid { grid-template-columns: 1fr; }
  .vis-choices { grid-template-columns: 1fr; }
  .detail-cols { grid-template-columns: 1fr; }
  .sidecard { position: static; }
  .brand__word { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto; }
  .card:hover, .btn:hover, .vis:hover { transform: none; }
}

/* Karta: län och orter */
.county-list { display: flex; flex-direction: column; gap: 12px; }
.county-item {
  padding: 12px;
  background: var(--bark);
  border: 1px solid var(--line-2);
  border-radius: 8px;
}
.county-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 8px;
}
.county-name { font-weight: 500; }
.county-count { font-size: 0.85rem; color: var(--birch-dim); white-space: nowrap; }
.county-cities { display: flex; gap: 6px; flex-wrap: wrap; }
.city-tag {
  padding: 2px 8px;
  background: var(--bark-2);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--birch-dim);
}
