/*
 * v3-site-shell.css
 * Vendored copy of v3 shell CSS (light-only) for use in the v2 ASP.NET MVC site.
 * Source: tunwalai-www-v3 src/styles/tunwalai-theme.css + global.css (lines 99–935, 1111–1377)
 *         + src/components/header/HomeSwitcher.css
 *         + src/components/header/header-menu-motion.css
 * Dark-mode blocks (html[data-mode='dark'] … and @media (prefers-color-scheme: dark) …)
 * are intentionally omitted — the shell is always light.
 * DO NOT edit manually; re-generate from v3 sources.
 */

/* ─── @font-face (verbatim from tunwalai-theme.css lines 1–119) ──────────── */

@font-face {
  font-display: swap;
  font-family: 'DB HelvethaicaMon X';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/DBHelvethaicaMonX/DBHelvethaicaMonX-Reg.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'DB HelvethaicaMon X';
  font-style: normal;
  font-weight: 500 600;
  src: url('../fonts/DBHelvethaicaMonX/DBHelvethaicaMonX-Med.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'DB HelvethaicaMon X';
  font-style: normal;
  font-weight: 700 900;
  src: url('../fonts/DBHelvethaicaMonX/DBHelvethaicaMonX-Bd.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Bai Jamjuree';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/BaiJamjuree/BaiJamjuree-Regular-Thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-display: swap;
  font-family: 'Bai Jamjuree';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/BaiJamjuree/BaiJamjuree-Regular-Latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-display: swap;
  font-family: 'Bai Jamjuree';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/BaiJamjuree/BaiJamjuree-Medium-Thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-display: swap;
  font-family: 'Bai Jamjuree';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/BaiJamjuree/BaiJamjuree-Medium-Latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-display: swap;
  font-family: 'Bai Jamjuree';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/BaiJamjuree/BaiJamjuree-SemiBold-Thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-display: swap;
  font-family: 'Bai Jamjuree';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/BaiJamjuree/BaiJamjuree-SemiBold-Latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-display: swap;
  font-family: 'Bai Jamjuree';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/BaiJamjuree/BaiJamjuree-Bold-Thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-display: swap;
  font-family: 'Bai Jamjuree';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/BaiJamjuree/BaiJamjuree-Bold-Latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-display: swap;
  font-family: 'MN Paethai';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/MNPaethai/MNPaethai-Reg.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'MN Paethai';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/MNPaethai/MNPaethai-Med.woff2') format('woff2');
}

/* ─── Design tokens (verbatim from tunwalai-theme.css :root blocks, light merged) ── */

:root {
  /* Shell is light-only in v2 (v3's color-mode toggle is dev-only). Pinned to
     'light' so a dark OS can't darken native controls/scrollbars on v2 pages. */
  color-scheme: light;

  --twl-font-db-helvethaica: 'DB HelvethaicaMon X', Arial, 'Helvetica Neue', sans-serif;
  --twl-font-bai-jamjuree: 'Bai Jamjuree', Arial, 'Helvetica Neue', sans-serif;
  --twl-font-mn-paethai: 'MN Paethai', Arial, 'Helvetica Neue', sans-serif;
  --Action-font-family: var(--twl-font-db-helvethaica);
  --Action-font-size-xs: 12px;
  --Action-font-size-sm: 14px;
  --Action-font-size-md: 16px;
  --Action-font-size-lg: 20px;
  --Body-font-family: var(--twl-font-bai-jamjuree);
  --Body-font-size-xs: 10px;
  --Body-font-size-sm: 12px;
  --Body-font-size-md: 14px;
  --Body-font-size-lg: 16px;
  --Body-font-size-xlg: 20px;
  --Body-font-line-height-xs: 15px;
  --Body-font-line-height-sm: 18px;
  --Body-font-line-height-md: 21px;
  --Body-font-line-height-lg: 24px;
  --Body-font-line-height-xlg: 30px;
  --Heading-font-family: var(--twl-font-db-helvethaica);
  --Heading-font-size-sm: 20px;
  --Heading-font-size-md: 24px;
  --Heading-font-size-lg: 32px;
  --Title-Hero-font-family: var(--twl-font-db-helvethaica);
  --Title-Hero-font-size: 64px;
  --Title-Page-font-family: var(--twl-font-db-helvethaica);
  --Title-Page-font-size-sm: 24px;
  --Title-Page-font-size-md: 28px;
  --Title-Page-font-size-lg: 32px;
  --Title-Page-font-size-xlg: 48px;

  --twl-type-scale-01: 0.625rem;
  --twl-type-scale-02: 0.75rem;
  --twl-type-scale-03: 0.875rem;
  --twl-type-scale-04: 1rem;
  --twl-type-scale-05: 1.25rem;
  --twl-type-scale-06: 1.5rem;
  --twl-type-scale-08: 2rem;
  --twl-type-scale-11: 4rem;
  --twl-line-height-01: 0.9375rem;
  --twl-line-height-02: 1.125rem;
  --twl-line-height-03: 1.3125rem;
  --twl-line-height-04: 1.5rem;
  --twl-line-height-05: 1.875rem;

  --twl-radius-sm: 0.5rem;
  --twl-radius-md: 0.625rem;
  --twl-radius-lg: 1rem;
  --twl-radius-full: 999px;
  --twl-elevation-xs: 0 2px 10px 0 rgba(7, 7, 8, 0.1);
  --twl-elevation-sm: 0 4px 20px 0 rgba(7, 7, 8, 0.1);
  --twl-elevation-md: 0 4px 20px 0 rgba(7, 7, 8, 0.2);
  --twl-shadow-sm: 0 4px 10px 0 rgba(7, 7, 8, 0.05);

  --twl-ref-static-base-black: #070708;
  --twl-ref-static-base-white: #ffffff;
  --twl-ref-opacity-black-0: rgba(7, 7, 8, 0);
  --twl-ref-opacity-black-5: rgba(7, 7, 8, 0.05);
  --twl-ref-opacity-black-10: rgba(7, 7, 8, 0.1);
  --twl-ref-opacity-black-20: rgba(7, 7, 8, 0.2);
  --twl-ref-opacity-black-60: rgba(7, 7, 8, 0.6);
  --twl-ref-opacity-black-90: rgba(7, 7, 8, 0.9);
  --twl-ref-opacity-white-0: rgba(255, 255, 255, 0);
  --twl-ref-opacity-white-20: rgba(255, 255, 255, 0.2);
  --twl-ref-opacity-white-50: rgba(255, 255, 255, 0.5);
  --twl-ref-opacity-white-90: rgba(255, 255, 255, 0.9);

  --twl-sem-bg-neutral-primary: var(--twl-ref-neutral-300);
  --twl-sem-bg-neutral-secondary: var(--twl-ref-neutral-200);
  --twl-sem-bg-neutral-tertiary: var(--twl-ref-neutral-100);
  --twl-sem-bg-brand-default: var(--twl-ref-brand-500);
  --twl-sem-bg-brand-hover: var(--twl-ref-brand-600);
  --twl-sem-bg-brand-active: var(--twl-ref-brand-700);
  --twl-sem-bg-brand-disabled: var(--twl-ref-brand-200);
  --twl-sem-bg-brand-subtle: var(--twl-ref-brand-50);
  --twl-sem-bg-brand-subtle-active: var(--twl-ref-brand-100);
  --twl-sem-bg-danger-default: var(--twl-ref-danger-500);
  --twl-sem-bg-danger-subtle: var(--twl-ref-danger-50);
  --twl-sem-bg-success-default: var(--twl-ref-success-500);
  --twl-sem-bg-success-subtle: var(--twl-ref-success-50);
  --twl-sem-bg-warning-default: var(--twl-ref-warning-500);
  --twl-sem-bg-warning-subtle: var(--twl-ref-warning-50);

  --twl-sem-text-neutral-primary: var(--twl-ref-neutral-900);
  --twl-sem-text-neutral-secondary: var(--twl-ref-neutral-600);
  --twl-sem-text-neutral-tertiary: var(--twl-ref-neutral-500);
  --twl-sem-text-neutral-placeholder: var(--twl-ref-neutral-500);
  --twl-sem-text-neutral-disabled: var(--twl-ref-neutral-400);
  --twl-sem-text-brand-default: var(--twl-ref-brand-600);
  --twl-sem-text-brand-hover: var(--twl-ref-brand-700);
  --twl-sem-text-brand-active: var(--twl-ref-brand-800);
  --twl-sem-text-brand-disabled: var(--twl-ref-brand-200);
  --twl-sem-text-brand-on-disabled: var(--twl-ref-brand-400);
  --twl-sem-text-danger-default: var(--twl-ref-danger-500);
  --twl-sem-text-success-default: var(--twl-ref-success-500);
  --twl-sem-text-warning-default: var(--twl-ref-warning-500);
  --twl-sem-text-static-white: var(--twl-ref-static-base-white);

  --twl-sem-icon-neutral-primary: var(--twl-ref-neutral-900);
  --twl-sem-icon-neutral-secondary: var(--twl-ref-neutral-600);
  --twl-sem-icon-neutral-tertiary: var(--twl-ref-neutral-500);
  --twl-sem-icon-neutral-disabled: var(--twl-ref-neutral-400);
  --twl-sem-icon-brand-default: var(--twl-ref-brand-600);
  --twl-sem-icon-brand-hover: var(--twl-ref-brand-700);
  --twl-sem-icon-brand-active: var(--twl-ref-brand-800);
  --twl-sem-icon-brand-disabled: var(--twl-ref-brand-200);
  --twl-sem-icon-brand-on-disabled: var(--twl-ref-brand-400);
  --twl-sem-icon-danger-default: var(--twl-ref-danger-500);
  --twl-sem-icon-success-default: var(--twl-ref-success-500);
  --twl-sem-icon-warning-default: var(--twl-ref-warning-500);

  --twl-sem-border-neutral-subtle: var(--twl-ref-neutral-200);
  --twl-sem-border-neutral-default: var(--twl-ref-neutral-300);
  --twl-sem-border-brand-default: var(--twl-ref-brand-500);
  --twl-sem-border-brand-hover: var(--twl-ref-brand-600);
  --twl-sem-border-brand-active: var(--twl-ref-brand-700);
  --twl-sem-border-brand-disabled: var(--twl-ref-brand-200);
  --twl-sem-border-brand-focus: var(--twl-ref-brand-600);
  --twl-sem-border-danger-default: var(--twl-ref-danger-500);

  --Background-Brand-default: var(--twl-sem-bg-brand-default);
  --Background-Brand-hover: var(--twl-sem-bg-brand-hover);
  --Background-Brand-active: var(--twl-sem-bg-brand-active);
  --Background-Brand-disabled: var(--twl-sem-bg-brand-disabled);
  --Background-Brand-subtle: var(--twl-sem-bg-brand-subtle);
  --Background-Brand-subtle-active: var(--twl-sem-bg-brand-subtle-active);
  --Text-Brand-default: var(--twl-sem-text-brand-default);
  --Text-Brand-hover: var(--twl-sem-text-brand-hover);
  --Text-Brand-active: var(--twl-sem-text-brand-active);
  --Text-Brand-disabled: var(--twl-sem-text-brand-disabled);
  --Text-Brand-on-brand-disabled: var(--twl-sem-text-brand-on-disabled);
  --Text-Danger-default: var(--twl-sem-text-danger-default);
  --Text-Static-white: var(--twl-sem-text-static-white);
  --Static-Opacity-Black-90: var(--twl-ref-opacity-black-90);
  --Icon-Brand-default: var(--twl-sem-icon-brand-default);
  --Icon-Brand-hover: var(--twl-sem-icon-brand-hover);
  --Icon-Brand-active: var(--twl-sem-icon-brand-active);
  --Icon-Brand-disabled: var(--twl-sem-icon-brand-disabled);
  --Icon-Brand-on-brand-disabled: var(--twl-sem-icon-brand-on-disabled);
  --Border-Brand-default: var(--twl-sem-border-brand-default);
  --Border-Brand-hover: var(--twl-sem-border-brand-hover);
  --Border-Brand-active: var(--twl-sem-border-brand-active);
  --Border-Brand-disabled: var(--twl-sem-border-brand-disabled);
  --Border-Brand-focus: var(--twl-sem-border-brand-focus);

  --twl-theme-accent-bg: var(--twl-sem-bg-brand-subtle);
  --twl-theme-accent-bg-active: var(--twl-sem-bg-brand-subtle-active);
  --twl-theme-accent-fill: var(--twl-sem-bg-brand-default);
  --twl-theme-accent-fill-hover: var(--twl-sem-bg-brand-hover);
  --twl-theme-accent-fill-active: var(--twl-sem-bg-brand-active);
  --twl-theme-accent-text: var(--twl-sem-text-brand-default);
  --twl-theme-accent-hover: var(--twl-sem-bg-brand-hover);
  --twl-theme-accent-active: var(--twl-sem-bg-brand-active);
  --twl-theme-accent-border: var(--twl-sem-border-brand-default);
  --twl-theme-accent-gradient-end: var(--twl-ref-brand-gradient-end);

  --background-base: var(--twl-ref-base-bg-base);
  --background-raised: var(--twl-ref-base-bg-raised);
  --background-inverse: var(--twl-ref-base-inverse);
  --background-on-color: var(--twl-ref-base-on-color);
  --Base-bg-base: var(--twl-ref-base-bg-base);
  --Base-bg-raised: var(--twl-ref-base-bg-raised);
  --Base-border-raised: var(--twl-ref-base-bg-raised);
  --Base-inverse: var(--twl-ref-base-inverse);
  --Base-bg-on-color: var(--twl-ref-base-on-color);
  --brand-active: var(--twl-sem-text-brand-active);
  --brand-border: var(--twl-sem-border-brand-default);
  --brand-default: var(--twl-sem-text-brand-default);
  --brand-gradient-end: var(--twl-ref-brand-gradient-end);
  --brand-hover: var(--twl-sem-text-brand-hover);
  --brand-subtle: var(--twl-sem-bg-brand-subtle);
  --brand-subtle-active: var(--twl-sem-bg-brand-subtle-active);
  --border-default: var(--twl-sem-border-neutral-default);
  --border-subtle: var(--twl-sem-border-neutral-subtle);
  --Border-Neutral-default: var(--twl-sem-border-neutral-default);
  --Border-Neutral-subtle: var(--twl-sem-border-neutral-subtle);
  --Icon-Neutral-primary: var(--twl-sem-icon-neutral-primary);
  --Icon-Neutral-disabled: var(--twl-sem-icon-neutral-disabled);
  --text-primary: var(--twl-sem-text-neutral-primary);
  --text-secondary: var(--twl-sem-text-neutral-secondary);
  --text-tertiary: var(--twl-sem-text-neutral-tertiary);
  --Text-Neutral-primary: var(--twl-sem-text-neutral-primary);

  /* Light ref values merged directly onto :root so light is the baseline */
  --twl-ref-base-bg-base: var(--twl-ref-static-base-white);
  --twl-ref-base-bg-raised: var(--twl-ref-static-base-white);
  --twl-ref-base-inverse: var(--twl-ref-neutral-900);
  --twl-ref-base-on-color: var(--twl-ref-static-base-white);
  --twl-ref-brand-50: #fff3f0;
  --twl-ref-brand-100: #ffe0d9;
  --twl-ref-brand-200: #ffc4b6;
  --twl-ref-brand-300: #ffa590;
  --twl-ref-brand-400: #ff8e76;
  --twl-ref-brand-500: #ff775f;
  --twl-ref-brand-600: #e85d45;
  --twl-ref-brand-700: #c04528;
  --twl-ref-brand-800: #8f2f18;
  --twl-ref-brand-900: #5c1d0c;
  --twl-ref-brand-gradient-end: #ff775f;
  --twl-ref-neutral-50: #fafafa;
  --twl-ref-neutral-100: #f2f2f3;
  --twl-ref-neutral-200: #e4e5e7;
  --twl-ref-neutral-300: #cacbce;
  --twl-ref-neutral-400: #9a9da2;
  --twl-ref-neutral-500: #6d7078;
  --twl-ref-neutral-600: #44464b;
  --twl-ref-neutral-700: #26282b;
  --twl-ref-neutral-800: #151619;
  --twl-ref-neutral-900: #070708;
  --twl-ref-danger-50: #fceeee;
  --twl-ref-danger-500: #c72126;
  --twl-ref-success-50: #effbf7;
  --twl-ref-success-500: #1abc8c;
  --twl-ref-warning-50: #fef7e8;
  --twl-ref-warning-500: #b0800c;
  --twl-ref-tun-bl-bg: #efe8fe;
  --twl-ref-tun-bl-border: #a078fd;
  --twl-ref-tun-bl-text: #a078fd;
  --twl-ref-tun-gl-bg: #ffecf4;
  --twl-ref-tun-gl-border: #ff3d91;
  --twl-ref-tun-gl-text: #ff3d91;
  --twl-ref-tun-fanfic-bg: #e6f8ff;
  --twl-ref-tun-fanfic-border: #22bcf2;
  --twl-ref-tun-fanfic-text: #22bcf2;
}

/* ─── [data-theme] mapping block (verbatim from tunwalai-theme.css lines 452–509) ── */

[data-theme] {
  --twl-house-theme-active-accent-bg: var(--twl-house-theme-light-accent-bg);
  --twl-house-theme-active-accent-bg-active: var(--twl-house-theme-light-accent-bg-active);
  --twl-house-theme-active-accent-color: var(--twl-house-theme-light-accent-color);
  --twl-house-theme-active-accent-gradient-end: var(--twl-house-theme-light-accent-gradient-end);
  --twl-house-theme-active-text-color: var(--twl-house-theme-light-text-color);
  --twl-house-theme-active-button-bg: var(--twl-house-theme-light-button-bg);
  --twl-house-theme-active-button-color: var(--twl-house-theme-light-button-color);
  --twl-house-theme-active-button-text: var(--twl-house-theme-light-button-text);

  --twl-theme-accent-bg: var(--twl-house-theme-active-accent-bg, var(--twl-sem-bg-brand-subtle));
  --twl-theme-accent-bg-active: var(
    --twl-house-theme-active-accent-bg-active,
    var(--twl-sem-bg-brand-subtle-active)
  );
  --twl-theme-accent-fill: var(
    --twl-house-theme-active-accent-color,
    var(--twl-sem-bg-brand-default)
  );
  --twl-theme-accent-fill-hover: var(
    --twl-house-theme-active-accent-color,
    var(--twl-sem-bg-brand-hover)
  );
  --twl-theme-accent-fill-active: var(
    --twl-house-theme-active-accent-color,
    var(--twl-sem-bg-brand-active)
  );
  --twl-theme-accent-text: var(
    --twl-house-theme-active-accent-color,
    var(--twl-sem-text-brand-default)
  );
  --twl-theme-accent-hover: var(
    --twl-house-theme-active-accent-color,
    var(--twl-sem-text-brand-hover)
  );
  --twl-theme-accent-active: var(
    --twl-house-theme-active-accent-color,
    var(--twl-sem-text-brand-active)
  );
  --twl-theme-accent-border: var(
    --twl-house-theme-active-accent-color,
    var(--twl-sem-border-brand-default)
  );
  --twl-theme-accent-gradient-end: var(
    --twl-house-theme-active-accent-gradient-end,
    var(--twl-ref-brand-gradient-end)
  );
  --twl-theme-house-text: var(--twl-house-theme-active-text-color, var(--text-primary));
  --twl-theme-button-bg: var(--twl-house-theme-active-button-bg, var(--twl-theme-accent-fill));
  --twl-theme-button-color: var(
    --twl-house-theme-active-button-color,
    var(--twl-theme-accent-text)
  );
  --twl-theme-button-text: var(
    --twl-house-theme-active-button-text,
    var(--Base-bg-on-color, var(--background-on-color))
  );
}

/* ─── Per-house static light themes (contract §5) ───────────────────────── */

[data-theme='bl'] {
  --twl-house-theme-light-accent-color: #a078fd;
  --twl-house-theme-light-accent-bg: #efe8fe;
}

[data-theme='gl'] {
  --twl-house-theme-light-accent-color: #ff3d91;
  --twl-house-theme-light-accent-bg: #ffecf4;
}

[data-theme='fanfic'] {
  --twl-house-theme-light-accent-color: #22bcf2;
  --twl-house-theme-light-accent-bg: #e6f8ff;
}

/* tun = default brand (#e85d45/#ff775f) — no override needed */

/* ─── Scoped box-sizing (contract §2) ───────────────────────────────────── */

.site-header,
.home-footer,
.home-switcher-dialog,
.site-auth-menu,
.site-header *,
.home-footer *,
.home-switcher-dialog *,
.site-auth-menu * {
  box-sizing: border-box;
}

/* ─── Header / tabs / actions / icons / dream-chat / auth / site-auth-menu / site-tools ─ */
/* Source: global.css lines 99–935 (skipping .home-page 92–97, infinite-carousel 154–178,
   confirm-dialog 556–641, button/home-content/home-feed 937–1110) */

.site-header {
  position: sticky;
  top: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--Border-Neutral-subtle, var(--border-subtle));
  background: var(--Base-bg-base, var(--background-base));
  padding: 16px clamp(16px, 10vw, 144px) 0;
}

.site-header__top,
.site-header__bottom {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-width: 0;
  width: 100%;
}

.site-header__top {
  min-height: 32px;
}

.site-header__bottom {
  min-height: 48px;
}

/* Match v3 global.css: brand + pill share bottom edge (flex-end), not mid-center.
   Logo box 57×32; pill sits on same baseline as logo. */
.site-brand-section {
  align-items: center;
  background: var(--Base-bg-raised, #fff);
  border-radius: var(--twl-radius-full, 999px);
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 4px 6px 4px 10px;
}

.brand-mark {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  min-height: 32px;
  white-space: nowrap;
  width: 57px;
}

.brand-mark__logo {
  block-size: 32px;
  display: block;
  inline-size: 57px;
  object-fit: contain;
}

.brand-mark__logo--dark {
  display: none;
}

html[data-mode='dark'] .brand-mark__logo--light {
  display: none;
}

html[data-mode='dark'] .brand-mark__logo--dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .brand-mark__logo--light,
  html[data-mode='system'] .brand-mark__logo--light {
    display: none;
  }

  html:not([data-mode]) .brand-mark__logo--dark,
  html[data-mode='system'] .brand-mark__logo--dark {
    display: block;
  }
}

.site-tabs,
.site-actions {
  display: flex;
  align-items: center;
}

.site-tabs {
  align-self: stretch;
  min-width: 0;
  overflow-x: auto;
  position: relative;
  scrollbar-width: none;
}

.site-tabs::-webkit-scrollbar {
  display: none;
}

.site-tabs__indicator {
  background: var(--twl-theme-accent-border, var(--twl-sem-border-brand-default));
  block-size: 2px;
  inset-block-end: 0;
  inset-inline-start: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease;
  will-change: transform, width;
}

.site-tabs__indicator::after {
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--twl-theme-accent-text, var(--twl-sem-text-brand-default)) 32%, white),
    transparent
  );
  block-size: 100%;
  content: '';
  inline-size: 38%;
  inset-block-start: 0;
  inset-inline-start: -42%;
  opacity: 0;
  position: absolute;
  transform: translateX(0);
}

