/* Kystlinjen's compact header and the real account surface. Panel focus,
   inert state, viewport placement and dragging remain owned by shell.js. */
.shell .shell-header {
  inset: 25px 30px auto;
  min-height: 0;
  padding: 0;
  gap: 24px;
  color: var(--ink);
}

.shell .shell-header > .brand {
  gap: 10px;
  padding: 7px 14px 7px 9px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 22px #031b2615;
}

.shell .brand-logo { width: 34px; height: 34px; }
.shell .brand-name {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -.065em;
  padding-right: 2px;
}
.shell .brand-tagline { display: none; }

.shell .shell-header > .header-actions {
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.shell .header-actions :is(.theme-toggle, .header-language-toggle, .user-menu__trigger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 9px;
  min-height: 44px;
  height: 44px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 12px;
  box-shadow: 0 5px 18px #031b260d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  transition: background-color 160ms, border-color 160ms, color 160ms;
}
.shell .header-actions :is(.theme-toggle, .header-language-toggle, .user-menu__trigger):hover {
  background: var(--surface-top);
  border-color: var(--edge-strong);
  transform: none;
}
.shell .header-actions :is(.theme-toggle, .header-language-toggle, .user-menu__trigger):focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 4px;
  transform: none;
}
.shell .header-actions .theme-toggle { width: 44px; padding: 0; }
.shell .theme-toggle [data-ui-icon] svg { width: 19px; height: 19px; stroke-width: 1.5; }
.shell .header-actions .header-language-toggle { gap: 6px; font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.header-language-divider,
.header-language-da,
.header-language-en { color: var(--quiet); }
.header-language-toggle[data-language="da"] .header-language-da,
.header-language-toggle[data-language="en"] .header-language-en { color: var(--ink); }
.shell .header-actions .user-menu__trigger { padding: 0 15px 0 12px; }
.shell .user-menu__trigger[hidden] { display: none; }
.shell .user-menu__trigger[aria-expanded="true"] { border-color: var(--edge-strong); background: var(--surface-top); }

.user-menu__avatar,
.account-identity__avatar { position: relative; display: grid; place-items: center; flex: none; }
.user-menu__avatar { width: 20px; height: 20px; }
.shell .user-menu__avatar .user-avatar {
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  border: 0;
  box-shadow: none;
  background: var(--surface);
}
.user-menu__avatar [data-ui-icon] svg { width: 18px; height: 18px; stroke-width: 1.5; }

.shell .user-menu__panel {
  gap: 0;
  top: calc(100% + 15px);
  width: min(352px, calc(100vw - 32px));
  max-height: calc(var(--account-viewport-height, 100dvh) - 106px);
  border-color: var(--edge);
  border-radius: 23px;
  background: var(--surface);
  background-image: var(--surface-gradient);
  box-shadow: var(--shadow);
}
.shell .account-panel-heading { flex: none; padding: 17px 20px 3px 25px; gap: 16px; }
.shell .account-panel-heading h2 { font-size: 25px; line-height: 1.2; font-weight: 550; letter-spacing: -.05em; }
.shell .user-menu__panel .account-panel-close:not(.is-hidden):not([hidden]) {
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
}
.shell .account-panel-close:hover { color: var(--ink); background: var(--hover); }
.shell .account-panel-close svg { width: 18px; height: 18px; stroke-width: 1.5; }
.shell .account-panel-content {
  padding: 0 25px 22px;
  scrollbar-width: thin;
  scrollbar-color: var(--edge-strong) transparent;
}
.shell .account-identity { gap: 12px; padding: 19px 0 22px; }
.account-identity__avatar {
  width: 44px;
  height: 44px;
  border: 1px solid var(--edge-strong);
  border-radius: 50%;
  color: var(--sea);
  background: var(--selected);
}
.account-identity__avatar svg { width: 21px; height: 21px; stroke-width: 1.5; }
.shell .account-identity__avatar .user-avatar {
  position: absolute;
  inset: -1px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--edge-strong);
  box-shadow: none;
  background: var(--surface);
}
.shell .user-menu__panel .user-name { font-size: 14px; font-weight: 550; line-height: 1.5; }
.shell .user-menu__panel .language-picker {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 17px 0;
  border-top: 1px solid var(--edge);
  color: var(--muted);
  font-size: 12px;
}
.shell .language-picker select {
  width: 142px;
  min-height: 44px;
  padding: 0 35px 0 12px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: var(--ink);
  background: var(--input);
  font-size: 12px;
}
.shell .language-picker select:focus-visible { outline: 2px solid var(--sea); outline-offset: 3px; }
.shell .user-menu__panel .user-admin-link { margin: 0; }
.shell .user-menu__panel .user-integration {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 17px 0;
  border: 0;
  border-top: 1px solid var(--edge);
}
.shell .user-integration > .user-integration__status { flex: 1 1 130px; font-size: 12px; line-height: 1.6; }
.shell .user-menu__panel .user-integration__message {
  flex: 0 0 100%;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.7;
}
.shell .user-menu__panel .user-integration__message:empty { display: none; }
.shell .user-menu__panel :is(a, button):not(.is-hidden):not([hidden]) { font-size: 12px; font-weight: 500; line-height: 1.4; }
.shell .user-menu__panel .user-integration .user-integration__action:not(.is-hidden):not([hidden]) {
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid var(--edge-strong);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  box-shadow: none;
}
.shell .user-menu__panel .user-integration__action:hover { color: var(--ink); background: var(--hover); }
.shell .user-menu__panel .garmin-sync-row {
  flex: 0 0 100%;
  gap: 8px;
  padding: 13px;
  margin-top: 5px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--input);
}
.shell .garmin-sync-row .user-integration__status { font-size: 11px; line-height: 1.6; font-weight: 500; }
.shell .garmin-sync-row .user-integration__action { justify-self: start; }
.shell .account-panel-content > :is(#privacy-link, .account-delete-trigger, .user-admin-link) {
  min-height: 44px;
  width: 100%;
  padding: 10px 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}
