/* FONT-SKALERT */
/* GeoTask Pro — base styles */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e2126;
  background: #f3f4f6;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- Auth page ---------- */
.auth-body { min-height: 100vh; min-height: 100dvh; background: #fff; }
.auth-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: stretch;
}

@keyframes authFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes authPopIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Left brand panel */
.auth-brand-panel {
  flex: 1 1 44%; max-width: 560px;
  background: linear-gradient(160deg, #0f172a 0%, #111827 55%, #1e293b 100%);
  color: #fff;
  padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-brand-panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 70%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 70%);
}
.auth-brand-content { position: relative; max-width: 400px; }
.auth-brand-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 56px;
  animation: authFadeUp .5s ease both;
}
.auth-brand-logo-icon {
  width: 34px; height: 34px; flex-shrink: 0; background: #2563eb; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.auth-brand-heading {
  font-size: 30px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em;
  margin: 0 0 16px;
  animation: authFadeUp .5s ease .08s both;
}
.auth-brand-sub { font-size: 14px; line-height: 1.6; color: #cbd5e1; margin: 0 0 36px; animation: authFadeUp .5s ease .16s both; }
.auth-brand-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; animation: authFadeUp .5s ease .24s both; }
.auth-brand-list li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 13px; line-height: 1.5; color: #e2e8f0; font-weight: 500;
}
.auth-brand-list-icon {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; margin-top: 1px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center; color: #93c5fd;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.auth-brand-list li:hover .auth-brand-list-icon {
  background: rgba(59,130,246,0.22); border-color: rgba(96,165,250,0.4); transform: scale(1.08);
}

/* Decorative animated route/pin illustration */
.auth-brand-map { position: relative; margin: 20px 0 8px; opacity: 0.9; will-change: transform; }
.auth-brand-map-svg { width: 100%; height: auto; display: block; overflow: visible; }
.auth-map-route { stroke-dasharray: 7 11; animation: authRouteFlow 2.4s linear infinite; }
@keyframes authRouteFlow { to { stroke-dashoffset: -36; } }
.auth-map-pulse { transform-box: fill-box; transform-origin: center; animation: authPinPulse 2.2s ease-out infinite; }
@keyframes authPinPulse {
  0% { r: 5; opacity: 0.9; }
  100% { r: 15; opacity: 0; }
}
.auth-map-pin-lg path { filter: drop-shadow(0 0 6px rgba(59,130,246,0.85)); }

