/* ==========================================================================
   "Instrument Panel" design tokens — a cool gunmetal neutral (not
   Tailwind's slate) with a radar/altimeter cyan-teal accent, chosen
   specifically to NOT be the generic blue-600-on-slate look every
   unstyled Tailwind admin template ships with. Warning stays a distinct
   warm amber so it never reads as "just the accent color" — semantic
   color and brand accent are deliberately different hues, not shades of
   the same one. Typography: IBM Plex Sans for UI text, IBM Plex Mono
   (tabular numerals) for every number this app shows — prices, percents,
   times, coordinates — reinforcing the instrument-panel idea instead of
   just being a font choice for its own sake. See index.html/dash.html
   etc. for the actual Google Fonts <link> that loads these.
   ========================================================================== */
:root {
  --cell: 140px;
  --bg-base: #0A0F14; --bg-surface: #131A21; --bg-empty: #0D1319;
  --border: #232E38; --text-primary: #E6EDF2; --text-secondary: #7E8FA0;
  --accent: #3B82F6; --positive: #43C97A; --positive-bg: #0C2A1E;
  --negative: #F0585E; --negative-bg: #2B1113;
  --warning: #F2B33D; --warning-bg: #2E2308;
  --font-sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Text color for anything painted directly ON --accent. Both the light
     and dark "Spedi blue" values below sit dark/saturated enough that
     white reads fine on either — unlike the earlier teal experiment,
     where dark mode's bright accent needed a dark ink instead. Kept as
     its own token rather than hardcoding #fff again so a future accent
     swap can't silently reintroduce that same contrast bug. */
  --accent-ink: #FFFFFF;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.24), 0 1px 1px rgba(0,0,0,.16);
  --shadow-md: 0 6px 16px rgba(0,0,0,.32), 0 2px 6px rgba(0,0,0,.20);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.44), 0 4px 10px rgba(0,0,0,.24);
  --ease: cubic-bezier(.4,0,.2,1);
}
html.light {
  --bg-base: #EEF1F3; --bg-surface: #FFFFFF; --bg-empty: #E4E9EC;
  --border: #C7D0D6; --text-primary: #101820; --text-secondary: #55636D;
  --accent: #2563EB; --positive: #1E8A4C; --positive-bg: #E3F5EC;
  --negative: #C4242E; --negative-bg: #FBE4E4;
  --warning: #A8650A; --warning-bg: #FBF0DA;
  --accent-ink: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(15,23,32,.06), 0 1px 1px rgba(15,23,32,.04);
  --shadow-md: 0 6px 16px rgba(15,23,32,.08), 0 2px 6px rgba(15,23,32,.05);
  --shadow-lg: 0 16px 40px rgba(15,23,32,.14), 0 4px 10px rgba(15,23,32,.07);
}
* { transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease; }

/* Global interactive-element baseline — one place instead of retrofitting
   every one of the ~20 button classes across the app individually. Every
   button gets a press animation and a smooth shadow transition for free;
   every select gets a themed custom arrow instead of the raw OS control;
   every focusable element gets a real focus ring instead of relying on
   whatever the browser's default happens to look like (inconsistent
   across Chrome/Firefox/Safari, and often invisible against a dark
   surface). */
button, select, input, textarea { font-family: inherit; }
button { transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease), filter .15s var(--ease); }
button:active:not(:disabled) { transform: scale(.96); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%237B8A96" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,9 12,15 18,9"/></svg>');
  background-repeat: no-repeat; background-position: right 8px center; background-size: 13px;
  padding-right: 26px !important;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
select:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Skeleton loading — replaces plain "Laddar…" text with a shape that
   previews the content about to arrive (a value line, a couple of text
   rows), same idea as any modern loading state: less jarring than text
   popping in, and it reads as "this widget is doing something" instead
   of "this widget is currently broken/empty." */
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-empty) 25%, var(--border) 50%, var(--bg-empty) 75%);
  background-size: 250% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton-line { height: 26px; width: 100%; }
.skeleton-text { height: 11px; width: 75%; margin-top: 8px; }
.skeleton-text.short { width: 45%; }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  margin: 0;
  height: 100%;
  /* Defensive, not decorative — if any element anywhere ever renders
     wider than the viewport, this is what stops mobile browsers from
     computing a zoomed-out initial scale to fit it (the actual bug
     reported: pages appearing permanently shrunk on a phone). */
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
/* App shell: header + collapsible sidebar + main content area. The
   sidebar lists apps — Dashboard is the only one today, but this is the shell
   any future app page reuses; a new app just adds a .sidebar-item plus
   its own <main> content.

   touch-action:none lives HERE, not on html/body — it disables native
   touch scrolling/pinch-zoom, which the dashboard's drag-to-move-widgets
   and Load Builder's 3D canvas both need so a touch-drag isn't fought by
   the browser's own pan/zoom gestures. Previously on html/body, it was
   silently applied to every page including the public landing/blog/login
   pages too, breaking normal touch scrolling there for no reason — those
   have no custom drag interactions to protect. */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; touch-action: none; }

.app-header {
  flex-shrink: 0; height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.15); position: relative; z-index: 1100;
}
.app-header-left { display: flex; align-items: center; gap: 12px; }
.app-header-right { display: flex; align-items: center; gap: 10px; }

.sidebar-toggle {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg-empty); border: 1px solid var(--border); color: var(--text-primary);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.sidebar-toggle:hover { border-color: var(--accent); color: var(--accent); }

.app-logo { display: flex; align-items: center; gap: 6px; }

/* Two logo files — logo.png (black wordmark) for the light theme,
   logo-dark.png (white wordmark) for the dark theme. Only one is ever
   shown; toggled by the html.light class theme.js already applies. */
.logo-for-light { display: none; }
html.light .logo-for-dark { display: none; }
html.light .logo-for-light { display: inline-block; }

.app-logo-img { height: 26px; width: auto; }
.login-logo-img { height: 34px; width: auto; }

.app-body { flex: 1; display: flex; min-height: 0; }

