:root {
  --app-header-h: 60px;
  --app-footer-h: 44px;
}

html {
  width: 100%;
  max-width: 100%;
  scrollbar-gutter: auto;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
  color: #ecf1f8;
  background:
    radial-gradient(900px 340px at 10% -10%, rgba(255, 212, 122, 0.15), rgba(0, 0, 0, 0)),
    radial-gradient(900px 320px at 95% 120%, rgba(255, 212, 122, 0.1), rgba(0, 0, 0, 0)),
    linear-gradient(180deg, #151922 0%, #0e1219 100%);
}

.app-header,
.app-footer {
  z-index: 2000;
  color: #f6eee3;
}

.app-header {
  position: sticky;
  top: 0;
  height: var(--app-header-h);
  background:
    linear-gradient(120deg, rgba(42, 45, 52, 0.97), rgba(24, 27, 33, 0.97));
  border-bottom: 1px solid rgba(240, 196, 95, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 194, 0.24),
    inset 0 -1px 0 rgba(8, 10, 15, 0.65),
    0 12px 26px rgba(7, 9, 14, 0.52),
    0 0 24px rgba(246, 194, 79, 0.28);
}

.app-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 225, 151, 0.24) 0%, rgba(0, 0, 0, 0) 70%);
}

.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  box-shadow: 0 0 18px rgba(245, 194, 75, 0.68);
}

.app-footer {
  height: var(--app-footer-h);
  color: #ffe2a5;
  background: linear-gradient(120deg, rgba(42, 45, 52, 0.95), rgba(24, 27, 33, 0.95));
  border-top: 1px solid rgba(240, 196, 95, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 194, 0.16),
    0 -8px 24px rgba(7, 9, 14, 0.32);
  backdrop-filter: blur(2px);
}

.app-header-inner,
.app-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.app-footer-inner {
  justify-content: center;
  text-align: center;
}

.brand {
  color: #ffd98c;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.03em;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.46),
    0 0 14px rgba(246, 198, 87, 0.38);
}

.brand-logo {
  width: auto;
  height: 90px;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
  transform: translateY(16px);
  display: block;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-menu {
  margin-left: auto;
  flex: 1 1 auto;
  min-width: 0;
}

.app-menu-toggle {
  display: none;
  list-style: none;
}

.app-menu-panel {
  display: flex;
  align-items: center;
  width: 100%;
}

.app-nav-main {
  margin-left: 40px;
  display: flex;
  gap: 18px;
}

.app-nav-user {
  margin-left: auto;
}

.app-nav-main a {
  border: none;
  background: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
  color: #ffe2a5;
  text-decoration: none;
  line-height: 1.2;
}

.app-nav-main a:hover {
  color: #fff2cf;
  text-decoration: underline;
}

.app-nav-main a.is-active {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.app-nav form {
  margin: 0;
  display: flex;
  align-items: center;
}

.app-nav-user a,
.app-nav-user button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  line-height: 1;
  color: #ffe2a5;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 7px;
  border: none;
  background: linear-gradient(180deg, rgba(66, 72, 84, 0.42), rgba(38, 44, 56, 0.46));
  box-shadow:
    inset 0 1px 0 rgba(255, 227, 162, 0.12),
    0 0 0 1px rgba(108, 84, 35, 0.3);
  margin: 0;
  font-family: inherit;
  appearance: none;
  transition: transform 120ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.app-nav-user button {
  cursor: pointer;
}

.app-nav-user a:hover,
.app-nav-user button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(82, 90, 105, 0.48), rgba(48, 55, 69, 0.5));
  box-shadow:
    0 4px 14px rgba(10, 12, 19, 0.4),
    0 0 18px rgba(247, 197, 82, 0.38);
}

