/* Shared editorial foundation. Page-specific layouts and product accents stay scoped. */
body[data-site-theme="editorial"] {
  --site-paper: #faf9f6;
  --site-ink: #191714;
  --site-muted: #625d57;
  --site-card: #fffdf8;
  --site-line: #e4e0d8;
  --site-focus: #3157e7;
  --site-font: "Avenir Next", Inter, system-ui, sans-serif;
  --bg: var(--site-paper);
  --text: var(--site-ink);
  --muted: var(--site-muted);
  --border: var(--site-line);
  --card-bg: var(--site-card);
  --header-bg: #fff;
  --footer-bg: var(--site-paper);
  --input-bg: var(--site-card);
  --input-border: #938c82;
  margin: 0;
  background: var(--site-paper);
  color: var(--site-ink);
  font-family: var(--site-font);
}
:is(html.dark, :root[data-theme="dark"]) body[data-site-theme="editorial"] {
  --site-paper: #25212a;
  --site-ink: #f8f2ea;
  --site-muted: #d6cdd4;
  --site-card: #302a35;
  --site-line: #504958;
  --site-focus: #a9b8ff;
  --header-bg: var(--site-card);
  --input-border: #827689;
}
body[data-site-theme] :where(p, li, a, span, label, button, input, select, textarea, summary, dt, dd, small) { font-family: var(--site-font); }
body[data-site-theme] :is(h1, h2, h3, h4, h5, h6) { font-family: var(--site-font); hyphens: none; }
body[data-site-theme] :is(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--site-focus); outline-offset: 4px; }
body[data-site-theme] #__next { top: 8px; left: 10px; right: 10px; width: calc(100vw - 20px); border-radius: 16px; }
body[data-site-theme] .ws-nav { box-sizing: border-box; min-height: 72px; font: 600 16px/1.4 var(--site-font); }
body[data-site-theme] .ws-left { min-width: 0; }
body[data-site-theme] .ws-logo { display: inline-flex; align-items: center; gap: clamp(6px, 1vw, 12px); min-width: 0; font: 700 clamp(15px, 2vw, 27px)/1.1 var(--site-font); text-decoration: none; }
body[data-site-theme] .ws-logo img { flex: none; width: clamp(40px, 4.5vw, 58px); height: auto; margin: 0; }
body[data-site-theme] .ws-logo__name { font: inherit; }
body[data-site-theme] .ws-center :is(a, .ws-plans summary) { font: inherit; }
body[data-site-theme] .ws-right .btn { box-sizing: border-box; min-width: 0; min-height: 40px; padding: 10px 20px; font: 700 14px/1.25 var(--site-font); white-space: nowrap; }
body[data-site-theme] .ws-right .btn-dark { --text: var(--site-paper); color: var(--site-paper) !important; background: var(--site-ink); border-color: var(--site-ink); }
body[data-site-theme] .ws-right .btn-outline { --text: var(--site-ink); color: var(--site-ink) !important; background: transparent; border-color: var(--site-ink); }
body[data-site-theme] .progress-container { overflow: hidden; border-radius: 0 0 16px 16px; background: transparent; }
body[data-site-theme] footer { border-top: 1px solid var(--site-line); background: var(--site-paper); }
body[data-site-theme] .footer-column :is(h4, a) { font-family: var(--site-font); }
body[data-site-theme] footer .store-badges a { box-sizing: border-box; max-width: 100%; }