.app-sidebar {
  flex-shrink: 0; width: 180px; overflow: hidden; box-sizing: border-box;
  background: var(--bg-surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 10px 8px; gap: 2px;
  transition: width .2s ease, padding .2s ease;
}
.app-sidebar.collapsed { width: 0; padding-left: 0; padding-right: 0; border-right: none; }

.sidebar-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  background: none; border: none; color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: left; white-space: nowrap; text-decoration: none;
}
.sidebar-item:hover { background: var(--bg-empty); }
.sidebar-item.active { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.sidebar-icon { font-size: 16px; flex-shrink: 0; display: flex; align-items: center; }
.sidebar-icon svg { display: block; }

/* Collapsible "Admin" group (shell.js) — folds every admin-only sidebar
   link (blog editor, driving bans, users, overview) under one entry
   instead of listing each as its own top-level item. `.sidebar-admin-item`
   still carries the existing show/hide-for-admins behavior unchanged
   (shell.js's admin-reveal block), now applied to the whole group at once
   rather than to each link individually. */
.sidebar-group-toggle { width: 100%; }
.sidebar-group-chevron {
  margin-left: auto; flex-shrink: 0; font-size: 12px; transition: transform .15s ease;
}
.sidebar-group.open .sidebar-group-chevron { transform: rotate(90deg); }
.sidebar-subgroup {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 0; overflow: hidden; transition: max-height .2s ease;
}
/* Fixed max-height (needed for the open/close transition — max-height
   can't animate to/from `auto`) sized generously above the current 6
   sub-items so adding another one later doesn't silently clip the list
   again the way 200px did once "Översättningar" became the 6th. */
.sidebar-group.open .sidebar-subgroup { max-height: 400px; }
.sidebar-subitem { padding-left: 30px; font-size: 12.5px; }

/* Admin-only read-only preview banner (dash.html/loader.html, entered via
   ?viewTemplate=/?viewLoad=, see app.js/loader.js) — shares this one class
   across both pages rather than a separate style per page since it's
   visually identical everywhere it appears. */
.view-mode-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-bottom: 1px solid var(--accent); color: var(--text-primary); font-size: 13px; font-weight: 600;
}
.view-mode-banner button {
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.view-mode-banner button:hover { opacity: .85; }

/* Shared small modal — used for the locked-app notice today, generic
   enough to reuse for anything else that needs a centered "stop and read
   this" dialog rather than an anchored popup like .popup-menu. */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  align-items: center; justify-content: center; z-index: 2000;
}
/* visibility:visible overrides body's visibility:hidden (set inline until
   the auth/access check resolves) — otherwise a locked-app modal shown
   before that check finishes would be invisible along with everything
   else, since CSS visibility is inherited and a child can't show itself
   through a hidden ancestor without saying so explicitly. */
.modal-overlay.open { display: flex; visibility: visible; }
.modal-box {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px; max-width: 320px; text-align: center; box-shadow: 0 12px 32px rgba(0,0,0,.3);
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); }
.modal-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 18px; }
.modal-text a { color: var(--accent); }
.modal-close-btn {
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 8px;
  padding: 9px 20px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.modal-close-btn:hover { opacity: .85; }
.modal-btn-row { display: flex; gap: 8px; justify-content: center; }
.modal-btn-secondary { background: none; border: 1px solid var(--border); color: var(--text-primary); }
.modal-btn-secondary:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

/* Cookie notice — hardcoded colors rather than the theme vars above,
   same reasoning as #applyModal in landing.css: this banner shows on
   pages that never load theme.js (index.html), so it needs to look
   right independent of which theme (if any) is active. */
.cookie-notice {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 2500;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: #161B22; border-radius: 12px; padding: 14px 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,.3); max-width: 640px; margin: 0 auto;
}
.cookie-notice-text { flex: 1; min-width: 220px; font-size: 13px; line-height: 1.5; margin: 0; color: rgba(255,255,255,.85); }
.cookie-notice-text a { color: #fff; }
.cookie-notice-btn {
  background: #FF4F00; color: #fff; border: none; border-radius: 8px; flex-shrink: 0;
  padding: 8px 18px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s ease;
}
.cookie-notice-btn:hover { background: #D94300; }

/* Small-screen "use a computer" notice (js/small-screen-notice.js) —
   inserted as the first child of <body> on index.html AND login.html, so
   it lives here (not landing.css) rather than being tied to a
   landing-page-specific wrapper. Navy informational tone, not the orange
   CTA color, so it doesn't read as another button competing with
   Ansök/Logga in. */
.small-screen-notice {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  background: #EFF6FF; border-bottom: 1px solid #BFDBFE; color: #1E3A8A;
  font-size: 13px; line-height: 1.5; box-sizing: border-box;
}
.small-screen-notice p { margin: 0; flex: 1; }
.small-screen-notice-close {
  flex-shrink: 0; background: none; border: 1px solid #1E3A8A; color: #1E3A8A;
  border-radius: 6px; padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.small-screen-notice-close:hover { background: #1E3A8A; color: #fff; }

.app-main { flex: 1; min-width: 0; position: relative; overflow: auto; }

.canvas {
  position: relative;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
  transform-origin: top left; /* scale factor itself is set from JS — see render() in app.js */
}
.cell {
  position: absolute;
  box-sizing: border-box;
}

/* Route-plan Granskningsläge (app.js's enterRoutePlanViewMode) shows
   exactly one synthetic widget on an otherwise-empty board, opened in its
   own popup window (admin-users.js's VIEW_MODE_WINDOW_FEATURES) — stretch
   that one tile to fill the whole window instead of its normal fixed
   grid-cell pixel size, since the popup exists purely to show this one
   thing at full size. !important overrides the inline left/top/width/
   height positionCell() sets in px, and the inline height render() sets
   on #canvas itself; percentages recompute on window resize for free, no
   JS resize listener needed. */
#canvas.route-plan-fullscreen { height: 100% !important; }
#canvas.route-plan-fullscreen .cell.filled {
  left: 0 !important; top: 0 !important;
  width: 100% !important; height: 100% !important;
}

/* Empty cells: visibility controlled via JS (.reveal class on #canvas).
   Dashed border (not solid) reads as "open slot," distinct at a glance
   from a filled card's solid border — and the hover state gives a target
   worth aiming for before the click, instead of the "+" being the only
   thing that reacts. */
.cell.empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--text-secondary);
  background: transparent;
  border: 1.5px dashed transparent;
  border-radius: var(--radius-md);
  transition: border-color .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease);
}
#canvas.reveal .cell.empty {
  background: var(--bg-empty);
  border-color: var(--border);
}
#canvas.reveal .cell.empty:hover {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-empty));
}
.plus-btn {
  background: none; border: none; color: inherit; font-size: 34px; line-height: 1;
  cursor: pointer; padding: 0; opacity: 0; pointer-events: none;
}
#canvas.reveal .plus-btn { opacity: 1; pointer-events: auto; }

/* Filled cards — soft elevation instead of a flat bordered box, with a
   gentle lift on hover while unlocked (a reason to believe the tile is
   draggable before you've grabbed it). No overflow:hidden here on
   purpose — several widgets (roadcamera/ferry/Kalkylark search &
   autocomplete dropdowns) render a popover that intentionally extends
   past the tile's own box; clipping at the card boundary would silently
   cut those off instead of just leaving a few content corners un-rounded
   at the card edge, which is the smaller cosmetic tradeoff of the two. */
/* Plays once per fresh mount — every renderWidget() call replaces the
   whole .cell.filled node with a new one (see buildFilledCell/
   renderWidget in app.js), so this fires exactly when content actually
   changed: initial data arriving (skeleton -> real content), a todo
   checked, a calendar day navigated, a widget added/resized. It does NOT
   fire on continuous typing (currency amount, notes, Kalkylark cells) —
   those update text in place without a re-render specifically to avoid
   stealing focus, which happens to also mean they never replay this. */
