:root {
  --shell-overlay: rgba(2, 6, 23, 0.76);
  --shell-surface: #0b1428;
  --shell-surface-soft: rgba(15, 23, 42, 0.92);
  --shell-shadow: 0 26px 58px rgba(2, 6, 23, 0.48);
  --mobile-menu-surface: linear-gradient(180deg, rgba(8, 15, 35, 0.995), rgba(15, 23, 42, 0.985));
  --mobile-menu-card: rgba(30, 41, 59, 0.84);
  --mobile-menu-card-border: rgba(148, 163, 184, 0.36);
  --drawer-width: 360px;
  --topbar-control-height: 40px;
  --topbar-chip-bg: rgba(15, 23, 42, 0.55);
  --topbar-chip-border: rgba(148, 163, 184, 0.35);
  --topbar-chip-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --topbar-select-bg: rgba(15, 23, 42, 0.92);
  --topbar-select-border: rgba(148, 163, 184, 0.42);
  --topbar-select-icon: #94a3b8;
  --topbar-help-bg: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(37, 99, 235, 0.22));
  --topbar-help-border: rgba(34, 197, 94, 0.34);
}

:root[data-theme="light"] {
  --shell-overlay: rgba(15, 23, 42, 0.34);
  --shell-surface: rgba(255, 255, 255, 0.995);
  --shell-surface-soft: rgba(255, 255, 255, 0.94);
  --shell-shadow: 0 20px 46px rgba(15, 23, 42, 0.2);
  --mobile-menu-surface: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 0.995));
  --mobile-menu-card: rgba(255, 255, 255, 0.98);
  --mobile-menu-card-border: rgba(148, 163, 184, 0.34);
  --topbar-chip-bg: rgba(255, 255, 255, 0.95);
  --topbar-chip-border: rgba(148, 163, 184, 0.3);
  --topbar-chip-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --topbar-select-bg: rgba(255, 255, 255, 0.98);
  --topbar-select-border: rgba(148, 163, 184, 0.34);
  --topbar-select-icon: #475569;
  --topbar-help-bg: linear-gradient(135deg, rgba(22, 163, 74, 0.16), rgba(37, 99, 235, 0.14));
  --topbar-help-border: rgba(22, 163, 74, 0.28);
}

.startup-splash {
  background: var(--shell-overlay) !important;
  backdrop-filter: none;
}

.startup-loader-card {
  width: min(250px, calc(100vw - 30px));
  padding: 20px 18px;
  border-radius: 14px;
  box-shadow: var(--shell-shadow);
  background: var(--shell-surface);
  display: grid;
  justify-items: center;
  gap: 10px;
}

.startup-loader-card .startup-splash-loader {
  margin: 0;
}

.startup-loader-card p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui, sans-serif);
  font-size: 13px;
}

.app-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand actions"
    "nav nav";
  align-items: center;
  gap: 12px 16px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 48%),
    linear-gradient(0deg, var(--topbar-bg), var(--topbar-bg));
  border-bottom: 1px solid color-mix(in srgb, var(--panel-border) 84%, var(--accent) 16%);
}

.app-topbar-workspace {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand actions"
    "nav nav";
}

.app-topbar > .brand {
  grid-area: brand;
  min-width: 0;
}

.app-topbar-workspace > .topbar-setup {
  grid-area: setup;
}

.topbar-setup {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-setup .field {
  margin: 0;
  width: 100%;
  max-width: 320px;
}

.topbar-setup .field span {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-select-wrap {
  position: relative;
  width: 100%;
}

.topbar-select-wrap select {
  width: 100%;
  height: var(--topbar-control-height);
  min-width: 180px;
  padding: 8px 40px 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--topbar-select-border);
  background: var(--topbar-select-bg);
  font-family: var(--font-ui, sans-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.topbar-select-wrap select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.topbar-select-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  stroke: var(--topbar-select-icon);
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-left: 0;
  flex: 0 0 auto;
}

.mobile-nav-overlay {
  display: none;
}

body.mobile-nav-open {
  overflow: hidden;
}

[data-perkins-nav="true"][data-perkins-visible="false"] {
  display: none !important;
}

.mobile-nav-toggle {
  display: none;
  min-height: var(--topbar-control-height);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}

.mobile-nav-toggle svg {
  width: 18px;
  height: 18px;
}

.mobile-nav-toggle svg path {
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
}

.topbar-action-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--topbar-chip-border);
  background: var(--topbar-chip-bg);
  box-shadow: var(--topbar-chip-shadow);
}

.topbar-quick-btn {
  min-height: var(--topbar-control-height);
  padding: 8px 13px;
  border-radius: 999px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
  border-color: color-mix(in srgb, var(--topbar-chip-border) 70%, transparent);
}

