/*
 * Schnueddels UI Base
 * Shared design tokens and low-level components for Schnueddels projects.
 */

:root {
  color-scheme: dark;

  --sd-font-sans: Inter, "Space Grotesk", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --sd-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --sd-bg: #0b1020;
  --sd-bg-raised: #11192d;
  --sd-surface: #151e33;
  --sd-surface-2: #1b2540;
  --sd-panel: #0f1728;
  --sd-border: rgba(173, 190, 220, 0.14);
  --sd-border-strong: rgba(173, 190, 220, 0.24);
  --sd-text: #eef4ff;
  --sd-text-soft: #c3d0e6;
  --sd-text-muted: #8496b2;

  --sd-accent: #6aa9ff;
  --sd-accent-strong: #8bc2ff;
  --sd-accent-ink: #08111f;
  --sd-info: #7ac7ff;
  --sd-warn: #f0b84b;
  --sd-danger: #ff6b8a;

  --sd-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --sd-shadow-md: 0 14px 38px rgba(0, 0, 0, 0.38);
  --sd-focus: 0 0 0 3px rgba(106, 169, 255, 0.28);

  --sd-radius-xs: 4px;
  --sd-radius-sm: 6px;
  --sd-radius-md: 8px;
  --sd-radius-lg: 12px;
  --sd-radius-xl: 16px;
  --sd-radius-pill: 999px;

  --sd-space-1: 4px;
  --sd-space-2: 8px;
  --sd-space-3: 12px;
  --sd-space-4: 16px;
  --sd-space-5: 20px;
  --sd-space-6: 24px;
  --sd-space-8: 32px;
  --sd-space-10: 40px;

  --sd-shell: 1180px;
  --sd-shell-wide: 1440px;
  --sd-topbar-height: 64px;
}

:root[data-theme="light"],
.sd-theme-light {
  color-scheme: light;

  --sd-bg: #eef3fb;
  --sd-bg-raised: #f8fbff;
  --sd-surface: #ffffff;
  --sd-surface-2: #edf3fb;
  --sd-panel: #fbfdff;
  --sd-border: rgba(34, 52, 82, 0.14);
  --sd-border-strong: rgba(34, 52, 82, 0.24);
  --sd-text: #132033;
  --sd-text-soft: #41536d;
  --sd-text-muted: #667990;
  --sd-accent: #2f6feb;
  --sd-accent-strong: #1f5bd4;
  --sd-accent-ink: #ffffff;
  --sd-info: #2f8bff;
  --sd-warn: #d58f1b;
  --sd-danger: #c64566;
  --sd-shadow-sm: 0 1px 2px rgba(24, 43, 79, 0.08);
  --sd-shadow-md: 0 14px 38px rgba(24, 43, 79, 0.14);
  --sd-focus: 0 0 0 3px rgba(47, 111, 235, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--sd-bg);
}

body.sd-app,
.sd-app {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(106, 169, 255, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(106, 169, 255, 0.04), transparent 220px),
    var(--sd-bg);
  color: var(--sd-text);
  font-family: var(--sd-font-sans);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

.sd-app button,
.sd-app input,
.sd-app select,
.sd-app textarea {
  font: inherit;
}

.sd-shell {
  width: min(100% - 32px, var(--sd-shell));
  margin-inline: auto;
}

.sd-shell--wide {
  width: min(100% - 32px, var(--sd-shell-wide));
}

.sd-topbar {
  min-height: var(--sd-topbar-height);
  border-bottom: 1px solid var(--sd-border);
  background: color-mix(in srgb, var(--sd-bg-raised) 94%, transparent);
  backdrop-filter: blur(14px);
}

.sd-topbar__inner {
  min-height: var(--sd-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sd-space-4);
}

.sd-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sd-space-3);
  min-width: 0;
  color: var(--sd-text);
  text-decoration: none;
  font-weight: 750;
}

.sd-brand__mark {
  width: 34px;
  height: 34px;
  border-radius: var(--sd-radius-md);
  background: var(--sd-accent);
  color: var(--sd-accent-ink);
  display: grid;
  place-items: center;
  font-weight: 850;
  box-shadow: var(--sd-shadow-sm);
}

