/* Account-owned research tools, sharing the ice-blue reading palette. */
.compact-paper h2 { display: flex; align-items: flex-start; gap: 10px; }
.compact-paper h2 .paper-title { flex: 1; min-width: 0; }
.paper-heart { display: grid; place-items: center; flex: none; width: 27px; height: 27px; padding: 5px; margin-top: -2px; border: 0; border-radius: 50%; background: transparent; color: #7188a6; opacity: 0; cursor: pointer; }
.paper-heart svg { width: 17px; height: 17px; }
.paper-card:hover .paper-heart, .paper-card:focus-within .paper-heart, .paper-heart.is-favorite { opacity: 1; }
.paper-heart:hover, .paper-heart:focus-visible { opacity: 1; color: #d42f55; background: #ffedf2; outline-color: #d42f55; }
.paper-heart.is-favorite { color: #d42f55; }
.paper-heart.is-favorite svg { fill: currentColor; stroke: currentColor; }
.paper-heart:disabled { cursor: progress; opacity: .55; }
.favorite-error { font-size: 11px; grid-column: 2; }
.search-app .page-button { white-space: nowrap; width: auto; padding-inline: 7px; font-size: 11px; }

/* An unobtrusive top-edge handle replaces the former composer heading strip. */
.chat-composer { position: relative; padding-top: 10px; border-top: 0; }
.chat-resizer { position: absolute; z-index: 2; inset: 0 0 auto; height: 10px; width: 100%; border: 0; background: transparent; cursor: ns-resize; touch-action: none; display: grid; place-items: center; }
.chat-resizer span { width: 32px; height: 3px; border-radius: 3px; background: #b3cae7; }
.chat-resizer:hover span, .chat-resizer:focus-visible span, .is-resizing .chat-resizer span { width: 52px; background: #1674ec; }
.chat-composer.has-manual-height { height: var(--composer-height); display: flex; flex-direction: column; min-height: 90px; }
.has-manual-height .chat-form { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.has-manual-height .chat-form .query-field { min-height: 0; flex: 1; overflow: auto; }
.search-app .has-manual-height .chat-form textarea { height: 100%; max-height: none; min-height: 20px; }
.has-manual-height .chat-actions { flex: none; }
.has-manual-height .chat-error { flex: none; max-height: 40px; overflow: auto; margin-top: 3px; }
.search-app .chat-form.voice-active .query-field > textarea { display: none; }
.chat-composer.has-manual-height.is-recording { min-height: 180px; }
.has-manual-height .chat-form.voice-active { min-height: 150px; }
.chat-summary-tools { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 12px; border-bottom: 1px solid #e3edf9; }
.chat-summary-hint { color: #56708f; font-size: 11px; }
.chat-summary-button { color: #1262cf; background: #edf5ff; border: 1px solid #c8defb; border-radius: 7px; padding: 7px 10px; font-size: 12px; }
.chat-summary-button:hover:not(:disabled) { background: #deedff; border-color: #8eb8ed; }
.chat-summary-button:disabled { opacity: .5; cursor: not-allowed; }
.notes-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.notes-heading h3 { margin: 0; font-size: 16px; color: #183759; }
.notes-heading span, .notes-empty { font-size: 12px; color: #56708f; }
.notes-form { display: flex; flex-direction: column; gap: 9px; }
.notes-form textarea { width: 100%; border: 1px solid #c4d9f1; border-radius: 9px; padding: 12px; resize: vertical; min-height: 90px; max-height: 300px; color: #233d60; font: inherit; font-size: 13px; line-height: 1.8; background: #fbfdff; box-sizing: border-box; }
.notes-form .button { align-self: flex-end; font-size: 12px; padding: 7px 13px; }
.notes-status .notice { margin: 10px 0; font-size: 12px; }
.paper-note { padding: 18px 0; border-top: 1px solid #e2ebf6; margin-top: 16px; }
.note-meta { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; color: #547190; font-size: 11px; margin-bottom: 12px; }
.note-meta > span { background: #ecf4ff; color: #275d99; padding: 3px 7px; border-radius: 4px; }

.library-dialog { width: min(1120px, calc(100vw - 48px)); max-width: none; height: min(780px, calc(100svh - 64px)); max-height: none; padding: 0; border: 1px solid #afcdef; border-radius: 18px; background: #f7fbff; color: #183654; box-shadow: 0 24px 90px #09285936; font-family: inherit; }
.library-dialog::backdrop, .library-small-dialog::backdrop { background: #1736544d; }
.library-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 26px; border-bottom: 1px solid #d6e6f8; background: #fff; }
.library-head h2 { font-size: 22px; margin: 3px 0 0; letter-spacing: .02em; }
.library-eyebrow { font-size: 11px; color: #54759a; letter-spacing: .1em; }
.library-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); height: calc(100% - 95px); min-height: 0; }
.library-sidebar { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 18px 12px; border-right: 1px solid #d7e6f5; }
.library-sidebar-label { margin: 0 9px 2px; font-size: 11px; color: #547190; }
.library-groups { overflow: auto; min-height: 0; }
.library-group { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 10px; border: 0; border-radius: 8px; margin-bottom: 3px; background: transparent; color: #325478; font: inherit; font-size: 12px; text-align: left; }
.library-group > span:first-child { overflow-wrap: anywhere; }
.library-group.active { background: #e2efff; color: #095ecb; font-weight: 600; }
.library-group:hover { background: #eaf3ff; }
.library-count { color: #607994; font-weight: 400; font-variant-numeric: tabular-nums; }
.library-group-form { display: grid; gap: 7px; margin-top: auto; padding-top: 12px; }
.library-dialog input:not([type="checkbox"]), .library-small-dialog input:not([type="checkbox"]) { width: 100%; box-sizing: border-box; border: 1px solid #c5d9f1; background: #fff; padding: 8px 10px; border-radius: 7px; color: #26496f; font: inherit; font-size: 12px; min-width: 0; }
.library-content { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 18px 22px 12px; background: #fff; }
.library-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.library-filter { display: flex; gap: 6px; min-width: 0; flex: 1; }
.library-filter input { max-width: 300px; }
.library-dialog .button, .library-small-dialog .button { font-size: 12px; padding: 7px 11px; min-height: 32px; white-space: nowrap; }
.library-dialog .primary, .library-small-dialog .primary { background: #0867e8; color: #fff; border: 1px solid #0867e8; }
.library-subtitle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0 10px; font-size: 12px; color: #486583; }
.library-feedback { font-size: 12px; line-height: 1.65; color: #356caa; }
.library-feedback.is-error { color: #ab354b; }
.library-list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1; scrollbar-width: thin; scrollbar-color: #b3cbe8 transparent; }
.library-paper { display: flex; align-items: flex-start; gap: 12px; padding: 16px 2px; border-top: 1px solid #e3edf7; }
.library-paper > input { margin-top: 5px; accent-color: #0867e8; }
.library-paper-detail { min-width: 0; flex: 1; }
.library-paper-title { border: 0; background: transparent; padding: 0; color: #1b3458; font-size: 14px; line-height: 1.6; font-weight: 600; text-align: left; }
.library-paper-title:hover { color: #0664dd; }
.library-translation { font-size: 12px; line-height: 1.65; color: #4c6789; margin: 4px 0; }
.library-note { color: #58718d; font-size: 12px; line-height: 1.7; margin: 6px 0; }
.library-paper-actions { display: flex; align-items: center; gap: 9px; }
.library-link { color: #2766af; border: 0; background: transparent; font-size: 12px; padding: 4px 0; white-space: nowrap; }
.library-heart { color: #d32e56; background: #fff1f4; border: 0; width: 28px; height: 28px; border-radius: 50%; font-size: 17px; }
.library-paper-groups { display: flex; gap: 5px; flex-wrap: wrap; }
.library-paper-groups span { background: #ecf4ff; border-radius: 4px; color: #456e9d; font-size: 10px; padding: 2px 6px; }
.library-pages { display: flex; justify-content: flex-end; align-items: center; gap: 13px; padding: 12px 0 0; border-top: 1px solid #e1eaf6; font-size: 12px; }
.library-empty { padding: 50px 20px; text-align: center; color: #5d7895; line-height: 1.9; font-size: 13px; }
.library-small-dialog { width: min(400px, calc(100vw - 50px)); box-sizing: border-box; border: 1px solid #bdd5f1; border-radius: 14px; padding: 24px; color: #254565; background: #fff; }
.library-small-dialog h3 { font-size: 17px; margin-top: 0; }
.library-small-dialog .button { margin: 14px 5px 0 0; }
.library-small-dialog .library-danger { color: #b83951; background: #fff4f5; border-color: #f2d5da; display: block; }
.library-group-options { max-height: 45vh; overflow-y: auto; }
.library-group-options label { display: flex; align-items: center; gap: 10px; padding: 8px 2px; font-size: 13px; }
.library-group-options input { accent-color: #0867e8; }
@media (hover: none) { .paper-heart { opacity: 1; } }
@media (max-width: 640px) {
  .library-dialog { width: calc(100vw - 16px); height: calc(100svh - 24px); border-radius: 12px; }
  .library-head { padding: 14px 16px; }
  .library-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: calc(100% - 80px); }
  .library-sidebar { padding: 9px 12px; border-right: 0; border-bottom: 1px solid #d7e6f5; gap: 5px; }
  .library-sidebar-label { display: none; }
  .library-groups { display: flex; gap: 5px; max-height: 80px; }
  .library-group { width: auto; min-width: max-content; padding: 8px; }
  .library-group-form { display: flex; padding: 0; }
  .library-group-form input { flex: 1; }
  .library-content { padding: 12px; }
  .library-tools { flex-wrap: wrap; gap: 7px; }
  .library-paper { gap: 8px; }
  .library-paper-actions { flex-direction: column; gap: 3px; }
  .paper-heart { opacity: 1; }
}