.topbar-action-cluster .topbar-quick-btn {
  white-space: nowrap;
}

#helpOpen.topbar-quick-btn {
  background: var(--topbar-help-bg);
  border: 1px solid var(--topbar-help-border);
}

.topbar-quick-btn .icon {
  width: 14px;
  height: 14px;
}

.topbar-quick-btn:hover {
  box-shadow: 0 10px 16px rgba(2, 6, 23, 0.24);
}

.topbar-actions .profile-trigger-btn,
.topbar-actions .profile-trigger {
  box-shadow: none;
  border: 1px solid var(--topbar-chip-border);
  background: var(--topbar-chip-bg);
}

.topbar-actions .profile-trigger-btn:hover,
.topbar-actions .profile-trigger:hover {
  box-shadow: 0 10px 16px rgba(2, 6, 23, 0.2);
}

.app-topbar > .topbar-actions {
  grid-area: actions;
}

.top-nav-inline {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 2px;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-start;
  margin-left: 0;
  scrollbar-width: thin;
}

.top-nav-core {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.top-nav-inline .nav-link {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  scroll-snap-align: start;
}

.mobile-nav-close {
  display: none;
}

.mobile-nav-head {
  display: none;
}

.mobile-nav-session-shell {
  display: none;
}

.mobile-nav-session-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--shell-surface);
  padding-bottom: 4px;
}

.mobile-nav-session-toolbar h2 {
  margin: 0;
  font-size: 14px;
  font-family: var(--font-ui, sans-serif);
  letter-spacing: 0.01em;
}

.mobile-nav-session-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mobile-nav-session-buttons button {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--mobile-menu-card-border);
  background: var(--mobile-menu-card);
  color: var(--text);
  font-family: var(--font-ui, sans-serif);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mobile-nav-session-buttons button:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--panel-border));
  background: color-mix(in srgb, var(--accent) 14%, var(--shell-surface-soft));
}

.mobile-nav-session-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-session-empty {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px dashed var(--panel-border);
  color: var(--muted);
  font-family: var(--font-ui, sans-serif);
  font-size: 12px;
}

.mobile-nav-session-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-top: 8px;
}

.mobile-nav-session-open {
  min-height: 56px;
  border-radius: 12px;
  border: 1px solid var(--mobile-menu-card-border);
  background: var(--mobile-menu-card);
  color: var(--text);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  text-align: left;
  cursor: pointer;
}

.mobile-nav-session-open:hover {
  border-color: var(--topbar-chip-border);
}

.mobile-nav-session-item.is-active .mobile-nav-session-open,
.mobile-nav-session-open.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--shell-surface-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.mobile-nav-session-title {
  font-family: var(--font-ui, sans-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.mobile-nav-session-meta {
  color: var(--muted);
  font-family: var(--font-ui, sans-serif);
  font-size: 10px;
  line-height: 1.2;
}

.mobile-nav-session-preview {
  color: var(--text);
  font-family: var(--font-body, sans-serif);
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.86;
}

.mobile-nav-session-delete {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  align-self: start;
  border-radius: 999px;
  border: 1px solid var(--mobile-menu-card-border);
  background: color-mix(in srgb, var(--mobile-menu-card) 92%, transparent);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}

.mobile-nav-session-delete:hover {
  border-color: var(--error-border);
  color: var(--error-text);
  background: color-mix(in srgb, var(--error-bg) 80%, transparent);
}

.utility-panel-toggle {
  min-width: 108px;
  gap: 8px;
}

.utility-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: var(--shell-overlay);
  backdrop-filter: blur(4px);
}

.utility-panel {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  z-index: 45;
  width: min(var(--drawer-width), calc(100vw - 12px));
  max-width: 100vw;
  height: 100dvh !important;
  padding: 20px 16px;
  border-radius: 18px 0 0 18px;
  border: 1px solid var(--panel-border);
  border-right: none;
  box-shadow: var(--shell-shadow);
  background: var(--shell-surface);
  transform: translate3d(106%, 0, 0) !important;
  transform-origin: right center;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: transform;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 12px;
}

.utility-panel[aria-hidden="true"] {
  pointer-events: none;
}

body.utility-panel-open .utility-panel {
  transform: translate3d(0, 0, 0) !important;
}

.utility-panel-head {
  align-items: center;
}

.utility-panel-head h2 {
  font-size: 19px;
}

.utility-panel-section {
  border-radius: 14px;
  background: var(--shell-surface-soft);
  padding: 12px;
}

.panel-nav {
  display: grid;
  gap: 8px;
}

.panel-nav .nav-link {
  justify-content: flex-start;
  width: 100%;
}

.utility-panel-actions {
  grid-template-columns: 1fr;
}

.utility-panel-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-family: var(--font-ui, sans-serif);
  font-size: 12px;
}