@keyframes cell-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.cell.filled {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  transition: box-shadow .15s var(--ease), transform .15s var(--ease);
  animation: cell-fade-in .2s var(--ease);
}
#canvas.reveal .cell.filled:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) {
  .cell.filled { animation: none; }
}
.cell.drop-ok { outline: 2px solid var(--positive); outline-offset: -2px; background: var(--positive-bg); }
.cell.drop-bad { outline: 2px solid var(--negative); outline-offset: -2px; background: var(--negative-bg); }

/* Locked (default): tile is view-only — controls hidden, no interaction, no grab cursor.
   Todos and Note are the exception: they stay fully usable (check/add/
   edit/remove items, typing) even when locked, so they work as demo-able
   quick-capture widgets without making people unlock edit mode first.
   Resizing/removing the whole tile still requires edit mode via
   .tile-controls below. */
.tile { cursor: default; }
.tile-controls { opacity: 0; pointer-events: none; }
.clock-city, .weather-city, .news-manage-btn, .news-feed-remove, .news-done-btn { pointer-events: none; }
#canvas.reveal .tile { cursor: grab; }
#canvas.reveal .tile-controls { opacity: 1; pointer-events: auto; }
#canvas.reveal .clock-city, #canvas.reveal .weather-city,
#canvas.reveal .news-manage-btn, #canvas.reveal .news-feed-remove, #canvas.reveal .news-done-btn { pointer-events: auto; }
/* News headlines (read-only preview popup) stay clickable regardless of
   lock state, same reasoning as Todos/Note — only feed management above
   requires unlocking. */
/* Barometer edit button: always clickable when shown — it only renders at
   all for admins (IS_ADMIN check in app.js), so no extra lock-state gate
   is needed on top of that. */
.barometer-edit-btn { cursor: pointer; }

.tile {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 10px; cursor: grab; box-sizing: border-box;
}
.tile.dragging-source { opacity: .25; }
.tile .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin-bottom: 4px; }
.tile .value { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.tile .delta { font-size: 11px; font-weight: 600; margin-top: 4px; padding: 1px 6px; border-radius: 999px; }
.tile .delta.up { background: var(--positive-bg); color: var(--positive); }
.tile .delta.down { background: var(--negative-bg); color: var(--negative); }

.tile-controls { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; z-index: 2; }
.tile-btn {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-empty); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.tile-btn:hover, .tile-btn:active { background: var(--negative-bg); border-color: var(--negative); color: var(--negative); }
.tile-btn.gear:hover, .tile-btn.gear:active,
.tile-btn.swap:hover, .tile-btn.swap:active { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: var(--accent); color: var(--accent); }

/* Popups */
.popup-menu {
  position: fixed; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.3); z-index: 1000; overflow: hidden; display: none; visibility: hidden;
}
.popup-menu.open { display: block; }
#addMenuPopup { width: 230px; max-height: min(70vh, 420px); overflow-y: auto; overflow-x: hidden; }
#sizeMenuPopup { min-width: 90px; }
#newsPreviewPopup { width: 320px; border-radius: 14px; }
.news-preview { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.news-preview-title { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }
.news-preview-source {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary);
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.news-preview-summary { font-size: 13px; color: var(--text-primary); line-height: 1.6; }
.news-preview-link {
  font-size: 12px; font-weight: 700; color: var(--accent-ink); text-decoration: none; margin-top: 6px;
  background: var(--accent); border-radius: 8px; padding: 9px 14px; text-align: center;
}
.news-preview-link:hover { filter: brightness(1.08); }
/* Widget-add picker: WIDGET_CATEGORIES accordion (widgets.js) — one
   category open at a time, so the list of 28 widget types never has to
   be shown all at once. */
.menu-category { border-bottom: 1px solid var(--border); }
.menu-category:last-child { border-bottom: none; }
.menu-category-header {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: none; border: none; cursor: pointer; color: var(--text-primary);
  font-size: 13px; font-weight: 700; text-align: left; font-family: inherit;
}
.menu-category-header:hover { background: var(--bg-empty); }
.menu-category-label { flex: 1; }
.menu-category-count {
  font-size: 10px; font-weight: 700; color: var(--text-secondary); background: var(--bg-empty);
  border-radius: 8px; padding: 1px 7px;
}
.menu-category-chevron { flex-shrink: 0; color: var(--text-secondary); transition: transform .15s ease; }
.menu-category.expanded .menu-category-chevron { transform: rotate(90deg); }
/* No animated max-height here on purpose — this list's real height has to
   be known synchronously the instant it expands, so the popup can
   reposition itself before paint (see the click handler in app.js). A
   mid-transition height would reposition against the wrong number and
   let the newly-taller popup run off the bottom of the screen anyway. */
.menu-category-items { display: none; }
.menu-category.expanded .menu-category-items { display: block; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 34px;
  font-size: 13px; color: var(--text-primary); cursor: pointer;
}
.menu-item:hover, .menu-item:active { background: var(--bg-empty); }
.widget-icon { flex-shrink: 0; color: var(--text-secondary); }
.menu-item:hover .widget-icon { color: var(--accent); }
.size-item { padding: 8px 14px; font-size: 13px; color: var(--text-primary); cursor: pointer; white-space: nowrap; border-bottom: 1px solid var(--border); }
.size-item:last-child { border-bottom: none; }
.size-item:hover, .size-item:active { background: var(--bg-empty); }
.size-item.current { color: var(--accent); font-weight: 700; }

/* Todos */
.todos-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.todo-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; overflow-y: auto; }
.todo-item { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 2px 0; }
.todo-check { width: 14px; height: 14px; min-width: 14px; border-radius: 4px; border: 1.5px solid var(--text-secondary); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--bg-base); background: transparent; }
.todo-item.done .todo-check { background: var(--text-primary); border-color: var(--text-primary); }
.todo-text { font-size: 11px; text-align: left; color: var(--text-primary); line-height: 1.25; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--text-secondary); }
.todo-item-remove { font-size: 9px; color: var(--text-secondary); padding: 2px 3px; margin-left: auto; flex-shrink: 0; }
.todo-item-remove:hover, .todo-item-remove:active { color: var(--negative); }
.todo-add { font-size: 11px; color: var(--accent); cursor: pointer; padding: 3px 0 1px; text-align: left; }
.todo-input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); font-size: 11px; padding: 2px 5px; box-sizing: border-box; }
.todo-input:focus { outline: none; border-color: var(--accent); }

/* World clock */
.clock-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.clock-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; overflow-y: auto; }
.clock-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 0; }
.clock-city { font-size: 11px; color: var(--text-primary); cursor: pointer; text-align: left; }
.clock-city:hover { color: var(--accent); }
.clock-time { font-size: 13px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.clock-select { font-size: 11px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); padding: 1px 4px; }
.clock-select:focus { outline: none; border-color: var(--accent); }