.site-tabs__indicator--pending::after {
  animation: site-tabs-progress-sweep 0.92s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  opacity: 1;
}

@keyframes site-tabs-progress-sweep {
  to {
    transform: translateX(372%);
  }
}

.site-tabs__link {
  align-items: center;
  color: var(--Text-Neutral-primary, var(--text-primary));
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica));
  font-size: var(--Action-font-size-lg, 20px);
  font-style: normal;
  font-weight: 500;
  height: 48px;
  justify-content: center;
  line-height: normal;
  padding: 4px 24px;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.site-tabs__link:hover,
.site-tabs__link:focus,
.site-tabs__link:focus-visible {
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default)) !important;
}

.site-tabs__link:active {
  opacity: 0.8;
}

.site-tabs__link[aria-current='page'] {
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
  font-weight: 700;
}

.site-tabs__link[aria-current='page']:hover {
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default)) !important;
}

@media (prefers-reduced-motion: reduce) {
  .site-tabs__indicator {
    transition: none !important;
  }

  .site-tabs__indicator--pending::after {
    animation: none;
    opacity: 0;
  }

  .site-tabs__link {
    transition: none;
  }
}

.site-actions {
  gap: 16px;
  justify-content: flex-end;
}

.site-header-icons {
  align-items: center;
  display: flex;
  gap: 24px;
}

