/* Färgerna kommer från web/js/brand.js (sätts som CSS-variabler vid start). Värdena här är reserv. */
:root {
  --bg: #050709; --surface: #10161C; --card: #151B21; --accent: #00D9FF; --text: #FFFFFF; --muted: #AAB6C2;
  --line: rgba(170, 182, 194, 0.16);
  --radius: 14px;
  --nav-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
.muted { color: var(--muted); }
.ico { flex: none; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
#main:focus { outline: none; }

/* Skal */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.content { max-width: 920px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }

.topbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 0 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.01em; }
.coach-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent); font-weight: 600; font-size: 14px;
}
.coach-btn[hidden] { display: none; }

.page-title { font-size: 26px; font-weight: 750; margin: 20px 0 16px; }

/* Bottenmeny (mobil) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; color: var(--muted);
}
.bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* Sidomeny (dator) */
@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 24px;
    position: fixed; top: 0; bottom: 0; left: 0; width: 240px;
    padding: 24px 16px; background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar nav { display: flex; flex-direction: column; gap: 4px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
  .sidebar nav a:hover { background: var(--card); color: var(--text); }
  .sidebar nav a[aria-current="page"] { background: var(--card); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
  .sidebar nav .coach-link { margin-top: 12px; border: 1px solid var(--line); color: var(--accent); }
  .shell { padding-left: 240px; }
  .content { padding: 8px 32px 48px; }
  .topbar { display: none; }
  .bottom-nav { display: none; }
  .page-title { margin-top: 28px; }
}

/* Innehåll */
.hero { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.hero-logo { border-radius: 50%; }
.hello { font-size: 20px; font-weight: 700; }

.coach-cta {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius);
}
.coach-cta > .ico:first-child { color: var(--accent); }
.coach-cta > span { flex: 1; display: flex; flex-direction: column; }
.coach-cta .muted { font-size: 14px; }

.grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.grid .card { margin-bottom: 0; }
.card h2 { font-size: 16px; font-weight: 650; margin-bottom: 8px; }
.card p + p { margin-top: 8px; }
.empty { color: var(--muted); }
.soon { font-size: 13px; color: var(--muted); opacity: 0.8; }

.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600;
}
.btn:hover { border-color: var(--accent); }
.noscript { padding: 24px; }

/* Mina uppgifter */
.facts { margin: 12px 0; padding-left: 20px; color: var(--muted); }
.facts li + li { margin-top: 4px; }
.stored { border-top: 1px solid var(--line); padding: 10px 0; }
.stored summary { cursor: pointer; font-weight: 600; }
.stored p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.danger { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger label { display: block; color: var(--muted); font-size: 15px; }
.danger .row { display: flex; gap: 8px; margin-top: 8px; }
input {
  flex: 1; min-width: 0; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus { border-color: var(--accent); outline: none; }
button.btn { font: inherit; color: var(--text); cursor: pointer; }
.btn-danger { border-color: #ff6b6b; color: #ff6b6b; }
button:disabled { opacity: 0.5; cursor: default; }
.form-msg { margin-top: 8px; font-size: 14px; min-height: 1em; }