.profile-trigger-btn,
.profile-trigger {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel-strong, rgba(15, 23, 42, 0.88));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui, sans-serif);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.28);
}

:root[data-theme="light"] .profile-trigger-btn,
:root[data-theme="light"] .profile-trigger {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.14);
}

.profile-trigger-btn:focus-visible,
.profile-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.profile-trigger-btn img,
.profile-trigger img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.profile-menu {
  position: fixed;
  z-index: 124;
  width: min(380px, calc(100vw - 18px));
  max-height: calc(100vh - 20px);
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: var(--shell-surface);
  box-shadow: var(--shell-shadow);
  padding: 14px;
  display: grid;
  gap: 11px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.profile-menu-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.profile-menu-avatar-shell {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--shell-surface-soft);
  color: var(--text);
  font-family: var(--font-ui, sans-serif);
  font-weight: 700;
}

.profile-menu-avatar-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-menu-identity {
  min-width: 0;
}

.profile-menu-name,
.profile-menu-email,
.profile-menu-role,
.profile-menu-about {
  margin: 0;
}

.profile-menu-name {
  font-family: var(--font-ui, sans-serif);
  font-size: 16px;
  font-weight: 700;
}

.profile-menu-email {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.profile-menu-role {
  margin-top: 3px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-family: var(--font-ui, sans-serif);
}

.profile-menu-about {
  color: var(--text);
  font-size: 13px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--shell-surface-soft);
  overflow-wrap: anywhere;
}

.profile-menu-context {
  display: grid;
  gap: 6px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--shell-surface-soft);
}

.profile-menu-context-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-family: var(--font-ui, sans-serif);
}

.profile-menu-context-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.profile-menu-context-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background: var(--shell-surface);
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}

.profile-menu-context-switch {
  min-height: 34px;
  padding: 6px 12px;
  justify-content: center;
  white-space: nowrap;
  box-shadow: none;
}

.profile-menu-context-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-menu-context-status.error {
  color: var(--danger, #b30021);
}

.profile-menu-actions {
  display: grid;
  gap: 7px;
}

.profile-menu-actions .btn,
.profile-menu-extra-actions .btn,
.profile-menu-danger-wrap .btn {
  width: 100%;
  justify-content: flex-start;
}

.profile-menu-extra-actions {
  display: grid;
  gap: 7px;
}

.profile-menu-extra-mobile-only {
  display: none;
}

.profile-menu-mobile-only {
  display: none !important;
}

.profile-menu-danger-wrap {
  border-top: 1px dashed var(--panel-border);
  padding-top: 9px;
}

.profile-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 122;
  background: var(--shell-overlay);
  backdrop-filter: blur(4px);
}

.profile-editor,
.profile-delete-dialog {
  position: fixed;
  z-index: 123;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: var(--shell-surface);
  box-shadow: var(--shell-shadow);
}