.profile-menu {
  position: relative;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  color: #ffe2a5;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid rgba(244, 198, 89, 0.62);
  background: linear-gradient(180deg, rgba(66, 72, 84, 0.42), rgba(38, 44, 56, 0.46));
  box-shadow:
    inset 0 1px 0 rgba(255, 227, 162, 0.12),
    0 0 0 1px rgba(108, 84, 35, 0.3);
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.profile-trigger::-webkit-details-marker {
  display: none;
}

.profile-menu[open] .profile-trigger,
.profile-trigger:hover {
  border-color: rgba(251, 212, 115, 0.86);
  background: linear-gradient(180deg, rgba(82, 90, 105, 0.48), rgba(48, 55, 69, 0.5));
  box-shadow:
    0 4px 14px rgba(10, 12, 19, 0.4),
    0 0 18px rgba(247, 197, 82, 0.38);
}

.profile-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 140px;
  border-radius: 9px;
  border: 1px solid rgba(246, 201, 95, 0.65);
  background: linear-gradient(180deg, rgba(30, 34, 43, 0.97), rgba(18, 22, 29, 0.97));
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 0 16px rgba(247, 197, 82, 0.2);
  padding: 6px;
  z-index: 2100;
}

.profile-dropdown a,
.profile-dropdown button {
  display: flex;
  width: 100%;
  height: auto;
  justify-content: flex-start;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  color: #ffe2a5;
  font-size: 13px;
  text-decoration: none;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
  border-color: rgba(246, 201, 95, 0.5);
  background: rgba(246, 201, 95, 0.12);
  transform: none;
  box-shadow: none;
}

.profile-dropdown form {
  width: 100%;
}

.app-nav-mobile-user {
  display: none;
}

.app-main {
  flex: 1 0 auto;
  min-height: 0;
}

@media (max-width: 767px) {
  .app-header {
    height: auto;
    min-height: var(--app-header-h);
  }

  .app-header-inner {
    position: relative;
    min-height: var(--app-header-h);
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .brand {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 16px;
    gap: 8px;
  }

  .brand-logo {
    width: auto;
    height: 64px;
    transform: translateY(8px);
  }

  .app-menu {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .app-menu-toggle {
    width: 42px;
    height: 42px;
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 10px;
    border: 1px solid rgba(244, 198, 89, 0.62);
    background: linear-gradient(180deg, rgba(66, 72, 84, 0.52), rgba(38, 44, 56, 0.56));
    box-shadow:
      inset 0 1px 0 rgba(255, 227, 162, 0.12),
      0 0 0 1px rgba(108, 84, 35, 0.3);
    cursor: pointer;
    user-select: none;
  }

  .app-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #ffe2a5;
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .app-menu.is-open .app-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .app-menu.is-open .app-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .app-menu.is-open .app-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .app-menu-panel {
    position: fixed;
    top: 70px;
    left: 14px;
    right: 14px;
    width: auto;
    max-width: 360px;
    margin: 0 auto;
    transform: none;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(246, 201, 95, 0.65);
    background: linear-gradient(180deg, rgba(30, 34, 43, 0.98), rgba(18, 22, 29, 0.98));
    box-shadow:
      0 18px 34px rgba(0, 0, 0, 0.45),
      0 0 16px rgba(247, 197, 82, 0.2);
    z-index: 2100;
  }

  .app-menu.is-open .app-menu-panel {
    display: flex;
  }

  .app-nav {
    align-items: stretch;
  }

  .app-nav-main,
  .app-nav-user {
    margin-left: 0;
    width: 100%;
  }

  .app-nav-main {
    flex-direction: column;
    gap: 0;
  }

  .app-nav-main a {
    display: block;
    padding: 10px 2px;
    border-bottom: 1px solid rgba(246, 201, 95, 0.16);
  }

  .app-nav-main a:last-child {
    border-bottom: none;
  }

  .app-nav-user {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .profile-menu {
    display: none;
  }

  .app-nav-mobile-user {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid rgba(246, 201, 95, 0.16);
  }

  .app-nav-mobile-user a,
  .app-nav-mobile-user button {
    width: 100%;
    min-height: 0;
    justify-content: flex-start;
    padding: 10px 2px;
    border-radius: 0;
    background: none;
    box-shadow: none;
    border-bottom: 1px solid rgba(246, 201, 95, 0.16);
  }

  .app-nav-mobile-user a:hover,
  .app-nav-mobile-user button:hover {
    transform: none;
    background: none;
    box-shadow: none;
    color: #fff2cf;
    text-decoration: underline;
  }
}

@media (max-width: 700px) {
  .app-nav a,
  .app-nav button {
    font-size: 12px;
    padding: 5px 8px;
  }

  .app-footer-inner {
    font-size: 12px;
  }
}
