/* Toppfältet, navigeringen, pomodoro-timern och volymen. */
/* ---------- Toppfält ---------- */
.topbar { position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); border-bottom: 2px solid var(--line); background: var(--bg); }
.topbar-inner { display: flex; align-items: center; gap: 12px; max-width: 1080px; height: var(--topbar-h); margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.course-chip { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px 0 6px; border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 3px 0 var(--line); color: var(--ink-strong); font-size: 15px; font-weight: 900; letter-spacing: 0.02em; text-decoration: none; transition: transform 70ms, box-shadow 70ms; }
.course-chip:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
@media (hover: hover) { .course-chip:hover { background: var(--soft); } }
.course-chip > .icon { width: 14px; height: 14px; color: var(--faint); }
.course-chip-badge { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--tone); color: var(--tone-text); }
.course-chip-badge .icon { width: 18px; height: 18px; }
.brand { display: flex; flex: none; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 38px; border-radius: 12px; background: var(--green); box-shadow: 0 3px 0 var(--primary-shadow); color: #ffffff; }
.brand-mark .icon { width: 24px; height: 24px; }
.brand-text { display: grid; line-height: 1.1; }
.brand-text strong { color: var(--primary); font-size: 21px; font-weight: 900; letter-spacing: -0.01em; }
.brand-text small { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.05em; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .brand-text strong { color: var(--green); } }
.topbar-stats { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.stat { display: inline-flex; align-items: center; gap: 6px; padding: 8px 6px; border-radius: 12px; color: var(--ink); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .icon { width: 26px; height: 26px; color: var(--faint); }
.stat--streak.is-active .icon { color: var(--orange); }
.stat--xp .icon { color: var(--gold); }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--muted); }
@media (hover: hover) { .icon-btn:hover { background: var(--soft); } }
.icon-btn .icon { width: 26px; height: 26px; }

/* ---------- Navigering ---------- */
.topnav { display: flex; gap: 4px; margin-left: 4px; }
.topnav-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 2px solid transparent; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 800; letter-spacing: 0.06em; text-decoration: none; text-transform: uppercase; }
.topnav-link .icon { width: 22px; height: 22px; }
@media (hover: hover) { .topnav-link:hover { background: var(--soft); } }
.topnav-link[aria-current="page"] { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-ink); }
.bottom-nav { display: none; }
.bottom-link { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 2px solid transparent; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-decoration: none; text-transform: uppercase; }
.bottom-link .icon { width: 26px; height: 26px; }
.bottom-link[aria-current="page"] { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-ink); }
.bottom-link.is-disabled { opacity: 0.45; }
.bottom-badge { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--red-face); color: #ffffff; font-size: 11px; line-height: 20px; text-align: center; }

/* ---------- Pomodoro och ljud ---------- */
.pomo-wrap { position: relative; flex: none; }
.pomo { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .pomo:not(.is-running):hover { background: var(--soft); } }
.pomo .icon { width: 22px; height: 22px; color: var(--red-face); }
.pomo--break .icon, .pomo--long .icon { color: var(--green); }
.pomo.is-running { border-color: var(--red-line); background: var(--red-soft); color: var(--red-ink); }
.pomo--break.is-running, .pomo--long.is-running { border-color: var(--green-line); background: var(--green-soft); color: var(--green-ink); }
.pomo-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 50; width: 268px; padding: 16px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18); text-align: center; animation: pop-in 140ms ease-out; }
.pomo-mode { color: var(--muted); font-size: 13px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.pomo-big { margin: 2px 0 12px; color: var(--ink-strong); font-size: 44px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pomo-actions { display: grid; gap: 8px; }
.pomo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pomo-row .btn { padding: 0 6px; font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; }
.pomo-count { margin-top: 12px; color: var(--ink); font-size: 14px; font-weight: 800; }
.pomo-hint { margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 700; }
.volume { position: relative; display: flex; flex: none; align-items: center; }
.volume-btn { color: var(--muted); }
.volume-btn[aria-pressed="true"] { color: var(--faint); }
.volume-pop {
  position: absolute;
  top: 50%;
  right: calc(100% - 6px);
  z-index: 5;
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 12px 0 16px;
  border: 2px solid var(--line);
  border-radius: 99px;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transform: translate(10px, -50%);
  transition: opacity 150ms, transform 150ms;
}
.volume:is(:hover, :focus-within, .is-open) .volume-pop { opacity: 1; pointer-events: auto; transform: translate(0, -50%); }
.volume--inline { flex-direction: row-reverse; justify-content: flex-end; gap: 10px; }
.volume--inline .volume-pop, .volume--inline:is(:hover, :focus-within) .volume-pop { position: static; height: auto; padding: 0; border: 0; background: none; opacity: 1; pointer-events: auto; transform: none; }
.volume-slider {
  width: 120px;
  height: 6px;
  margin: 0;
  border-radius: 99px;
  background: linear-gradient(to right, var(--blue-face) var(--fill, 80%), var(--line-strong) var(--fill, 80%));
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.volume-slider::-webkit-slider-thumb { width: 16px; height: 16px; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 2px var(--blue-face), 0 1px 3px rgba(0, 0, 0, 0.3); -webkit-appearance: none; }
.volume-slider::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 2px var(--blue-face), 0 1px 3px rgba(0, 0, 0, 0.3); }
.volume-slider:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; }