/* Older marketing pages use the same open reading layout and readable scale. */
body[data-theme-layout="legacy"] { padding: 0; font-size: 18px; line-height: 1.6; }
body[data-theme-layout="legacy"] > :is(main, .content-container, .column),
body[data-theme-layout="legacy"] > div > .column {
  box-sizing: border-box;
  width: min(87.5%, 1300px);
  max-width: 1300px;
  margin: 0 auto;
  padding: calc(var(--header-offset, 88px) + clamp(32px, 4vw, 64px)) 0 80px;
}
body[data-theme-layout="legacy"] :is(h1, h2, h3) { color: var(--site-ink) !important; text-align: left; font-weight: 900; line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; word-break: normal; }
body[data-theme-layout="legacy"] h1 { max-width: 23ch; font-size: clamp(40px, 5.8vw, 80px); margin-bottom: 24px; }
body[data-theme-layout="legacy"] h2 { font-size: clamp(30px, 3.5vw, 46px); margin-bottom: 20px; }
body[data-theme-layout="legacy"] h3 { font-size: clamp(23px, 2.2vw, 30px); margin-bottom: 14px; }
body[data-theme-layout="legacy"] :is(main, .content-container, .column) :is(p, li) { color: var(--site-ink) !important; font-size: inherit !important; line-height: 1.65; hyphens: none; }
body[data-theme-layout="legacy"] :is(main, .content-container, .column) p { max-width: 78ch; }
body[data-theme-layout="legacy"] :is(main, .content-container, .column) :is(input, select, textarea, button) { font-size: 16px; }
body[data-theme-layout="legacy"] :is(.hero-card, .b2b-hero, .press-hero, .release-hero, .campaign-hero, .pricing-hero, .ella-contact-hero, .faq-hero) {
  border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 0; text-align: left;
}
body[data-theme-layout="legacy"] :is(.b2b-section, .release-section, .pricing-container > .section, .team-page > .values, .ella-legal-card) {
  border: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--site-line); background: transparent;
  margin-top: 44px; padding: 32px 0 0;
}
body[data-theme-layout="legacy"] :is(.card, .team-card, .plan-card, .detail-card, .b2b-card, .score-card) { border-color: var(--site-line); background: var(--site-card); box-shadow: none; }
body[data-theme-layout="legacy"] :is(.campaign-card, .campaign-links, .campaign-proof li, .ella-contact-card, .ella-contact-aside, .ella-contact-panel, .ella-contact-form, .ella-contact-stat, .ella-legal-toc, .release-media-card, .release-meta li, .release-logo-card, .release-quote, .marketing-hero, .link-card, .cta-band, .pending-card, .pending-list li, .prefs) { border-color: var(--site-line); background: var(--site-card); box-shadow: none; }
body[data-theme-layout="legacy"] :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { color: var(--site-ink) !important; border-color: var(--site-line); background: var(--site-card); }
body[data-theme-layout="legacy"] :is(.campaign-button, .btn-dark, .btn-outline, .btn-light) { box-sizing: border-box; min-width: 0; min-height: 48px; max-width: 100%; padding: 12px 22px; border: 1px solid var(--site-ink); border-radius: 999px; box-shadow: none; font: 700 17px/1.3 var(--site-font); text-align: center; white-space: normal; overflow-wrap: anywhere; }
body[data-theme-layout="legacy"] :is(.campaign-button.primary, .btn-dark) { --text: var(--site-paper); color: var(--site-paper) !important; background: var(--site-ink); }
body[data-theme-layout="legacy"] :is(.campaign-button.secondary, .btn-outline, .btn-light) { --text: var(--site-ink); color: var(--site-ink) !important; background: transparent; }
body[data-theme-layout="legacy"] :is(.pricing-kicker, .pill, .badge, .eyebrow) { font-size: 14px; }
body[data-theme-layout="legacy"] .square { background: transparent; border: 0; box-shadow: none; }
body[data-theme-layout="legacy"] .hero-actions { justify-content: flex-start; }
body[data-theme-layout="legacy"] .content-container .content-container { width: 100%; padding: 0; }
body[data-theme-layout="legacy"] .column { display: block; }
body[data-theme-layout="legacy"] .column > .small-column { display: block; width: auto; margin: 0 0 28px; padding: 0; }
body[data-theme-layout="legacy"] .column > .large-column { width: 100%; max-width: none; margin: 0; padding: 0; }
body[data-theme-layout="legacy"] :is(.grid, .grid-two, .team-grid, .plan-grid) { min-width: 0; }
body[data-theme-layout="legacy"] :is(.grid, .grid-two, .team-grid, .plan-grid) > * { min-width: 0; }
body[data-theme-layout="legacy"].legal-links-page > .content-container { max-width: 1100px; }
body[data-theme-layout="legacy"] .ella-legal-card { max-width: none; font-size: 18px; }
body[data-theme-layout="utility"] { background: var(--site-paper); color: var(--site-ink); }