.site-category {
  align-items: center;
  display: inline-flex;
  position: relative;
}

.site-category__backdrop {
  display: none;
}

.category-menu {
  background: var(--background-raised);
  border: 1px solid var(--Base-border-raised, var(--border-subtle));
  border-radius: var(--twl-radius-lg);
  box-shadow: var(--twl-elevation-md);
  box-sizing: border-box;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  max-height: min(650px, calc(100vh - 96px));
  max-width: calc(100vw - 32px);
  overflow: hidden;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  transform-origin: top right;
  width: 450px;
  z-index: 1000002;
}

.category-menu__header {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
  justify-content: space-between;
  padding: 24px 24px 16px;
}

.category-menu__heading {
  color: var(--text-primary);
  font-family: var(--twl-font-db-helvethaica, sans-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
}

.category-menu__close {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 24px;
  justify-content: center;
  padding: 0;
  width: 24px;
}

.category-menu__close:hover,
.category-menu__close:focus-visible {
  color: var(--text-primary);
}

.category-menu__list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
  overflow-y: auto;
  padding: 0 24px 24px;
}

.category-menu__item {
  align-items: center;
  background: var(--background-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--twl-radius-sm);
  box-sizing: border-box;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
}

.category-menu__item:hover,
.category-menu__item:focus-visible {
  background: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle));
  border-color: var(--twl-theme-accent-border, var(--twl-sem-border-brand-default));
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
  outline: 0;
}

.category-menu__item:hover .category-menu__description,
.category-menu__item:focus-visible .category-menu__description {
  color: var(--text-secondary);
}

.category-menu__icon {
  align-items: center;
  display: inline-flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.category-menu__icon-image {
  display: block;
  height: 32px;
  object-fit: contain;
  width: 32px;
}

.category-menu__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.category-menu__title {
  color: var(--text-primary);
  font-family: var(--twl-font-bai-jamjuree, sans-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 21px;
}

.category-menu__description {
  color: var(--text-secondary);
  font-family: var(--twl-font-bai-jamjuree, sans-serif);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.site-header-right {
  align-items: center;
  display: flex;
  gap: 8px;
}

.dream-chat-btn {
  align-items: center;
  border: 1px solid var(--Border-Neutral-default, var(--border-default));
  border-radius: var(--twl-radius-full);
  box-sizing: border-box;
  color: var(--Text-Neutral-primary, var(--text-primary)) !important;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica));
  font-size: var(--Action-font-size-lg, 20px);
  font-weight: 700;
  gap: 4px;
  height: 28px;
  justify-content: center;
  line-height: normal;
  padding: 2px 12px;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}

.dream-chat-btn:is(:link, :visited, :hover, :focus, :active) {
  color: var(--Text-Neutral-primary, var(--text-primary)) !important;
  text-decoration: none !important;
}

.dream-chat-btn::before {
  border-radius: inherit;
  content: '';
  inset: -1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.dream-chat-btn:hover {
  background: var(--Base-bg-raised, #fff);
  border-color: transparent;
}

.dream-chat-btn:hover::before {
  background: linear-gradient(90deg, #79f2f1 0%, #1e8cff 50%, #b371fd 100%);
  opacity: 1;
  padding: 2px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.dream-chat-btn img,
.dream-chat-btn__label {
  display: block;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.site-icon-link {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--twl-radius-full);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica));
  font-size: var(--Action-font-size-lg, 20px);
  font-weight: 500;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0;
  position: relative;
  white-space: nowrap;
}

.site-icon-link::before {
  background: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle));
  border-radius: var(--twl-radius-full);
  content: '';
  inset: -6px;
  opacity: 0;
  position: absolute;
  transition: opacity 0.16s ease;
}

.site-icon-link > svg,
.site-icon-link > img {
  position: relative;
  z-index: 1;
}

/* Notification badge — v3 NotificationBell.css parity */
.notification-bell__icon {
  align-items: center;
  display: inline-flex;
  height: 20px;
  justify-content: center;
  position: relative;
  width: 20px;
  z-index: 1;
}

.notification-bell__badge {
  align-items: center;
  background: var(--Background-Danger-default, var(--twl-sem-bg-danger-default, #e0284a));
  border-radius: var(--twl-radius-full);
  box-shadow: 0 0 0 2px var(--Base-bg-base, var(--background-base, #fff));
  color: var(--Text-Static-white, #fff);
  display: inline-flex;
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica));
  font-size: 12px;
  font-weight: 700;
  height: 18px;
  inset-block-start: 0;
  inset-inline-end: 0;
  justify-content: center;
  line-height: 1;
  min-width: 18px;
  padding: 0 5px;
  position: absolute;
  transform: translate(50%, -48%);
  white-space: nowrap;
}

.notification-bell__badge.d-none {
  display: none !important;
}

.site-icon-link:hover,
.site-icon-link:focus,
.site-icon-link:focus-visible {
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
}

.site-icon-link:hover::before,
.site-icon-link:focus::before,
.site-icon-link:focus-visible::before {
  opacity: 1;
}

.site-auth-profile:hover {
  background: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle));
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
}

.color-mode-toggle {
  margin: 0;
}

.site-auth-login {
  align-items: center;
  background: transparent;
  border: 1px solid var(--Border-Brand-default, var(--twl-sem-border-brand-default));
  border-radius: var(--twl-radius-full);
  box-sizing: border-box;
  color: var(--Text-Brand-default, var(--twl-sem-text-brand-default));
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica));
  font-size: var(--Action-font-size-lg, 20px);
  font-weight: 700;
  gap: 4px;
  height: 28px;
  justify-content: center;
  line-height: normal;
  padding: 2px 12px;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}