.sd-brand__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sd-nav {
  display: flex;
  align-items: center;
  gap: var(--sd-space-2);
}

.sd-nav a,
.sd-nav button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sd-space-3);
  border: 1px solid transparent;
  border-radius: var(--sd-radius-md);
  background: transparent;
  color: var(--sd-text-soft);
  text-decoration: none;
  cursor: pointer;
}

.sd-nav a:hover,
.sd-nav button:hover,
.sd-nav [aria-current="page"] {
  border-color: var(--sd-border);
  background: var(--sd-surface-2);
  color: var(--sd-text);
}

.sd-page {
  padding-block: var(--sd-space-8);
}

.sd-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: var(--sd-space-5);
  align-items: start;
}

.sd-layout--right {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
}

.sd-main,
.sd-sidebar {
  min-width: 0;
}

.sd-stack {
  display: grid;
  gap: var(--sd-space-4);
}

.sd-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sd-space-2);
}

.sd-section-title {
  margin: 0;
  color: var(--sd-text);
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.sd-copy {
  margin: 0;
  color: var(--sd-text-soft);
}

.sd-muted {
  color: var(--sd-text-muted);
}

.sd-panel,
.sd-card {
  border: 1px solid var(--sd-border);
  background: var(--sd-panel);
  box-shadow: var(--sd-shadow-sm);
}

.sd-panel {
  border-radius: var(--sd-radius-lg);
  padding: var(--sd-space-5);
}

.sd-card {
  border-radius: var(--sd-radius-md);
  padding: var(--sd-space-4);
}

.sd-card:hover {
  border-color: var(--sd-border-strong);
}

.sd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sd-space-3);
  min-height: 48px;
  padding: var(--sd-space-2);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-lg);
  background: var(--sd-surface);
}

.sd-toolbar__group {
  display: flex;
  align-items: center;
  gap: var(--sd-space-2);
  min-width: 0;
}

.sd-button,
.sd-icon-button {
  min-height: 38px;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-md);
  background: var(--sd-surface);
  color: var(--sd-text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sd-space-2);
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sd-button {
  padding: 0 var(--sd-space-4);
}

.sd-icon-button {
  width: 38px;
  padding: 0;
}

.sd-button:hover,
.sd-icon-button:hover {
  border-color: var(--sd-border-strong);
  background: var(--sd-surface-2);
}

.sd-button:active,
.sd-icon-button:active {
  transform: translateY(1px);
}

.sd-button:focus-visible,
.sd-icon-button:focus-visible,
.sd-input:focus,
.sd-select:focus,
.sd-textarea:focus {
  outline: none;
  box-shadow: var(--sd-focus);
}

.sd-button--primary {
  border-color: color-mix(in srgb, var(--sd-accent) 60%, transparent);
  background: var(--sd-accent);
  color: var(--sd-accent-ink);
}

.sd-button--primary:hover {
  border-color: var(--sd-accent-strong);
  background: var(--sd-accent-strong);
}

.sd-button--quiet {
  background: transparent;
}

.sd-button--danger {
  border-color: color-mix(in srgb, var(--sd-danger) 55%, transparent);
  color: var(--sd-danger);
}

.sd-button--danger:hover {
  background: color-mix(in srgb, var(--sd-danger) 14%, transparent);
}

.sd-field {
  display: grid;
  gap: var(--sd-space-2);
}

.sd-label {
  color: var(--sd-text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.sd-input,
.sd-select,
.sd-textarea {
  width: 100%;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-md);
  background: var(--sd-surface);
  color: var(--sd-text);
  padding: 10px 12px;
}

.sd-textarea {
  min-height: 110px;
  resize: vertical;
}

.sd-help {
  color: var(--sd-text-muted);
  font-size: 0.88rem;
}

.sd-tabs {
  display: inline-flex;
  gap: var(--sd-space-1);
  padding: var(--sd-space-1);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-lg);
  background: var(--sd-surface);
}

