:root {
    --bg: #e9e2d3;
    --bg-soft: #f3eedf;
    --panel: #2f3841;
    --panel-2: #35404a;
    --text: #f7f3eb;
    --muted: #c9c1b3;
    --muted-2: #a6b0b8;
    --line: rgba(255,255,255,.08);
    --line-strong: rgba(255,255,255,.14);
    --accent: #efe3c8;
    --accent-text: #2d3339;
    --shadow: 0 24px 60px rgba(31,36,41,.16);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --container: 1240px;
  }
  
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  html {
    font-size: 16px;
  }
  
  body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
      radial-gradient(circle at top center, rgba(255,255,255,.42), transparent 28%),
      linear-gradient(180deg, #ece6d7 0%, var(--bg) 100%);
    color: var(--text);
    min-height: 100vh;
  }
  
  body.modal-open {
    overflow: hidden;
  }
  
  a {
    color: inherit;
    text-decoration: none;
  }
  
  button,
  input {
    font: inherit;
  }
  
  img {
    display: block;
    max-width: 100%;
  }
  
  svg {
    display: block;
    fill: currentColor;
    flex: 0 0 auto;
  }
  
  .shell {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
  }
  
  .app-main {
    padding-bottom: 40px;
  }
  
  .site-header {
    padding: 18px 0 6px;
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(10px);
  }
  
  .topbar {
    min-height: 74px;
    background: linear-gradient(180deg, #36414b 0%, #2f3841 100%);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
  }
  
  .topbar__icon-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    color: #f3efe5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
  }
  
  .topbar__icon-btn svg {
    width: 22px;
    height: 22px;
  }
  
  .topbar__nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    gap: 22px;
    align-items: center;
  }
  
  .topbar__link {
    position: relative;
    padding: 10px 6px 14px;
    color: #eee6d8;
    font-size: .96rem;
    font-weight: 700;
  }
  
  .topbar__link::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: rgba(239,227,200,.85);
    transform: scaleX(0);
    transition: transform .22s ease;
  }
  
  .topbar__link:hover::after,
  .topbar__link.is-active::after {
    transform: scaleX(1);
  }
  
  .topbar__profile {
    min-height: 54px;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.04);
    border: 0;
    cursor: pointer;
    color: #fff;
  }
  
  .topbar__profile-name {
    color: #f3efe6;
    font-size: .95rem;
    font-weight: 700;
  }
  
  .topbar__burger {
    width: 18px;
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
  }
  
  .topbar__burger span,
  .topbar-mobile__burger span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: #f3efe6;
  }
  
  .topbar-mobile {
    display: none;
    position: relative;
    justify-content: flex-end;
  }
  
  .topbar-mobile__toggle {
    min-width: 84px;
    height: 52px;
    padding: 8px 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, #36414b 0%, #2f3841 100%);
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
  }
  
  .topbar-mobile__burger {
    width: 18px;
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
  }
  
  .topbar-mobile__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(260px, calc(100vw - 32px));
    background: linear-gradient(180deg, #36414b 0%, #2f3841 100%);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 10px;
    display: grid;
    gap: 8px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: .22s ease;
  }
  
  .topbar-mobile__panel.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  
  .topbar-mobile__link {
    padding: 14px 16px;
    border-radius: 14px;
    color: #f3efe6;
    font-weight: 700;
    background: rgba(255,255,255,.03);
  }

  .topbar-mobile__link.is-active {
    color: var(--accent);
    background: rgba(239,227,200,.1);
    border: 1px solid rgba(239,227,200,.14);
  }
  
  .avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.18);
    box-shadow: 0 8px 18px rgba(0,0,0,.15);
  }
  
  .avatar--sm { width: 42px; height: 42px; }
  .avatar--xs { width: 32px; height: 32px; }
  .avatar--lg { width: 64px; height: 64px; }
  
  .panel {
    background: linear-gradient(180deg, #33404a 0%, #2e3740 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
  }
  
  .tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    min-height: 34px;
    border-radius: 999px;
    background: rgba(239,227,200,.11);
    border: 1px solid rgba(239,227,200,.18);
    color: var(--accent);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
  }
  
  .tag--status {
    background: rgba(158,214,163,.1);
    border-color: rgba(158,214,163,.16);
    color: #d6f2d8;
  }
  
  .section-title {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -.04em;
    color: #f8f3ea;
  }
  
  .section-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .primary-btn,
  .secondary-btn {
    min-height: 52px;
    padding: 0 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 0;
    cursor: pointer;
  }
  
  .primary-btn {
    background: var(--accent);
    color: var(--accent-text);
  }
  
  .secondary-btn {
    border: 1px solid rgba(239,227,200,.18);
    color: var(--accent);
    background: rgba(255,255,255,.03);
  }

  .secondary-btn--compact {
    min-height: 40px;
    padding: 0 16px;
    font-size: .88rem;
  }
  
  .page {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .28s ease, transform .28s ease;
  }
  
  .page.is-page-visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  .empty-state {
    padding: 30px;
    text-align: center;
  }
  
  .empty-state h3 {
    margin: 0 0 10px;
    color: #fff8ef;
  }
  
  .empty-state p {
    margin: 0;
    color: var(--muted);
  }
  
  .demo-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    min-width: 240px;
    max-width: calc(100vw - 36px);
    padding: 14px 16px;
    border-radius: 16px;
    background: #2f3841;
    color: #f3efe6;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 16px 40px rgba(0,0,0,.2);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: .22s ease;
    z-index: 100;
  }
  
  .demo-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .topbar__auth {
    margin-left: auto;
    display: flex;
    align-items: center;
    min-width: 190px;
    justify-content: flex-end;
  }

  .topbar__auth:empty {
    min-width: 0;
  }

  .topbar-mobile__auth {
    padding: 10px 12px 4px;
  }

  .topbar-mobile__auth:empty {
    display: none;
  }

  .auth-button {
    border: 0;
    border-radius: 999px;
    min-height: 44px;
    padding: 0 18px;
    cursor: pointer;
    background: #5865f2;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(88, 101, 242, .28);
  }

  .auth-button--ghost {
    cursor: default;
    color: var(--muted);
    background: rgba(255,255,255,.06);
    box-shadow: none;
  }

  .auth-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.11);
    background: rgba(255,255,255,.06);
  }

  .auth-user__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
  }

  .auth-user__text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.1;
  }

  .auth-user__text strong {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff8ef;
    font-size: .92rem;
  }

  .auth-user__text span {
    color: var(--muted);
    font-size: .76rem;
  }

  .auth-user__logout {
    border: 0;
    border-radius: 999px;
    padding: 8px 10px;
    color: #ffe6dc;
    background: rgba(255,255,255,.08);
    cursor: pointer;
  }

  .auth-error {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffd8ca;
    font-size: .84rem;
  }

  .site-footer {
    padding: 0 0 34px;
    color: #59636b;
  }

  .site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-radius: 24px;
    background: rgba(255,255,255,.34);
    border: 1px solid rgba(47,56,65,.08);
  }

  .site-footer__inner span {
    font-weight: 900;
    color: #2f3841;
  }

  .site-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
    font-size: .9rem;
    font-weight: 800;
  }

  .site-footer__links a:hover {
    color: #2f3841;
  }

  .legal-page {
    display: grid;
    gap: 18px;
  }

  .legal-hero {
    padding: clamp(24px, 4vw, 42px);
  }

  .legal-hero__eyebrow {
    display: inline-flex;
    margin-bottom: 14px;
    color: var(--accent);
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .76rem;
  }

  .legal-hero h1 {
    margin: 0 0 14px;
    color: #fff8ef;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: .96;
  }

  .legal-hero p {
    margin: 0;
    max-width: 780px;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.7;
  }

  .legal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .legal-card {
    padding: clamp(20px, 3vw, 30px);
  }

  .legal-card h2 {
    margin: 0 0 12px;
    color: #fff8ef;
    font-size: clamp(1.25rem, 2vw, 1.7rem);
  }

  .legal-card p,
  .legal-card li {
    color: var(--muted);
    line-height: 1.68;
  }

  .legal-card p {
    margin: 0 0 12px;
  }

  .legal-card ul {
    margin: 0;
    padding-left: 20px;
  }

  .legal-card a {
    color: var(--accent);
    font-weight: 900;
  }

  .legal-note {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(239,227,200,.1);
    color: var(--muted);
    border: 1px solid rgba(239,227,200,.12);
  }

  .cookie-notice {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 120;
    width: min(760px, calc(100vw - 28px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px 16px 20px;
    border-radius: 24px;
    color: #f7f3eb;
    background:
      linear-gradient(135deg, rgba(54,65,75,.98), rgba(38,46,54,.98)),
      #2f3841;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 22px 60px rgba(24,30,36,.28);
    transform: translate(-50%, 18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
  }

  .cookie-notice.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
  }

  .cookie-notice[hidden] {
    display: none;
  }

  .cookie-notice__text {
    display: grid;
    gap: 4px;
  }

  .cookie-notice__text strong {
    color: #fff8ef;
    font-size: .98rem;
  }

  .cookie-notice__text span {
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
  }

  .cookie-notice__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
  }

  .cookie-notice__actions a {
    color: var(--accent);
    font-weight: 900;
    font-size: .88rem;
  }

  .cookie-notice__actions button {
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    color: var(--accent-text);
    background: var(--accent);
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(239,227,200,.16);
  }
  
  @media (max-width: 860px) {
    .topbar--desktop {
      display: none;
    }
  
    .topbar-mobile {
      display: flex;
    }

    .auth-user {
      justify-content: space-between;
      border-radius: 22px;
    }

    .site-footer__inner {
      align-items: flex-start;
      flex-direction: column;
    }

    .site-footer__links {
      justify-content: flex-start;
    }

    .cookie-notice {
      align-items: stretch;
      flex-direction: column;
      bottom: 12px;
      border-radius: 20px;
    }

    .cookie-notice__actions {
      justify-content: space-between;
    }
  }
  
  @media (max-width: 640px) {
    .shell {
      width: min(100% - 20px, var(--container));
    }
  }
