/* AppWrapper designsystem — delas av alla sidor. */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-2: #64b5f6;
  --border: #d2d2d7;
  --ok: #34c759;
  --ok-bg: #e4f6e8;
  --ok-text: #1e7b34;
  --warn: #ff9f0a;
  --warn-bg: #fff3e0;
  --warn-text: #9a5b00;
  --err: #ff3b30;
  --err-bg: #fde8e7;
  --err-text: #b3261e;
  --code-bg: #f0f0f2;
  --ink: #1d1d1f;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 10px 30px rgba(0,0,0,.05);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 72px;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Toppmeny ---- */
nav.aw {
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  max-width: 780px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 4px; height: 54px;
  overflow-x: auto; scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.brand { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; margin-right: 10px; white-space: nowrap; }
.brand a { color: var(--text); }
.brand a:hover { text-decoration: none; }
.navlink {
  font-size: 14px; padding: 6px 13px; border-radius: 999px;
  color: var(--muted); white-space: nowrap; transition: background .15s;
}
.navlink:hover { background: var(--bg); text-decoration: none; }
.navlink.active { background: var(--ink); color: #fff; }

/* ---- Layout ---- */
main.aw { max-width: 780px; margin: 0 auto; padding: 30px 16px 0; }
main.aw.wide { max-width: 880px; }
h1 { font-size: clamp(24px, 5vw, 30px); font-weight: 700; letter-spacing: -0.02em; }
.sub { color: var(--muted); font-size: 14.5px; margin: 6px 0 22px; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.note { color: var(--muted); font-size: 13.5px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
@media (max-width: 480px) { .card { padding: 18px 16px; } }

/* ---- Knappar ---- */
button, .btn {
  font-family: inherit;
  font-size: 14px; font-weight: 500; padding: 10px 16px; border: none;
  border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer;
  display: inline-block; text-align: center; transition: filter .15s, transform .05s;
}
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; }
button:active, .btn:active { transform: scale(.985); }
button.secondary, .btn.secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
button.danger { background: transparent; color: var(--err); border: 1px solid var(--border); }
button:disabled { opacity: .5; cursor: default; }

/* ---- Formulär ---- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 16px 0 6px; }
input[type="text"], input[type="url"], input[type="password"], input[type="email"], select, textarea {
  width: 100%; font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text); font-family: inherit;
}
input::placeholder, textarea::placeholder { color: #b6b6bb; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,.15);
}
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type="color"] {
  width: 44px; height: 40px; padding: 0; border: 1px solid var(--border);
  border-radius: 10px; background: none; cursor: pointer; flex-shrink: 0;
}
.color-row input[type="text"] { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.form-section { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 16px; }
.form-section:first-of-type { border-top: none; margin-top: 8px; padding-top: 0; }
.form-section h3 { font-size: 14px; font-weight: 600; }
.form-section .hint { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---- Tooltips ---- */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--border); color: var(--card);
  font-size: 11px; font-weight: 700; cursor: help;
  position: relative; vertical-align: 1px; margin-left: 5px;
}
.tip::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 400; line-height: 1.5;
  padding: 8px 12px; border-radius: 10px; width: 240px; text-align: left;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 60;
}
.tip:hover::after, .tip:focus::after { opacity: 1; }
@media (max-width: 600px) { .tip::after { width: 190px; } }

/* ---- Badges ---- */
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.badge {
  font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.badge.err { background: var(--err-bg); color: var(--err-text); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }

/* ---- Tabeller ---- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }

/* ---- Kod ---- */
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em;
  background: var(--code-bg); border-radius: 6px; padding: 2px 6px;
}
pre {
  background: var(--ink); color: #f5f5f7; border-radius: 12px;
  padding: 14px 16px; overflow-x: auto; margin: 10px 0 18px;
  font-size: 13px; line-height: 1.55;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ---- Statistik-komponenter ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.tile { background: var(--bg); border-radius: 12px; padding: 14px; text-align: center; }
.tile .num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.tile .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bar { background: #e8e8ed; border-radius: 4px; height: 8px; overflow: hidden; min-width: 60px; }
.bar > div { background: var(--accent); height: 100%; }

/* ---- Guide-steg ---- */
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.step-num.done { background: var(--ok); }
ul.aw { margin: 6px 0 6px 20px; font-size: 14.5px; }
ul.aw li { margin: 4px 0; }

/* ---- Diverse ---- */
.ok-text { color: var(--ok); }
.err-text { color: var(--err); }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 28px 0; }
.hidden { display: none; }
.swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  vertical-align: -1px; margin-right: 4px; border: 1px solid rgba(0,0,0,.15);
}