.sd-tab {
  min-height: 34px;
  border: 0;
  border-radius: var(--sd-radius-md);
  background: transparent;
  color: var(--sd-text-soft);
  padding: 0 var(--sd-space-3);
  cursor: pointer;
  font-weight: 700;
}

.sd-tab:hover,
.sd-tab[aria-selected="true"],
.sd-tab.is-active {
  background: var(--sd-surface-2);
  color: var(--sd-text);
}

.sd-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-pill);
  background: var(--sd-surface-2);
  color: var(--sd-text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.sd-badge--success {
  border-color: color-mix(in srgb, var(--sd-accent) 55%, transparent);
  color: var(--sd-accent-strong);
}

.sd-badge--info {
  border-color: color-mix(in srgb, var(--sd-info) 55%, transparent);
  color: var(--sd-info);
}

.sd-badge--warn {
  border-color: color-mix(in srgb, var(--sd-warn) 55%, transparent);
  color: var(--sd-warn);
}

.sd-badge--danger {
  border-color: color-mix(in srgb, var(--sd-danger) 55%, transparent);
  color: var(--sd-danger);
}

.sd-table-wrap {
  overflow: auto;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-lg);
  background: var(--sd-panel);
}

.sd-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.sd-table th,
.sd-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--sd-border);
  text-align: left;
  vertical-align: middle;
}

.sd-table th {
  color: var(--sd-text-soft);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  background: var(--sd-surface);
}

.sd-table tr:last-child td {
  border-bottom: 0;
}

.sd-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--sd-space-4);
  background: rgba(0, 0, 0, 0.58);
}

.sd-modal {
  width: min(100%, 520px);
  max-height: min(760px, 90vh);
  overflow: auto;
  border: 1px solid var(--sd-border-strong);
  border-radius: var(--sd-radius-xl);
  background: var(--sd-bg-raised);
  color: var(--sd-text);
  box-shadow: var(--sd-shadow-md);
}

.sd-modal__header,
.sd-modal__body,
.sd-modal__footer {
  padding: var(--sd-space-5);
}

.sd-modal__header {
  border-bottom: 1px solid var(--sd-border);
}

.sd-modal__footer {
  border-top: 1px solid var(--sd-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--sd-space-2);
}

.sd-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sd-space-4);
}

.sd-project-card {
  display: grid;
  gap: var(--sd-space-3);
  min-height: 132px;
  color: var(--sd-text);
  text-decoration: none;
}

.sd-project-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.sd-project-card__meta {
  color: var(--sd-text-muted);
  font-size: 0.9rem;
}

.sd-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: var(--sd-space-6);
  border: 1px dashed var(--sd-border-strong);
  border-radius: var(--sd-radius-lg);
  color: var(--sd-text-muted);
  text-align: center;
}

.sd-global-header {
  --sd-header-height: 44px;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 2147483000;
  min-height: var(--sd-header-height);
  border-bottom: 1px solid var(--sd-border);
  background: color-mix(in srgb, var(--sd-bg-raised) 92%, transparent);
  color: var(--sd-text);
  font-family: var(--sd-font-sans);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.sd-global-header,
.sd-global-header * {
  box-sizing: border-box;
}

.sd-global-header a,
.sd-global-header button {
  font: inherit;
}

.sd-global-header__inner {
  width: min(100% - 20px, var(--sd-shell-wide));
  min-height: var(--sd-header-height);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sd-space-3);
}

.sd-global-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sd-space-2);
  min-width: 0;
  color: var(--sd-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 850;
}

.sd-global-header__mark {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  flex: 0 0 auto;
}

.sd-global-header__mark .sd-global-header__mark-icon {
  width: 100%;
  height: 100%;
}

.sd-global-header__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sd-global-header__project {
  color: var(--sd-text-muted);
  font-weight: 700;
}

.sd-global-header__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sd-space-2);
  min-width: 0;
}

.sd-global-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sd-global-header__menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.sd-global-header__link,
.sd-global-header__button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--sd-radius-md);
  background: transparent;
  color: var(--sd-text-soft);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.sd-global-header__menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 30px;
  width: 30px;
  padding: 0;
  background: var(--sd-surface);
  border-color: var(--sd-border);
  border-radius: var(--sd-radius-md);
}

