/* Preserve the existing visual styles; restore a clear action hierarchy. */
body.yf-ui-prototype .yf-prototype-recent-new { display: none; }
body.yf-ui-prototype .yf-prototype-sidebar-bottom #newConversationBtn { border-color: transparent; box-shadow: none; }
body.yf-ui-prototype .yf-prototype-sidebar-bottom .account-nav {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px; max-height: none; overflow: visible;
}
body.yf-ui-prototype .yf-prototype-sidebar-bottom :is(#themeToggle,#loginBtn) {
  width: 100%; height: 40px; min-height: 40px; padding: 0 8px; box-shadow: none;
}
body.yf-ui-prototype .yf-prototype-sidebar-bottom #themeToggle { border-color: transparent; background: transparent; }
body.yf-ui-prototype .yf-prototype-sidebar-bottom #themeToggle:hover { background: var(--yf-primary-soft); }
body.yf-ui-prototype[data-auth-state="guest"] .yf-prototype-sidebar-bottom #loginBtn {
  border-color: var(--yf-primary); background: var(--yf-primary); color: var(--yf-on-primary);
}
body.yf-ui-prototype .yf-prototype-sidebar-bottom #homepageUsage { grid-column: 1 / -1; padding: 0 8px; margin: 0; }
body.yf-ui-prototype[data-auth-state="guest"] .yf-prototype-sidebar-bottom #homepageUsage { display: none; }
body.yf-ui-prototype .yf-prototype-sidebar-bottom #accessMenuWrap { grid-column: 1 / -1; justify-self: start; }
body.yf-ui-prototype .yf-prototype-sidebar-bottom #accessMenuButton { min-height: 32px; padding: 5px 8px; border-color: transparent; background: transparent; font-size: 12px; }
body.yf-ui-prototype .yf-prototype-sidebar-bottom #userMenu { grid-column: 1 / -1; }

/* The composer owns focus feedback; the textarea does not need native resize chrome. */
body.yf-ui-prototype #home #chatInput { resize: none; }
body.yf-ui-soft[data-yf-style="default"][data-yf-soft-route="home"]:not(.is-conversation-mode) #home #chatInput { height: 76px; min-height: 76px; }
body.yf-ui-soft[data-yf-style="default"][data-yf-soft-route="home"] #home #searchForm.composer:focus-within {
  border-color: var(--yf-primary); box-shadow: var(--yf-soft-shadow);
}
body.yf-ui-prototype #home #chatInput:focus { outline: none; box-shadow: none; }

