:root {
  --bg: #fffaf3;
  --panel: #fffdf9;
  --text: #2b0f08;
  --muted: #657089;
  --line: #ead8c1;
  --accent: #ff8a00;
  --accent-dark: #9a3b16;
  --blue: #0d6efd;
  --shadow: 0 18px 45px rgba(72, 35, 12, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 92% 30%, rgba(255, 255, 255, 0.82) 0 12%, transparent 13%),
    linear-gradient(180deg, #fffaf3 0%, #fff 48%, #fffaf3 100%);
  color: var(--text);
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 18px clamp(18px, 6vw, 96px);
  background: rgba(255, 253, 249, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.logo,
.main-nav {
  display: flex;
  align-items: center;
}

.logo {
  gap: 12px;
  min-width: max-content;
}

.logo img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.logo strong {
  font-size: clamp(30px, 3.8vw, 44px);
  line-height: 1;
  font-weight: 900;
}

.logo span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff1dc;
  color: var(--accent-dark);
  font-weight: 800;
}

.main-nav {
  gap: clamp(18px, 3vw, 38px);
  overflow-x: auto;
  scrollbar-width: none;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 850;
  white-space: nowrap;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  padding: 10px 0;
  color: #34313b;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent-dark);
}

.page {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(18px, 5vw, 46px) 72px;
}

.seo-article {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(34px, 6vw, 70px);
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.kicker {
  margin: 0 0 12px;
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 950;
}

h2 {
  margin-top: 42px;
  color: var(--accent-dark);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 900;
}

p {
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.62;
}

.seo-lead {
  color: #5b657c;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 650;
}

.seo-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 42px;
}

.primary-button,
.seo-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-weight: 850;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  html {
    color-scheme: dark;
  }

  body {
    background: #0d1118;
    color: #fff7ed;
  }

  .app-header,
  .seo-article {
    background: rgba(25, 20, 17, 0.94);
    border-color: rgba(255, 210, 158, 0.22);
  }

  .main-nav a {
    color: #f7efe5;
  }

  p,
  .seo-lead {
    color: #d7deed;
  }
}

@media (max-width: 760px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .main-nav {
    width: 100%;
    padding-bottom: 4px;
  }

  .seo-article {
    padding: 28px 20px;
    border-radius: 14px;
  }
}

.site-legal-footer {
  margin-top: 64px;
  background: rgba(255, 253, 249, 0.94);
  border-top: 1px solid var(--line);
  color: var(--text);
}

.site-legal-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr) minmax(220px, 0.8fr);
  gap: 28px;
}

.site-legal-footer h2 {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 16px;
}

.site-legal-footer p,
.site-legal-footer a,
.site-legal-footer span {
  font-size: 14px;
  line-height: 1.6;
}

.site-legal-footer p {
  margin: 0 0 8px;
  color: var(--muted);
}

.site-legal-footer a {
  color: var(--accent-dark);
  font-weight: 800;
}

.site-legal-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.site-legal-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.site-legal-logo strong,
.site-legal-logo span {
  display: block;
}

.site-legal-logo strong {
  font-size: 20px;
}

.site-legal-links {
  display: grid;
  align-content: start;
  gap: 8px;
}

.site-legal-bottom {
  border-top: 1px solid var(--line);
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  .site-legal-footer {
    background: rgba(25, 20, 17, 0.94);
    border-color: rgba(255, 210, 158, 0.22);
  }

  .site-legal-footer p,
  .site-legal-footer span {
    color: #d7deed;
  }

  .site-legal-footer a {
    color: #ffb467;
  }
}

@media (max-width: 820px) {
  .site-legal-inner {
    grid-template-columns: 1fr;
  }

  .site-legal-bottom {
    display: grid;
  }
}