.sd-global-header__menu-button .sd-global-header__icon {
  width: 16px;
  height: 16px;
}

.sd-global-header__icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.sd-global-header__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sd-global-header__mark-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.sd-global-header__brand--compact {
  width: 30px;
  height: 30px;
  justify-content: center;
  flex: 0 0 auto;
}

.sd-global-header__brand-icon {
  width: 26px;
  height: 26px;
}

.sd-global-header__label {
  display: inline-flex;
  align-items: center;
}

.sd-global-header__link:hover,
.sd-global-header__button:hover {
  border-color: var(--sd-border);
  background: var(--sd-surface-2);
  color: var(--sd-text);
}

.sd-global-header__button {
  appearance: none;
}

.sd-global-header__button[aria-pressed="true"] {
  color: var(--sd-accent-strong);
}

.sd-global-header__logout {
  color: var(--sd-danger);
}

.sd-global-header__menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 2147483001;
  width: min(460px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  max-height: min(78dvh, calc(100dvh - var(--sd-header-height) - 16px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 12px;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-lg);
  background: color-mix(in srgb, var(--sd-bg-raised) 94%, transparent);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sd-global-header__backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: transparent;
}

.sd-global-header__backdrop[hidden] {
  display: none !important;
}

.sd-global-header__menu-panel[hidden] {
  display: none !important;
}

.sd-global-header__menu-panel-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.sd-global-header__menu-section {
  min-width: 0;
  padding: 2px 0;
}

.sd-global-header__menu-home {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  row-gap: 8px;
  padding: 2px 2px 12px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--sd-border);
}

.sd-global-header__menu-home-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.sd-global-header__menu-home-link img {
  display: block;
  width: min(100%, 92px);
  height: auto;
  object-fit: contain;
}

.sd-global-header__menu-home-link-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 220px);
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-md);
  background: var(--sd-surface);
  color: var(--sd-text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 750;
}

.sd-global-header__menu-title {
  margin: 0 0 8px;
  color: var(--sd-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sd-global-header__menu-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.sd-global-header__menu-link {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--sd-radius-md);
  background: transparent;
  color: var(--sd-text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 650;
}

.sd-global-header__menu-link:hover {
  border-color: var(--sd-border);
  background: var(--sd-surface-2);
  color: var(--sd-text);
}

body.sd-has-global-header.sd-global-header-reserve {
  padding-top: 44px;
}

body.sd-has-global-header.sd-global-header-overlay .sd-global-header {
  background: color-mix(in srgb, var(--sd-bg-raised) 78%, transparent);
}

body.sd-global-header-menu-open {
  overflow: hidden;
}

.sd-global-footer {
  --sd-footer-height: 44px;
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  clear: none !important;
  align-self: auto !important;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-height: calc(var(--sd-footer-height) + env(safe-area-inset-bottom));
  margin: 0 !important;
  padding: 0 0 env(safe-area-inset-bottom) !important;
  border: 0 !important;
  border-top: 1px solid var(--sd-border) !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--sd-bg-raised) 92%, transparent) !important;
  color: var(--sd-text-soft);
  font-family: var(--sd-font-sans);
  text-align: initial !important;
  transform: none !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.18) !important;
}

.sd-global-footer,
.sd-global-footer * {
  box-sizing: border-box;
}

.sd-global-footer a,
.sd-global-footer select {
  font: inherit;
}

.sd-global-footer__inner {
  width: 100%;
  min-height: var(--sd-footer-height);
  margin-inline: 0;
  padding-inline: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sd-space-3);
  flex-wrap: nowrap;
  overflow: hidden;
}

.sd-global-footer__copyright {
  margin: 0;
  color: var(--sd-text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

.sd-global-footer__nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sd-space-2);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.sd-global-footer__nav::-webkit-scrollbar {
  display: none;
}

.sd-global-footer__nav a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--sd-radius-md);
  color: var(--sd-text-soft);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 750;
  white-space: nowrap;
}

