/* JN Converter – stilmall (omskriven 2026-11-25) */

/* Ljust tema är standard */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f3f5f9;
  --border: #e4e8ef;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0891b2;
  --accent-strong: #0e7490;
  --on-accent: #ffffff;
  --accent-soft: rgba(8, 145, 178, 0.10);
  --accent-ink: #0e7490;
  --grad: linear-gradient(135deg, #14d4d4 0%, #0ea5e9 55%, #2563eb 100%);
  --navy: #0b1d33;
  --ok: #15803d;
  --error: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .08);
  --head-bg: rgba(255, 255, 255, .8);
  --glow: radial-gradient(60% 55% at 50% 0%, rgba(20, 212, 212, .14), transparent 70%);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #161a21;
  --surface-2: #1d222b;
  --border: #2a303b;
  --text: #e8eaee;
  --muted: #9aa3b2;
  --accent: #22c3dd;
  --accent-strong: #4dd6ea;
  --on-accent: #04141c;
  --accent-soft: rgba(34, 195, 221, 0.12);
  --accent-ink: #4dd6ea;
  --navy: #070f1c;
  --ok: #4ade80;
  --error: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .35);
  --head-bg: rgba(22, 26, 33, .85);
  --glow: radial-gradient(60% 55% at 50% 0%, rgba(34, 195, 221, .10), transparent 70%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.modal-open { overflow: hidden; }

a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Sidhuvud ---------- */
.site-head {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-head-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.01em;
  flex-shrink: 0;
}

.wordmark-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 800;
}

.site-nav { display: flex; gap: 4px; flex: 1; }

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.is-active { color: var(--text); background: var(--surface-2); }

.site-head-actions { display: flex; gap: 6px; }

