/* YapThing chat typography: a consistent, quiet reading hierarchy.
   Preserve the YapThing brand and layout; reduce oversized text without
   shrinking the mobile input or the controls people need to tap. */
:root {
  --yap-typeface: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --yap-type-reading: 14.5px;
  --yap-type-navigation: 13.5px;
  --yap-type-secondary: 12px;
}
body > main > .workspace,
#yap-tool-menu,
#account-panel,
.yap-project-rename-dialog {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-navigation);
  letter-spacing: normal;
}
body > main > .workspace > .top,
#yap-tool-menu {
  line-height: 1.45;
}
/* Conversation: same body size for users, assistant prose and lists. */
#messages > .message.user,
#messages > .message.yap-assistant-reply,
#messages > .message:not(.user):not(.yap-assistant-reply),
#messages .yap-prose,
#messages .msg.thing .bubble.yap-prose,
#messages .yap-prose :is(p, li, blockquote) {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-reading) !important;
  line-height: 1.62 !important;
  letter-spacing: normal !important;
}
#messages .yap-prose h2 {
  font-size: 18px !important;
  line-height: 1.34 !important;
  font-weight: 700;
}
#messages .yap-prose h3 {
  font-size: 16px !important;
  line-height: 1.36 !important;
  font-weight: 680;
}
#messages .yap-prose h4 {
  font-size: 14.5px !important;
  line-height: 1.38 !important;
  font-weight: 680;
}
#messages .yap-prose :is(h2,h3,h4) {
  font-family: var(--yap-typeface) !important;
  letter-spacing: -.018em !important;
}
/* Supporting information is distinct, but never microscopic. */
#messages .message-actions button,
#messages .yap-activity,
#messages .yap-working,
#messages .yap-response-meta,
#messages .yap-sources small,
#messages .yap-cited-sources,
#messages .message small {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-secondary) !important;
  line-height: 1.45 !important;
}
#messages .yap-work-message,
#messages .yap-upgrade-card {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-reading) !important;
  line-height: 1.55 !important;
}
/* Sidebar: one size for navigation, projects and recent chat titles. */
#yap-tool-menu :is(
  .yap-nav-item,
  .sidebar-button,
  #new,
  #assistant-new,
  .yap-project-row,
  .yap-project-folder>summary,
  .yap-project-folder[open]>.yap-chat-entry .yap-project-chat,
  #history>.yap-chat-entry>button:first-child,
  #history button,
  .yap-project-navigation>button,
  .yap-project-navigation .yap-project-show-more,
  .yap-sidebar-quick-actions button,
  .yap-project-menu-panel button,
  #yap-menu-settings>summary
) {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-navigation) !important;
  line-height: 1.42 !important;
  letter-spacing: normal !important;
}
/* Section labels are smaller, all at the same size. */
#yap-tool-menu :is(
  #yap-nav-projects,
  .yap-sidebar-section-title,
  .yap-nav-recents h3,
  .yap-project-navigation>h3,
  .yap-recent-navigation>h3,
  .yap-sidebar-caption
) {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-secondary) !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
}
/* Composer, top bar, account and secondary tool menus. */
.workspace .composer textarea#prompt {
  font-family: var(--yap-typeface) !important;
  font-size: 14.5px !important;
  line-height: 1.55 !important;
}
.workspace .composer :is(
  #yap-response-modes>summary,
  .yap-tool-options select,
  .yap-tool-options button,
  #yap-attachment-menu>div button.yap-attach-item,
  .yap-mode-panel button,
  #send
) {
  font-family: var(--yap-typeface) !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}
.workspace .top :is(button, select, label),
#account-panel :is(button, label, a, select) {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-navigation) !important;
  line-height: 1.4 !important;
}
.workspace .top :is(small, #model-status, .statusline small),
.composer .yap-accuracy-note {
  font-family: var(--yap-typeface) !important;
  font-size: 11.5px !important;
  line-height: 1.45 !important;
}
.workspace.yap-empty-chat #yap-empty-hero h1 {
  font-family: var(--yap-typeface) !important;
  font-size: clamp(29px, 2.8vw, 36px) !important;
  line-height: 1.2 !important;
}
.workspace.yap-empty-chat #yap-empty-hero p {
  font-family: var(--yap-typeface) !important;
  font-size: 14.5px !important;
  line-height: 1.55 !important;
}
@media (max-width:700px) {
  /* iOS must keep inputs >= 16px to prevent focus zoom. */
  .workspace .composer textarea#prompt,
  #account-panel input {
    font-size: 16px !important;
  }
  #messages > .message.user,
  #messages > .message.yap-assistant-reply,
  #messages .yap-prose,
  #messages .yap-prose :is(p, li) {
    font-size: 14.5px !important;
    line-height: 1.6 !important;
  }
  #yap-tool-menu :is(.yap-nav-item, #history>.yap-chat-entry>button:first-child, .yap-project-folder>summary) {
    font-size: 14px !important;
  }
  .workspace.yap-empty-chat #yap-empty-hero h1 {
    font-size: clamp(28px, 7.5vw, 34px) !important;
  }
}

/* Higher-specificity legacy rules formerly left these two mismatched. */
#yap-tool-menu #yap-nav-projects {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-secondary) !important;
  line-height: 1.4 !important;
}
#form.composer .compose-row #prompt {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-reading) !important;
  line-height: 1.55 !important;
}
@media (max-width:700px) {
  #form.composer .compose-row #prompt { font-size: 16px !important; }
}

/* Primary-nav specificity: Projects is a quiet section caption. */
#yap-tool-menu #yap-nav-primary #yap-nav-projects {
  font-family: var(--yap-typeface) !important;
  font-size: var(--yap-type-secondary) !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
}
@media(max-width:700px) {
  #yap-tool-menu #yap-nav-primary #yap-nav-projects {
    font-size: var(--yap-type-secondary) !important;
  }
}