.sd-global-footer__nav a:hover {
  border-color: var(--sd-border);
  background: var(--sd-surface-2);
  color: var(--sd-text);
}

.sd-global-footer__language {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  color: var(--sd-text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.sd-global-footer__language select {
  min-height: 30px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-md);
  background: var(--sd-surface-2);
  color: var(--sd-text);
}

body.sd-has-global-footer {
  padding-bottom: calc(var(--sd-footer-height, 44px) + env(safe-area-inset-bottom));
}

@media (max-width: 760px) {
  .sd-global-header {
    --sd-header-height: 46px;
  }

  .sd-global-footer {
    --sd-footer-height: 46px;
  }

  .sd-global-footer__inner {
    width: 100%;
    padding-inline: 6px;
    justify-content: space-between;
    gap: 6px;
  }

  .sd-global-footer__copyright,
  .sd-global-footer__nav a,
  .sd-global-footer__language {
    font-size: 0.78rem;
  }

  .sd-global-footer__nav {
    justify-content: flex-start;
  }

  .sd-global-footer__nav a {
    padding-inline: 8px;
  }

  .sd-global-footer__nav a[data-sd-footer-report="true"] {
    display: none;
  }

  .sd-global-header__inner {
    width: calc(100% - 12px);
    gap: var(--sd-space-2);
  }

  .sd-global-header__project {
    display: none;
  }

  .sd-global-header__nav {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sd-global-header__nav::-webkit-scrollbar {
    display: none;
  }

  .sd-global-header__link,
  .sd-global-header__button {
    padding-inline: 8px;
    font-size: 0.8rem;
  }

  .sd-global-header__menu-button {
    width: 30px;
  }

  .sd-global-header__menu-button .sd-global-header__icon {
    width: 16px;
    height: 16px;
  }

  .sd-global-header__menu-panel {
    width: min(420px, calc(100vw - 12px));
    max-width: calc(100vw - 12px);
    top: calc(100% + 6px);
    left: 0;
    max-height: calc(100dvh - var(--sd-header-height) - 10px - env(safe-area-inset-bottom));
    padding: 8px;
  }

  .sd-global-header__menu-panel-inner {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sd-global-header__menu-home {
    justify-items: center;
    padding-bottom: 10px;
  }

  .sd-global-header__menu-home-link img {
    width: min(100%, 88px);
  }

  .sd-global-header__backdrop {
    background: rgba(7, 10, 18, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .sd-global-header__link[data-sd-optional="true"] {
    display: none;
  }

  body.sd-has-global-header.sd-global-header-reserve {
    padding-top: 46px;
  }

  body.sd-has-global-footer {
    padding-bottom: calc(var(--sd-footer-height, 46px) + env(safe-area-inset-bottom));
  }
}

@media (max-width: 480px) {
  .sd-global-footer__copyright {
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sd-global-footer__language select {
    max-width: 86px;
  }

  .sd-global-header__inner {
    gap: 6px;
  }

  .sd-global-header__brand {
    flex: 0 0 auto;
  }

  .sd-global-header__title {
    display: none;
  }

  .sd-global-header__nav {
    gap: 4px;
  }

  .sd-global-header__link,
  .sd-global-header__button {
    padding-inline: 6px;
  }

  .sd-global-header__label {
    display: none;
  }

  .sd-global-header__menu-button .sd-global-header__label {
    display: inline-flex;
  }

  .sd-global-header__brand--compact {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 760px) {
  .sd-shell,
  .sd-shell--wide {
    width: min(100% - 24px, var(--sd-shell));
  }

  .sd-topbar__inner,
  .sd-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sd-nav,
  .sd-toolbar__group {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    scrollbar-width: thin;
  }

  .sd-layout,
  .sd-layout--right {
    grid-template-columns: 1fr;
  }

  .sd-page {
    padding-block: var(--sd-space-5);
  }

  .sd-panel {
    padding: var(--sd-space-4);
  }

  .sd-modal__header,
  .sd-modal__body,
  .sd-modal__footer {
    padding: var(--sd-space-4);
  }
}