/* Daily Journal's habit ideas are illustrative, controllable, and never auto-play. */
.habit-carousel { min-width: 0; padding: clamp(24px, 3vw, 40px); border: 1px solid var(--site-line); border-radius: 24px; background: var(--site-card); }
.daily-journal-shell .habit-carousel__heading { max-width: 22ch; margin: 0 0 28px; font-size: clamp(25px, 2.4vw, 34px); line-height: 1.12; }
.habit-carousel__track { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 12px; }
.habit-carousel__track::-webkit-scrollbar { display: none; }
.habit-carousel__slide { box-sizing: border-box; flex: 0 0 100%; min-width: 0; scroll-snap-align: start; padding: 0 2px 4px; }
.habit-carousel__icon { --text: #3157e7; display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 84px; margin-bottom: 22px; border-radius: 26px; color: var(--text); background: #e7ecff; }
.habit-carousel__icon svg { width: 46px; height: 46px; }
.habit-carousel__icon--walk { --text: #276b55; background: #e4f1e9; }
.habit-carousel__icon--journal { --text: #8d5025; background: #f9ebd9; }
.habit-carousel__icon--moon { --text: #7953ab; background: #eee7f8; }
.daily-journal-shell .habit-carousel h3 { margin: 0 0 24px; font-size: clamp(27px, 2.8vw, 36px); }
.habit-carousel dl { display: grid; gap: 20px; margin: 0; }
.habit-carousel dt { margin: 0 0 4px; color: var(--site-muted); font-size: 15px; font-weight: 600; }
.habit-carousel dd { margin: 0; color: var(--site-ink); font-size: 20px; line-height: 1.45; }
.habit-carousel__controls { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--site-line); }
.habit-carousel__controls[hidden] { display: none; }
.habit-carousel__controls button { --text: var(--site-ink); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--site-line); border-radius: 50%; background: transparent; font: 500 24px/1 var(--site-font); cursor: pointer; }
.habit-carousel__controls button:hover:not(:disabled) { background: var(--site-paper); }
.habit-carousel__controls button:disabled { opacity: .35; cursor: default; }
.habit-carousel__position { font-size: 15px; }
@media (min-width: 769px) and (max-width: 1120px) {
  body[data-site-theme] .ws-nav { gap: 10px; padding-inline: 12px; font-size: 14px; }
  body[data-site-theme] .ws-left { max-width: 190px; }
  body[data-site-theme] .ws-center { gap: 12px; }
  body[data-site-theme] .ws-right { gap: 6px; }
  body[data-site-theme] .ws-right .btn { padding: 8px 12px; font-size: 13px; }
}
@media (max-width: 768px) {
  body[data-site-theme] .ws-nav { min-height: 64px; }
  body[data-site-theme] .ws-right .btn { min-height: 36px; padding: 8px 10px; font-size: 13px; }
  body[data-site-theme] .header.menu-open .ws-center.header__links { top: 100%; border-radius: 0 0 16px 16px; }
  body[data-theme-layout="legacy"] > :is(main, .content-container, .column), body[data-theme-layout="legacy"] > div > .column { width: calc(100% - 40px); padding-top: calc(var(--header-offset, 80px) + 24px); }
  body[data-theme-layout="legacy"] h1 { font-size: clamp(40px, 9.3vw, 67px); }
  body[data-theme-layout="legacy"] :is(.grid, .grid-two, .team-grid, .plan-grid) { grid-template-columns: minmax(0, 1fr); }
  body[data-theme-layout="legacy"] :is(.detail-grid, .faq-hero-layout, .b2b-hero) { grid-template-columns: minmax(0, 1fr); }
  body[data-theme-layout="legacy"] :is(.faq-hero-main, .faq-hero-cta, .b2b-hero > *, .b2b-links) { min-width: 0; max-width: 100%; }
  body[data-theme-layout="legacy"] :is(.faq-hero-cta, .b2b-hero-note) { box-sizing: border-box; }
  body[data-theme-layout="legacy"] .faq-cta-copy { white-space: normal; }
  body[data-theme-layout="legacy"] .prefs .btnbar { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  body[data-theme-layout="legacy"] .prefs .btnbar .btn { width: 100%; margin: 0; }
  body[data-site-theme] :is(.shop-announcement, .shop-button) { box-sizing: border-box; max-width: 100%; }
  .habit-carousel { padding: 24px; }
  .habit-carousel dd { font-size: 18px; }
}
@media (max-width: 480px) {
  body[data-site-theme] .ws-logo__name { display: none; }
  body[data-site-theme] .ella-preview-tabs { flex-wrap: wrap; min-width: 0; }
  body[data-site-theme] .ella-preview-tabs button { min-width: 0; flex: 1 1 100px; white-space: normal; }
  body[data-site-theme] .ella-billing-switch { box-sizing: border-box; flex-wrap: wrap; }
  body[data-site-theme] .ella-billing-switch button { min-width: 0; flex-wrap: wrap; white-space: normal; }
  body[data-site-theme] .ella-billing-switch .ella-annual-deal { white-space: normal; }
}