/* Weather */
.weather-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.weather-city { font-size: 11px; color: var(--accent); cursor: pointer; text-align: left; margin-top: 2px; }
.weather-city:hover { text-decoration: underline; }
.weather-main { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.weather-emoji { font-size: 22px; }
.weather-temp { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.weather-desc { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.weather-loading { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.weather-search-wrap { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.weather-search-input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); font-size: 11px; padding: 3px 6px; box-sizing: border-box; }
.weather-search-input:focus { outline: none; border-color: var(--accent); }
.weather-search-results { display: flex; flex-direction: column; gap: 2px; max-height: 80px; overflow-y: auto; }
.weather-result { font-size: 10px; color: var(--text-primary); cursor: pointer; padding: 2px 4px; border-radius: 3px; text-align: left; }
.weather-result:hover { background: var(--bg-empty); }
.weather-result-empty { font-size: 10px; color: var(--text-secondary); padding: 2px 4px; }

/* Logo */
.logo-tile { justify-content: center; align-items: center; gap: 8px; }
.logo-display { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; }
.logo-default { max-width: 85%; box-sizing: border-box; }
.logo-default-img { height: 44px; max-width: 100%; object-fit: contain; }
.logo-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { position: absolute; bottom: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; pointer-events: none; }
#canvas.reveal .logo-actions { opacity: 1; pointer-events: auto; }
.logo-upload-btn, .logo-reset-btn {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-empty); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.logo-upload-btn:hover, .logo-reset-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: var(--accent); color: var(--accent); }
.logo-file-input { display: none; }

/* News */
.news-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.news-label { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.news-manage-btn { font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.news-manage-btn:hover { color: var(--accent); }
.news-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; overflow-y: auto; }
.news-item { display: flex; flex-direction: column; text-decoration: none; padding: 3px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.news-item:last-child { border-bottom: none; }
.news-item-title { font-size: 11px; color: var(--text-primary); line-height: 1.25; text-align: left; }
.news-item-source { font-size: 9px; color: var(--text-secondary); margin-top: 1px; text-transform: uppercase; letter-spacing: .03em; text-align: left; }
.news-empty { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.news-feed-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; overflow-y: auto; }
.news-feed-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 0; }
.news-feed-name { font-size: 10px; color: var(--text-primary); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-feed-remove { font-size: 9px; color: var(--text-secondary); cursor: pointer; flex-shrink: 0; }
.news-feed-remove:hover { color: var(--negative); }
.news-add-row { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.news-add-input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); font-size: 10px; padding: 3px 6px; box-sizing: border-box; }
.news-add-input:focus { outline: none; border-color: var(--accent); }
.news-add-error { font-size: 9px; color: var(--negative); min-height: 12px; }
.news-done-btn { font-size: 11px; color: var(--accent); cursor: pointer; text-align: center; margin-top: 4px; }

/* Roadwork / Trafikverket map */
.roadwork-tile { align-items: stretch; justify-content: flex-start; padding: 8px; }
.roadwork-search-row { margin-bottom: 6px; }
.roadwork-search-input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-size: 12px; padding: 6px 10px; box-sizing: border-box; }
.roadwork-search-input:focus { outline: none; border-color: var(--accent); }
.roadwork-map { flex: 1; width: 100%; min-height: 0; border-radius: 8px; overflow: hidden; background: var(--bg-empty); }
/* Mute OSM's stock tile colors (bright green parks, yellow/orange roads)
   so the map fits the dashboard's neutral palette — filtered on the tile
   pane only, so markers/popups keep their real colors. */
.roadwork-map .leaflet-tile-pane { filter: saturate(.55) brightness(1.05); }
.roadwork-updated { flex-shrink: 0; margin-top: 4px; text-align: center; }

/* Kalender — European public holidays (computed) + truck driving bans
   (admin-entered), same scrollable-list convention as .news-list/.news-item.
   Single-day view (prev/next nav), not an upcoming list — no per-item date,
   the day lives once in .calendar-nav-date. */
.calendar-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.calendar-nav-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.calendar-nav-btn {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-empty); color: var(--text-primary); font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.calendar-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.calendar-nav-date { font-size: 12px; font-weight: 700; color: var(--text-primary); text-align: center; }
.calendar-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; min-height: 0; margin-top: 6px; }
/* Column, not row — country names are now spelled out (not just a 2-letter
   code), long enough (e.g. "Bosnien och Hercegovina") that a side-by-side
   layout would squeeze the holiday name instead of just wrapping cleanly. */
.calendar-item { display: flex; flex-direction: column; gap: 1px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.calendar-item:last-child { border-bottom: none; }
.calendar-item-country {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-secondary);
}
.calendar-item-label { font-size: 11px; color: var(--text-primary); line-height: 1.25; }
.calendar-item-label a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); }
.calendar-item-label a:hover { text-decoration-color: currentColor; }
.calendar-item--holiday .calendar-item-country { color: var(--accent); }
.calendar-item--ban .calendar-item-country { color: var(--warning); }
.calendar-empty { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.calendar-skeleton { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }

/* Ruttplanerare — form + map + several result panels, dummy-data POC
   (app/services/routeplanner.py). Richest widget in the app so far
   (MIN_SPAN_BY_TYPE.routeplanner=4, defaults to 8x), so this leans on
   scroll (overflow-y auto) rather than trying to cram everything above
   the fold. */
.routeplanner-tile { align-items: stretch; justify-content: flex-start; padding: 10px; overflow-y: auto; }
.routeplanner-form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.routeplanner-form-row { display: flex; gap: 6px; }
.routeplanner-input {
  flex: 1; min-width: 0; background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-primary); font-size: 12px; padding: 6px 8px; box-sizing: border-box;
}
.routeplanner-input:focus { outline: none; border-color: var(--accent); }
.routeplanner-input-narrow { flex: 0 0 90px; }
.routeplanner-plan-btn {
  flex: 1; background: var(--accent); color: var(--accent-ink); border: none; border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer; padding: 6px 8px;
}
.routeplanner-plan-btn:hover { opacity: .85; }
.routeplanner-plan-btn:disabled { opacity: .6; cursor: default; }
.routeplanner-error { font-size: 11px; color: var(--negative); margin-top: 6px; }
.routeplanner-empty { font-size: 11px; color: var(--text-secondary); margin-top: 10px; }
.routeplanner-note { font-size: 11px; color: var(--warning); margin-top: 8px; }

/* flex:1 + min-height:0 so this grows to fill whatever's left of the
   tile at larger spans (16x/32x) instead of leaving dead space below a
   fixed-height map — .routeplanner-map below is the one child that
   actually grows into that space; the stat/panel/summary/status
   children keep their natural size regardless of tile height. */
.routeplanner-results { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.routeplanner-map {
  width: 100%; flex: 1; min-height: 160px; border-radius: 8px; overflow: hidden; background: var(--bg-empty); margin-top: 10px;
}
.routeplanner-map .leaflet-tile-pane { filter: saturate(.55) brightness(1.05); }

.routeplanner-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.routeplanner-stat { background: var(--bg-empty); border-radius: 8px; padding: 8px; text-align: center; }
.routeplanner-stat-value { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.routeplanner-stat-label { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }

.routeplanner-panel { margin-top: 8px; }
.routeplanner-panel-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-secondary); }
.routeplanner-panel-line { font-size: 12px; color: var(--text-primary); line-height: 1.35; }

