@import url("xynoxia-unified-theme.css?v=20261025");
/* XYNOXIA PLUS mobile product polish — desktop rules intentionally unchanged. */
@media (max-width: 760px) {
  :root { --mobile-gutter: 16px; }

  html { scroll-padding-top: 78px; }
  body { overflow-x: clip; font-size: 14px; }

  .demo-ribbon {
    min-height: 24px;
    height: auto;
    padding: 5px 10px;
    gap: 7px;
    font-size: 8px;
    letter-spacing: .1em;
    text-align: center;
    line-height: 1.35;
  }

  .topbar {
    height: 66px;
    min-height: 66px;
    padding: 0 14px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .brand {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    max-width: calc(100% - 98px);
  }

  .brand-symbol {
    width: 35px;
    height: 35px;
    min-width: 35px;
    font-size: 20px;
  }

  .brand > span:last-child {
    min-width: 0;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .12em;
    white-space: nowrap;
  }

  .brand .wordmark-final-a {
    height: 1.08em !important;
    width: .65em !important;
    filter: none !important;
  }

  .brand small {
    max-width: 195px;
    margin-top: 3px;
    font-size: 7px;
    letter-spacing: .12em;
    line-height: 1.35;
    white-space: normal;
  }

  .search-wrap { display: none; }

  .top-actions {
    flex: 0 0 auto;
    gap: 8px;
    margin-left: auto;
  }

  .top-actions .icon-btn,
  .top-actions .avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 20px;
  }

  .app-layout {
    display: block;
    min-height: 0;
    width: 100%;
  }

  .sidebar { display: none; }

  .main-content {
    width: 100%;
    min-width: 0;
    padding: 24px var(--mobile-gutter) calc(170px + env(safe-area-inset-bottom));
  }

  .view { min-width: 0; }
  .welcome-row {
    display: block;
    margin-bottom: 23px;
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 9px;
    letter-spacing: .16em;
    line-height: 1.5;
  }

  .welcome-row h1,
  .page-intro h1,
  .plus-hero h1 {
    font-family: var(--sans);
    font-size: clamp(37px, 9.3vw, 48px);
    font-weight: 760;
    line-height: .99;
    letter-spacing: -.065em;
    overflow-wrap: anywhere;
  }

  .welcome-row h1 em,
  .page-intro h1 em,
  .plus-hero h1 em {
    color: #a10e2b;
    font-weight: 450;
    font-style: normal;
  }

  .lead,
  .page-intro > p,
  .welcome-row > div > p:not(.eyebrow) {
    max-width: 42rem;
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.65;
    color: #777983;
  }

  .date-chip { display: none; }

  .home-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .feature-card {
    min-height: 0;
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(145deg, #171719 0%, #211316 100%);
    border: 1px solid #383034;
    color: #fff;
    box-shadow: 0 12px 28px rgba(31, 13, 18, .09);
  }

  .feature-top { gap: 10px; }
  .feature-card .eyebrow { color: #d20d35; margin: 0; }
  .tiny-pill {
    flex: 0 0 auto;
    border-color: #555157;
    color: #e1dfe3;
    padding: 6px 8px;
    font-size: 8px;
  }

  .feature-art {
    height: clamp(150px, 42vw, 190px);
    margin: 9px 0 14px;
    background: radial-gradient(ellipse at center, rgba(151, 0, 32, .24), transparent 66%);
  }

  .orbit { border-color: rgba(231, 195, 205, .23); }
  .breath-core {
    width: 98px;
    height: 98px;
    background: #a10e2b;
    border-color: #d65a73;
    box-shadow: 0 0 0 13px rgba(161, 14, 43, .22), 0 0 34px rgba(161, 14, 43, .22);
  }
  .breath-core span { color: #fff; }
  .breath-core b { color: #fff; }

  .feature-copy h2,
  .daily-card h2 {
    font-family: var(--sans);
    font-size: clamp(23px, 6vw, 29px);
    font-weight: 730;
    line-height: 1.12;
    letter-spacing: -.05em;
  }

  .feature-copy p {
    max-width: 36rem;
    margin: 0 0 17px;
    color: #c5c2c7;
    font-size: 14px;
    line-height: 1.65;
  }

  .feature-card .button {
    width: 100%;
    min-height: 48px;
    justify-content: space-between;
    padding: 13px 15px;
    border-radius: 12px;
    background: #a10e2b;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
  }

  .daily-card {
    min-height: 0;
    padding: 20px;
    border-radius: 15px;
    background: #f7f7f8;
    border-color: #e3e3e7;
  }
  .daily-card .quote-mark { margin: 18px 0 7px; color: #a10e2b; }
  .daily-card h2 { font-size: 24px; }
  .daily-card > p { font-size: 13px; line-height: 1.6; }
  .card-bottom { padding-top: 13px; }

  .section-heading {
    align-items: flex-start;
    margin: 31px 0 14px;
  }
  .section-heading h2 { font-size: 26px; }
  .section-heading .eyebrow { margin-bottom: 7px; }

  .tool-grid,
  .full-tool-grid,
  .resource-grid,
  .book-grid,
  .books-grid,
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tool-card {
    min-width: 0;
    min-height: 168px;
    padding: 14px;
    border-radius: 13px;
  }
  .tool-icon { margin-bottom: 12px; }
  .tool-card > b { font-size: 19px; line-height: 1.12; }
  .tool-card > small { font-size: 11px; line-height: 1.5; }

  .page-intro { margin-bottom: 25px; }
  .library-filter { gap: 7px; }
  .filter-chip { padding: 8px 11px; font-size: 10px; }

  .resource-art { height: 115px; padding: 12px; }
  .resource-body { padding: 13px; }
  .resource-body h2 { font-size: 19px; }
  .resource-body p { min-height: 0; font-size: 11px; }

  #view-books .book-cover {
    min-height: 0 !important;
    aspect-ratio: 3 / 4.2;
  }
  #view-books .book-card,
  #view-books .resource-card { min-width: 0; }
  #view-books .book-cover:after { inset: 7px; }
  #view-books .book-cover b { font-size: clamp(14px, 4vw, 20px); }
  #view-books .book-cover small { font-size: 7px; }

  .library-controls,
  .filter-bar,
  .course-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }
  .library-controls label,
  .filter-bar label { min-width: 0; }
  .library-controls input,
  .library-controls select,
  .filter-bar input,
  .filter-bar select,
  .course-filters input,
  .course-filters select {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    font-size: 16px;
  }

  .journey-summary { gap: 8px; }
  .journey-summary > div { padding: 13px; }
  .journey-summary strong { font-size: 32px; }

  .plus-banner {
    flex-wrap: wrap;
    padding: 19px;
    border-radius: 15px;
  }
  .plus-banner h2 { font-size: 24px; }
  .plus-banner .button { width: 100%; margin: 0; }
  .journey-strip { flex-wrap: wrap; }
  .journey-copy { min-width: 0; flex: 1; }
  .journey-strip .progress-track { flex-basis: 100%; }

  /* Native-app style bottom dock: one horizontal row, swipe to reach all destinations. */
  .mobile-nav {
    position: fixed;
    z-index: 900;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(226, 220, 228, .95);
    border-radius: 19px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 36px rgba(27, 16, 26, .15), 0 1px 0 #fff inset;
    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav button {
    flex: 0 0 57px;
    width: 57px;
    min-width: 57px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 3px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #73737c;
    font-size: 10px;
    line-height: 1.05;
    white-space: nowrap;
    touch-action: pan-x;
  }
  .mobile-nav button span { font-size: 20px; line-height: 1; color: #9b102c; }
  .mobile-nav button.active {
    background: #f7e9ed;
    color: #87001e;
    font-weight: 750;
    box-shadow: inset 0 0 0 1px rgba(153, 0, 27, .08);
  }
  .mobile-nav button[data-route="entertainment"] { flex-basis: 82px; width: 82px; min-width: 82px; }
  .mobile-nav button[data-route="plus"] span {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 8px;
    background: #a10e2b;
    color: white;
    font-size: 17px;
  }

  /* Keep Ask XYNOXIA accessible without covering the primary action or navigation. */
  .ask-xynoxia-launcher {
    position: fixed;
    z-index: 899;
    right: 14px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: auto;
    max-width: min(205px, calc(100vw - 28px));
    min-height: 51px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border-radius: 17px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  }
  .ask-xynoxia-launcher > span:first-child {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 20px;
  }
  .ask-xynoxia-launcher > span:nth-child(2) { min-width: 0; }
  .ask-xynoxia-launcher b { display: block; font-size: 12px; line-height: 1.2; }
  .ask-xynoxia-launcher small { display: block; margin-top: 3px; font-size: 10px; line-height: 1.2; }
  .ask-launcher-arrow { font-size: 17px; margin-left: 2px; }

  .ask-xynoxia-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    height: min(82dvh, 760px);
    border-radius: 20px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .app-footer {
    padding: 20px var(--mobile-gutter) calc(150px + env(safe-area-inset-bottom));
  }
  .modal-backdrop { padding: 12px; }
  .tool-modal { max-height: calc(100dvh - 24px); overflow-y: auto; }
}

@media (max-width: 390px) {
  .topbar { padding-inline: 11px; }
  .brand { gap: 7px; max-width: calc(100% - 90px); }
  .brand-symbol { width: 32px; height: 32px; min-width: 32px; }
  .brand > span:last-child { font-size: 12px; letter-spacing: .1em; }
  .brand small { max-width: 145px; font-size: 6.5px; letter-spacing: .09em; }
  .top-actions { gap: 6px; }
  .top-actions .icon-btn, .top-actions .avatar { width: 36px; height: 36px; min-width: 36px; }
  .main-content { padding-left: 13px; padding-right: 13px; }
  .welcome-row h1, .page-intro h1, .plus-hero h1 { font-size: clamp(35px, 9vw, 41px); }
  .feature-card { padding: 15px; }
  .tool-grid, .full-tool-grid, .resource-grid, .book-grid, .books-grid, .course-grid { gap: 8px; }
  .tool-card { padding: 11px; min-height: 155px; }
  .mobile-nav { left: 7px; right: 7px; }
  .mobile-nav button { flex-basis: 54px; width: 54px; min-width: 54px; }
  .mobile-nav button[data-route="entertainment"] { flex-basis: 78px; width: 78px; min-width: 78px; }
  .ask-xynoxia-launcher { max-width: min(190px, calc(100vw - 24px)); }
}

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  html { scroll-behavior: auto; }
}


/* Mobile flagship pass — stronger hierarchy, safer overlays, cleaner reading room. */
@media (max-width: 760px) {
  html { scroll-padding-top: 88px; }
  .main-content {
    padding-top: 24px;
    padding-bottom: calc(218px + env(safe-area-inset-bottom));
  }
  .view { scroll-margin-top: 88px; }
  .welcome-row, .page-intro { max-width: 42rem; }
  .welcome-row h1, .page-intro h1, .plus-hero h1 {
    max-width: 12ch;
    font-size: clamp(36px, 9.1vw, 47px);
    line-height: 1.015;
    letter-spacing: -.068em;
    text-wrap: balance;
  }
  .lead, .page-intro > p, .welcome-row > div > p:not(.eyebrow) {
    max-width: 39rem;
    font-size: 15px;
    line-height: 1.62;
  }
  .feature-card { box-shadow: 0 18px 42px rgba(31,13,18,.14); }
  .feature-art { margin-inline: auto; max-width: 390px; }
  .tool-card, .book-item, .resource-card, .course-card {
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  }
  .tool-card:active, .book-item:active, .resource-card:active, .course-card:active {
    transform: scale(.985);
  }
  #view-books .book-library-toolbar { gap: 18px; }
  #view-books .book-homework-note { max-width: 38rem; line-height: 1.55; }
  #view-books .book-cover { min-height: 0 !important; aspect-ratio: 3 / 4.35; }
  #view-books .book-cover .book-photo { object-position: center; }
  #view-books .book-info { padding: 12px 11px 14px; }
  #view-books .book-info .tool-meta { font-size: 8px; letter-spacing: .09em; }
  #view-books .book-info h3 { font-size: 16px; line-height: 1.18; }
  #view-books .book-info p { font-size: 12px; line-height: 1.5; }
  #view-books .book-open { width: 100%; min-height: 42px; justify-content: center; }
  .mobile-nav { touch-action: pan-x; }
  .mobile-nav button { min-height: 56px; }
  .mobile-nav button.active { background: #f8e9ed; }
  /* While the user is actively scrolling, get the helper out of the reading flow. */
  body.is-scrolling .ask-xynoxia-launcher { opacity: 0; pointer-events: none; transform: translateY(8px); }
  .ask-xynoxia-launcher { transition: opacity .18s ease, transform .18s ease; }
  .ask-xynoxia-panel { max-height: calc(100dvh - 24px - env(safe-area-inset-top)); }
  .reader-page { padding: 20px 16px !important; }
  .reader-toolbar { gap: 10px; }
  .reader-toolbar-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .reader-toolbar-actions button { min-height: 38px; }
}
@media (max-width: 390px) {
  .main-content { padding-left: 13px; padding-right: 13px; }
  .mobile-nav { gap: 2px; }
  .mobile-nav button { flex-basis: 50px; width: 50px; min-width: 50px; font-size: 9px; }
  .mobile-nav button[data-route="entertainment"] { flex-basis: 70px; width: 70px; min-width: 70px; }
  #view-books .book-info h3 { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-card, .book-item, .resource-card, .course-card, .ask-xynoxia-launcher { transition: none !important; }
}


/* Keep the desktop library exactly as designed; use clearer copy only on mobile. */
.books-copy-mobile { display: none !important; }
@media (max-width: 760px) {
  .books-copy-desktop { display: none !important; }
  .books-copy-mobile { display: block !important; }
}

@media (max-width: 760px) {
  /* Let the photographic book jackets read as photographs, not dark placeholders. */
  #view-books .book-cover:before {
    background: linear-gradient(90deg, rgba(0,0,0,.24), transparent 26%),
      linear-gradient(0deg, rgba(7,19,15,.72) 0%, rgba(7,19,15,.08) 58%, rgba(7,19,15,.16) 100%) !important;
  }
  #view-books .book-cover .book-photo { filter: saturate(.92) contrast(1.02); }
}


/* XYNOXIA flagship mobile experience — October 2026
   Ensure the mobile polish is actually loaded by the app shell, then keep navigation
   and the Ask launcher from obscuring the content they're meant to help with. */
@media (max-width: 760px) {
  .library-app {
    padding-bottom: 0;
    overflow-x: clip;
  }

  .mobile-nav {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(7px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    gap: 2px;
    padding: 5px;
    min-height: 68px;
    border-radius: 21px;
  }

  .mobile-nav button,
  .mobile-nav button[data-route="entertainment"] {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 56px;
    padding: 6px 1px;
    gap: 4px;
    font-size: clamp(8px, 2.35vw, 10px);
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .mobile-nav button span {
    flex: 0 0 auto;
    font-size: clamp(17px, 4.8vw, 21px);
  }

  .mobile-nav button.active {
    box-shadow: inset 0 0 0 1px rgba(153, 0, 27, .12);
  }

  .mobile-nav button[data-route="plus"] span {
    width: 25px;
    height: 25px;
    font-size: 16px;
  }

  /* Compact helper launcher: content stays readable and the bottom dock remains usable. */
  .ask-xynoxia-launcher {
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    max-width: min(205px, calc(100vw - 24px));
    min-height: 48px;
    padding: 7px 10px;
    border-radius: 16px;
  }

  .ask-xynoxia-launcher b { font-size: 12px; }
  .ask-xynoxia-launcher small { font-size: 10px; }

  /* Leave a deliberate scroll runway after every view so the dock never hides the last card. */
  .main-content {
    padding-bottom: calc(132px + env(safe-area-inset-bottom));
  }

  .view,
  .saas-view {
    scroll-margin-top: 90px;
  }

  .tool-grid,
  .resource-grid,
  .course-grid,
  .book-grid,
  .books-grid {
    align-items: stretch;
  }

  .tool-product,
  .tool-card,
  .resource-card,
  .course-card,
  .book-item {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  input, select, textarea, button {
    touch-action: manipulation;
  }
}

@media (max-width: 360px) {
  .mobile-nav { left: 5px; right: 5px; padding: 4px; gap: 1px; }
  .mobile-nav button,
  .mobile-nav button[data-route="entertainment"] {
    font-size: 8px;
    letter-spacing: -.02em;
  }
  .mobile-nav button span { font-size: 16px; }
  .ask-xynoxia-launcher { max-width: 184px; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav, .ask-xynoxia-launcher { scroll-behavior: auto; transition: none !important; }
}