.ghost-btn {
  display: inline-grid;
  place-items: center;
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ghost-btn:hover { color: var(--text); border-color: var(--muted); }

/* ---------- Sida ---------- */
.page {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
}

.notice span { flex: 1; }

.notice-close {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.notice-close:hover { color: var(--text); }

.intro { padding: 8px 0 0; }
.intro h1 { font-size: 28px; letter-spacing: -.02em; }
.intro p { color: var(--muted); margin-top: 6px; max-width: 640px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page > *, .card > * { min-width: 0; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 17px; font-weight: 650; }
.section { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.section-title { font-size: 17px; font-weight: 650; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.text-error { color: var(--error); }
.text-ok { color: var(--ok); }
.neg { color: var(--error); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.action-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.action-row.end { align-items: center; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; }

/* ---------- Formulär ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }

input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 42px;
}

textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

input[type="file"] {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}

input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* ---------- Knappar ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { background: var(--accent-strong); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-lg { min-height: 46px; padding: 0 24px; }

.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--muted); }

.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { background: transparent; color: var(--text); border-color: var(--muted); }

/* ---------- Lägesväljare ---------- */
.seg {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
}

.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }

/* ---------- Filyta ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 36px 20px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); }
.dz-icon { color: var(--accent); margin-bottom: 4px; }
.dz-title { font-weight: 600; }
.dz-sub { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

.dz-file {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

details.adv { border-top: 1px solid var(--border); padding-top: 12px; }
details.adv[open] { display: flex; flex-direction: column; gap: 14px; }

summary { cursor: pointer; font-weight: 600; color: var(--muted); }
summary:hover { color: var(--text); }

/* ---------- Status & resultat ---------- */
.status {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status.is-ok { border-color: var(--ok); }
.status.is-error { border-color: var(--error); color: var(--error); }

.progress { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.result {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.result h3 { font-size: 15px; }
.result h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.result ul { margin: 0; padding-left: 20px; }
.result-text { white-space: pre-wrap; max-height: 420px; overflow: auto; width: 100%; font-size: 14px; }

/* ---------- Länkkort ---------- */
.link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .15s;
}

.link-card:hover { border-color: var(--accent); }
.link-card strong::after { content: " →"; color: var(--accent); }
.link-card span { color: var(--muted); font-size: 14px; }

/* ---------- PDF-verktyg ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tool { gap: 10px; }
.tool h2 { font-size: 17px; }
.tool .btn { align-self: flex-start; }
.tool-wide { grid-column: 1 / -1; }
.tool-out:empty { display: none; }

/* ---------- K4 ---------- */
.steps {
  list-style: none;
  counter-reset: s;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.steps li {
  counter-increment: s;
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 14px;
}

.steps li::before {
  content: counter(s);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.steps b { color: var(--text); font-weight: 600; }

.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--surface-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td[contenteditable] { cursor: text; }
.data-table td[contenteditable]:hover { background: var(--surface-2); }
.data-table td[contenteditable]:focus { outline: none; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tfoot td { font-weight: 650; border-top: 1px solid var(--border); border-bottom: 0; background: var(--surface-2); }
.data-table .col-x { width: 40px; text-align: center; padding: 0 6px; }

.k4-table td { padding: 4px 6px; }
.k4-table td[data-k="result"], .k4-table tfoot td { padding: 9px 12px; }
.k4-table input, .k4-table select {
  min-height: 36px;
  padding: 6px 8px;
  background: transparent;
  border-color: transparent;
}
.k4-table input:hover, .k4-table select:hover { border-color: var(--border); }
.k4-table td.num input { text-align: right; font-variant-numeric: tabular-nums; min-width: 90px; }
.k4-table td:nth-child(2) input { min-width: 160px; }
.data-table .col-sec { width: 76px; }
.help-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.status ul { margin: 4px 0 0; padding-left: 18px; }

.x-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.x-btn:hover { color: var(--error); background: var(--surface-2); }

details > summary.card-title { color: var(--text); }

.raw-box {
  margin: 12px 0 0;
  padding: 14px;
  max-height: 360px;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  white-space: pre-wrap;
}

/* ---------- VHS ---------- */
.preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  max-height: 520px;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.preview img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Sidfot ---------- */
.site-foot {
  border-top: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  font-size: 13px;
  color: var(--muted);
}

.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Modaler ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 { font-size: 17px; }

.modal-x {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-x:hover { color: var(--text); }
.modal-body { padding: 20px; }
.prose h3 { font-size: 14px; margin: 16px 0 4px; }
.prose p { color: var(--muted); }

.pay-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pay-box span { font-size: 12px; color: var(--muted); font-weight: 600; }
.pay-box strong { font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------- Modernt, ljust lager ---------- */
body {
  font-size: 15.5px;
  background: var(--glow) no-repeat top center / 100% 520px, var(--bg);
}

/* Toppbar */
.topbar { background: var(--navy); color: #c9d6e6; font-size: 13px; position: relative; z-index: 30; }
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 7px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-stat { display: inline-flex; align-items: center; gap: 8px; }
.topbar-stat[hidden] { display: none !important; }
.topbar .dot { width: 4px; height: 4px; border-radius: 50%; background: #22c3dd; opacity: .8; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-actions > a { color: #c9d6e6; text-decoration: none; }
.topbar-actions > a:hover { color: #fff; }

.settings { position: relative; }
.settings-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: #e6eef7;
  font: inherit; font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.settings-btn:hover, .settings-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }

.settings-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 320px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.settings-row { display: flex; flex-direction: column; gap: 6px; }
.settings-row > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mini-seg { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.mini-seg button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 8px; border-radius: 999px; cursor: pointer;
}
.mini-seg button:hover { color: var(--text); }
.mini-seg button.is-active { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.settings-link { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.settings-link:hover { text-decoration: underline; }

/* Centrerat sidhuvud: logga överst, meny under */
.site-head {
  position: static;
  background: transparent;
  border-bottom: 0;
}
.site-head-inner {
  max-width: 960px;
  padding: 22px 24px 6px;
  flex-direction: column;
  gap: 14px;
}
.brand-logo { display: inline-flex; }
.brand-logo img { display: block; height: 76px; width: auto; }
.site-nav {
  flex: none;
  justify-content: center;
  padding: 4px;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.site-nav a { border-radius: 999px; padding: 7px 18px; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a.is-active { background: var(--grad); color: #fff; }

.page { max-width: 960px; padding: 24px 24px 64px; gap: 24px; }

.notice {
  align-self: center;
  max-width: 760px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px 8px 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  align-items: center;
}
.notice::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.intro { text-align: center; padding: 16px 0 4px; }
.intro h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; font-weight: 750; }
.intro p { margin: 10px auto 0; font-size: 16.5px; max-width: 620px; }

.card { border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card-title { font-size: 18px; letter-spacing: -.01em; }

/* Startsidans huvudkort */
.intro + .card { max-width: 860px; width: 100%; align-self: center; box-shadow: var(--shadow-lg); }
.seg { align-self: center; border-radius: 999px; padding: 4px; }
.seg-btn { border-radius: 999px; padding: 8px 20px; }
.seg-btn.is-active { background: var(--grad); color: #fff; box-shadow: none; }

.dropzone { padding: 44px 20px; border-radius: 14px; background: var(--surface-2); }
.dz-icon {
  width: 52px; height: 52px; padding: 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.dz-title { font-size: 16px; }

.btn { border-radius: 999px; padding: 0 22px; background: var(--grad); color: #fff; box-shadow: 0 2px 8px rgba(14, 165, 233, .25); }
.btn:hover { background: var(--grad); filter: brightness(1.06); }
.btn-secondary, .btn-ghost { background: var(--surface-2); color: var(--text); filter: none; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-secondary:hover { background: var(--surface-2); filter: none; }
.btn-ghost:hover { background: transparent; filter: none; }
.btn-lg { padding: 0 28px; }
.btn-secondary, .btn-ghost { box-shadow: none; }

input[type="text"], input[type="email"], input[type="number"], select, textarea { border-radius: 10px; background: var(--surface); }
input[type="file"] { border-radius: 10px; background: var(--surface-2); }

.section { max-width: 860px; width: 100%; align-self: center; }
.section-title { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.link-card { border-radius: 14px; padding: 20px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border); }
.link-card strong { font-size: 15.5px; }

.steps { max-width: 860px; width: 100%; align-self: center; }
.tool-grid { gap: 20px; }

.k4-table input:focus, .k4-table select:focus { background: var(--surface); }
.data-table th { background: var(--surface-2); }

.site-foot { background: var(--surface); }

/* ---------- Mobil ---------- */
@media (max-width: 820px) {
  .topbar-inner { padding: 6px 16px; }
  .topbar-info { display: none; }
  .topbar-actions { width: 100%; justify-content: flex-end; gap: 14px; }
  .settings-panel { width: min(320px, calc(100vw - 32px)); }
  .site-head-inner { padding: 16px 16px 4px; gap: 12px; }
  .brand-logo img { height: 52px; }
  .site-nav { max-width: 100%; overflow-x: auto; }
  .site-nav a { padding: 6px 12px; font-size: 14px; white-space: nowrap; }
  .notice { border-radius: 14px; }
  .notice::before { align-self: flex-start; margin-top: 6px; }
  .page { padding: 18px 16px 40px; }
  .link-grid, .tool-grid, .steps { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .intro h1 { font-size: 23px; }
  .card { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .seg { align-self: stretch; }
  .seg-btn { flex: 1; padding: 8px 6px; }
  .action-row > .btn { width: 100%; }
  .tool .btn { align-self: stretch; }
}

/* GIF-inställningar */
.gif-options { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }

/* Komprimeringsnivå */
.compress-seg { border-radius: 14px; padding: 4px; }
.compress-seg label { flex: 1; cursor: pointer; }
.compress-seg input { position: absolute; opacity: 0; pointer-events: none; }
.compress-seg span {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 6px; border-radius: 10px;
  font-size: 14px; font-weight: 650; color: var(--muted);
}
.compress-seg small { font-size: 11.5px; font-weight: 500; }
.compress-seg input:checked + span { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.compress-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Säkerhetsmärken i sidfoten */
.trust-badges { flex-basis: 100%; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.trust-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 8px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2);
  color: var(--text); font-weight: 600; font-size: 12.5px;
}
.trust-badge img { height: 24px; width: auto; }
.site-foot a.trust-badge:hover { text-decoration: none; border-color: var(--accent); }

/* Säkerhetssidan */
.sec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.sec-card { gap: 12px; }
.sec-card p { color: var(--muted); }
.sec-head { display: flex; align-items: center; gap: 12px; }
.sec-head img { height: 44px; width: auto; }
.sec-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); }
.sec-list a { color: var(--accent-ink); }
@media (max-width: 820px) { .sec-grid { grid-template-columns: 1fr; } }

/* Hjälpsidan */
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.help-toc a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.help-toc a:hover { border-bottom-color: currentColor; }
.help-sec { scroll-margin-top: 16px; }
.help-sec > p { margin: 0 0 8px; }
.help-sec code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.help-sec .steps { align-self: stretch; }