.site-auth-login::before {
  border: 2px solid transparent;
  border-radius: inherit;
  content: '';
  inset: -1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.site-auth-login:hover {
  background: var(--Base-bg-raised, #fff);
  border-color: transparent;
  color: var(--Text-Brand-hover, var(--twl-sem-text-brand-hover));
}

.site-auth-login:hover::before {
  border-color: var(--TUN-Hetero-border, #e85d45);
  opacity: 1;
}

.site-auth-login:active {
  background: transparent;
  border-color: var(--Border-Brand-active, var(--twl-sem-border-brand-active));
  color: var(--Text-Brand-active, var(--twl-sem-text-brand-active));
}

.site-auth-actions {
  align-items: center;
  display: flex;
  min-width: 0;
  position: relative;
}

.site-auth-skeleton {
  animation: site-auth-skeleton-shimmer 1.4s ease-in-out infinite;
  background: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle));
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--background-raised) 44%, transparent) 48%,
    transparent 100%
  );
  background-size: 220% 100%;
  border: 1px solid
    color-mix(
      in srgb,
      var(--twl-theme-accent-text, var(--twl-sem-text-brand-default)) 12%,
      transparent
    );
  border-radius: var(--twl-radius-full);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--background-raised) 70%, transparent);
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  overflow: hidden;
  width: 32px;
}

.site-auth-skeleton img {
  display: block;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  width: 100%;
}

.site-auth-profile {
  align-items: center;
  border: 0;
  border-radius: var(--twl-radius-full);
  cursor: pointer;
  display: inline-flex;
  background: var(--text-primary);
  color: var(--background-base);
  height: 32px;
  justify-content: center;
  overflow: visible;
  padding: 0;
  width: 32px;
}

.site-profile-avatar {
  --site-profile-avatar-size: 32px;
  display: inline-flex;
  flex: 0 0 var(--site-profile-avatar-size);
  height: var(--site-profile-avatar-size);
  position: relative;
  width: var(--site-profile-avatar-size);
}

.site-profile-avatar--menu {
  --site-profile-avatar-size: 40px;
}

.site-profile-avatar--large {
  --site-profile-avatar-size: 48px;
}

.site-profile-avatar--profile {
  --site-profile-avatar-size: 120px;
}

.site-profile-avatar__image {
  border-radius: var(--twl-radius-full);
  display: block;
  height: 100%;
  object-fit: cover;
  position: relative;
  width: 100%;
  z-index: 1;
}

.site-profile-avatar__fallback {
  align-items: center;
  background: var(--brand-subtle);
  border-radius: var(--twl-radius-full);
  color: var(--brand-default);
  display: inline-flex;
  height: 100%;
  justify-content: center;
  width: 100%;
  z-index: 1;
}

.site-profile-avatar__frame {
  block-size: 150%;
  height: 150%;
  inline-size: 150%;
  inset: -25%;
  max-height: none;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  width: 150%;
  z-index: 2;
}

.site-profile-avatar__badge {
  height: 100%;
  inset: 0;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 3;
}

@keyframes site-auth-skeleton-shimmer {
  from {
    background-position: 160% 0;
  }

  to {
    background-position: -160% 0;
  }
}

/* ─── Profile dropdown menu ──────────────────────────────────────────────── */

/*
 * Figma: Profile Menu (node 3113:114536)
 * Structure: flex-col, gap-8px between User Section and Menu Section.
 * Dividers are full-bleed — sections own their padding; no outer padding on container.
 *
 * Exact Figma spec:
 *   Profile Menu:   flex-col, gap-8px
 *   User Section:   pt-8px (top padding on the section wrapper)
 *   User Wrapper:   py-8px px-16px gap-8px → combined: padding 16px 16px 8px
 *   Menu Section:   flex-col, gap-8px (wraps Balance List, Dividers, Menu List, Sign Out)
 *   Balance rows:   px-16px py-8px gap-12px, icon 24px
 *   Menu rows:      px-16px py-8px gap-12px, icon 16px
 *   Sign Out:       pb-8px on section, row same as menu rows
 */
.site-auth-menu {
  background: var(--background-raised);
  border: 1px solid var(--Base-border-raised, var(--border-subtle));
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree));
  border-radius: var(--twl-radius-lg);
  box-shadow: var(--twl-elevation-md);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
  min-width: 270px;
  overflow: hidden;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 270px;
  z-index: 50;
}

.site-auth-menu__close {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text-tertiary);
  cursor: pointer;
  display: none;
  height: 40px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 40px;
  z-index: 2;
}

.site-auth-menu__close:hover,
.site-auth-menu__close:focus-visible {
  color: var(--text-primary);
}

/* ── User Section ── */
/* Figma: User Section pt-[8px] + User Wrapper py-[8px] px-[16px] gap-[8px]
 * Top = 8 (section) + 8 (wrapper) = 16px total, bottom = 8px
 * Clicking → goes to profile page; cursor-pointer only, no hover bg fill. */
.site-auth-menu__identity {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
  padding: 16px 16px 8px;
  text-decoration: none;
}

/* Avatar — 40×40 full-radius */
.site-auth-menu__identity > .site-profile-avatar {
  flex-shrink: 0;
}

/* User info text area */
.site-auth-menu__identity-info {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.site-auth-menu__identity strong {
  color: var(--text-primary);
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 21px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-auth-menu__identity small {
  color: var(--text-tertiary);
  display: block;
  font-size: 12px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Divider — full-bleed hairline ── */
/* Figma: h-0 node with a 1px border, width 100%, no inset */
.site-auth-menu__divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 0;
}

/* ── Menu Section — wraps Balance List + Dividers + Menu List + Sign Out ── */
/* Figma: Menu Section is flex-col gap-8px; dividers get spacing from the gap,
 * not from their own margin. */
.site-auth-menu__menu-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Balance List ── */
/* Figma: flex-col, no gap between rows; each row: px-[16px] py-[8px] gap-[12px]
 * Icon size: 24px. No min-height — height is purely from padding + content.
 * Linkable rows (coin, ticket, vip) → hover bg + brand-hover text + cursor-pointer.
 * Static rows (key) → no hover bg, cursor-default. */
.site-auth-menu__balances {
  display: flex;
  flex-direction: column;
}

.site-auth-menu__balances a,
.site-auth-menu__balances > span {
  align-items: center;
  color: var(--text-primary);
  display: flex;
  gap: 12px;
  padding: 8px 16px;
  text-decoration: none;
}

/* Static balance rows — not clickable */
.site-auth-menu__balances > span {
  cursor: default;
}

/* Linkable balance rows — hover */
.site-auth-menu__balances a:hover,
.site-auth-menu__balances a:focus-visible {
  background: var(--twl-sem-bg-brand-subtle);
  color: var(--twl-sem-text-brand-default) !important;
}

.site-auth-menu__balances img {
  flex-shrink: 0;
  height: 24px;
  object-fit: contain;
  width: 24px;
}

.site-auth-menu__balances-text {
  flex: 1 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Menu List ── */
/* Figma: flex-col, no gap; each row: px-[16px] py-[8px] gap-[12px]
 * Icon size: 16px. No min-height — height is from padding + line-height (37px natural). */
.site-auth-menu__links {
  display: flex;
  flex-direction: column;
}

.site-auth-menu__links a,
.site-auth-menu__links button {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 12px;
  line-height: 21px;
  padding: 8px 16px;
  text-align: start;
  text-decoration: none;
  width: 100%;
}

.site-auth-menu__links a:hover,
.site-auth-menu__links a:focus-visible,
.site-auth-menu__links button:hover,
.site-auth-menu__links button:focus-visible {
  background: var(--twl-sem-bg-brand-subtle);
  color: var(--twl-sem-text-brand-default) !important;
}

.site-auth-menu__links > .site-auth-menu__mobile-only,
.site-auth-menu__writer {
  display: none;
  interpolate-size: allow-keywords;
}

.site-auth-menu__writer summary {
  align-items: center;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 12px;
  line-height: 21px;
  list-style: none;
  padding: 8px 16px;
}

.site-auth-menu__writer summary::-webkit-details-marker {
  display: none;
}

.site-auth-menu__writer summary:hover,
.site-auth-menu__writer summary:focus-visible {
  background: var(--twl-sem-bg-brand-subtle);
  color: var(--twl-sem-text-brand-default) !important;
}

.site-auth-menu__writer-chevron {
  margin-inline-start: auto;
  transition: transform 0.2s ease;
}

.site-auth-menu__writer[open] .site-auth-menu__writer-chevron {
  transform: rotate(180deg);
}

.site-auth-menu__writer::details-content {
  block-size: 0;
  opacity: 0;
  overflow: hidden;
  transition: block-size 180ms ease, opacity 140ms ease, content-visibility 180ms;
  transition-behavior: allow-discrete;
}

.site-auth-menu__writer[open]::details-content {
  block-size: auto;
  opacity: 1;
}

.site-auth-menu__writer-links {
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  .site-auth-menu__writer-chevron,
  .site-auth-menu__writer::details-content {
    transition: none;
  }
}

/* ── Sign Out Section ── */
/* Figma: pb-[8px] on section container, row spec same as menu rows
 * Color: text/danger/default both light and dark (token is already mode-aware) */
.site-auth-menu__signout {
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
}

.site-auth-menu__signout button,
.site-auth-menu__signout a {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 12px;
  line-height: 21px;
  padding: 8px 16px;
  text-align: start;
  text-decoration: none;
  width: 100%;
}

.site-auth-menu__signout button:hover,
.site-auth-menu__signout a:hover {
  color: var(--Text-Danger-default, var(--twl-sem-text-danger-default)) !important;
}

.site-auth-menu__error {
  color: var(--twl-sem-text-danger-default);
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  padding: 0 16px;
}

.site-tools {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  height: 48px;
  position: relative;
}

.site-tools a {
  align-items: center;
  color: var(--Text-Neutral-primary, var(--text-primary));
  display: inline-flex;
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica));
  font-size: var(--Action-font-size-lg, 20px);
  font-style: normal;
  font-weight: 500;
  gap: 8px;
  line-height: normal;
  padding: 0;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.site-tools__trigger {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 8px;
  text-decoration: none;
}

.site-tools__trigger-chevron {
  flex: 0 0 auto;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.site-tools__trigger[aria-expanded='true'] .site-tools__trigger-chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .site-tools__trigger-chevron {
    transition: none;
  }
}

.site-tools a:not(:last-child) {
  /* Divider between the two writer tools, matching Figma's right border +
   * 12px trailing padding on the first item (Writer Dashboard). */
  border-inline-end: 1px solid var(--Border-Neutral-default, var(--border-default));
  padding-inline-end: 12px;
}

.site-tools a:hover,
.site-tools a:focus,
.site-tools a:focus-visible {
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default)) !important;
}

