.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) and (max-width: 1025px) {
  .shell {
    padding-left: 40px;
    padding-right: 40px;
  }
}

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 44px;
  padding: 10px 0 14px;
  box-sizing: border-box;
  margin-top: auto;
  font-family: system-ui, sans-serif;
  color: var(--color-muted, rgba(14, 26, 48, 0.72));
  font-size: 12px;
}

.app-footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  min-width: 0;
}

.app-footer .branding-line {
  flex: 1;
  min-width: 0;
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 0.35em;
  flex-wrap: wrap;
  color: color-mix(in srgb, var(--color-text, #0e1a30) 68%, var(--color-muted, rgba(14, 26, 48, 0.72)));
}

.app-footer a.branding-ntp-link {
  color: #3b82f6;
  text-decoration: none;
}

.app-footer a.branding-ntp-link:hover {
  text-decoration: underline;
}

[data-theme="midnight"] .app-footer,
[data-theme="dark"] .app-footer {
  color: #9d94a8;
}

[data-theme="midnight"] .app-footer .branding-line,
[data-theme="dark"] .app-footer .branding-line {
  color: #9d94a8;
}

[data-theme="midnight"] .app-footer .branding-line b,
[data-theme="dark"] .app-footer .branding-line b {
  color: #e8e6eb;
}

[data-theme="midnight"] .app-footer .branding-ntp-link,
[data-theme="dark"] .app-footer .branding-ntp-link {
  color: #ebe6f0;
}

[data-theme="midnight"] .app-footer .branding-ntp-link:hover,
[data-theme="dark"] .app-footer .branding-ntp-link:hover {
  color: #ffffff;
}

[data-theme="midnight"] .app-footer-actions .icon-btn.theme-toggle,
[data-theme="dark"] .app-footer-actions .icon-btn.theme-toggle,
[data-theme="midnight"] .app-footer-lang-wrap select,
[data-theme="dark"] .app-footer-lang-wrap select {
  color: #ebe6f0;
}

.app-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-height: 24px;
}

.app-footer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-footer-actions .icon-btn.theme-toggle {
  position: relative;
  border: none;
  min-width: 24px;
  width: 24px;
  min-height: 24px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.app-footer-actions .icon-btn.theme-toggle .theme-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.app-footer-actions .icon-btn.theme-toggle .theme-icon-light,
.app-footer-actions .icon-btn.theme-toggle .theme-icon-dark {
  display: none;
  width: 20px;
  height: 20px;
}

.app-footer-actions .icon-btn.theme-toggle:not([data-theme-mode]) .theme-icon-light,
.app-footer-actions .icon-btn.theme-toggle[data-theme-mode="classic"] .theme-icon-light,
.app-footer-actions .icon-btn.theme-toggle[data-theme-mode="light"] .theme-icon-light {
  display: block;
}

.app-footer-actions .icon-btn.theme-toggle[data-theme-mode="midnight"] .theme-icon-dark,
.app-footer-actions .icon-btn.theme-toggle[data-theme-mode="dark"] .theme-icon-dark {
  display: block;
}

.app-footer-actions .icon-btn.theme-toggle[data-theme-mode="classic"],
.app-footer-actions .icon-btn.theme-toggle[data-theme-mode="light"] {
  color: var(--color-muted, rgba(14, 26, 48, 0.6));
}

.app-footer-actions .icon-btn.theme-toggle[data-theme-mode="midnight"],
.app-footer-actions .icon-btn.theme-toggle[data-theme-mode="dark"] {
  color: var(--color-text-primary, #e7ecf8);
}

.app-footer-actions .icon-btn.theme-toggle:active {
  background: transparent;
}

.app-footer-lang-wrap select {
  padding: 4px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text, #0e1a30);
  font-size: 13px;
  cursor: pointer;
}

.app-footer-lang-wrap select:focus {
  outline: none;
}

.app-footer:has([data-version-placeholder]) {
  overflow: hidden;
}

.app-footer:has([data-version-placeholder]) .branding-line {
  position: relative;
  color: transparent;
  pointer-events: none;
  overflow: hidden;
  flex: 0 1 auto;
  max-width: 280px;
}

.app-footer:has([data-version-placeholder]) .branding-line a {
  color: transparent;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.app-footer:has([data-version-placeholder]) .branding-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  max-width: 280px;
  height: 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--color-surface-alt, rgba(14, 26, 48, 0.06)) 0%, var(--color-border, rgba(14, 26, 48, 0.12)) 45%, var(--color-surface-alt, rgba(14, 26, 48, 0.06)) 90%);
  background-size: 200% 100%;
  animation: footer-shimmer 1.6s ease-in-out infinite;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-height: 20px;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions .icon-btn.theme-toggle {
  overflow: hidden;
  flex: 0 0 20px;
  min-width: 20px;
  width: 20px;
  height: 20px;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions .app-footer-lang-wrap {
  overflow: hidden;
  flex: 0 0 52px;
  width: 52px;
  min-height: 20px;
  height: 20px;
  box-sizing: border-box;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions .icon-btn.theme-toggle,
.app-footer:has([data-version-placeholder]) .app-footer-actions .app-footer-lang-wrap {
  position: relative;
  color: transparent;
  pointer-events: none;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions .icon-btn.theme-toggle {
  background: transparent !important;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions .app-footer-lang-wrap select {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions .icon-btn.theme-toggle svg,
.app-footer:has([data-version-placeholder]) .app-footer-actions .app-footer-lang-wrap select {
  opacity: 0;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions .icon-btn.theme-toggle::before,
.app-footer:has([data-version-placeholder]) .app-footer-actions .app-footer-lang-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--color-surface-alt, rgba(14, 26, 48, 0.06)), var(--color-border, rgba(14, 26, 48, 0.12)), var(--color-surface-alt, rgba(14, 26, 48, 0.06)));
  background-size: 200% 100%;
  animation: footer-shimmer 1.6s ease-in-out infinite;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions .icon-btn.theme-toggle::before {
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
}

.app-footer:has([data-version-placeholder]) .app-footer-actions .app-footer-lang-wrap::after {
  left: 0;
  width: 52px;
  animation-delay: 0.2s;
}

@keyframes footer-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .app-footer:has([data-version-placeholder]) .branding-line::before,
  .app-footer:has([data-version-placeholder]) .app-footer-actions .icon-btn.theme-toggle::before,
  .app-footer:has([data-version-placeholder]) .app-footer-actions .app-footer-lang-wrap::after {
    animation: none;
    background: var(--color-surface-alt, rgba(14, 26, 48, 0.06));
  }
}