/* Account labels and fields follow one rhythm; keep a single visible focus edge. */
body.yf-ui-prototype .auth-dialog { padding: 28px; max-height: calc(100dvh - 32px); overflow-y: auto; }
body.yf-ui-prototype .auth-dialog-head { align-items: flex-start; margin-bottom: 20px; }
body.yf-ui-prototype .auth-kicker { font-family: inherit; font-size: 12px; letter-spacing: .04em; }
body.yf-ui-prototype .auth-dialog h2 { margin: 5px 0 0; font-size: 23px; line-height: 1.4; }
body.yf-ui-prototype .auth-tabs { margin: 0 0 20px; }
body.yf-ui-prototype .auth-form { gap: 7px; }
body.yf-ui-prototype .auth-form label { font-size: 13px; line-height: 20px; }
body.yf-ui-prototype .auth-form label:not(:first-child) { margin-top: 7px; }
body.yf-ui-prototype .auth-form input { min-height: 46px; background: var(--yf-surface); }
body.yf-ui-prototype .auth-form input:focus { border-color: var(--yf-primary); outline: none; box-shadow: none; }
body.yf-ui-prototype .auth-form input:focus-visible { outline: 2px solid var(--yf-primary); outline-offset: -2px; }
body.yf-ui-prototype .auth-form .auth-submit { margin-top: 11px; }
body.yf-ui-prototype .auth-code-row { gap: 9px; }
body.yf-ui-prototype .auth-consent { margin-top: 16px; font-size: 12px; line-height: 1.7; }
body.yf-ui-prototype .auth-consent input { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
body.yf-ui-prototype .auth-register { margin-bottom: 0; font-size: 13px; }
body.yf-ui-prototype .auth-close { border: 0; background: transparent; }
body.yf-ui-prototype .auth-close:hover { background: var(--yf-primary-soft); }

/* Give the appearance choices more space, and keep auxiliary tools quiet. */
body.yf-ui-prototype .ps-header { padding: 17px 20px 10px; }
body.yf-ui-prototype .ps-eyebrow { display: none; }
body.yf-ui-prototype .ps-header h2 { margin: 0; }
body.yf-ui-prototype .ps-quick-tools { padding: 0 20px 10px; gap: 6px; }
body.yf-ui-prototype .ps-quick-tools .ps-preview-selection { display: none; }
body.yf-ui-prototype .ps-preview-tools button { border-color: transparent; background: transparent; box-shadow: none; padding-inline: 8px; }
body.yf-ui-prototype .ps-editor { padding: 0 20px 6px; }
body.yf-ui-prototype .ps-tabs { margin-bottom: 14px; }
body.yf-ui-prototype .ps-section-note { margin-bottom: 12px; font-size: 12px; }
body.yf-ui-prototype .ps-style-grid { gap: 10px; }
body.yf-ui-prototype .ps-style-thumb { height: 60px; }
body.yf-ui-prototype .ps-style-option > strong { margin-top: 6px; }
body.yf-ui-prototype .ps-style-option > small { margin-top: 2px; font-size: 11px; line-height: 1.5; }
body.yf-ui-prototype .ps-style-note { margin-top: 12px; font-size: 11px; line-height: 1.6; }
body.yf-ui-prototype .ps-panel :is(.ps-more,.ps-readability,.ps-exact-details) > summary { border-color: transparent; background: transparent; padding-inline: 2px; }
body.yf-ui-prototype .ps-panel :is(.ps-more,.ps-readability,.ps-exact-details) > summary:hover { background: var(--yf-primary-soft); }
body.yf-ui-prototype .ps-readability.is-warn > summary { color: var(--yf-danger); }
body.yf-ui-prototype .ps-footer { padding: 11px 20px 13px; }
body.yf-ui-prototype .ps-footer-actions { margin-top: 8px; gap: 8px; }
body.yf-ui-prototype .ps-footer > small { margin-top: 7px; font-size: 11px; line-height: 1.5; }
body.yf-ui-prototype .ps-close { border: 0; background: transparent; }
body.yf-ui-prototype .ps-close:hover { background: var(--yf-primary-soft); }
body.yf-ui-prototype .ps-live-target.is-selected > span { display: none; }
body.yf-ui-prototype .ps-live-target:hover > span,
body.yf-ui-prototype .ps-live-target:focus-visible > span { display: block; width: max-content; max-width: 160px; white-space: nowrap; }

/* Keep mobile navigation and account actions in one drawer layout. */
@media (max-width: 720px) {
  body.yf-ui-prototype #mobileMenuButton { width: 42px; height: 42px; border: 0; border-radius: 9px; }
  body.yf-ui-prototype #mobileMenuButton:hover { background: var(--yf-primary-soft); }
  body.yf-ui-prototype[data-yf-soft-route="home"]:not(.is-conversation-mode) main > #home.hero {
    justify-content: flex-start; padding-top: clamp(164px, 24dvh, 220px);
    padding-bottom: max(60px, env(safe-area-inset-bottom));
  }
  body.yf-ui-soft[data-yf-style="default"][data-yf-soft-route="home"] #home .hero-copy h1 { font-size: 26px; line-height: 1.4; font-weight: 550; }
  body.yf-ui-prototype .auth-dialog { padding: 24px 20px; }
  body.yf-ui-prototype.sidebar-open .topbar {
    inset: 0 auto 0 0; width: min(300px, calc(100vw - 40px));
    height: 100dvh; padding: 0 12px; display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr) auto;
    align-items: stretch; gap: 0; background: var(--yf-sidebar-fill, var(--yf-surface));
    border-right: 1px solid var(--yf-border); border-bottom: 0;
  }
  body.yf-ui-prototype.sidebar-open #mobileMenuButton { grid-area: 1 / 1; align-self: center; margin: 0; }
  body.yf-ui-prototype.sidebar-open #navBrandHome { grid-area: 1 / 2; align-self: center; width: auto; margin: 0; }
  body.yf-ui-prototype.sidebar-open .topbar #primaryNav {
    position: static; inset: auto; z-index: auto; grid-area: 2 / 1 / 3 / -1;
    width: auto; height: auto; min-height: 0; margin: 0; padding: 8px 0 14px;
    overflow-y: auto; overscroll-behavior: contain; border: 0;
    transform: none; background: transparent; visibility: visible;
  }
  body.yf-ui-prototype.sidebar-open .topbar .yf-prototype-sidebar-bottom {
    position: static; inset: auto; grid-area: 3 / 1 / 4 / -1;
    width: auto; margin: 0; max-height: 43dvh; overflow-y: auto;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
    background: var(--yf-sidebar-fill, var(--yf-surface));
  }
  body.yf-ui-prototype .yf-prototype-sidebar-bottom :is(#themeToggle,#loginBtn) { min-height: 44px; height: 44px; }
  body.yf-ui-prototype .yf-prototype-sidebar-bottom #accessMenuButton { min-height: 40px; }
}

@media (min-width: 721px) {
  body.yf-ui-soft[data-yf-style="book"][data-yf-soft-route="home"]:not(.is-conversation-mode) #home :is(.hero-copy,.hero-stage) { max-width: calc(100% - 88px); }
  /* The existing collapse controller removes the rail entirely. */
  body.yf-ui-prototype.sidebar-collapsed .yf-prototype-sidebar-bottom { display: none; }
  body.yf-ui-prototype.sidebar-collapsed #sidebarCollapseButton {
    position: fixed; left: 12px; right: auto; top: 16px; width: 40px; height: 40px;
    transform: none; opacity: 1; border: 1px solid var(--yf-border);
    border-radius: 10px; background: var(--yf-surface); color: var(--yf-primary);
  }
}