.routeplanner-ai-summary {
  font-size: 12px; color: var(--text-primary); line-height: 1.4; font-style: italic;
  background: var(--bg-empty); border-radius: 8px; padding: 8px 10px; margin-top: 10px;
}
.routeplanner-status {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px; text-align: center; font-size: 13px; font-weight: 700;
}
.routeplanner-status-green { background: var(--positive-bg); color: var(--positive); }
.routeplanner-status-yellow { background: var(--warning-bg); color: var(--warning); }
.routeplanner-status-red { background: var(--negative-bg); color: var(--negative); }
.routeplanner-status-neutral { background: var(--bg-empty); color: var(--text-secondary); }

/* Valutaomvandlare — never smaller than 2x (MIN_SPAN_BY_TYPE.currency=2 in
   widgets.js), so this doesn't need the scroll/overflow handling
   routeplanner's does; amount+select rows just need to stay readable at
   the narrower 2x (2 cols x 1 row) width down to the default 4x. */
.currency-tile { align-items: stretch; justify-content: center; padding: 10px 8px; gap: 8px; }
.currency-row { display: flex; gap: 6px; align-items: center; }
.currency-amount {
  flex: 1; min-width: 0; background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-primary); font-size: 13px; font-weight: 700; padding: 6px 8px; box-sizing: border-box;
}
.currency-amount:focus { outline: none; border-color: var(--accent); }
/* Chrome/Firefox's up/down spinner arrows on type="number" add visual
   noise this tile doesn't need — the swap button already covers "change
   direction," and typing a new amount is the primary interaction. */
.currency-amount::-webkit-outer-spin-button, .currency-amount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.currency-amount[type="number"] { -moz-appearance: textfield; }
.currency-select {
  flex: 0 0 68px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-primary); font-size: 12px; font-weight: 700; padding: 6px 4px; box-sizing: border-box; cursor: pointer;
}
.currency-select:focus { outline: none; border-color: var(--accent); }
.currency-result {
  flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.currency-result-empty { color: var(--text-secondary); font-weight: 400; font-size: 12px; }
.currency-swap-btn {
  align-self: center; background: none; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-secondary); font-size: 14px; width: 28px; height: 28px; cursor: pointer; line-height: 1;
}
.currency-swap-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Trafikkamera */
.roadcamera-tile { align-items: stretch; justify-content: flex-start; padding: 8px; }
.roadcamera-search-row { position: relative; margin-bottom: 6px; }
.roadcamera-search-input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-size: 11px; padding: 5px 8px; box-sizing: border-box; }
.roadcamera-search-input:focus { outline: none; border-color: var(--accent); }
.roadcamera-search-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 6px; margin-top: 2px; max-height: 120px; overflow-y: auto; }
.roadcamera-search-results:empty { border: none; margin-top: 0; }
.roadcamera-result { font-size: 10px; color: var(--text-primary); padding: 4px 8px; cursor: pointer; text-align: left; }
.roadcamera-result:hover { background: var(--bg-empty); }
.roadcamera-result-empty { font-size: 10px; color: var(--text-secondary); padding: 4px 8px; }
.roadcamera-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.roadcamera-img { width: 100%; flex: 1; min-height: 0; object-fit: cover; border-radius: 8px; background: var(--bg-empty); }
.roadcamera-caption { font-size: 10px; color: var(--text-secondary); margin-top: 4px; text-align: center; }
.roadcamera-empty { font-size: 11px; color: var(--text-secondary); margin-top: 8px; }

/* Note */
.note-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.note-textarea {
  flex: 1; width: 100%; min-height: 0; resize: none;
  background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-primary); font-size: 12px; line-height: 1.4; padding: 8px;
  box-sizing: border-box; font-family: inherit; margin-top: 4px;
}
.note-textarea:focus { outline: none; border-color: var(--accent); }

/* Färja */
.ferry-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.ferry-search-row { position: relative; margin-bottom: 6px; }
.ferry-search-input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-size: 11px; padding: 5px 8px; box-sizing: border-box; }
.ferry-search-input:focus { outline: none; border-color: var(--accent); }
.ferry-search-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 6px; margin-top: 2px; max-height: 120px; overflow-y: auto; }
.ferry-search-results:empty { border: none; margin-top: 0; }
.ferry-result { font-size: 10px; color: var(--text-primary); padding: 4px 8px; cursor: pointer; text-align: left; }
.ferry-result:hover { background: var(--bg-empty); }
.ferry-result-empty { font-size: 10px; color: var(--text-secondary); padding: 4px 8px; }
.ferry-view { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ferry-route { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.ferry-next-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin-top: 8px; }
.ferry-next-time { font-size: 22px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ferry-status { font-size: 11px; color: var(--positive); margin-top: 4px; }
.ferry-empty { font-size: 11px; color: var(--text-secondary); margin-top: 8px; text-align: center; }

/* Transportbarometer */
.barometer-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.barometer-relations { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.barometer-relation-label { display: flex; justify-content: space-between; align-items: center; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-primary); }
.barometer-edit-btn { font-size: 11px; color: var(--text-secondary); cursor: pointer; }
.barometer-edit-btn:hover { color: var(--accent); }
.barometer-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 4px; }
.barometer-segment { height: 100%; }
.barometer-frakt { background: var(--accent); }
.barometer-lastrum { box-sizing: border-box; } /* background set inline per status color */
.barometer-values { display: flex; justify-content: space-between; margin-top: 3px; font-size: 10px; font-weight: 700; color: var(--text-primary); }

/* Load Builder — dashboard shell only; the real form/3D view lives in
   loader.html, opened via the ↗ button. Its own top-right button rather
   than the generic .tile-controls gear/remove pair (opacity:0 until
   unlocked) — this one should stay usable in locked/view mode too, same
   reasoning as barometer-edit-btn above. */
.loadbuilder-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.loadbuilder-header { display: flex; justify-content: space-between; align-items: center; }
.loadbuilder-open-btn {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  background: var(--bg-empty); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.loadbuilder-open-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: var(--accent); color: var(--accent); }
.loadbuilder-ai-input {
  margin-top: 8px; width: 100%; resize: none; box-sizing: border-box;
  font-family: inherit; font-size: 11px; padding: 6px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-empty); color: var(--text-primary);
}
.loadbuilder-analyze-btn {
  margin-top: 6px; align-self: flex-end; font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--bg-empty); color: var(--text-primary); cursor: pointer;
}
.loadbuilder-analyze-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.loadbuilder-analyze-btn:disabled { opacity: .6; cursor: default; }
.loadbuilder-result { margin-top: 6px; font-size: 11px; color: var(--text-secondary); overflow-y: auto; flex: 1; min-height: 0; }
.loadbuilder-result.error { color: var(--negative); }
.loadbuilder-truck { font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.loadbuilder-items { margin: 0; padding-left: 16px; }

/* Miniräknare */
.calculator-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; gap: 0; }
.calculator-display {
  margin-top: 8px; width: 100%; box-sizing: border-box; text-align: right;
  font-family: var(--font-mono); font-size: 15px; font-weight: 600;
  padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-empty); color: var(--text-primary);
}
.calculator-preview {
  min-height: 15px; text-align: right; font-family: var(--font-mono);
  font-size: 11px; color: var(--text-secondary); padding: 2px 2px 0;
}
.calculator-preview.error { color: var(--negative); }
.calculator-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.calculator-btn {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  padding: 7px 0; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-empty); color: var(--text-primary); cursor: pointer;
}
.calculator-btn:hover { border-color: var(--accent); color: var(--accent); }
.calculator-btn.equals { grid-column: span 2; background: var(--accent); border-color: var(--accent); color: var(--bg-surface); }
.calculator-btn.equals:hover { opacity: .85; color: var(--bg-surface); }
.calculator-history { margin-top: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.calculator-history-row {
  display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--text-secondary);
  font-family: var(--font-mono); padding: 2px 0;
}
.calculator-history-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Kalkylark */
.sheet-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; gap: 0; }
.sheet-topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-toolbar { display: flex; gap: 4px; }
.sheet-toolbar-btn {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  padding: 3px 7px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-empty); color: var(--text-secondary); cursor: pointer;
}
.sheet-toolbar-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.sheet-toolbar-btn:disabled { opacity: .7; cursor: default; }
.sheet-scroll { margin-top: 8px; overflow: auto; flex: 1; min-height: 0; }
.sheet-table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.sheet-table th, .sheet-table td { border: 1px solid var(--border); padding: 0; }
.sheet-table th {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--text-secondary); background: var(--bg-empty); padding: 3px 4px; text-align: center;
}
.sheet-table th.sheet-corner { background: transparent; border: none; }
.sheet-cell {
  width: 100%; box-sizing: border-box; border: none; background: transparent; color: var(--text-primary);
  font-family: var(--font-mono); font-size: 11px; text-align: right;
  padding: 4px 5px;
}
.sheet-cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--bg-empty); }
.sheet-cell-error { color: var(--negative); }
.sheet-cell-picking { background: color-mix(in srgb, var(--accent) 22%, transparent) !important; }
.sheet-error { min-height: 14px; margin-top: 4px; font-size: 10.5px; color: var(--negative); }