.shell .account-panel-content > #privacy-link { border-top: 1px solid var(--edge); border-radius: 0; }
.shell .account-panel-content > .account-delete-trigger { color: var(--quiet); }
.shell .user-menu__panel .user-logout-btn:not(.is-hidden):not([hidden]) {
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid var(--edge-strong);
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}
.shell .user-menu__panel .user-logout-btn:hover { background: var(--hover); }
.shell .user-menu__panel :focus-visible { outline: 2px solid var(--sea); outline-offset: -2px; }
.shell .account-backdrop { background: #04151e3d; }

@media (max-width: 760px) {
  .shell .shell-header {
    inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) auto max(12px, env(safe-area-inset-left));
    gap: 10px;
  }
  .shell .shell-header > .brand { gap: 7px; padding: 6px 11px 6px 7px; border-radius: 12px; }
  .shell .brand-logo { width: 29px; height: 29px; }
  .shell .brand-name { font-size: 21px; }
  .shell .shell-header > .header-actions { gap: 6px; }
  .shell .header-actions .header-language-toggle { padding: 0 10px; gap: 4px; }
  .shell .header-actions .user-menu__trigger { padding: 0 11px; gap: 7px; }
  .shell .user-menu__panel {
    top: calc(var(--account-viewport-top, 0px) + var(--account-viewport-height, 100dvh) - max(var(--route-canvas-gutter), env(safe-area-inset-bottom)));
    width: auto;
    max-height: calc(var(--account-viewport-height, 100dvh) - 5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .shell .account-panel-heading { padding-top: 0; }
  .shell .user-menu__panel .account-sheet-handle:not(.is-hidden):not([hidden]) { min-height: 44px; height: 44px; padding: 0; }
  .shell .account-sheet-handle::before { background: var(--edge-strong); }
}

@media (max-width: 390px) {
  .shell .header-actions .user-menu__trigger { width: 44px; padding: 0; }
  .shell .user-menu__trigger > [data-i18n="Account"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell .header-actions :is(.theme-toggle, .header-language-toggle, .user-menu__trigger) { transition: none; }
}