.site-tools a:active {
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .site-tools a {
    transition: none;
  }
}

/* ─── Footer (global.css lines 1111–1377) ────────────────────────────────── */

.home-footer {
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree)) !important;
  padding: 32px 32px 32px;
}

.home-footer__surface {
  background: var(--twl-ref-brand-50, var(--twl-sem-bg-brand-subtle));
  border-radius: 24px;
  color: var(--Text-Neutral-primary, var(--text-primary));
  overflow: clip;
}

.home-footer__content {
  align-items: start;
  display: grid;
  gap: 32px;
  grid-template-columns: 248px repeat(3, minmax(0, 1fr));
  min-height: 333px;
  padding: 64px 144px;
}

.home-footer__logo {
  align-items: center;
  block-size: 92px;
  display: flex;
  inline-size: 248px;
}

.home-footer__logo img {
  block-size: 92px;
  display: block;
  inline-size: 228px;
  object-fit: contain;
}

.home-footer__column,
.home-footer__social {
  min-inline-size: 0;
}

.home-footer__column h2,
.home-footer__social h2 {
  color: var(--Text-Brand-default, var(--twl-sem-text-brand-default));
  font-family: var(--Heading-font-family, var(--twl-font-db-helvethaica)) !important;
  font-size: var(--Heading-font-size-md, 24px) !important;
  font-weight: 500 !important;
  line-height: 1;
  margin: 0 0 8px;
}

.home-footer__column ul,
.home-footer__social ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-footer__column a,
.home-footer__column span,
.home-footer__social a {
  color: inherit;
  text-decoration: none;
}

.home-footer__column a,
.home-footer__column span {
  display: inline-block;
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree)) !important;
  font-size: var(--Body-font-size-md, 14px) !important;
  font-weight: 500 !important;
  line-height: var(--Body-font-line-height-md, 21px);
  overflow-wrap: anywhere;
}

.home-footer__column a:hover,
.home-footer__social a:hover {
  color: var(--Text-Brand-hover, var(--twl-sem-text-brand-hover)) !important;
}

.home-footer__social {
  display: grid;
  gap: 16px;
}

.home-footer__social li a {
  align-items: center;
  display: inline-flex;
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree)) !important;
  font-size: var(--Body-font-size-lg, 16px) !important;
  font-weight: 500 !important;
  gap: 8px;
  line-height: var(--Body-font-line-height-lg, 24px);
  white-space: nowrap;
}

.home-footer__social-icon {
  block-size: 32px;
  display: block;
  flex: 0 0 auto;
  inline-size: 32px;
}

.home-footer__app-links {
  display: flex;
  gap: 8px;
}

.home-footer__app-links a {
  display: block;
  flex: 0 0 120px;
}

.home-footer__app-links img {
  block-size: 40px;
  display: block;
  inline-size: 120px;
}

.home-footer__bottom {
  align-items: center;
  display: flex;
  gap: 32px;
  justify-content: space-between;
  padding: 32px 120px;
}

.home-footer__bottom p {
  color: var(--Text-Neutral-secondary, var(--text-secondary));
  flex: 1 1 auto;
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree)) !important;
  font-size: var(--Body-font-size-xs, 10px) !important;
  font-weight: 500 !important;
  line-height: var(--Body-font-line-height-xs, 15px);
  margin: 0;
  min-inline-size: 0;
}

.home-footer__dbd-link {
  align-items: center;
  block-size: 40px;
  display: flex;
  flex: 0 0 auto;
  font-size: 0;
  inline-size: 85px;
  line-height: 0;
}

.home-footer__dbd-logo {
  block-size: 36px;
  flex: 0 0 auto;
  inline-size: 85px;
  object-fit: contain;
}

@media (min-width: 761px) and (max-width: 1199px) {
  .home-footer {
    padding: 32px 16px;
  }

  .home-footer__content {
    gap: 32px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
    padding: 32px 48px;
  }

  .home-footer__logo {
    block-size: 84px;
    grid-column: 1 / -1;
    inline-size: 226px;
  }

  .home-footer__logo img {
    block-size: 72px;
    inline-size: 174px;
  }

  .home-footer__column:nth-of-type(2) {
    grid-column: 1;
  }

  .home-footer__social {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
    grid-column: 2;
    grid-row: 2 / span 2;
    justify-content: flex-start;
  }

  .home-footer__social h2 {
    margin-block-end: 0;
  }

  .home-footer__social li {
    display: flex;
  }

  .home-footer__app-links {
    flex-wrap: nowrap;
    margin-block-start: auto;
  }

  .home-footer__bottom {
    gap: 16px;
    padding: 32px 48px;
  }
}

@media (max-width: 760px) {
  .home-footer {
    padding-bottom: 16px;
    padding-inline: 16px;
  }

  .home-footer__surface {
    border-radius: 16px;
  }

  .home-footer__content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
    padding: 32px;
  }

  .home-footer__logo {
    block-size: 48px;
    inline-size: 116px;
    order: 3;
  }

  .home-footer__logo img {
    block-size: 48px;
    inline-size: 116px;
  }

  .home-footer__column {
    inline-size: 100%;
  }

  .home-footer__column h2,
  .home-footer__social h2 {
    margin-block-end: 12px;
  }

  .home-footer__social {
    gap: 8px;
    order: 4;
  }

  .home-footer__social h2 {
    display: none;
  }

  .home-footer__app-links {
    gap: 12px;
    order: 5;
  }

  .home-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 24px 32px 16px;
  }
}

@media (max-width: 360px) {
  .home-footer__app-links {
    flex-wrap: wrap;
  }
}

/* ─── HomeSwitcher.css (verbatim, dark blocks removed) ───────────────────── */

.home-switcher {
  min-width: 0;
}

.home-switcher__trigger {
  align-items: center;
  background: var(--twl-theme-accent-fill, var(--twl-sem-bg-brand-default));
  border: 0;
  border-radius: var(--twl-radius-full);
  color: var(--Base-bg-on-color, var(--background-on-color));
  cursor: pointer;
  display: inline-flex;
  gap: 4px;
  justify-content: center;
  line-height: normal;
  min-width: 0;
  padding: 0 4px 0 8px;
}