/* "Picker" widgets (Vägtullar, Miljözoner, Diesel per land, Lastbilsparkering, Gränsväntetid, Fraktindex) */
.picker-tile { align-items: stretch; justify-content: flex-start; padding: 10px 8px 8px; }
.picker-empty { margin-top: 10px; font-size: 11px; color: var(--text-secondary); }
.picker-skeleton { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.picker-select {
  margin-top: 8px; width: 100%; box-sizing: border-box; font-size: 11px; padding: 6px 8px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--bg-empty); color: var(--text-primary);
}
.picker-rows { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.picker-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.picker-row-label { color: var(--text-secondary); }
.picker-row-value { font-weight: 700; color: var(--text-primary); text-align: right; }

/* Kör- och vilotid */
.restbreak-tile { align-items: center; justify-content: center; padding: 10px 8px 8px; }
.restbreak-display { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); margin-top: 4px; }
.restbreak-display.restbreak-over { color: var(--negative); }
.restbreak-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.restbreak-sub.restbreak-over { color: var(--negative); font-weight: 700; }
.restbreak-controls { display: flex; gap: 6px; margin-top: 8px; }
.restbreak-btn {
  font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-empty); color: var(--text-primary); cursor: pointer;
}
.restbreak-btn:hover { border-color: var(--accent); color: var(--accent); }
.restbreak-hint { margin-top: 8px; font-size: 9.5px; line-height: 1.4; color: var(--text-secondary); text-align: center; }
.sheet-autocomplete {
  position: absolute; z-index: 5; min-width: 84px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.28); overflow: hidden;
}
.sheet-ac-item {
  font-family: var(--font-mono); font-size: 11px;
  padding: 5px 9px; cursor: pointer; color: var(--text-primary);
}
.sheet-ac-item.active, .sheet-ac-item:hover { background: var(--accent); color: var(--bg-surface); }
.barometer-status { display: flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 700; color: var(--text-secondary); margin-top: 3px; }
.barometer-status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.barometer-updated { font-size: 8px; color: var(--text-secondary); margin-top: 2px; }
.barometer-empty { font-size: 10px; color: var(--text-secondary); margin-top: 4px; }
.barometer-source { font-size: 9px; color: var(--text-secondary); margin-top: auto; padding-top: 8px; text-align: center; text-decoration: none; }
.barometer-source:hover { color: var(--accent); text-decoration: underline; }
.barometer-edit-input { width: 56px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); font-size: 11px; padding: 2px 4px; box-sizing: border-box; }
.barometer-edit-input:focus { outline: none; border-color: var(--accent); }

.diesel-sparkline { width: 80px; height: 20px; color: var(--accent); margin-top: 4px; }

/* Fokustimer — urgency colors override the tile's own background (not the
   cell's), so only this tile is affected. Contrast-checked: white text vs
   each of these two is 4.9:1+ (verified against WCAG, not eyeballed).
   Only yellow/red on purpose — no green — and the yellow-to-red switch is
   proportional to the chosen duration (see updateTimerColorTier), not a
   fixed absolute cutoff. */
.timer-tile { align-items: center; justify-content: center; gap: 4px; padding: 8px; transition: background-color .4s ease; }
.timer-tile-yellow { background: #a16207; }
.timer-tile-red { background: #b91c1c; }
.timer-tile-yellow .label, .timer-tile-red .label,
.timer-tile-yellow .timer-display, .timer-tile-red .timer-display,
.timer-tile-yellow .timer-slider-value, .timer-tile-red .timer-slider-value {
  color: #fff;
}
.timer-display { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-primary); line-height: 1; }
.timer-controls { display: flex; gap: 6px; margin-top: 2px; }
.timer-btn {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-empty); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.timer-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: var(--accent); color: var(--accent); }
/* On the saturated yellow/red backgrounds, the default theme-colored button
   would have poor contrast — flip to a translucent white treatment there. */
.timer-tile-yellow .timer-btn, .timer-tile-red .timer-btn {
  background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.5); color: #fff;
}
.timer-tile-yellow .timer-btn:hover, .timer-tile-red .timer-btn:hover { background: rgba(255,255,255,.4); }
.timer-slider-row { display: flex; flex-direction: column; align-items: center; width: 100%; margin-top: 4px; gap: 2px; }
.timer-slider { width: 80%; height: 4px; cursor: pointer; }
.timer-slider-value { font-size: 10px; font-weight: 700; color: var(--text-primary); }

