:root {
  --bg: #fbfaf7;
  --fg: #142019;
  --muted: #56635c;
  --card: #fff;
  --border: #e1e5e0;
  --accent: #14523f;
  --accent-fg: #fff;
  --ok: #1f7a5e;
  --err: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101512;
    --fg: #e8ece9;
    --muted: #9aa5a0;
    --card: #182019;
    --border: #2a352f;
    --accent: #5cc39f;
    --accent-fg: #0d1512;
    --ok: #4fb596;
    --err: #f2877f;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { flex: 1; width: 100%; max-width: 40rem; margin: 0 auto; padding: 40px 16px; }
h1 { margin: 0 0 8px; font-size: 1.85rem; letter-spacing: -0.03em; line-height: 1.15; }
h2 { margin: 0 0 4px; font-size: 1.125rem; }
.lead { margin: 0 0 24px; color: var(--muted); }
[hidden] { display: none !important; }
label { display: block; margin-bottom: 4px; font-weight: 600; }
input {
  width: 100%; padding: 10px 12px; margin-bottom: 12px;
  font: inherit; color: var(--fg); background: var(--card);
  border: 1px solid var(--border); border-radius: 8px;
}
button {
  padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--accent-fg); background: var(--accent); border: 0; border-radius: 8px;
}
button:disabled { opacity: 0.6; cursor: default; }
button.link { padding: 0; color: var(--muted); background: none; font-weight: 400; text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cards { display: grid; gap: 16px; margin-bottom: 24px; }
.card { padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.status { margin: 0 0 12px; color: var(--muted); }
.status[data-state="connected"] { color: var(--ok); }
.status[data-state="error"] { color: var(--err); }
.card .status:last-child { margin-bottom: 0; }
.message { margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px; background: var(--card); }
.message.ok { border-left-color: var(--ok); }
.message.error { border-left-color: var(--err); }
.note { color: var(--muted); }
footer { padding: 16px; text-align: center; color: var(--muted); font-size: 0.875rem; }

/* Guide och förhandsvisning */
:root { --warn: #8a6100; --warn-bg: #fff4d1; --stop-bg: #fdecea; }
@media (prefers-color-scheme: dark) { :root { --warn: #f0c75e; --warn-bg: #3a3118; --stop-bg: #3b1f1d; } }
main { max-width: 52rem; }
h3 { margin: 24px 0 8px; font-size: 1rem; }
h4 { margin: 16px 0 8px; font-size: 0.9375rem; }
select {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--fg); background: var(--card);
  border: 1px solid var(--border); border-radius: 8px;
}
.field { margin-bottom: 12px; }
.field label { font-weight: 600; }
.pair { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .pair { grid-template-columns: 1fr 1fr; } }
.step { margin: 24px 0; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.step > h3:first-child { margin-top: 0; }
.hint { margin: -4px 0 12px; color: var(--muted); font-size: 0.875rem; }
.grouprow { margin-bottom: 12px; padding: 12px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px; }
.grouprow h4 { margin-top: 0; }
.grouprow.incomplete { background: var(--warn-bg); border-left-color: var(--warn); }
.row-hint { margin: 0; color: var(--warn); font-weight: 600; font-size: 0.875rem; }
.message.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.banner { padding: 10px 14px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); }
.ok-text { color: var(--ok); font-weight: 600; }
.err-text { color: var(--err); }
.errlist { padding-left: 20px; color: var(--err); }
.tablewrap { overflow-x: auto; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
td:last-child { white-space: normal; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.stop td { background: var(--stop-bg); }
tr.total td { font-weight: 700; }
#preview-run, #preview .field { max-width: 20rem; }

/* Header, status and buttons in the landing page style */
.top { border-bottom: 1px solid var(--border); background: var(--bg); }
.top-inner { display: flex; align-items: center; height: 60px; max-width: 52rem; margin: 0 auto; padding: 0 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 750; font-size: 1.1rem; letter-spacing: -0.02em; text-decoration: none; }
.mark { width: 24px; height: 24px; border-radius: 7px; background:
  linear-gradient(#fff, #fff) 5px 5px / 6px 14px no-repeat,
  linear-gradient(#7fd3b4, #7fd3b4) 13px 5px / 6px 6px no-repeat,
  linear-gradient(#fff, #fff) 13px 13px / 6px 6px no-repeat,
  #14523f; }
.card { padding: 20px; border-radius: 14px; box-shadow: 0 1px 2px rgba(20, 32, 25, 0.04); }
.cards { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.status { display: flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: none; }
.status[data-state="connected"]::before { background: var(--ok); }
.status[data-state="error"]::before { background: var(--err); }
button { border-radius: 10px; }
button:hover:not(:disabled) { filter: brightness(1.08); }
button.secondary { color: var(--fg); background: var(--card); border: 1px solid var(--border); font-weight: 600; }
button.link:hover { filter: none; color: var(--fg); }
.step, .grouprow { border-radius: 14px; }

/* Kryssrutan "Jag har granskat förslaget" */
.field.check { display: flex; align-items: center; gap: 10px; max-width: none; }
.field.check input { width: auto; margin: 0; }
.field.check label { font-weight: 400; }