.auth-brand-footnote { position: relative; font-size: 11px; color: #64748b; font-weight: 600; }

/* Right form panel */
.auth-form-panel {
  flex: 1 1 56%;
  display: flex; align-items: center; justify-content: center;
  padding: 32px; background: #f4f6fa;
  position: relative;
}
.auth-form-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 20px;
  padding: 40px 36px; box-shadow: 0 24px 60px rgba(15,23,42,0.12), 0 4px 14px rgba(15,23,42,0.05);
  animation: authPopIn .45s cubic-bezier(.2,.8,.3,1) both;
}
.auth-mobile-logo {
  display: none; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 800; margin-bottom: 28px;
}
.auth-tabs { position: relative; display: flex; background: #f0f0f1; border-radius: 12px; padding: 4px; margin-bottom: 28px; }
.auth-tab-thumb {
  position: absolute; top: 4px; left: 4px; bottom: 4px; width: calc(50% - 4px);
  background: #fff; border-radius: 9px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform .3s cubic-bezier(.2,.8,.3,1);
}
.auth-tabs.tab-register .auth-tab-thumb { transform: translateX(100%); }
.auth-tab {
  position: relative; z-index: 1; flex: 1; border: none; background: transparent; padding: 10px; border-radius: 9px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #9ca3af;
  transition: color .15s ease;
}
.auth-tab.active { color: #111827; }
.auth-form-heading { margin-bottom: 22px; }
.auth-form-heading h2 { font-size: 21px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; }
.auth-form-heading p { font-size: 13px; color: #6b7280; margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field-label { font-size: 11px; font-weight: 700; color: #374151; }
.auth-field-label-row { display: flex; align-items: center; justify-content: space-between; }
.auth-forgot-link { background: none; border: none; padding: 0; font-size: 11px; font-weight: 700; color: #2563eb; transition: color .15s ease; }
.auth-forgot-link:hover { color: #1d4ed8; text-decoration: underline; }
.input-icon-row { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 14px; color: #9ca3af; pointer-events: none; transition: color .15s ease, transform .15s ease; }
.input-icon-row:focus-within .input-icon { color: #2563eb; transform: scale(1.08); }
.auth-form input {
  width: 100%; padding: 12px 14px 12px 40px; border-radius: 12px; border: 1px solid #e5e7eb;
  font-size: 14px; outline: none; background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-form input.has-toggle { padding-right: 42px; }
.auth-form input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.input-toggle-btn {
  position: absolute; right: 6px; width: 30px; height: 30px; border: none; background: none;
  color: #9ca3af; border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.input-toggle-btn:hover { background: #f3f4f6; color: #4b5563; }
.auth-error {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 14px;
  font-size: 13px; font-weight: 600; margin-bottom: 16px;
}
.auth-error.shake { animation: authShake .4s ease; }
@keyframes authShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.password-strength { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.password-strength-track { flex: 1; height: 4px; border-radius: 2px; background: #f0f1f3; overflow: hidden; }
.password-strength-bar { height: 100%; width: 0%; border-radius: 2px; background: #d1d5db; transition: width .2s ease, background .2s ease; }
.password-strength-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #9ca3af; flex-shrink: 0; }
.password-strength[data-level="weak"] .password-strength-bar { background: #ef4444; }
.password-strength[data-level="weak"] .password-strength-label { color: #dc2626; }
.password-strength[data-level="medium"] .password-strength-bar { background: #f59e0b; }
.password-strength[data-level="medium"] .password-strength-label { color: #d97706; }
.password-strength[data-level="strong"] .password-strength-bar { background: #22c55e; }
.password-strength[data-level="strong"] .password-strength-label { color: #16a34a; }
.auth-footnote { font-size: 11px; color: #9ca3af; line-height: 1.5; margin-top: 24px; }

@media (max-width: 900px) {
  .auth-brand-panel { display: none; }
  .auth-form-panel { background: #fff; padding: 24px; }
  .auth-mobile-logo { display: flex; }
  .auth-form-card { box-shadow: none; padding: 0; animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand-logo, .auth-brand-heading, .auth-brand-sub, .auth-brand-list, .auth-form-card { animation: none; }
  .auth-map-route, .auth-map-pulse { animation: none; }
}

.btn {
  border: none; border-radius: 10px; font-weight: 700; letter-spacing: 0.01em;
  font-size: 12.5px; padding: 10px 18px; transition: transform .1s ease, opacity .2s ease, background .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-primary { background: #2563eb; color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,0.28); }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: 0.5; box-shadow: none; }
.btn-dark { background: #111827; color: #fff; }
.btn-dark:hover { background: #1f2937; }
.btn-ghost { background: transparent; color: #4b5563; }
.btn-ghost:hover { background: #e5e7eb; }
.btn-danger-ghost { background: transparent; color: #dc2626; border: 1px solid transparent; }
.btn-danger-ghost:hover { background: #fef2f2; border-color: #fecaca; }
.btn-danger-ghost.confirming { background: #dc2626; color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 8px; }
.link-btn { background: none; border: none; color: #2563eb; font-weight: 700; font-size: 12px; transition: color .15s ease; }
.link-btn:hover { color: #1d4ed8; }

/* ---------- App shell ---------- */
.app-shell {
  height: 100vh;
  height: 100dvh; /* accounts for mobile browser toolbars so the bottom never gets clipped */
  display: flex; flex-direction: column; overflow: hidden;
}
.app-header {
  height: 64px; background: #fff; border-bottom: 1px solid #e9eaed;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; flex-shrink: 0; z-index: 1050;
}
.header-left, .header-right { display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 32px; height: 32px; background: #111827; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.brand-name { font-weight: 700; letter-spacing: -0.01em; font-size: 14px; color: #111827; }
.icon-btn {
  width: 38px; height: 38px; border: none; background: #f3f4f6; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 14px; color: #4b5563;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: #e5e7eb; }
.icon-btn.primary { background: #111827; color: #fff; }
.icon-btn.primary:hover { background: #1f2937; }
.icon-btn.danger { background: transparent; color: #9ca3af; }
.icon-btn.danger:hover { background: #fef2f2; color: #dc2626; }
.icon-btn.floating { background: rgba(255,255,255,0.95); box-shadow: 0 8px 20px rgba(15,23,42,0.14); border: 1px solid #e5e7eb; }
.lg-hidden { display: none; }

.view-switch { display: flex; background: #f3f4f6; padding: 4px; border-radius: 12px; }
.view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; padding: 8px 18px; border-radius: 9px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #9ca3af;
  transition: background .15s ease, color .15s ease;
}
.view-btn.active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(15,23,42,0.1); }

.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: none; background: #f3f4f6; color: #4b5563;
  transition: background .15s ease, color .15s ease;
}
.user-menu-btn:hover { background: #e5e7eb; color: #111827; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: #2563eb; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
}
.user-avatar-lg { width: 38px; height: 38px; font-size: 12.5px; }
.user-menu-btn-name { font-size: 12.5px; font-weight: 700; color: #111827; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-chevron { flex-shrink: 0; color: #9ca3af; transition: transform .15s ease; }
.user-menu-chevron.open { transform: rotate(180deg); }
.user-menu-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 1002; width: 230px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 12px 28px rgba(15,23,42,0.14);
  overflow: hidden;
}
.user-menu-info { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #f3f4f6; }
.user-menu-name { font-size: 12.5px; font-weight: 700; color: #111827; }
.user-menu-role { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-top: 2px; }
.user-menu-item {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border: none; background: none;
  color: #374151; font-size: 12px; font-weight: 700; text-align: left;
}
.user-menu-item:hover { background: #f9fafb; }
.user-menu-logout { color: #dc2626; border-top: 1px solid #f3f4f6; }
.user-menu-logout:hover { background: #fef2f2; }

.app-main { flex: 1; display: flex; overflow: hidden; position: relative; }

.mobile-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.2); backdrop-filter: blur(2px); z-index: 1005; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 360px; background: #fff; border-right: 1px solid #e9eaed;
  display: flex; flex-direction: column; height: 100%; flex-shrink: 0; z-index: 1010;
}
.sidebar-top { padding: 18px 20px; border-bottom: 1px solid #f0f1f3; }
.sidebar-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.sidebar-action-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

.new-project-panel { margin-bottom: 20px; padding: 14px; background: #f9fafb; border-radius: 14px; border: 1px solid #f0f1f3; }
.new-project-panel h4 { margin: 0 0 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #6b7280; }
.input-row { display: flex; gap: 8px; }
.input-row input, .input-row select { flex: 1; padding: 9px 12px; border-radius: 12px; border: 1px solid #e5e7eb; font-size: 12px; outline: none; }

.search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.search-box { position: relative; flex: 1; min-width: 0; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #111827; pointer-events: none; }
.search-box input {
  width: 100%; min-width: 0; padding: 9px 12px 9px 32px; border-radius: 10px; border: 1px solid #e5e7eb;
  background: #f9fafb; font-size: 12.5px; outline: none; transition: border-color .15s ease, background .15s ease;
}
.search-box input:focus { background: #fff; border-color: #111827; }
.chip-toggle {
  flex-shrink: 0; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; border-radius: 10px;
  padding: 9px 12px; font-size: 11px; font-weight: 700; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip-toggle:hover { border-color: #d1d5db; }
.chip-toggle.active { background: #111827; color: #fff; border-color: #111827; }
.sort-select {
  flex-shrink: 0; appearance: none; border: 1px solid #e5e7eb; background: #fff; border-radius: 10px;
  padding: 9px 24px 9px 10px; font-size: 11px; font-weight: 600; color: #4b5563;
}
.sort-select.full { width: 100%; padding: 10px 12px; }

.filter-group { margin-bottom: 14px; }
.filter-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #9ca3af; margin-bottom: 7px; }
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip-row.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  white-space: nowrap; border: 1px solid #e5e7eb; background: #fff; color: #6b7280;
  border-radius: 8px; padding: 6px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em; display: flex; align-items: center; gap: 6px; transition: background .12s ease, border-color .12s ease;
}
.chip:hover:not(.active) { border-color: #d1d5db; background: #f9fafb; }
.chip.active { background: #111827; color: #fff; border-color: #111827; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Filter dropdowns (Prosjekt / Type / Område / Utstyr) ---------- */
/* A dropdown opens *inline*: its list pushes the filters below it down
   instead of floating on top of them, so nothing is ever covered — and on a
   phone it just scrolls along with the rest of the sidebar. */
.project-picker { position: relative; }
.project-picker-btn {
  width: 100%; display: flex; align-items: center; gap: 9px; min-height: 40px;
  border: 1px solid #e5e7eb; background: #fff; border-radius: 12px; padding: 8px 12px;
  font-size: 12.5px; font-weight: 600; color: #1f2937; text-align: left;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.project-picker-btn:hover { border-color: #cbd5e1; background: #fcfcfd; }
.project-picker-btn:focus-visible { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.18); }
.project-picker:has(.project-picker-panel:not(.hidden)) .project-picker-btn { border-color: #111827; box-shadow: 0 0 0 3px rgba(17,24,39,0.08); }
.project-picker-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-picker-count {
  flex-shrink: 0; min-width: 26px; padding: 2px 7px; border-radius: 999px; background: #f3f4f6; color: #6b7280;
  font-size: 10px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.project-picker-chevron { flex-shrink: 0; color: #9ca3af; font-size: 11px; transition: transform .2s ease, color .2s ease; }
.project-picker:has(.project-picker-panel:not(.hidden)) .project-picker-chevron { transform: rotate(180deg); color: #111827; }
.proj-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: #111827; }
.project-picker-panel {
  margin-top: 8px; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15,23,42,0.08); overflow: hidden; display: flex; flex-direction: column;
}
/* The project dropdown is the main selector — Type / Område / Utstyr only
   narrow things down inside it — so it sits in its own tinted card with a
   blue accent and a slightly bigger, bolder button. */
.filter-group-project {
  padding: 11px 12px 12px; margin-bottom: 18px; border-radius: 16px;
  background: linear-gradient(180deg, #f6f9ff 0%, #eef4ff 100%); border: 1px solid #d6e3fb;
}
.filter-group-project .filter-label { color: #2563eb; margin-bottom: 8px; }
.project-picker-main .project-picker-btn {
  min-height: 48px; border-radius: 12px; border-color: #bcd0f7; background: #fff;
  font-size: 13px; font-weight: 700; color: #0f172a;
  box-shadow: 0 1px 2px rgba(37,99,235,0.08), 0 3px 10px rgba(37,99,235,0.10);
}
.project-picker-main .project-picker-btn:hover { border-color: #8fb0f2; background: #fff; }
.project-picker-main .project-picker-btn:focus-visible { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.22); }
.project-picker-main .proj-dot { width: 11px; height: 11px; box-shadow: 0 0 0 3px rgba(15,23,42,0.07); }
.project-picker-main .project-picker-count { background: #e6eefd; color: #2563eb; }
.project-picker-main .project-picker-chevron { color: #2563eb; }
.project-picker-main:has(.project-picker-panel:not(.hidden)) .project-picker-btn { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.16); }
.project-picker-main:has(.project-picker-panel:not(.hidden)) .project-picker-chevron { color: #2563eb; }
.project-picker-main .project-picker-panel { border-color: #bcd0f7; box-shadow: 0 6px 18px rgba(37,99,235,0.12); }
.project-picker-main .project-picker-item.active { background: #2563eb; }
.project-picker-search {
  border: none; border-bottom: 1px solid #f1f2f4; padding: 10px 12px; font-size: 12.5px; outline: none;
  width: 100%; box-sizing: border-box; background: #fff;
}
.project-picker-search::placeholder { color: #9ca3af; }
.project-picker-list { max-height: min(300px, 42vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.project-picker-item {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; border-radius: 10px; border: none; background: none;
  width: 100%; text-align: left; font-size: 12px; font-weight: 600; color: #374151;
  transition: background .12s ease;
}
.project-picker-item:hover { background: #f3f4f6; }
.project-picker-item.active { background: #111827; color: #fff; }
.project-picker-item.active .project-picker-item-count { color: rgba(255,255,255,0.65); }
.project-picker-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-picker-item-count { flex-shrink: 0; font-size: 10px; color: #9ca3af; font-weight: 700; font-variant-numeric: tabular-nums; }
.project-picker-item-del,
.project-picker-item-pin,
.project-picker-item-members,
.project-picker-item-rename,
.project-picker-item-move {
  flex-shrink: 0; opacity: 0; border: none; background: none; font-size: 13px; line-height: 1; padding: 5px 6px; border-radius: 7px;
}
.project-picker-item-del { color: #f87171; }
.project-picker-item-pin,
.project-picker-item-members,
.project-picker-item-rename,
.project-picker-item-move { color: #9ca3af; }
.project-picker-item-move { font-size: 11px; padding: 5px 4px; }
.project-picker-item-pin.set { opacity: 1; color: #2563eb; }
.project-picker-item:hover .project-picker-item-del,
.project-picker-item:hover .project-picker-item-pin,
.project-picker-item:hover .project-picker-item-members,
.project-picker-item:hover .project-picker-item-rename,
.project-picker-item:hover .project-picker-item-move { opacity: 1; }
.project-picker-item-del:hover { background: #fef2f2; color: #dc2626; }
.project-picker-item-pin:hover,
.project-picker-item-rename:hover { background: #eff6ff; color: #2563eb; }
.project-picker-item-members:hover,
.project-picker-item-move:hover:not(:disabled) { background: #f3f4f6; color: #111827; }
.project-picker-item.active .project-picker-item-pin.set { color: #93c5fd; }
.project-picker-item-move:disabled { opacity: 0 !important; cursor: default; }
/* With a mouse the per-row actions stay out of the way (taking no room at
   all, so names get the full width) until the row is hovered or focused. */
@media (hover: hover) {
  .project-picker-item-del,
  .project-picker-item-pin,
  .project-picker-item-members,
  .project-picker-item-rename,
  .project-picker-item-move { display: none; }
  .project-picker-item-pin.set,
  .project-picker-item:hover .project-picker-item-del,
  .project-picker-item:hover .project-picker-item-pin,
  .project-picker-item:hover .project-picker-item-members,
  .project-picker-item:hover .project-picker-item-rename,
  .project-picker-item:hover .project-picker-item-move,
  .project-picker-item:focus-within .project-picker-item-del,
  .project-picker-item:focus-within .project-picker-item-pin,
  .project-picker-item:focus-within .project-picker-item-members,
  .project-picker-item:focus-within .project-picker-item-rename,
  .project-picker-item:focus-within .project-picker-item-move { display: inline-block; }
}
/* No hover on a touchscreen — so the per-row actions (rename, delete,
   reorder, ...) would otherwise be invisible there. Always show them. */
@media (hover: none) {
  .project-picker-item-del,
  .project-picker-item-pin,
  .project-picker-item-members,
  .project-picker-item-rename,
  .project-picker-item-move { opacity: 0.85; padding: 7px 6px; }
  .project-picker-item-move { padding: 7px 4px; }
}
.project-picker-empty { padding: 18px; text-align: center; font-size: 11px; color: #9ca3af; font-weight: 700; text-transform: uppercase; }

.project-picker-sort-row {
  display: flex; justify-content: flex-end; padding: 4px 8px; border-bottom: 1px solid #f1f2f4; background: #fafafb;
}
.project-picker-sort-row .link-btn { padding: 7px 8px; border-radius: 8px; }
.project-picker-sort-row .link-btn:hover:not(:disabled) { background: #eff6ff; }
.project-picker-sort-row .link-btn:disabled { opacity: 0.4; cursor: default; }

.type-picker-create { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #f1f2f4; background: #fafafb; }
.type-picker-create input {
  flex: 1; min-width: 0; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 11px; font-size: 12.5px; outline: none; background: #fff;
}
.type-picker-create input:focus { border-color: #111827; }
.type-picker-create .btn { flex-shrink: 0; }

.sidebar-filter-summary { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.sidebar-filter-summary span { font-size: 10px; font-weight: 800; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.08em; }

.load-more-wrap { display: flex; justify-content: center; padding: 16px; }

.task-list { flex: 1; overflow-y: auto; background: #fafafa; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.task-list-empty { text-align: center; padding: 40px 12px; opacity: 0.4; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

.task-card {
  width: 100%; text-align: left; background: #fff; border: 1px solid #e9eaed; border-radius: 12px;
  padding: 14px; box-shadow: 0 1px 2px rgba(15,23,42,0.03);
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
.task-card:active { transform: scale(0.99); }
.task-card:hover { box-shadow: 0 4px 14px rgba(15,23,42,0.08); border-color: #d1d5db; }
.task-card.selected { border-color: #111827; box-shadow: 0 0 0 1px #111827; }
.task-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.task-card-status { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.task-card-id { font-size: 10px; font-weight: 600; color: #9ca3af; margin-top: 2px; }
.task-card-priority { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 6px; background: #f3f4f6; color: #6b7280; }
.task-card-priority.urgent { background: #fee2e2; color: #dc2626; }
.task-card-project { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 6px; background: #eff6ff; color: #2563eb; margin-top: 4px; }
.task-card-title { font-weight: 600; font-size: 12.5px; margin: 0 0 4px; color: #111827; }
.task-card-desc { font-size: 12px; color: #6b7280; margin: 0 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-card-footer { display: flex; justify-content: space-between; border-top: 1px solid #f3f4f6; padding-top: 8px; font-size: 10px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Content / Map ---------- */
.content-area { flex: 1; position: relative; overflow: hidden; }
.view-panel { position: absolute; inset: 0; }
.map-container { width: 100%; height: 100%; }

.map-filter-toggle-wrap { position: absolute; top: 16px; left: 16px; z-index: 400; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.map-filter-panel {
  width: min(340px, calc(100vw - 32px)); background: rgba(255,255,255,0.98); border: 1px solid #e5e7eb; border-radius: 14px;
  box-shadow: 0 16px 36px rgba(15,23,42,0.16); overflow: hidden;
}
.map-filter-header { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; background: #fafafa; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #6b7280; }
.map-filter-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 16px; max-height: 60vh; max-height: 60dvh; overflow-y: auto; overscroll-behavior: contain; }
.map-filter-footer { padding: 12px 16px; background: #fafafa; border-top: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; }
.map-filter-footer span { font-size: 10px; font-weight: 700; color: #9ca3af; }

.map-instructions {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.92); border: 1px solid #e5e7eb; padding: 8px 16px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; z-index: 400; pointer-events: none;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}
.duplicate-banner {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 1000;
  background: #facc15; color: #111827; padding: 12px 24px; border-radius: 999px; font-weight: 900;
  text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; box-shadow: 0 15px 30px rgba(0,0,0,0.2); border: 2px solid #fff;
}
.street-view-btn {
  position: absolute; bottom: 24px; right: 24px; z-index: 400; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #fff; color: #4b5563; font-size: 18px; box-shadow: 0 10px 24px rgba(15,23,42,0.18);
}
.street-view-btn.active { background: #facc15; color: #111827; }

.locate-me-btn {
  position: absolute; bottom: 144px; right: 24px; z-index: 400; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #fff; color: #4b5563; box-shadow: 0 10px 24px rgba(15,23,42,0.18);
  display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease;
}
.locate-me-btn:hover { background: #f3f4f6; }
.locate-me-btn.active { background: #2563eb; color: #fff; }
/* Status pill beside the locate button while the GPS position is being refined */
.gps-status {
  position: absolute; right: 84px; bottom: 154px; z-index: 400; max-width: calc(100% - 190px);
  padding: 7px 13px; border-radius: 14px; background: rgba(255,255,255,0.97); border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15,23,42,0.14); font-size: 12px; font-weight: 700; line-height: 1.35; color: #374151; text-align: right;
}
.gps-status[data-tone="good"] { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.gps-status[data-tone="warn"] { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.gps-status[data-tone="bad"] { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.locate-me-btn.spinning svg { animation: locate-me-spin 1s linear infinite; }
@keyframes locate-me-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Locked (default) = task markers aren't draggable, so panning around on
   mobile can't accidentally move one. .active = unlocked, markers can be
   dragged to reposition a task (see state.isMoveMode). */
.move-mode-btn {
  position: absolute; bottom: 204px; right: 24px; z-index: 400; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #fff; color: #4b5563; box-shadow: 0 10px 24px rgba(15,23,42,0.18);
  display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease;
}
.move-mode-btn:hover { background: #f3f4f6; }
.move-mode-btn.active { background: #2563eb; color: #fff; }

.my-location-marker { position: relative; }
.my-location-dot {
  position: absolute; top: 7px; left: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: #2563eb; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.my-location-pulse {
  position: absolute; top: 1px; left: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(37,99,235,0.35); animation: my-location-pulse 2s ease-out infinite;
}
@keyframes my-location-pulse {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ---------- Cable drawing ---------- */
.cable-draw-btn {
  position: absolute; bottom: 84px; right: 24px; z-index: 400; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #fff; color: #4b5563; box-shadow: 0 10px 24px rgba(15,23,42,0.18);
  display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease;
}
.cable-draw-btn:hover:not(:disabled) { background: #f3f4f6; }
.cable-draw-btn.active { background: #2563eb; color: #fff; }
.cable-draw-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.leaflet-container.cable-draw-cursor { cursor: crosshair !important; }

.cable-draw-toolbar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 900;
  background: rgba(255,255,255,0.98); border: 1px solid #e5e7eb; border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15,23,42,0.16); padding: 10px 14px;
  display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 32px));
}
#cable-draw-hint { font-size: 12px; font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cable-draw-toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Bulk select ---------- */
/* These sit outside #map-view (as content-area-level siblings, so they also
   show up in table view), which means they don't benefit from being nested
   alongside the map's own floating controls. Leaflet's internal panes/corner
   controls carry their own z-index values (up to 1000) that otherwise leak
   past .view-panel's lack of a stacking context and paint over anything
   below ~1000 — hence the same high z-index tier as .map-search/.duplicate-banner. */
.bulk-select-btn {
  position: absolute; bottom: 24px; left: 24px; z-index: 1002; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #fff; color: #4b5563; box-shadow: 0 10px 24px rgba(15,23,42,0.18);
  display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease;
}
.bulk-select-btn:hover { background: #f3f4f6; }
.bulk-select-btn.active { background: #2563eb; color: #fff; }

.bulk-action-bar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1002;
  background: #111827; color: #fff; border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15,23,42,0.24); padding: 10px 12px 10px 18px;
  display: flex; align-items: center; gap: 16px; max-width: min(560px, calc(100vw - 32px));
}
#bulk-action-count { font-size: 12px; font-weight: 700; white-space: nowrap; }
.bulk-action-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.bulk-action-buttons .btn-ghost { color: #d1d5db; }
.bulk-action-buttons .btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* ---------- Map underlays ---------- */
/* Same content-area-level positioning/z-index reasoning as .bulk-select-btn above. */
.overlay-manage-btn {
  position: absolute; bottom: 84px; left: 24px; z-index: 1002; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #fff; color: #4b5563; box-shadow: 0 10px 24px rgba(15,23,42,0.18);
  display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease;
}
.overlay-manage-btn:hover { background: #f3f4f6; }
.overlay-place-hint { text-align: left; margin: 10px 0 0; }
.overlay-upload-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
#overlay-file-input { width: 100%; font-size: 12px; }
.overlay-opacity-slider { width: 90px; flex-shrink: 0; }
.overlay-reposition-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e5e7eb; background: #fff;
  color: #374151; padding: 6px 10px; border-radius: 8px; font-size: 11px; font-weight: 700;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.overlay-reposition-btn:hover { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
/* Narrow screens: the name gets its own line instead of being squeezed to nothing between the controls. */
@media (max-width: 480px) {
  .overlay-row { flex-wrap: wrap; }
  .overlay-row .member-row-info { flex: 1 1 100%; }
  .overlay-row .overlay-opacity-slider { flex: 1; width: auto; }
}

/* ---- Underlay editor (place / move / scale / rotate an underlay) ---- */
/* Sits at content-area level like the other floating tools, so it needs
   the same high z-index tier as .bulk-select-btn above. */
.overlay-editor-toolbar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1002;
  width: min(480px, calc(100vw - 24px)); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  background: rgba(255,255,255,0.98); border: 1px solid #e5e7eb; border-radius: 16px;
  box-shadow: 0 14px 32px rgba(15,23,42,0.18);
}
.overlay-editor-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.overlay-editor-heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.overlay-editor-heading strong { font-size: 13px; color: #111827; }
.overlay-editor-readout { font-size: 11px; font-weight: 600; color: #6b7280; }
.overlay-editor-actions { display: flex; gap: 6px; flex-shrink: 0; }
.overlay-editor-tools { justify-content: flex-start; gap: 12px; padding-top: 10px; border-top: 1px solid #f0f1f3; }
.overlay-editor-opacity { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; color: #6b7280; }
.overlay-editor-hint { font-size: 11px; line-height: 1.4; color: #6b7280; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: #f3f4f6; border-radius: 10px; }
.segmented-btn {
  border: none; background: transparent; color: #6b7280; padding: 6px 11px; border-radius: 8px;
  font-size: 11px; font-weight: 700; transition: background .12s ease, color .12s ease;
}
.segmented-btn.active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(15,23,42,0.15); }
/* On a phone the toolbar would otherwise cover a third of the map — the
   handles explain themselves, so drop the hint text there. */
@media (max-width: 640px) {
  .overlay-editor-toolbar { top: 8px; padding: 10px 12px; }
  .overlay-editor-hint { display: none; }
}

/* ---------- Backup ---------- */
/* Stacked above .overlay-manage-btn, same positioning/z-index tier. */
.backup-manage-btn {
  position: absolute; bottom: 144px; left: 24px; z-index: 1002; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #fff; color: #4b5563; box-shadow: 0 10px 24px rgba(15,23,42,0.18);
  display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease;
}
.backup-manage-btn:hover { background: #f3f4f6; }
.backup-hint { text-align: left; margin: 0 0 12px; }
.backup-target-row { display: flex; gap: 18px; margin: 14px 0; }
.backup-radio { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #374151; cursor: pointer; }
.backup-radio input { margin: 0; }
#backup-import-result { text-align: left; color: #16a34a; margin-top: 12px; }
/* Handles of the underlay editor: the marker box is a roomy 34px touch
   target around a smaller visible dot. */
.overlay-handle { display: flex; align-items: center; justify-content: center; }
.overlay-handle-dot {
  display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  background: #f59e0b; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.38); cursor: grab;
  box-sizing: content-box; transition: border-radius .12s ease;
}
.overlay-handle-corner .overlay-handle-dot:active { cursor: grabbing; }
/* In "Fri form" the corners turn square, hinting they move on their own. */
.overlay-free-mode .overlay-handle-corner .overlay-handle-dot { border-radius: 5px; background: #ef4444; }
.overlay-handle-rotate .overlay-handle-dot {
  width: 22px; height: 22px; background: #2563eb; color: #fff; font-size: 13.5px; font-weight: 700; line-height: 1;
}
.overlay-editing { cursor: move !important; touch-action: none; }

.cable-vertex-handle {
  width: 14px; height: 14px; border-radius: 50%; background: #2563eb; border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35); cursor: move;
}
.saved-flash { color: #16a34a !important; font-weight: 700; }

.map-search {
  position: absolute; top: 16px; left: 64px; z-index: 1000; background: rgba(255,255,255,0.97);
  border: 1px solid #e5e7eb; border-radius: 22px; box-shadow: 0 8px 22px rgba(15,23,42,0.12);
  display: flex; align-items: center; height: 44px; overflow: hidden;
  width: 44px; transition: width .2s ease;
}
.map-search.expanded { width: min(320px, calc(100vw - 140px)); }
.map-search-toggle {
  width: 44px; height: 44px; flex-shrink: 0; border: none; background: none; color: #111827;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.map-search-toggle:active { background: #f3f4f6; }
.map-search-icon { display: inline-flex; }
.map-search-icon.spinning { animation: map-search-spin 0.8s linear infinite; }
@keyframes map-search-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.map-search input {
  border: none; outline: none; background: transparent; padding: 8px 4px; font-size: 13px;
  flex: 1; min-width: 0; opacity: 0; transition: opacity .15s ease;
}
.map-search.expanded input { opacity: 1; }
.map-search-clear {
  width: 40px; height: 40px; flex-shrink: 0; border: none; background: none; color: #9ca3af;
  display: none; align-items: center; justify-content: center; border-radius: 50%; margin-right: 2px;
}
.map-search.expanded .map-search-clear { display: flex; }
.map-search-clear:hover { background: #f3f4f6; color: #111827; }
.map-search-results {
  position: absolute; top: 48px; left: 0; width: max(300px, 100%); background: #fff; border: 1px solid #e5e7eb;
  border-radius: 14px; box-shadow: 0 12px 28px rgba(15,23,42,0.14); overflow: hidden; z-index: 1001;
}
.map-search-result { display: block; width: 100%; text-align: left; border: none; background: none; padding: 14px 16px; }
.map-search-result:hover, .map-search-result:active { background: #eff6ff; }
.map-search-result-title { font-size: 13px; font-weight: 700; }
.map-search-result-sub { font-size: 10px; color: #9ca3af; text-transform: uppercase; font-weight: 700; margin-top: 2px; }
.map-search-message { padding: 14px; font-size: 12px; color: #6b7280; font-weight: 600; text-align: center; }

/* Marker */
.geotask-marker { position: relative; }
.geotask-marker-body {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.geotask-marker-inner { transform: rotate(45deg); color: #fff; font-size: 13px; }
.geotask-marker.selected .geotask-marker-body { box-shadow: 0 0 0 4px rgba(37,99,235,0.45), 0 4px 10px rgba(0,0,0,0.25); }
.geotask-marker-check {
  position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 50%;
  background: #2563eb; color: #fff; border: 2px solid #fff; font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 12px 32px rgba(15,23,42,0.2); }

/* Small confirm popups (move a task / delete a cable point) */
.geotask-popup { min-width: 200px; }
.geotask-popup-actions { display: flex; gap: 6px; }
.geotask-popup-actions .btn { flex: 1; padding: 8px; font-size: 9px; }

/* ---------- Info popups (a task or a cable clicked on the map) ---------- */
/* Everything is scoped under .geotask-info-popup — Leaflet's own popup CSS
   (margins on <p>, content padding, close button) would otherwise win. */
.geotask-info-popup .leaflet-popup-content-wrapper {
  border-radius: 16px; padding: 0;
  box-shadow: 0 18px 44px rgba(15,23,42,0.22), 0 2px 6px rgba(15,23,42,0.08);
}
.geotask-info-popup .leaflet-popup-content { margin: 0; font-size: 12px; line-height: 1.4; font-family: inherit; }
.geotask-info-popup .leaflet-popup-tip { box-shadow: 0 6px 14px rgba(15,23,42,0.12); }
.leaflet-container .geotask-info-popup a.leaflet-popup-close-button {
  top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 8px;
  font-family: inherit; font-size: 17px; font-weight: 400; line-height: 25px;
  color: #9ca3af; transition: background .12s ease, color .12s ease;
}
.leaflet-container .geotask-info-popup a.leaflet-popup-close-button:hover { background: #f3f4f6; color: #111827; }

.geotask-info-popup .popup-card { padding: 14px 16px 16px; }
/* right padding keeps the pills clear of the close button */
.geotask-info-popup .popup-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-right: 28px; margin-bottom: 12px; }
.geotask-info-popup .popup-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: #f3f4f6; color: #374151; font-size: 10px; font-weight: 700; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.geotask-info-popup .popup-pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.geotask-info-popup .popup-pill-line { width: 14px; height: 4px; border-radius: 2px; }
.geotask-info-popup .popup-id { font-size: 11px; font-weight: 600; color: #9ca3af; margin-bottom: 3px; }
.geotask-info-popup .popup-title {
  margin: 0; font-size: 13.5px; line-height: 1.3; font-weight: 700; color: #111827; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.geotask-info-popup .popup-desc {
  margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: #6b7280;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.geotask-info-popup .popup-meta {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: start;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0f1f3;
}
.geotask-info-popup .popup-meta-label { padding-top: 2px; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #9ca3af; }
.geotask-info-popup .popup-meta-value { display: flex; align-items: flex-start; gap: 7px; min-width: 0; font-size: 12px; font-weight: 600; line-height: 1.35; color: #1f2937; overflow-wrap: anywhere; }
.geotask-info-popup .popup-meta-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.geotask-info-popup .popup-address { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; font-size: 11px; line-height: 1.4; color: #6b7280; }
.geotask-info-popup .popup-address svg { flex-shrink: 0; margin-top: 1px; color: #9ca3af; }
.geotask-info-popup .popup-actions { display: flex; gap: 8px; margin-top: 16px; }
.geotask-info-popup .popup-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .1s ease;
}
.geotask-info-popup .popup-btn:active { transform: scale(0.97); }
.geotask-info-popup .popup-btn-primary { flex: 1; background: #111827; color: #fff; }
.geotask-info-popup .popup-btn-primary:hover { background: #1f2937; }
.geotask-info-popup .popup-btn-icon { flex: none; width: 38px; padding: 0; background: #fff; color: #4b5563; border-color: #e5e7eb; }
.geotask-info-popup .popup-btn-icon:hover { background: #f3f4f6; color: #111827; }
.geotask-info-popup .popup-btn-icon.active { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.geotask-info-popup .popup-btn-danger { color: #dc2626; }
.geotask-info-popup .popup-btn-danger:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
@media (pointer: coarse) {
  .geotask-info-popup .popup-btn { height: 44px; }
  .geotask-info-popup .popup-btn-icon { width: 44px; }
}

.geotask-move-confirm { min-width: 200px; }
.geotask-move-confirm-title { font-size: 12px; font-weight: 700; color: #111827; margin-bottom: 10px; line-height: 1.4; }
.geotask-move-popup .leaflet-popup-content-wrapper { border: 2px solid #2563eb; box-shadow: 0 10px 30px rgba(37,99,235,0.25); }

/* ---------- Table ---------- */
.table-toolbar { display: flex; justify-content: flex-end; align-items: center; padding: 12px 20px; background: #fafafa; border-bottom: 1px solid #f0f1f3; }
.table-toolbar .btn { display: inline-flex; align-items: center; gap: 7px; }
.task-table { width: 100%; border-collapse: collapse; background: #fff; }
.task-table thead th {
  text-align: left; padding: 13px 20px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #9ca3af; background: #fafafa; border-bottom: 1px solid #f0f1f3;
}
.task-table tbody td { padding: 13px 20px; border-bottom: 1px solid #f3f4f6; font-size: 12.5px; vertical-align: top; }
.task-table tbody tr:hover { background: #fafafa; cursor: pointer; }
.task-table tbody tr.row-selected { background: #eff6ff; }
.table-select-col { display: none; width: 1%; padding-right: 0 !important; }
.task-table.bulk-mode .table-select-col { display: table-cell; }
.table-select-col input[type=checkbox] { pointer-events: none; width: 16px; height: 16px; }
.table-empty { text-align: center; padding: 60px 12px; opacity: 0.45; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.table-actions { display: flex; gap: 6px; }
.table-actions button { border: none; background: none; padding: 6px; border-radius: 8px; color: #9ca3af; font-size: 13px; }
.table-actions button:hover { background: #f3f4f6; color: #2563eb; }
.table-actions .del:hover { background: #fef2f2; color: #dc2626; }
.status-dot-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 2px; }
.badge-priority { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; padding: 3px 8px; border-radius: 6px; background: #f3f4f6; color: #6b7280; }
.badge-priority.urgent { background: #fef2f2; color: #dc2626; }
#table-view.view-panel { overflow: auto; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55); backdrop-filter: blur(6px);
  z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card { width: 100%; max-width: 540px; max-height: 90vh; max-height: 90dvh; background: #fff; border-radius: 16px; box-shadow: 0 24px 56px rgba(15,23,42,0.28); display: flex; flex-direction: column; overflow: hidden; }
.modal-header { padding: 18px 22px; border-bottom: 1px solid #f0f1f3; background: #fafafa; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 14px; font-weight: 700; color: #111827; }
.modal-header-title { display: flex; align-items: center; gap: 12px; }
.modal-header-icon {
  width: 34px; height: 34px; border-radius: 50%; background: #eff6ff; color: #2563eb;
  display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 700; flex-shrink: 0;
}
.modal-body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 12.5px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.field textarea { resize: none; }

/* Soft-tinted variant used for Status/Prioritet (colored dynamically via JS
   custom properties to match the selected value) and for Farge/Vedlegg
   (static gray/purple tint) — gives the modal visual grouping without
   replacing the underlying native <select>/<input> controls. */
.field-tint-box {
  border-radius: 12px; padding: 10px 14px 12px; border: 1px solid var(--tint-border, #e5e7eb);
  background: var(--tint-bg, #f9fafb); transition: background .15s ease, border-color .15s ease;
}
.field-tint-box label { display: flex; align-items: center; gap: 6px; }
.field-tint-icon { font-size: 11px; color: var(--tint-text, inherit); }
.field.field-tint-box select {
  border: none; background: transparent; padding: 3px 0 0; font-weight: 700; font-size: 13px;
  color: var(--tint-text, #111827);
}
.field.field-tint-box select:focus { box-shadow: none; }
.type-select-row { display: flex; align-items: center; gap: 8px; }
.type-select-row select { flex: 1; min-width: 0; }
.type-select-row .btn { flex-shrink: 0; }
.type-select-row select:disabled { background: #f9fafb; color: #9ca3af; cursor: not-allowed; }
.type-select-row .btn:disabled { opacity: 0.4; cursor: not-allowed; }

.color-row { display: flex; align-items: center; gap: 8px; }
#bulk-color-picker-row { margin-top: 8px; }
.field-checkbox { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: #6b7280; font-weight: 600; }
.field-checkbox input { width: auto; }
.color-row input[type=text] { flex: 1; font-family: monospace; }
.color-row input[type=color] { width: 40px; height: 38px; padding: 2px; border-radius: 10px; border: 1px solid #e5e7eb; }
.location-banner { background: #eff6ff; color: #1d4ed8; border-radius: 10px; padding: 12px 16px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.location-icon { font-size: 13px; flex-shrink: 0; }
.location-pick-btn { margin-left: auto; flex-shrink: 0; white-space: nowrap; }
.task-meta-info { font-size: 11px; color: #9ca3af; font-weight: 600; text-align: center; margin: -6px 0 0; }

/* ---------- Task modal (new / edit task) ---------- */
#task-modal .modal-card { max-width: 620px; }
.task-form { gap: 26px; padding: 22px 24px; overscroll-behavior: contain; }
.form-section { display: flex; flex-direction: column; gap: 14px; }
.form-section-title {
  margin: 0; display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase; color: #9ca3af;
}
.form-section-title::after { content: ''; flex: 1; height: 1px; background: #eef0f2; }
.form-section-count {
  padding: 1px 8px; border-radius: 999px; background: #eef2ff; color: #4f46e5; font-size: 10px; letter-spacing: 0;
}
.task-form .field label { margin-bottom: 6px; }
.task-form .field input, .task-form .field select, .task-form .field textarea { min-height: 42px; background: #fff; }
.task-form .field textarea { min-height: 92px; padding: 10px 12px; line-height: 1.45; }
.task-form .field.field-tint-box select { min-height: 0; background: transparent; }
.field-hint { margin: 8px 0 0; font-size: 11px; color: #9ca3af; font-weight: 600; }

/* Position */
.location-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid #dbeafe; background: #f5f9ff; border-radius: 12px;
}
.location-card .location-icon {
  width: 36px; height: 36px; border-radius: 50%; background: #dbeafe; color: #2563eb;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.location-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.location-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7280; }
.location-value {
  font-size: 12.5px; font-weight: 700; color: #1d4ed8; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.location-card .location-pick-btn { margin-left: 0; border: 1px solid #bfdbfe; background: #fff; color: #2563eb; }
.location-card .location-pick-btn:hover { background: #eff6ff; }

/* Marker color */
.color-field-row { display: flex; align-items: center; gap: 10px; }
.task-form .color-swatch-btn {
  position: relative; display: block; width: 44px; height: 44px; margin: 0; flex-shrink: 0;
  border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; cursor: pointer;
}
.task-form .color-swatch-btn input[type=color] {
  position: absolute; top: -8px; left: -8px; width: calc(100% + 16px); height: calc(100% + 16px);
  min-height: 0; padding: 0; border: none; border-radius: 0; background: none; cursor: pointer;
}
.color-swatch-btn input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch-btn input[type=color]::-webkit-color-swatch { border: none; }
.color-swatch-btn input[type=color]::-moz-color-swatch { border: none; }
/* No own color: show the swatch as "empty" (white with a red slash) */
.color-field.is-empty .color-swatch-btn::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; background:
    linear-gradient(to top right, transparent calc(50% - 1px), #ef4444 calc(50% - 1px), #ef4444 calc(50% + 1px), transparent calc(50% + 1px)), #fff;
}
.task-form .color-field-row input[type=text] { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.color-presets { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.color-preset {
  width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid #fff; cursor: pointer;
  box-shadow: 0 0 0 1px #e5e7eb; transition: transform .1s ease, box-shadow .1s ease;
}
.color-preset:hover { transform: scale(1.12); }
.color-preset.active { box-shadow: 0 0 0 2px #111827; }

/* Attachments */
.visually-hidden-input {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden;
  opacity: 0; clip: rect(0 0 0 0); pointer-events: none;
}
.attachments-upload { display: flex; flex-direction: column; gap: 10px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; text-align: center;
  border: 2px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.dropzone:hover { border-color: #818cf8; background: #f5f3ff; }
.visually-hidden-input:focus-visible + .dropzone { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.18); }
.dropzone.dragover { border-color: #4f46e5; background: #eef2ff; transform: scale(1.01); }
.dropzone-icon {
  width: 44px; height: 44px; border-radius: 50%; background: #e0e7ff; color: #4f46e5;
  display: flex; align-items: center; justify-content: center; margin-bottom: 2px;
}
.dropzone-title { font-size: 12.5px; font-weight: 600; color: #4b5563; }
.dropzone-title strong { font-weight: 800; color: #111827; }
.dropzone-sub { font-size: 11px; font-weight: 600; color: #9ca3af; }
.dz-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .dz-desktop { display: none; }
  .dz-touch { display: inline; }
}
.task-form .camera-btn { display: none; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; }
@media (pointer: coarse) { .task-form .camera-btn { display: inline-flex; } }

.attachments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.attachments-grid:empty { display: none; }
.attachment-item {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 1px solid #e5e7eb; background: #f9fafb;
}
.attachment-open { display: block; width: 100%; height: 100%; color: inherit; text-decoration: none; }
.attachment-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.attachment-item:hover img { transform: scale(1.04); }
.attachment-file {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  height: 100%; padding: 8px; text-align: center; background: linear-gradient(180deg, #fff, #f8fafc);
}
.attachment-file-badge { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; color: #dc2626; background: #fee2e2; border-radius: 6px; padding: 3px 7px; }
.attachment-file-name {
  max-width: 100%; font-size: 10px; font-weight: 700; line-height: 1.3; color: #374151; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.attachment-file-size { font-size: 10px; font-weight: 600; color: #9ca3af; }
.attachment-remove {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: none;
  background: rgba(17,24,39,0.78); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s ease, background .15s ease; cursor: pointer;
}
.attachment-item:hover .attachment-remove, .attachment-remove:focus-visible { opacity: 1; }
.attachment-remove:hover { background: #dc2626; }
@media (hover: none) { .attachment-remove { opacity: 1; width: 30px; height: 30px; } }
.attachment-item.uploading img { filter: grayscale(0.4) brightness(0.9); }
.attachment-spinner {
  display: inline-block; width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid #c7d2fe; border-top-color: #4f46e5; animation: attachment-spin .7s linear infinite;
}
.attachment-spinner-overlay { position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; background: rgba(255,255,255,0.85); }
@keyframes attachment-spin { to { transform: rotate(360deg); } }
.attachments-progress { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 700; color: #4f46e5; }
.attachments-error {
  display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 10px 12px; border-radius: 10px;
  background: #fef2f2; color: #b91c1c; font-size: 12px; font-weight: 600;
}
.attachments-locked {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px; border-radius: 12px;
  background: #f8fafc; border: 1px dashed #cbd5e1; color: #6b7280; font-size: 12px; font-weight: 600;
}
.attachments-locked svg { flex-shrink: 0; color: #9ca3af; }

/* Phone: the task form slides up as a bottom sheet instead of a floating card */
@keyframes sheet-up { from { transform: translateY(28px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .modal-sheet { align-items: flex-end; padding: 0; }
  .modal-sheet .modal-card {
    max-width: none; max-height: 94vh; max-height: 94dvh; border-radius: 22px 22px 0 0; animation: sheet-up .22s ease-out;
  }
  .modal-sheet .modal-header { position: relative; padding: 18px 18px 14px; }
  .modal-sheet .modal-header::before {
    content: ''; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; border-radius: 2px;
    background: #d1d5db; transform: translateX(-50%);
  }
  .task-form { padding: 18px 16px; gap: 22px; }
  .modal-sheet .modal-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-sheet .modal-footer .btn { min-height: 44px; }
  .modal-sheet .modal-footer-right { flex: 1; justify-content: flex-end; }
}
@media (max-width: 520px) {
  #task-modal .form-row.two-col:not(.keep-two) { grid-template-columns: 1fr; }
}
/* iPhones zoom the page when a field under 16px gets focus */
@supports (-webkit-touch-callout: none) {
  #task-modal .field input, #task-modal .field select, #task-modal .field textarea { font-size: 14px; }
}
.modal-footer { padding: 16px 22px; border-top: 1px solid #f3f4f6; background: #fafafa; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-footer-right { display: flex; gap: 10px; }

.members-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; margin-bottom: 16px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #f0f1f3; border-radius: 10px; background: #fafafa; }
.member-row-info { flex: 1; min-width: 0; }
.member-row-name { font-size: 12.5px; font-weight: 700; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-row-email { font-size: 11px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-row select {
  border: 1px solid #e5e7eb; border-radius: 10px; padding: 6px 8px; font-size: 11px; font-weight: 700;
  background: #fff; flex-shrink: 0;
}
.member-row-remove {
  flex-shrink: 0; border: none; background: none; color: #f87171; padding: 6px; border-radius: 8px;
}
.member-row-remove:hover { background: #fef2f2; color: #dc2626; }
.members-add-row { display: flex; gap: 8px; align-items: center; }
.members-add-row select { flex: 1; min-width: 0; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 10px; font-size: 12px; background: #fff; }
.members-empty-hint { font-size: 11px; color: #9ca3af; font-weight: 600; margin-top: 10px; text-align: center; }

.apikeys-hint { font-size: 12px; color: #6b7280; margin: 0 0 14px; line-height: 1.5; }
.apikeys-hint code { font-size: 11px; background: #f3f4f6; padding: 1px 5px; border-radius: 5px; }
.apikeys-new { padding: 12px; border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 10px; margin-bottom: 14px; }
.apikeys-new-label { font-size: 11px; font-weight: 700; color: #166534; margin-bottom: 8px; }
.apikeys-new-row { display: flex; gap: 8px; }
.apikeys-new-row input { flex: 1; min-width: 0; font-family: monospace; font-size: 12px; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 10px; background: #fff; }
.members-add-row input[type="text"] { flex: 1; min-width: 0; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 10px; font-size: 12px; background: #fff; }
.member-row.apikey-revoked { opacity: 0.55; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .lg-hidden { display: flex; }
  .sidebar { position: absolute; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .brand-name { display: none; }
}
/* Short or narrow screens (phones, small laptop windows): all the filters
   plus a dropdown can be taller than the screen, and the list of tasks below
   them used to just get squeezed to nothing while the bottom of an opened
   dropdown was cut off with no way to reach it. Let the whole sidebar scroll
   as one instead, so every filter, every dropdown and the task list can be
   reached. */
@media (max-width: 1024px), (max-height: 800px) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .sidebar-top { flex-shrink: 0; }
  .task-list { flex: 1 0 auto; overflow-y: visible; }
  .project-picker-list { max-height: min(280px, 40vh); }
}
/* Big screens: the dropdowns open inline, so the filters can grow taller
   than the sidebar — let that block scroll on its own (always leaving a
   strip of the task list visible) rather than cutting it off. */
@media (min-width: 1025px) and (min-height: 801px) {
  .sidebar-top { max-height: calc(100% - 110px); overflow-y: auto; overscroll-behavior: contain; }
}
/* Quiet scrollbars (mouse devices). A scrollbar that only exists while the
   content is tall enough used to pop in the moment a dropdown was opened —
   squeezing everything in the sidebar a few pixels to the left. Now the room
   for it is always reserved (scrollbar-gutter), so nothing moves, and the bar
   itself is a slim rounded thumb without arrows instead of the chunky system
   one. Touch screens keep their own overlay scrollbars, which take no room. */
@media (hover: hover) and (pointer: fine) {
  .sidebar, .sidebar-top, .task-list, .project-picker-list { scrollbar-gutter: stable; }
  .sidebar-top { padding-right: 12px; }
  .project-picker-list { padding-right: 0; }
  .sidebar::-webkit-scrollbar,
  .sidebar-top::-webkit-scrollbar,
  .task-list::-webkit-scrollbar,
  .project-picker-list::-webkit-scrollbar { width: 10px; }
  .sidebar::-webkit-scrollbar-track,
  .sidebar-top::-webkit-scrollbar-track,
  .task-list::-webkit-scrollbar-track,
  .project-picker-list::-webkit-scrollbar-track { background: transparent; }
  .sidebar::-webkit-scrollbar-thumb,
  .sidebar-top::-webkit-scrollbar-thumb,
  .task-list::-webkit-scrollbar-thumb,
  .project-picker-list::-webkit-scrollbar-thumb {
    background: #d5d8de; border-radius: 999px; border: 3px solid transparent; background-clip: content-box;
  }
  .sidebar::-webkit-scrollbar-thumb:hover,
  .sidebar-top::-webkit-scrollbar-thumb:hover,
  .task-list::-webkit-scrollbar-thumb:hover,
  .project-picker-list::-webkit-scrollbar-thumb:hover { background: #aab0ba; background-clip: content-box; }
  @supports not selector(::-webkit-scrollbar) {
    .sidebar, .sidebar-top, .task-list, .project-picker-list { scrollbar-width: thin; scrollbar-color: #d5d8de transparent; }
  }
}
/* Touch screens and phones: bigger tap targets, and inputs at 16px so iOS
   doesn't zoom the whole page when one is focused. */
@media (max-width: 1024px) {
  .sidebar { width: min(380px, 92vw); }
  .project-picker-search, .type-picker-create input { font-size: 13px; }
}
/* iPhones zoom the whole page when a text field under 16px gets focus — only
   there, keep the fields at 16px. */
@supports (-webkit-touch-callout: none) {
  .project-picker-search, .type-picker-create input { font-size: 14px; }
}
@media (pointer: coarse) {
  .project-picker-btn { min-height: 46px; }
  .project-picker-main .project-picker-btn { min-height: 50px; }
  .project-picker-item { min-height: 42px; }
  .project-picker-sort-row .link-btn { padding: 10px 10px; }
  .type-picker-create input, .type-picker-create .btn { min-height: 42px; }
}
@media (max-width: 640px) {
  .view-btn .lbl { display: none; }
  .user-menu-panel { width: 200px; }
  .user-menu-btn-name { display: none; }
  .user-menu-btn { padding: 4px; gap: 0; }
  .cable-draw-toolbar { flex-direction: column; align-items: stretch; top: 8px; padding: 10px 12px; gap: 8px; }
  .cable-draw-toolbar-actions { justify-content: flex-end; }
  #cable-draw-hint { white-space: normal; text-align: center; }
}

.auth-install { margin: 16px 0 0; text-align: center; font-size: 12.5px; font-weight: 600; }
.auth-install a { color: #2563eb; text-decoration: none; }
.auth-install a:hover { text-decoration: underline; }

/* Innlogging: hjelpetekst under felt */
.auth-hint { margin: 6px 2px 0; font-size: 12px; color: #6b7280; }