/* Drag ghost */
.ghost-tile {
  position: fixed; background: var(--bg-surface); border: 1px solid var(--accent); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px;
  pointer-events: none; z-index: 1000; box-shadow: 0 12px 32px rgba(0,0,0,.3); opacity: .9;
}
.ghost-tile .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin-bottom: 4px; }
.ghost-tile .value { font-size: 18px; font-weight: 700; color: var(--text-primary); }

/* Greeting: now an in-flow header child (see .app-header), not
   independently fixed-positioned — that's what used to make it visually
   collide with widgets in the corner. */
.greeting {
  height: 34px; display: flex; align-items: center;
  padding: 0 16px; border-radius: 17px;
  background: var(--bg-empty); border: 1px solid var(--border); color: var(--text-primary);
  font-size: 13px; font-weight: 700;
}

/* Refresh timer: a circular progress wipe, one full sweep per 60s cycle —
   mirrors the actual auto-refresh cadence for weather/camera/roadwork.
   No number inside on purpose, just the wipe. */
.refresh-timer-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: help; }
.refresh-timer-label { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); white-space: nowrap; }
.refresh-timer {
  position: relative; width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  background: var(--bg-empty);
  border: 1px solid var(--border);
}
.rt-half { position: absolute; top: 0; left: 0; width: 50%; height: 100%; overflow: hidden; }
.rt-half-2 { transform-origin: 100% 50%; transform: rotate(180deg); }
.rt-mask {
  position: absolute; top: 0; left: -100%; width: 200%; height: 100%;
  background: var(--accent);
  transform-origin: 100% 50%;
}
.rt-mask-1 { animation: rt-rotate-1 60s linear infinite; }
.rt-mask-2 { animation: rt-rotate-2 60s linear infinite; }
@keyframes rt-rotate-1 {
  0%, 50% { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}
@keyframes rt-rotate-2 {
  0% { transform: rotate(0deg); }
  50%, 100% { transform: rotate(180deg); }
}

/* Header icon buttons (theme/lock/logout) — in-flow now, sized to match
   .sidebar-toggle for a consistent header. */
.theme-toggle, .visibility-toggle, .logout-btn, .blog-header-btn, .lang-toggle {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-empty); border: 1px solid var(--border); color: var(--text-primary);
  font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
/* Text label (EN/SV) rather than an icon — smaller than the emoji-sized
   default so two letters don't crowd the circle. */
.lang-toggle { font-size: 11px; font-weight: 700; font-family: inherit; }
.theme-toggle svg, .logout-btn svg, .blog-header-btn svg { display: block; }
.visibility-toggle.forced-hidden { border-color: var(--negative); color: var(--negative); }
.logout-btn:hover { border-color: var(--negative); color: var(--negative); }

/* Feedback button — deliberately NOT part of the neutral circular
   icon-button group above. During this early pilot, maximizing feedback
   volume matters more than a quiet header: a labeled, accent-filled pill
   in the header-LEFT cluster (next to the logo, not buried among the
   right-side icons) is far more discoverable than an icon-only button
   with just a hover tooltip. */
.feedback-btn {
  height: 34px; flex-shrink: 0; margin-left: 4px;
  background: var(--accent); border: none; border-radius: 17px; color: var(--accent-ink);
  font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 0 14px;
}
.feedback-btn svg { display: block; }
.feedback-btn:hover { filter: brightness(1.1); }

/* Blog/"what's new" header icon — clicking it (shell.js) opens an inline
   preview popup of the 3 latest posts instead of navigating straight to
   blog.html; href="blog.html" stays as a plain-link fallback if that JS
   fails. The badge dot is shown/hidden by the same shell.js logic,
   comparing the newest published post's date against sp_blog_last_seen (set
   the moment the popup is opened, not just when a post is actually read —
   same "seen" semantics as a notification bell). */
.blog-header-wrap { position: relative; }
.blog-header-btn { position: relative; text-decoration: none; }
.blog-header-btn:hover { border-color: var(--accent); color: var(--accent); }
.blog-badge-dot {
  position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--negative); border: 1.5px solid var(--bg-surface);
}

.blog-preview-dropdown {
  display: none; position: absolute; top: 42px; right: 0; width: 280px; z-index: 1200;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.25); padding: 6px; box-sizing: border-box;
}
.blog-preview-dropdown.open { display: block; }
.blog-preview-item {
  display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit;
}
.blog-preview-item:hover { background: var(--bg-empty); }
.blog-preview-meta {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); margin-bottom: 3px;
}
.blog-preview-title { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.blog-preview-footer {
  display: block; text-align: center; font-size: 12px; font-weight: 700; color: var(--accent);
  text-decoration: none; padding: 8px; margin-top: 4px; border-top: 1px solid var(--border);
}
.blog-preview-footer:hover { text-decoration: underline; }

/* Dashboard templates ("Mallar") — trigger mirrors the neutral header
   icon-button family (.theme-toggle etc.) but as a labeled pill since it
   carries text, not just an icon; the dropdown panel reuses
   .blog-preview-dropdown's exact structure/positioning. Save/Uppdatera is
   the one affirmative action here, so it gets the same accent-filled
   treatment as .feedback-btn/.modal-close-btn rather than the neutral
   family. */
.templates-wrap { position: relative; }
.templates-trigger {
  height: 34px; flex-shrink: 0; display: flex; align-items: center; gap: 6px;
  background: var(--bg-empty); border: 1px solid var(--border); border-radius: 17px; color: var(--text-primary);
  font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; padding: 0 14px;
}
.templates-trigger:hover { border-color: var(--accent); color: var(--accent); }
/* Same rotating-chevron language as .sidebar-group-chevron — a visual cue
   that this pill opens something, not just a plain button. */
.templates-trigger-chevron { font-size: 12px; transition: transform .15s ease; }
.templates-trigger.open .templates-trigger-chevron { transform: rotate(90deg); }
.templates-save-btn {
  height: 34px; flex-shrink: 0;
  background: var(--accent); border: none; border-radius: 17px; color: var(--accent-ink);
  font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; padding: 0 14px;
}
.templates-save-btn:hover { filter: brightness(1.1); }

.templates-dropdown {
  display: none; position: absolute; top: 42px; right: 0; width: 260px; z-index: 1200;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.25); padding: 6px; box-sizing: border-box;
  max-height: 320px; overflow-y: auto;
}
.templates-dropdown.open { display: block; }
.templates-empty { padding: 10px; font-size: 13px; color: var(--text-secondary); }
.templates-item { display: flex; align-items: center; gap: 4px; }
.templates-item-load {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: none; text-align: left; font-family: inherit; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; color: inherit;
}
.templates-item-load:hover { background: var(--bg-empty); }
.templates-item-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.templates-item-owner-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-secondary); background: var(--bg-empty); border-radius: 4px; padding: 2px 6px; flex-shrink: 0;
}
.templates-item-delete {
  flex-shrink: 0; background: none; border: none; cursor: pointer; font-size: 13px;
  color: var(--text-secondary); padding: 6px; border-radius: 6px;
}
.templates-item-delete:hover { color: var(--negative); background: var(--negative-bg); }