.profile-editor-shell,
.profile-delete-shell {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.profile-editor-head,
.profile-delete-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-editor-head h2,
.profile-delete-head h2 {
  margin: 0;
  font-size: 18px;
}

.profile-editor-form,
.profile-delete-form {
  display: grid;
  gap: 10px;
}

.profile-editor-avatar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-editor-avatar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-editor .field input,
.profile-editor .field textarea,
.profile-delete-dialog .field input {
  width: 100%;
}

.profile-editor-status,
.profile-delete-status {
  margin: 0;
  min-height: 20px;
  color: var(--accent);
  font-size: 13px;
  font-family: var(--font-ui, sans-serif);
}

.profile-editor-status.error,
.profile-delete-status.error {
  color: #f87171;
}

.profile-delete-warning {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-editor-foot,
.profile-delete-foot {
  display: flex;
  justify-content: flex-end;
}

.topbar-profile-wrap {
  margin-left: auto;
  justify-content: flex-end;
  flex: 0 0 auto;
}

@media (max-width: 1280px) {
  .top-nav-inline {
    width: 100%;
  }

  .topbar-actions {
    width: auto;
    justify-content: flex-end;
    align-items: center;
  }
}

header.topbar > .topbar-profile-wrap {
  margin-left: auto;
  flex: 0 0 auto;
  min-width: auto;
  width: auto;
}

@media (max-width: 980px) {
  .app-topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
  }

  .app-topbar-workspace {
    grid-template-areas:
      "brand actions"
      "nav nav";
  }

  .topbar-actions {
    width: auto;
    justify-content: flex-end;
    align-items: center;
  }

  .topbar-action-cluster {
    max-width: 100%;
  }

  .utility-panel-toggle {
    width: auto;
    margin-left: 0;
  }

  .top-nav-inline {
    width: 100%;
    justify-content: flex-start;
  }

  .utility-panel {
    width: min(340px, calc(100vw - 10px));
  }

  header.topbar > .topbar-profile-wrap {
    width: auto;
    min-width: auto;
  }
}

@media (max-width: 1024px) {
  .app-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    gap: 8px 10px;
    align-items: center;
  }

  .app-topbar-workspace {
    grid-template-areas:
      "brand actions"
      "nav nav";
  }

  .app-topbar > .brand {
    min-height: 40px;
    gap: 10px;
  }

  .app-topbar .logo {
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: 10px;
  }

  .app-topbar .title h1 {
    font-size: 16px;
    line-height: 1.2;
  }

  .app-topbar .title p {
    display: none;
  }

  .app-topbar > .topbar-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .mobile-nav-overlay {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: none !important;
  }

  .topbar-action-cluster {
    display: inline-flex;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    gap: 6px;
  }

  #helpOpen.topbar-quick-btn {
    display: none;
  }

  #settingsOpen.topbar-quick-btn {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
    font-size: 0;
  }

  #settingsOpen.topbar-quick-btn .icon {
    width: 18px;
    height: 18px;
  }

  .topbar-actions .profile-trigger-btn,
  .topbar-actions .profile-trigger {
    align-self: center;
  }

  .top-nav-inline {
    position: static;
    top: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    z-index: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    opacity: 1;
    margin: 0;
    padding: 4px 0 0;
    border-right: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    transition: none;
    pointer-events: auto;
  }

  .top-nav-core {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-top: 0;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .top-nav-inline.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .top-nav-inline .nav-link {
    width: auto;
    min-height: 40px;
    justify-content: center;
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--muted);
    border-color: var(--panel-border);
    font-size: 13px;
    padding: 8px 12px;
  }

  body.mobile-keyboard-open .app-topbar,
  body.mobile-keyboard-open .app-topbar-workspace {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "nav actions";
    padding: 6px 10px;
    gap: 6px 8px;
  }

  body.mobile-keyboard-open .app-topbar > .brand,
  body.mobile-keyboard-open .app-topbar > .topbar-setup {
    display: none !important;
  }

  body.mobile-keyboard-open .app-topbar > .topbar-actions {
    grid-area: actions;
    width: auto;
    gap: 6px;
  }

  body.mobile-keyboard-open .app-topbar .top-nav-inline {
    grid-area: nav;
    width: 100%;
    padding: 0;
    margin: 0;
    gap: 6px;
  }

  body.mobile-keyboard-open .app-topbar .top-nav-inline .nav-link {
    min-height: 34px;
    border-radius: 9px;
    padding: 6px 10px;
    font-size: 12px;
  }

  body.mobile-keyboard-open #helpOpen.topbar-quick-btn {
    display: none !important;
  }

  body.mobile-keyboard-open #settingsOpen.topbar-quick-btn {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 10px;
  }

  body.mobile-keyboard-open .topbar-actions .profile-trigger-btn,
  body.mobile-keyboard-open .topbar-actions .profile-trigger {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .mobile-nav-close {
    display: none;
  }

  .mobile-nav-head {
    display: none;
  }

  .mobile-nav-session-shell {
    display: none;
  }

  .mobile-nav-session-toolbar {
    display: none;
  }

  .mobile-nav-session-buttons {
    display: none;
  }

  .mobile-nav-session-buttons button {
    display: none;
  }

  .mobile-nav-session-list {
    display: none;
  }

  .mobile-nav-session-open {
    min-height: 56px;
  }

  .mobile-nav-session-title {
    font-size: 12px;
  }

  .mobile-nav-session-preview {
    font-size: 11px;
    opacity: 0.86;
  }

  .mobile-nav-session-delete {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  .top-nav-inline [data-admin-nav],
  .top-nav-inline [data-perkins-nav] {
    display: none !important;
  }

  .profile-menu-mobile-only {
    display: none !important;
  }

  .profile-menu-extra-mobile-only {
    display: none;
  }

  .utility-panel {
    width: min(92vw, 320px);
    border-radius: 14px 0 0 14px;
    border-right: none;
  }

  .utility-panel-actions {
    grid-template-columns: 1fr;
  }

  .profile-editor,
  .profile-delete-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }
}

@media (max-width: 560px) {
  .topbar-actions {
    align-items: center;
  }

  .topbar-actions .profile-trigger-btn,
  .topbar-actions .profile-trigger {
    align-self: center;
  }

  .profile-menu {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    padding: 12px;
    gap: 10px;
  }

  .profile-menu-context-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-menu-context-switch {
    width: 100%;
  }
}