.home-switcher__trigger span {
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica));
  font-size: var(--Action-font-size-lg, 20px);
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-switcher__trigger svg {
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.home-switcher-dialog {
  background: transparent;
  border: 0;
  color: var(--twl-house-selection-text-active, var(--text-primary));
  inset: 0;
  margin: auto;
  max-block-size: calc(100dvh - 32px);
  max-inline-size: 450px;
  overflow: visible;
  padding: 0;
  position: fixed;
  width: min(450px, calc(100vw - 32px));
}

.home-switcher-dialog::backdrop {
  background: var(--Static-Opacity-Black-90, var(--twl-ref-opacity-black-90, rgba(7, 7, 8, 0.9)));
}

.home-switcher-dialog:focus {
  outline: none;
}

.home-switcher-dialog__surface {
  --twl-house-selection-bg-start-active: var(
    --twl-house-selection-light-bg-start,
    var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle))
  );
  --twl-house-selection-bg-end-active: var(
    --twl-house-selection-light-bg-end,
    var(--Base-bg-raised, var(--background-raised))
  );
  --twl-house-selection-accent-active: var(
    --twl-house-selection-light-accent,
    var(--twl-theme-accent-text, var(--twl-sem-text-brand-default))
  );
  --twl-house-selection-text-active: var(--twl-house-selection-light-text, var(--text-primary));
  --twl-house-selection-button-bg-active: var(
    --twl-house-selection-light-button-bg,
    var(--twl-theme-accent-fill, var(--twl-sem-bg-brand-default))
  );
  --twl-house-selection-button-text-active: var(
    --twl-house-selection-light-button-text,
    var(--Base-bg-on-color, var(--background-on-color))
  );
  --twl-house-selection-icon-image: url('/images/v3/home-switcher/astroid.svg');

  background: linear-gradient(
    180deg,
    var(--twl-house-selection-bg-start-active) 0%,
    var(--twl-house-selection-bg-end-active) 68%
  );
  border: 1px solid var(--Base-border-raised, var(--border-subtle));
  border-radius: 24px;
  box-shadow: var(--twl-elevation-md);
  display: grid;
  gap: 24px;
  /* minmax(0, 1fr) pins the column to the surface width independent of content.
     Without the 0 min, the carousel's wide track (15 duplicated slides) drives
     the column to its max-content and the whole modal blows out — title, rail
     and button escape the surface. Keep this. */
  grid-template-columns: minmax(0, 1fr);
  inline-size: 100%;
  justify-items: center;
  min-block-size: 433px;
  overflow: visible;
  padding: 100px 24px 24px;
  position: relative;
  /* The whole surface is swipeable to switch houses; stop drags from selecting
     the title/description text mid-swipe. */
  user-select: none;
}

.home-switcher-dialog__artwork {
  block-size: 300px;
  display: block;
  inline-size: 400px;
  inset-block-start: -150px;
  inset-inline-start: 50%;
  max-inline-size: min(400px, calc(100vw - 2px));
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  z-index: 2;
}

.home-switcher__trigger:focus-visible,
.home-switcher-dialog__primary-action:focus-visible {
  outline: 2px solid var(--twl-house-selection-accent-active, var(--twl-theme-accent-border));
  outline-offset: 3px;
}

.home-switcher-dialog__content {
  display: grid;
  gap: 12px;
  inline-size: min(402px, calc(100vw - 48px));
  justify-items: center;
  max-inline-size: 100%;
  text-align: center;
  z-index: 2;
}

.home-switcher-dialog__title {
  font-family: var(--Title-Page-font-family, var(--twl-font-db-helvethaica));
  font-size: var(--Title-Page-font-size-sm, 24px);
  font-weight: 700;
  line-height: 1;
  margin: 0;
}

.home-switcher-dialog__divider {
  align-items: center;
  color: var(--twl-house-selection-accent-active);
  display: flex;
  gap: 8px;
  justify-content: center;
}

.home-switcher-dialog__divider img,
.home-switcher-dialog__divider svg {
  block-size: 16px;
  inline-size: 16px;
  object-fit: contain;
}

.home-switcher-dialog__divider-icon {
  align-items: center;
  background: currentColor;
  block-size: 16px;
  color: currentColor;
  display: inline-flex;
  inline-size: 16px;
  justify-content: center;
  mask: var(--twl-house-selection-icon-image) center / contain no-repeat;
  -webkit-mask: var(--twl-house-selection-icon-image) center / contain no-repeat;
}

.home-switcher-dialog__divider::before,
.home-switcher-dialog__divider::after {
  background: currentColor;
  block-size: 1px;
  content: '';
  inline-size: 80px;
}

.home-switcher-dialog__house {
  display: grid;
  gap: 4px;
  inline-size: 100%;
  margin: 0;
  max-inline-size: 100%;
  word-break: break-word;
}

.home-switcher-dialog__house strong {
  font-family: var(--Title-Page-font-family, var(--twl-font-db-helvethaica));
  font-size: var(--Title-Page-font-size-lg, 32px);
  font-weight: 700;
  line-height: 1;
}

.home-switcher-dialog__house span {
  align-items: center;
  color: var(--twl-house-selection-text-active);
  display: flex;
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree));
  font-size: var(--Body-font-size-md, 14px);
  font-weight: 500;
  justify-content: center;
  line-height: var(--Body-font-line-height-md, 21px);
  min-block-size: calc(var(--Body-font-line-height-md, 21px) * 2);
  overflow-wrap: break-word;
  padding: 0 16px;
  white-space: normal;
}

.home-switcher__options {
  --home-switcher-option-size: 74px;
  --home-switcher-option-gap: 8px;
  --home-switcher-visible-options: 5;
  --home-switcher-visible-option-gaps: 4;

  /* IMPORTANT: pin this to the column width (inline-size: 100%) and never wider.
     This is a grid item of the dialog surface. If it has no definite width it
     sizes to its 1200px track and blows the modal out; if it is wider than the
     column it blows the modal out too. Either way the title, rail and button
     escape the surface. The full-bleed width belongs on the viewport below. */
  inline-size: 100%;
  min-inline-size: 0;
  z-index: 2;
}

.home-switcher__options-viewport {
  inline-size: min(
    100%,
    calc(
      (var(--home-switcher-option-size) * var(--home-switcher-visible-options)) +
        (var(--home-switcher-option-gap) * var(--home-switcher-visible-option-gaps))
    )
  );
  /* A taller pointer/drag zone so swipes register in the band around the icons,
     not only dead-on one. padding-block grows the hit box; the matching negative
     margin-block pulls it back out of flow so the surface height is unchanged. */
  margin-block: -16px;
  margin-inline: auto;
  padding-block: 16px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
}

.home-switcher__options-viewport.active {
  cursor: grabbing;
}

.home-switcher__options-track {
  display: flex;
  align-items: center;
  backface-visibility: hidden;
  gap: var(--home-switcher-option-gap);
  justify-content: flex-start;
}

.home-switcher__slide {
  flex: 0 0 var(--home-switcher-option-size);
  flex-shrink: 0;
  min-inline-size: 0;
  transform: translate3d(0, 0, 0);
}

.home-switcher__item {
  --switcher-option-bg: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle));
  --switcher-option-color: var(
    --twl-house-theme-light-accent-color,
    var(--twl-theme-accent-text, var(--twl-sem-text-brand-default))
  );

  align-items: center;
  background: var(--Base-bg-raised, var(--background-raised));
  border: 1px solid var(--Border-Neutral-subtle, var(--border-subtle));
  border-radius: 8px;
  color: var(--switcher-option-color);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  block-size: 64px;
  inline-size: var(--home-switcher-option-size);
  min-inline-size: var(--home-switcher-option-size);
  padding: 0;
  transition:
    border-color 0.18s ease,
    opacity 0.18s ease,
    transform 0.18s ease;
}

.home-switcher__item:hover,
.home-switcher__item[data-selected='true'],
.home-switcher__slide[data-carousel-selected='true'] .home-switcher__item {
  border-color: var(--switcher-option-color);
}

.home-switcher__item:focus-visible {
  outline: 2px solid var(--switcher-option-color);
  outline-offset: 3px;
}

.home-switcher__item[data-selected='true']:focus-visible {
  outline: 0;
}

.home-switcher__item[data-selected='true'],
.home-switcher__slide[data-carousel-selected='true'] .home-switcher__item {
  border-width: 2px;
  opacity: 1;
  transform: scale(1);
}

.home-switcher__slide:not([data-carousel-selected='true'])
  .home-switcher__item[data-selected='true'] {
  border-color: var(--Border-Neutral-subtle, var(--border-subtle));
  border-width: 1px;
  opacity: 0.72;
  transform: scale(0.94);
}

.home-switcher__item:hover {
  transform: translateY(-1px);
}

.home-switcher__item:not([data-selected='true']) {
  opacity: 0.72;
  transform: scale(0.94);
}

.home-switcher__item:not([data-selected='true']):hover {
  opacity: 0.88;
  transform: translateY(-1px) scale(0.96);
}

/* v3 HomeSwitcher: logo 48×48 inside 74×64 option tile */
.home-switcher__item-logo {
  block-size: 48px;
  display: block;
  inline-size: 48px;
  object-fit: contain;
}

.home-switcher-dialog__primary-action {
  align-items: center;
  align-self: stretch;
  background: var(--twl-house-selection-button-bg-active);
  border-radius: var(--twl-radius-full);
  box-shadow:
    inset 0 -1px 0 rgb(0 0 0 / 14%),
    0 1px 2px rgb(0 0 0 / 8%);
  color: var(--twl-house-selection-button-text-active) !important;
  display: inline-flex;
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica));
  font-size: var(--Action-font-size-lg, 20px);
  font-weight: 700;
  gap: 8px;
  block-size: 44px;
  inline-size: 100%;
  justify-content: center;
  line-height: 1;
  min-block-size: 44px;
  padding: 10px 24px;
  text-align: center;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
  z-index: 2;
}

.home-switcher-dialog__primary-action:hover,
.home-switcher-dialog__primary-action:focus,
.home-switcher-dialog__primary-action:active {
  color: var(--twl-house-selection-button-text-active) !important;
}

.home-switcher-dialog__primary-action:hover {
  box-shadow:
    inset 0 -1px 0 rgb(0 0 0 / 20%),
    0 1px 2px rgb(0 0 0 / 8%);
  filter: saturate(1.04) brightness(0.94);
}

.home-switcher-dialog__primary-action:active {
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 18%);
  filter: saturate(0.98) brightness(0.88);
}

.home-switcher-dialog__primary-action-text {
  line-height: 1;
}

/* While navigating, the button is a progress indicator — block re-taps. */
.home-switcher-dialog__primary-action[aria-busy='true'],
.home-switcher-dialog__primary-action[data-loading='true'],
.home-switcher-dialog__primary-action:has(.home-switcher-dialog__primary-action-pending) {
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%);
  cursor: progress;
  filter: saturate(0.78) brightness(1.02);
  pointer-events: none;
}