/* Email/social icons — deliberately lighter-weight than the circular
   header-right action buttons above: this is a passive contact/brand
   link, not an interactive control, so it shouldn't compete for
   attention next to the logo. */
.app-social-links {
  display: flex; align-items: center; gap: 4px; margin-left: 10px; padding-left: 10px;
  border-left: 1px solid var(--border);
}
.social-link {
  width: 26px; height: 26px; border-radius: 6px; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; transition: color .15s, background .15s;
}
.social-link svg { display: block; }
.social-link:hover { color: var(--accent); background: var(--bg-empty); }
@media (max-width: 700px) { .app-social-links { display: none; } }

/* Feedback modal (bug report / feature suggestion) */
.modal-box-wide { max-width: 480px; width: 90vw; text-align: left; }
.modal-box-wide .modal-title { text-align: center; margin-bottom: 16px; }
.feedback-kind-row { display: flex; gap: 8px; margin-bottom: 14px; }
.feedback-kind-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px; border-radius: 8px; border: 1px solid var(--border);
  background: none; color: var(--text-secondary); font-size: 13px; cursor: pointer;
}
.feedback-kind-btn svg { flex-shrink: 0; }
.feedback-kind-btn.active { border-color: var(--accent); color: var(--accent); background: var(--bg-empty); }
.feedback-title-input {
  width: 100%; background: var(--bg-base); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-size: 13px; font-weight: 600;
  padding: 10px; box-sizing: border-box; font-family: inherit; margin-bottom: 10px;
}
.feedback-title-input:focus { outline: none; border-color: var(--accent); }
.feedback-select-row { display: flex; gap: 8px; margin-bottom: 10px; }
.feedback-select {
  flex: 1; background: var(--bg-base); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-size: 13px;
  padding: 9px 10px; box-sizing: border-box; font-family: inherit;
}
.feedback-select:focus { outline: none; border-color: var(--accent); }
.feedback-textarea {
  width: 100%; resize: vertical; background: var(--bg-base); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-size: 13px; line-height: 1.4;
  padding: 10px; box-sizing: border-box; font-family: inherit; margin-bottom: 10px; min-height: 120px;
}
.feedback-textarea:focus { outline: none; border-color: var(--accent); }
.feedback-screenshot-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-empty); margin-bottom: 8px;
}
.feedback-screenshot-row.active { border-color: var(--accent); }
.feedback-screenshot-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-primary); }
.feedback-screenshot-label svg { flex-shrink: 0; color: var(--text-secondary); }

.feedback-toggle-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.feedback-toggle-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.feedback-toggle-slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 999px;
  pointer-events: none; transition: background .15s;
}
.feedback-toggle-slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s;
}
.feedback-toggle-switch input:checked + .feedback-toggle-slider { background: var(--accent); }
.feedback-toggle-switch input:checked + .feedback-toggle-slider::before { transform: translateX(16px); }
.feedback-toggle-switch input:disabled + .feedback-toggle-slider { opacity: .6; }
.feedback-screenshot-preview { display: none; margin-bottom: 10px; }
.feedback-screenshot-preview.visible { display: block; }
.feedback-screenshot-preview canvas {
  max-width: 100%; max-height: 220px; width: 100%; height: auto;
  border-radius: 6px; border: 1px solid var(--border); display: block;
  cursor: crosshair; touch-action: none; background: var(--bg-base);
}
/* Doodle toolbar — pen colors + undo for annotating the captured
   screenshot before submission (see shell.js's feedback doodle logic). */
.feedback-doodle-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.feedback-doodle-color {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent;
  padding: 0; box-sizing: border-box; cursor: pointer;
}
.feedback-doodle-color.active { border-color: var(--text-primary); }
.feedback-doodle-undo-btn {
  margin-left: auto; font-size: 12px; color: var(--text-secondary);
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; cursor: pointer;
}
.feedback-doodle-undo-btn:hover:not(:disabled) { color: var(--text-primary); border-color: var(--accent); }
.feedback-doodle-undo-btn:disabled { opacity: .4; cursor: default; }
.feedback-status { font-size: 12px; color: var(--text-secondary); min-height: 16px; margin-bottom: 10px; text-align: center; }
.feedback-status.success { color: var(--positive); font-size: 14px; font-weight: 700; }

/* Auto-error-report toast — built dynamically in shell.js rather than
   living in dash.html/loader.html markup, so both pages stay in sync
   without editing HTML in two places for a purely JS-driven feature. */
.error-report-toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 3000; max-width: 320px;
  background: var(--bg-surface); border: 1px solid var(--negative); border-radius: 8px;
  padding: 12px 16px; font-size: 13px; color: var(--text-primary); line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s;
}
.error-report-toast.visible { opacity: 1; transform: translateY(0); }

/* Standalone floating icon button — only used on login.html, which has no
   header/shell of its own to sit inside. */
.standalone-icon-btn {
  position: fixed; top: 14px; right: 14px; z-index: 1100;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-primary);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.login-card { width: 100%; max-width: 340px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px; box-shadow: 0 12px 32px rgba(0,0,0,.3); box-sizing: border-box; }
.login-logo { display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.login-title { font-size: 16px; font-weight: 700; text-align: center; margin: 0 0 18px; color: var(--text-primary); }
.login-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin: 12px 0 4px; }
.login-input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 14px; padding: 9px 10px; box-sizing: border-box; }
.login-input:focus { outline: none; border-color: var(--accent); }
.login-error { font-size: 12px; color: var(--negative); min-height: 16px; margin-top: 10px; }
.login-hint { font-size: 13px; color: var(--text-secondary); text-align: center; line-height: 1.5; }
.login-submit { width: 100%; margin-top: 14px; padding: 10px; border: none; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.login-submit:disabled { opacity: .6; cursor: default; }
.login-submit:hover:not(:disabled) { filter: brightness(1.08); }
.login-toggle { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-secondary); }
.login-toggle a { color: var(--accent); text-decoration: none; margin-left: 4px; cursor: pointer; }
.login-toggle a:hover { text-decoration: underline; }
.login-optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-secondary); }
.login-privacy-link { text-align: center; margin: 10px 0 0; font-size: 12px; }
.login-privacy-link a { color: var(--text-secondary); }
.login-privacy-link a:hover { color: var(--accent); }

/* App-wide toasts (shell.js's showToast/showSuccessMessage/showErrorMessage/
   showWarningMessage) — moved here from loader.css since the functions
   themselves moved from loader.js to shell.js, so every app page can show
   one now, not just Load Builder. Status colors kept distinct at a glance,
   unlike the rest of the page's decorative color use. */
.loader-toast {
  /* top: 72px, not 20px — the app header is 56px tall (.app-header above)
     with its own z-index:1100; at top:20px this sat on top of it instead
     of below it, covering the header icons. */
  position: fixed; top: 72px; right: 20px; z-index: 9999; max-width: 360px;
  padding: 12px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.loader-toast-success { background: var(--positive); }
.loader-toast-error { background: var(--negative); }
.loader-toast-warning { background: #f5b400; color: #1a1300; }
