/* Shared shell: the same type, icon rhythm, and active state at every viewport. */
:root { --mobile-nav-reserve: calc(5rem + var(--keyboard-inset) + var(--safe-bottom-inset)); }

.rk-page-header.rk-page-header,
#app-shell > .rk-app-header {
  min-height: 64px;
  gap: 10px;
  box-shadow: none;
  border-bottom: 1px solid var(--border-card);
}
.rk-page-header.rk-page-header { padding-top: 10px; padding-bottom: 10px; margin-bottom: 22px; }
@media (min-width: 768px) { .rk-page-header.rk-page-header { margin-left: -24px; margin-right: -24px; } }
.rk-page-header--home.rk-page-header--home { border-bottom-color: transparent; }
.rk-page-header--home.is-scrolled.rk-page-header--home { border-bottom-color: rgba(255,255,255,.12); }
.rk-hdr-titlewrap { gap: 2px; }
.rk-hdr-eyebrow {
  color: var(--accent-dark);
  font: 700 10px/1.1 Inter, sans-serif;
  letter-spacing: .12em;
}
[data-theme="dark"] .rk-hdr-eyebrow { color: #d6c18d; }
.rk-hdr-title {
  margin: 0;
  color: var(--text-primary);
  font: 600 clamp(15px, 1.45vw, 17px)/1.22 'Space Grotesk', Inter, sans-serif;
  letter-spacing: -.02em;
}
.rk-hdr-actions { gap: 8px; }
.rk-back-btn, .rk-hdr-icon-btn, .rk-header-hamburger, #mobile-search-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--border-card);
  border-radius: 11px;
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: none;
  font-size: 14px;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.rk-back-btn:hover, .rk-hdr-icon-btn:hover, .rk-header-hamburger:hover, #mobile-search-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: none;
}
.rk-avatar.rk-avatar {
  width: 40px;
  height: 40px;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--border-card);
  background: var(--accent);
  font: 700 12px/1 Inter, sans-serif;
}
.profile-dropdown.profile-dropdown { min-width: 205px; width: max-content; padding: 6px; border-radius: 12px !important; }
.profile-dropdown.profile-dropdown a { min-height: 42px; padding: 10px 12px; border-radius: 8px; color: var(--text-secondary); font: 600 12px/1.3 Inter, sans-serif; }
.profile-dropdown.profile-dropdown a i { width: 18px; color: var(--text-muted); text-align: center; }
.profile-dropdown.profile-dropdown a:hover { background: var(--accent-bg); color: var(--text-primary); }
.profile-dropdown.profile-dropdown a:hover i { color: var(--accent-dark); }
.rk-hdr-brand { font-family: 'Space Grotesk', Inter, sans-serif; font-weight: 700; letter-spacing: -.035em; }
.rk-hdr-tagline { font-size: 10px; font-weight: 600; letter-spacing: .08em; }