/* Keep legal pages visually aligned with the main app header without loading full app CSS. */
.app-header {
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, auto) 1fr auto;
  align-items: center;
  gap: clamp(16px, 4vw, 56px);
  min-height: 80px;
  padding: 0 clamp(18px, 5vw, 84px);
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 12px 34px rgba(80, 45, 17, 0.08);
  backdrop-filter: blur(14px);
}

.logo {
  gap: 11px;
}

.logo img {
  width: 48px;
  height: 48px;
}

.logo strong {
  color: #36150d;
  font-size: clamp(28px, 2.6vw, 38px);
  font-weight: 900;
  white-space: nowrap;
}

.logo span {
  align-self: start;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff2df;
  color: #9a3b16;
  font-size: 13px;
  font-weight: 900;
}

.main-nav,
.auth-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.3vw, 34px);
}

.main-nav {
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav a {
  position: relative;
  padding: 28px 6px 25px;
  color: #34323b;
  font-size: clamp(18px, 1.25vw, 21px);
  font-weight: 900;
  white-space: nowrap;
}

.main-nav a.active::after,
.main-nav a:hover::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 17px;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: #ff8a00;
}

.auth-links {
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.auth-links button,
.auth-links a,
.auth-links .user-badge,
.account-menu-trigger,
.account-menu-panel > button,
.account-menu-panel > .user-badge {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #4c4d56;
  padding: 11px 16px;
  box-shadow: 0 8px 22px rgba(80, 45, 17, 0.08);
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  line-height: normal;
  min-height: 40px;
  white-space: nowrap;
}

.auth-links .login-link {
  background: #ff8a00;
  color: #fff;
}

.user-badge,
.auth-links .account-menu-trigger {
  background: #f6eadc !important;
  color: #6f341a !important;
}

.auth-links button[hidden],
.auth-links a[hidden],
.auth-links span[hidden],
.account-menu[hidden],
.account-menu-panel[hidden] {
  display: none !important;
}

.account-menu {
  position: relative;
}

.account-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  cursor: pointer;
}

.account-avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #8c3b16;
  color: #fff;
}

.account-chevron::before {
  content: "⌄";
  font-size: 14px;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 10px;
  border: 1px solid #ead8c1;
  border-radius: 14px;
  background: #fffdf9;
  box-shadow: 0 20px 48px rgba(72, 35, 12, 0.18);
}

.account-menu-panel > button,
.account-menu-panel > .user-badge {
  width: 100%;
  text-align: left;
}

@media (max-width: 1350px) {
  .app-header {
    gap: 16px;
    padding: 0 28px;
  }

  .logo strong {
    font-size: 28px;
  }

  .logo img {
    width: 42px;
    height: 42px;
  }

  .main-nav {
    gap: 14px;
  }

  .main-nav a {
    font-size: 17px;
  }

  .auth-links button,
  .auth-links a,
  .auth-links .user-badge,
  .account-menu-trigger {
    padding: 9px 12px;
    font-size: 13px;
  }
}

@media (max-width: 760px) {
  .app-header {
    position: static;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    gap: 10px;
    padding: 12px 14px 14px;
    overflow: hidden;
  }

  .app-header .logo {
    min-width: 0;
  }

  .app-header .logo img {
    width: 42px;
    height: 42px;
  }

  .app-header .logo strong {
    min-width: 0;
    font-size: 30px;
  }

  .app-header .main-nav,
  .app-header .auth-links {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .app-header .main-nav {
    gap: 18px;
    padding: 2px 18px 8px 0;
  }

  .app-header .main-nav a {
    flex: 0 0 auto;
    padding: 10px 2px 12px;
    font-size: 19px;
  }

  .app-header .main-nav a.active::after,
  .app-header .main-nav a:hover::after {
    bottom: 4px;
  }

  .app-header .auth-links {
    gap: 9px;
    padding: 2px 18px 2px 0;
  }

  .account-menu-panel {
    position: fixed;
    right: 12px;
    bottom: 18px;
    left: 12px;
    width: auto;
    max-height: min(360px, calc(100dvh - 42px));
    overflow-y: auto;
  }
}