.home-switcher-dialog__primary-action-pending {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  line-height: 1;
}

.home-switcher-dialog__primary-action-spinner {
  --duration: 1.05s;

  block-size: 18px;
  inline-size: 18px;
  margin-inline-end: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .home-switcher-dialog__primary-action {
    transition-duration: 1ms;
  }

  .home-switcher-dialog__primary-action-spinner {
    --duration: 1.8s;
  }
}

.home-switcher-dialog__primary-action-text--dark,
.home-switcher-dialog__artwork--dark,
.home-switcher__item-logo--dark {
  display: none;
}

@media (max-width: 1023px) {
  .home-switcher-dialog {
    margin: auto 0 0;
    max-block-size: 100dvh;
    max-inline-size: 100vw;
    width: 100vw;
  }

  .home-switcher-dialog__surface {
    border-end-end-radius: 0;
    border-end-start-radius: 0;
    inline-size: 100vw;
    min-block-size: 404px;
    padding: 100px 24px calc(16px + env(safe-area-inset-bottom));
  }

  .home-switcher-dialog__content {
    inline-size: calc(100vw - 48px);
  }

  .home-switcher__options {
    --home-switcher-option-size: 80px;
  }
}

@media (max-width: 767px) {
  .site-category__backdrop:not([hidden]) {
    background: var(--Static-Opacity-Black-60, var(--twl-ref-opacity-black-60, rgb(7 7 8 / 60%)));
    display: block;
    inset: 0;
    position: fixed;
    z-index: 1000000;
  }

  .category-menu {
    border-bottom: 0;
    border-left: 0;
    border-right: 0;
    border-end-end-radius: 0;
    border-end-start-radius: 0;
    bottom: 0;
    left: 0;
    max-height: 85dvh;
    max-width: none;
    position: fixed;
    right: 0;
    top: auto;
    transform-origin: bottom center;
    width: 100vw;
    z-index: 1000001;
  }

  .category-menu__header {
    padding: 16px 16px 16px 24px;
  }

  .category-menu__list {
    padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  }

  .home-switcher-dialog__surface {
    min-block-size: 425px;
  }

  .home-switcher__options-viewport {
    /* Mobile keeps the approved full-bleed rail so neighbouring items peek in. */
    inline-size: calc(100% + 48px);
    margin-inline: -24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-switcher__item {
    transition: none;
  }

  .home-switcher__item,
  .home-switcher__item:hover,
  .home-switcher__item:not([data-selected='true']),
  .home-switcher__item:not([data-selected='true']):hover {
    opacity: 1;
    transform: none;
  }
}

/* ─── header-menu-motion.css (verbatim) ─────────────────────────────────── */

/* Shared open/close motion for the three header menus (notification, profile,
   category). Desktop/tablet: fade + rise + scale settle. Mobile: bottom sheet
   that slides from the bottom edge. The `closing` state plays it in reverse. */

.header-menu-motion {
  animation: header-menu-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-menu-motion--closing {
  animation: header-menu-out 0.16s ease-in forwards;
  pointer-events: none;
}

@keyframes header-menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes header-menu-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.header-menu-backdrop {
  animation: header-menu-backdrop-in 0.2s ease-out;
}

.header-menu-backdrop--closing {
  animation: header-menu-backdrop-out 0.16s ease-in forwards;
  pointer-events: none;
}

@keyframes header-menu-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes header-menu-backdrop-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@media (max-width: 767.98px) {
  .header-menu-motion--sheet {
    animation: header-menu-sheet-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .header-menu-motion--sheet.header-menu-motion--closing {
    animation: header-menu-sheet-out 0.2s ease-in forwards;
  }
}

@keyframes header-menu-sheet-in {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes header-menu-sheet-out {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-menu-motion,
  .header-menu-motion--closing,
  .header-menu-motion--sheet,
  .header-menu-backdrop,
  .header-menu-backdrop--closing {
    animation: none;
  }
}

/* The sticky V3 header already occupies layout space; remove the legacy fixed-header offset. */
@media (max-width: 991px) {
  :where(.site-header) ~ #main-body {
    padding-top: 0 !important;
  }
}

/* ─── Responsive shell rules (vendored from global.css 4918–5095, shell-only) ──
   These were below the header block in v3's global.css. Without them the navbar
   stays desktop-dense on phones and the profile menu never becomes a sheet. */
@media (max-width: 900px) {
  .site-header {
    background: var(--Base-bg-base, var(--background-base));
    padding: 16px 16px 0;
  }

  .site-header__top,
  .site-header__bottom {
    flex-direction: row;
  }

  .site-header__bottom {
    min-height: 48px;
  }

  .site-brand-section {
    gap: 8px;
  }

  .site-actions {
    gap: 16px;
    justify-content: flex-end;
  }

  .site-header-icons {
    gap: 16px;
  }

  .site-header-right {
    gap: 16px;
  }

  .dream-chat-btn__label {
    display: none;
  }

  /* Mobile collapses the label, so drop the pill frame and render the icon bare
     to match the Figma navbar (Icon/20/Line/Dream-chat), not a circled icon. */
  .dream-chat-btn {
    border: 0;
    height: auto;
    padding: 0;
  }

  .dream-chat-btn::before {
    content: none;
  }

  .site-tabs {
    width: 100%;
  }

  .site-tabs__link {
    flex: 1 0 max-content;
    height: 48px;
    min-width: max-content;
    padding: 4px 24px;
  }

  .site-tools {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .site-auth-menu {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 8px;
    inset: 0;
    max-height: none;
    max-width: none;
    min-height: 100dvh;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(8px + env(safe-area-inset-top)) 0 calc(8px + env(safe-area-inset-bottom));
    position: fixed;
    right: auto;
    top: 0;
    width: 100vw;
    z-index: 1000001;
  }

  .site-auth-menu__close {
    display: inline-flex;
  }

  .site-auth-menu__identity {
    min-height: 72px;
    padding: 16px 64px 12px 24px;
  }

  .site-auth-menu__balances a,
  .site-auth-menu__balances > span,
  .site-auth-menu__links a,
  .site-auth-menu__links button,
  .site-auth-menu__signout button,
  .site-auth-menu__signout a {
    min-height: 48px;
    padding: 10px 24px;
  }

  .site-auth-menu__links > .site-auth-menu__mobile-only {
    display: flex;
  }

  .site-auth-menu__writer {
    display: block;
  }

  .site-auth-menu__writer summary {
    min-height: 48px;
    padding: 10px 24px;
  }

  .site-auth-menu__writer-links a {
    padding-inline-start: 52px;
  }

  .site-auth-menu__error {
    padding-inline: 24px;
  }
}

@media (max-width: 560px) {
  .site-brand-section {
    align-items: center;
    gap: 8px;
  }

  .site-icon-link {
    min-width: 20px;
  }

  .site-auth-login {
    min-width: 32px;
  }

  .site-actions {
    align-items: center;
  }
}

/* Custom Dropdown Styles for V3 Shell Header */
.writer-dropdown-menu,
.noti-box {
  background-color: #ffffff !important;
  border: 1px solid #eaeaea !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.site-writer {
  display: inline-flex;
  position: relative;
}

.site-writer__backdrop {
  display: none;
}

.writer-dropdown-menu {
  background: var(--background-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--twl-radius-lg);
  box-shadow: var(--twl-elevation-md);
  width: 270px;
  min-width: 270px;
  padding: 8px 0 !important;
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 8px) !important;
  transform-origin: top right;
  z-index: 50 !important;
}

.writer-dropdown-menu__header {
  display: none;
}

.writer-dropdown-menu__title {
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica));
  font-size: 20px;
  font-weight: 500;
  line-height: normal;
  color: #191919;
}

.writer-dropdown-menu__close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #888888;
  cursor: pointer;
  display: none;
  height: 48px;
  justify-content: center;
  margin-right: -12px;
  padding: 0;
  width: 48px;
}

.writer-dropdown-menu .dropdown-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 8px 16px !important;
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree)) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 21px !important;
  color: #191919 !important;
  background: transparent !important;
  transition: all 0.2s ease;
  min-height: auto !important; /* Overwrite V3 menu item min-height */
  border: none !important;
}

.writer-dropdown-menu .dropdown-item:hover,
.writer-dropdown-menu .dropdown-item:focus,
.writer-dropdown-menu .dropdown-item:focus-visible {
  background-color: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle)) !important;
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default)) !important;
}

.writer-dropdown-menu .dropdown-item i,
.writer-dropdown-menu .dropdown-item .writer-menu-item__icon {
  color: inherit;
  flex: 0 0 16px;
  font-size: 16px;
  height: 16px;
  margin: 0;
  text-align: center;
  width: 16px;
}

.writer-dropdown-menu .dropdown-item .writer-menu-item__icon {
  display: block;
  stroke: currentColor;
}

/* Writer menu becomes a bottom sheet on mobile, matching the notification box */
@media (max-width: 767.98px) {
  .site-writer__backdrop {
    display: block;
    inset: 0;
    position: fixed;
    z-index: 1000000;
  }

  .writer-dropdown-menu {
    border-bottom: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-end-end-radius: 0 !important;
    border-end-start-radius: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    max-width: none !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    position: fixed !important;
    right: 0 !important;
    top: auto !important;
    transform-origin: bottom center !important;
    width: 100vw !important;
    z-index: 1000001 !important;
  }

  .writer-dropdown-menu__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 16px 24px 8px;
  }

  .writer-dropdown-menu__close {
    display: inline-flex !important;
  }

  .writer-dropdown-menu .dropdown-item {
    min-height: 48px !important;
    padding: 10px 24px !important;
  }
}