.rk-sidebar { border-right: 1px solid var(--border-card); }
.rk-sidebar-menu { padding: 15px 12px 26px; scrollbar-gutter: stable; }
.rk-sidebar-dash-row { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-card); }
.rk-sidebar-group { margin: 0 0 7px; }
.rk-sidebar-group-toggle {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font: 700 11px/1.35 Inter, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.rk-sidebar-group-toggle:hover, .rk-sidebar-group.has-active .rk-sidebar-group-toggle { color: var(--text-primary); background: var(--bg-muted); }
.rk-sidebar-group-toggle .fa-chevron-down { font-size: 10px; color: var(--text-faint); transition: transform .2s ease; }
.rk-sidebar-group-panel { overflow: hidden; transition: max-height .25s ease, opacity .2s ease; }
.rk-sidebar-group-inner { padding: 4px 0 5px; }
.rk-sidebar-menu .sidebar-nav-link.sidebar-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  margin: 2px 0;
  padding: 5px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font: 600 13px/1.3 Inter, sans-serif;
  letter-spacing: 0;
  box-shadow: none;
  transform: none;
}
.rk-sidebar-menu .sidebar-nav-link:hover { background: var(--bg-muted); color: var(--text-primary); transform: none; }
.rk-sidebar-menu .sidebar-nav-link.is-active.sidebar-nav-link { background: var(--accent-bg); color: var(--text-primary); }
.rk-sidebar-menu .sidebar-nav-link.is-active::before { content: ''; position: absolute; inset: 9px auto 9px 0; width: 2px; border-radius: 2px; background: var(--accent); }
.rk-sidebar-menu .sidebar-nav-icon.sidebar-nav-icon {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: none;
  color: var(--text-muted);
  font-size: 13px;
}
.rk-sidebar-menu .sidebar-nav-link:hover .sidebar-nav-icon,
.rk-sidebar-menu .sidebar-nav-link.is-active .sidebar-nav-icon { border-color: rgba(179,154,95,.4); background: var(--bg-card); color: var(--accent-dark); }
[data-theme="dark"] .rk-sidebar-menu .sidebar-nav-link.is-active.sidebar-nav-link { color: var(--text-primary); }
[data-theme="dark"] .rk-sidebar-menu .sidebar-nav-link.is-active .sidebar-nav-icon { color: #d6c18d; }
.sidebar-nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-sidebar-brand-link { gap: 9px; }
.rk-sidebar-brand-logo { width: 32px; height: 32px; }
.rk-sidebar-hamburger-inline { width: 36px; height: 36px; border-radius: 9px; }

#mobile-bottom-tabs#mobile-bottom-tabs {
  height: calc(68px + var(--safe-bottom-inset));
  padding: 0 4px var(--safe-bottom-inset);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  background: var(--bg-header);
  border-top: 1px solid var(--border-card);
  box-shadow: 0 -5px 22px rgba(15,23,42,.06);
}
@media (min-width: 1024px) { #mobile-bottom-tabs#mobile-bottom-tabs { display: none; } }
.rk-mobile-tab {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  font: 600 11px/1.15 Inter, sans-serif;
}
.rk-mobile-tab::before { content: ''; position: absolute; top: 0; left: 29%; right: 29%; height: 2px; border-radius: 0 0 2px 2px; background: transparent; }
.rk-mobile-tab__icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; font-size: 16px; }
.rk-mobile-tab__label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-mobile-tab:hover, .rk-mobile-tab.is-active { color: var(--text-primary); }
.rk-mobile-tab.is-active::before { background: var(--accent); }
.rk-mobile-tab.is-active .rk-mobile-tab__icon { color: var(--accent-dark); background: var(--accent-bg); }
[data-theme="dark"] .rk-mobile-tab.is-active .rk-mobile-tab__icon { color: #d6c18d; }
.rk-mobile-tab[data-mobile-action="menu"][aria-expanded="true"] { color: var(--text-primary); }
.rk-mobile-tab[data-mobile-action="menu"][aria-expanded="true"] .rk-mobile-tab__icon { background: var(--accent-bg); color: var(--accent-dark); }

.rk-page-header :is(button, a, input):focus-visible,
.rk-sidebar :is(button, a):focus-visible,
#mobile-bottom-tabs :is(button, a):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1023px) {
  .rk-sidebar.rk-sidebar--mobile-open { background: var(--bg-sidebar); }
  .rk-sidebar.rk-sidebar--mobile-open .rk-sidebar-menu { padding: 15px 16px 32px; }
  .rk-sidebar.rk-sidebar--mobile-open .rk-sidebar-mobile-head { min-height: 67px; padding: 11px 16px; }
  .rk-sidebar-mobile-title { color: var(--text-primary); font: 600 19px/1.2 'Space Grotesk', Inter, sans-serif; letter-spacing: -.025em; text-transform: none; }
  .rk-sidebar-mobile-close { width: 42px; height: 42px; }
}
@media (max-width: 480px) {
  .rk-page-header.rk-page-header { padding-left: 14px; padding-right: 14px; gap: 8px; }
  .rk-hdr-actions { gap: 6px; }
  .rk-back-btn, .rk-hdr-icon-btn, .rk-header-hamburger { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
  .rk-avatar.rk-avatar { width: 38px; height: 38px; }
  .rk-hdr-title { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .rk-sidebar-group-panel, .rk-mobile-tab, .rk-page-header button { transition-duration: .01ms !important; }
}