/* Custom Dropdown Container for Inbox */
.site-inbox {
  display: inline-flex;
  position: relative;
}

.site-inbox__backdrop {
  display: none;
}

/* Notification Box Dropdown */
.noti-box {
  background: var(--background-raised) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--twl-radius-sm) !important;
  box-shadow: var(--twl-elevation-md) !important;
  color: var(--text-primary);
  display: grid;
  gap: 12px;
  width: min(400px, calc(100vw - 24px)) !important;
  max-width: none !important;
  height: auto !important;
  max-height: min(560px, 80vh) !important;
  overflow-y: auto;
  padding: 16px 0 8px !important;
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 10px) !important;
  transform-origin: top right;
  z-index: 50 !important;
  box-sizing: border-box;
}

.noti-box__header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding-inline: 20px;
}

.noti-box__header-actions {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.noti-box__settings {
  align-items: center;
  border-radius: var(--twl-radius-full);
  color: var(--text-primary);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  text-decoration: none !important;
  width: 32px;
}

.noti-box__settings:hover,
.noti-box__settings:focus-visible {
  background: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle));
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
}

.noti-box__close {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  cursor: pointer;
  display: none;
  height: 48px;
  justify-content: center;
  padding: 0;
  width: 48px;
  margin-right: -12px;
}

@media (max-width: 767.98px) {
  .site-inbox__backdrop {
    display: block;
    inset: 0;
    position: fixed;
    z-index: 1000000;
  }

  .noti-box {
    border-bottom: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-end-end-radius: 0 !important;
    border-end-start-radius: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    max-height: 85dvh !important;
    max-width: none !important;
    position: fixed !important;
    right: 0 !important;
    top: auto !important;
    transform-origin: bottom center !important;
    width: 100vw !important;
    z-index: 1000001 !important;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .noti-box__close {
    display: inline-flex !important;
  }
}

.noti-box .nav-tabs {
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 0 20px !important;
  display: flex;
  gap: 20px;
  margin: 0 !important;
}

.noti-box .nav-tabs .nav-item {
  position: relative;
}

.noti-box .nav-tabs .nav-link {
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica)) !important;
  font-size: var(--Action-font-size-lg, 20px);
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
  padding: 0 0 8px 0;
  background: transparent !important;
  border: none !important;
}

.noti-box .nav-tabs .nav-link.active {
  color: var(--text-primary) !important;
  border-bottom: 2px solid var(--twl-theme-accent-text, var(--twl-sem-text-brand-default)) !important;
}

.noti-box .nav-tabs .nav-link:hover,
.noti-box .nav-tabs .nav-link:focus-visible {
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
  background: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle)) !important;
  border-radius: var(--twl-radius-sm) var(--twl-radius-sm) 0 0;
}

.noti-box .inbox-tab {
  cursor: pointer;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 0;
  display: flex;
  transition: background-color 0.2s ease;
  text-decoration: none !important;
}

.noti-box .inbox-unread-tab {
  background: color-mix(
    in srgb,
    var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle)) 46%,
    transparent
  ) !important;
}

.noti-box .inbox-tab:hover,
.noti-box .inbox-tab:focus-visible {
  background: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle));
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
}

.noti-box .inbox-tab:hover .inbox-message-date,
.noti-box .inbox-tab:focus-visible .inbox-message-date {
  color: var(--text-secondary);
}

.noti-box .inbox-tab:hover .tag-new-inbox,
.noti-box .inbox-tab:focus-visible .tag-new-inbox {
  color: #fff;
}

.noti-box .inbox-unread-tab:hover,
.noti-box .inbox-unread-tab:focus-visible {
  background: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle)) !important;
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default)) !important;
}

.noti-box .inbox-header {
  font-size: var(--Heading-font-size-sm, 20px);
  font-family: var(--Heading-font-family, var(--twl-font-db-helvethaica)) !important;
  font-weight: 500;
  color: var(--text-primary);
  line-height: normal;
}

.noti-box .inbox-message-title {
  -webkit-box-orient: vertical;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: var(--Body-font-size-md, 14px);
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree)) !important;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  line-height: var(--Body-font-line-height-md, 1.5);
}

.noti-box .inbox-message-title > span:not(.tag-new-inbox) {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.noti-box .inbox-message-title > span:not(.tag-new-inbox):not(.f-normal-65) {
  font-weight: 700;
}

.noti-box .inbox-message-title > span.f-normal-65 {
  font-weight: 500;
}

.noti-box .inbox-message-date {
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree)) !important;
  font-size: var(--Body-font-size-sm, 12px);
  font-weight: 500;
  color: var(--text-secondary);
  line-height: var(--Body-font-line-height-sm, 1.5);
  margin-top: 2px;
}

.noti-box .load-more {
  text-align: center;
  padding: 16px;
  cursor: pointer;
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica)) !important;
  font-size: var(--Action-font-size-lg, 20px);
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
  font-weight: 500;
  border-top: 0;
}

.noti-box .load-more:hover,
.noti-box .load-more:focus-visible {
  background-color: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle));
  color: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
}

.noti-box .notification-panel__loading-more {
  display: block;
}

.noti-box .notification-panel__sentinel {
  display: block;
  height: 1px;
}

.noti-box .notification-panel__skeleton {
  display: grid;
  padding-block-end: 8px;
}

.noti-box .notification-skeleton-row {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 10px 20px;
}

.noti-box .notification-panel__skeleton .notification-skeleton-row:nth-child(2) {
  opacity: 0.72;
}

.noti-box .notification-panel__skeleton .notification-skeleton-row:nth-child(3) {
  opacity: 0.48;
}

.noti-box .notification-panel__skeleton .notification-skeleton-row:nth-child(4) {
  opacity: 0.26;
}

.noti-box .notification-skeleton-row__avatar {
  border-radius: var(--twl-radius-full);
  flex: 0 0 auto;
  height: 48px;
  width: 48px;
}

.noti-box .notification-skeleton-row__lines {
  display: grid;
  flex: 1 1 auto;
  gap: 7px;
}

.noti-box .notification-skeleton-row__line {
  border-radius: var(--twl-radius-full);
  height: 13px;
  width: 92%;
}

.noti-box .notification-skeleton-row__line--short {
  width: 64%;
}

.noti-box .notification-skeleton-row__line--time {
  height: 11px;
  width: 88px;
}

.noti-box .notification-skeleton-row__avatar,
.noti-box .notification-skeleton-row__line {
  animation: notification-skeleton-shimmer 1.4s ease-in-out infinite;
  background: var(--twl-theme-accent-bg, var(--twl-sem-bg-brand-subtle));
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--background-raised) 55%, transparent) 48%,
    transparent 100%
  );
  background-size: 220% 100%;
}

@keyframes notification-skeleton-shimmer {
  0% {
    background-position: 180% 0;
  }

  100% {
    background-position: -40% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .noti-box .notification-skeleton-row__avatar,
  .noti-box .notification-skeleton-row__line {
    animation: none;
  }
}

.noti-box .inbox-not-found {
  margin-top: 0;
  padding: 24px 20px 32px;
  text-align: center;
}

.noti-box .inbox-not-found img {
  width: 120px !important;
}

.noti-box .inbox-not-found .font-24 {
  color: var(--text-secondary);
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree)) !important;
  font-size: var(--Body-font-size-md, 14px) !important;
  font-weight: 500;
  padding-top: 8px !important;
}

.noti-box .tab-content {
  max-height: min(480px, 60vh);
  overflow-y: auto;
}

.noti-box .inbox-media {
  flex: 0 0 auto;
}

.noti-box .img-circle {
  height: 48px !important;
  object-fit: cover;
  width: 48px !important;
}

.noti-box .badge-inbox {
  border-radius: var(--twl-radius-full);
  bottom: -2px !important;
  height: 20px !important;
  padding: 0;
  position: absolute;
  right: -2px !important;
  top: auto !important;
  width: 20px !important;
}

.noti-box .inbox-message-content {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
}

.inbox-unread-dot {
  background: var(--twl-theme-accent-text, var(--twl-sem-text-brand-default));
  border-radius: var(--twl-radius-full);
  flex: 0 0 auto;
  height: 8px;
  width: 8px;
}

.new-sub-inbox-sign {
  background: var(--Background-Danger-default, var(--twl-sem-bg-danger-default, #e0284a));
  border-radius: var(--twl-radius-full);
  color: transparent;
  display: inline-block;
  font-size: 0;
  height: 8px;
  margin: 0 0 0 4px !important;
  padding: 0;
  position: absolute;
  right: -12px;
  top: 0;
  width: 8px;
}

/* Legacy class kept for non-shell pages; shell uses .notification-bell__badge */
.new-inbox-sign {
  font-size: 12px;
  font-family: var(--Action-font-family, var(--twl-font-db-helvethaica)) !important;
  background: var(--Background-Danger-default, var(--twl-sem-bg-danger-default, #e0284a));
  border-radius: var(--twl-radius-full);
  color: #fff;
  left: auto;
  right: -8px;
  top: -4px;
  height: auto;
  min-width: 18px;
  padding: 3px 5px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  z-index: 10;
}

.noti-box .tag-new-inbox {
  background: var(--Background-Danger-default, var(--twl-sem-bg-danger-default, #e0284a));
  border-radius: var(--twl-radius-full);
  color: #fff;
  display: inline-block;
  font-family: var(--Body-font-family, var(--twl-font-bai-jamjuree)) !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  margin-right: 6px;
  padding: 3px 8px;
  vertical-align: middle;
}

/* Fix dropdown menu behavior and sizing */
.site-dropdown-container .dropdown-menu {
  margin-top: 8px !important;
}

/* Remove default outline highlight when focused across the entire website */
*:focus,
*:focus-visible {
  outline: none !important;
}
