  /* ---------- Book a session ---------- */
  .error-box .book-hint { display: block; margin-top: 8px; }
  .bk-intro { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
  .bk-allowance { margin: 0; font-weight: 600; font-size: 13.5px; }
  /* Continue with Google, under Sign in and Create account (Google's look: white, grey edge, the four-colour G) */
  .google-or { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .google-or > span:first-child { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12.5px; }
  .google-or > span:first-child::before, .google-or > span:first-child::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
  .btn-google, .login-card a.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; padding: 0 14px; border-radius: 8px;
    background: #fff; color: #1f1f1f; border: 1px solid #747775; font: 500 14px "Roboto", "IBM Plex Sans", system-ui, sans-serif; text-decoration: none; }
  .btn-google:hover { background: #f8faff; }
  .btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }
  .bk-pass-msg { display: inline-block; margin-top: 4px; font-weight: 400; color: var(--danger, #b42318); }
  .bk-pass-msg:empty { display: none; }
  .bk-mine { display: flex; flex-direction: column; gap: 8px; }
  .bk-mine-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); }
  .bk-mine-row .when { flex: 1; min-width: 180px; font-weight: 500; }
  .bk-mine-row .when small { display: block; font-weight: 400; color: var(--text-faint); font-size: 12px; }
  .bk-mine-row.soon { border-color: var(--accent); border-left-width: 4px; background: var(--accent-soft); }
  .bk-mine-row.soon .when { font-weight: 700; color: var(--text); }
  .bk-off-note { margin-bottom: 14px; }
  .bk-soon { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-text-on); }
  .bk-now { font-size: 11px; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
  .bk-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .bk-nav b { font-size: 14px; }
  .bk-days { display: grid; grid-template-columns: repeat(var(--bk-cols, 5), minmax(0, 1fr)); gap: 10px; }
  @media (max-width: 760px) { .bk-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .bk-day { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .bk-day-head { font-size: 12.5px; font-weight: 600; color: var(--text-muted); padding: 2px 2px 4px; border-bottom: 1px solid var(--border); }
  .bk-day-head.today { color: var(--accent-strong); }
  .bk-closed { font-size: 12px; color: var(--text-faint); font-style: italic; padding: 6px 2px; }
  .bk-slot {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px;
    padding: 6px 9px; font-size: 13px; font-weight: 600; cursor: pointer;
    min-height: var(--bk-h, 0); justify-content: center;   /* every slot the same height (Sessions.evenRows) */
  }
  .bk-slot small { font-size: 11px; font-weight: 400; color: var(--text-faint); }
  /* free: light blue, like everything you can take (New, Request this service) */
  .bk-slot.free { background: #f4f8fe; border-color: #c6daf3; color: #1f5fa8; }
  .bk-slot.free:hover:not(:disabled) { background: #e4eefb; border-color: #2f7fd6; }
  .bk-slot.free.alt { background: #eaf2fc; border-color: #b8d0f0; }   /* the checkerboard's second blue */
  .bk-slot.free.alt:hover:not(:disabled) { background: #dde9fa; border-color: #2f7fd6; }
  .bk-slot.free.purple { background: #f8f5fe; border-color: #ddd1f6; color: #5a3ea8; }
  .bk-slot.free.purple:hover:not(:disabled) { background: #ece5fb; border-color: #7c5cff; }
  .bk-slot.free.purple.alt { background: #f0eafd; border-color: #cfc1f2; }
  .bk-slot.free.purple.alt:hover:not(:disabled) { background: #e5dcfa; border-color: #7c5cff; }
  .bk-slot.free.limit, .bk-slot.free.limit.alt { cursor: default; background: #f3f6fa; border-color: #dde4ee; color: #8a9bb3; }
  .bk-slot.free.limit.alt { background: #eaeff6; }   /* still a faint checkerboard */
  .bk-slot.free.limit:hover { background: #f3f6fa; border-color: #dde4ee; }
  .bk-slot.free.limit.alt:hover { background: #eaeff6; }
  .bk-slot.free.limit .seats { color: #8a9bb3; font-style: italic; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bk-slot.free { background: #16304f; border-color: #2b5482; color: #9cc7f5; } }
  :root[data-theme="dark"] .bk-slot.free { background: #16304f; border-color: #2b5482; color: #9cc7f5; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bk-slot.now:not(.limit) { background: #3a2c0c; border-color: #a87a12; color: #f3cf7a; } }
  :root[data-theme="dark"] .bk-slot.now:not(.limit) { background: #3a2c0c; border-color: #a87a12; color: #f3cf7a; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bk-slot.free.alt { background: #1d3b60; border-color: #34618f; } }
  :root[data-theme="dark"] .bk-slot.free.alt { background: #1d3b60; border-color: #34618f; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bk-slot.free.purple { background: #2a2250; border-color: #4a3d86; color: #c8b8f6; } :root:not([data-theme="light"]) .bk-slot.free.purple.alt { background: #332960; border-color: #574a9a; } }
  :root[data-theme="dark"] .bk-slot.free.purple { background: #2a2250; border-color: #4a3d86; color: #c8b8f6; }
  :root[data-theme="dark"] .bk-slot.free.purple.alt { background: #332960; border-color: #574a9a; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bk-slot.free.limit { background: #1b2230; border-color: #2a3446; color: #6f819b; } }
  :root[data-theme="dark"] .bk-slot.free.limit { background: #1b2230; border-color: #2a3446; color: #6f819b; }
  /* yours: solid green, so it can't be missed; red while confirming a cancel */
  /* the session running now, with a free seat: amber, "Now · join (ends …)", so it isn't taken for a later time */
  .bk-slot.now, .bk-slot.now.alt, .bk-slot.now.purple, .bk-slot.now.purple.alt { background: #fff6e0; border-color: #e0a100; color: #8a5a00; }
  .bk-slot.now:hover:not(:disabled) { background: #ffedc2; border-color: #c08800; }
  .bk-slot.now.limit { cursor: default; background: #f3f6fa; border-color: #dde4ee; color: #8a9bb3; }
  .bk-slot.mine { background: #1f8a50; border-color: #1f8a50; color: #fff; }
  /* the next session that can be taken: named above the calendar, and the slot has the focus */
  .bk-upnext { margin: 10px 0; font-size: 13.5px; }
  .bk-slot.bk-focus { outline: 2px solid var(--accent); outline-offset: 2px; }
  .bk-slot.mine small { color: #fff; opacity: .95; }
  .bk-slot.mine .bk-note { white-space: nowrap; }   /* "Booking confirmed" on one line */
  /* a booking cancelled because its day was closed: red, with why */
  .bk-mine-row.closed { border-color: var(--error); background: var(--error-soft); }
  .bk-mine-row.closed .when { color: var(--error); }
  .bk-mine-row.closed .when small.bk-closed-why { display: block; margin-top: 3px; color: var(--error); font-weight: 600; white-space: normal; }
  .bk-soon.closed { background: var(--error); color: #fff; }
  .home-session.closed { color: var(--error); text-decoration: none; }
  .bk-slot.mine.confirm { background: #f2c94c; border-color: #d9a800; color: #3d2f00; }   /* press again to cancel: yellow, a pause before it's gone */
  .bk-slot.mine.confirm small, .bk-slot.mine.confirm .seats { color: #3d2f00; }
  .bk-slot .seats { font-weight: 400; color: var(--text-muted); white-space: nowrap; }
  .bk-slot.mine .seats { color: #fff; }
  .bk-slot.just-changed { animation: status-pop .45s ease-out; }
  @media (prefers-reduced-motion: reduce) { .bk-slot.just-changed { animation: none; } }
  .bk-slot.full, .bk-slot.past, .bk-slot.later, .bk-slot.soon, .bk-slot.outside, .bk-slot.now { cursor: default; color: var(--text-faint); background: var(--surface-alt); border-color: var(--border); }
  .bk-slot.past { opacity: .55; }
  .bk-slot:disabled { cursor: default; }
  .bk-legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); margin: 2px 0 10px; }
  .bk-legend span { white-space: nowrap; }
  .bk-legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; border: 1px solid transparent; }
  .bk-legend .l-free::before { background: linear-gradient(135deg, #2f7fd6 50%, #7c5cff 50%); }   /* blue or purple */
  .bk-legend .l-mine::before { background: #1f8a50; }
  .bk-legend .l-full::before { background: #a9b3c1; }
  .bk-legend .l-limit::before { background: transparent; border: 1px dashed #8a9bb3; }   /* faded: an empty box */

  /* ---------- Sum 1 ---------- */
  .sum1-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 18px; align-items: stretch; }
  @media (max-width: 860px) { .sum1-grid { grid-template-columns: minmax(0, 1fr); } }
  .sum1-avatar { text-align: center; }
  .sum1-avatar > .panel-title { text-align: left; }
  .sum1-avatar .result-head, .sum1-chat .result-head { width: 100%; }
  .sum1-face { width: min(100%, 260px); aspect-ratio: 1; border-radius: 22px; overflow: hidden; position: relative;
    background: linear-gradient(145deg, var(--accent-soft), var(--surface-alt)); border: 1px solid var(--border); display: grid; place-items: center; }
  .sum1-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .sum1-face svg { width: 58%; height: 58%; color: var(--accent-strong); opacity: .75; }
  .sum1-face.speaking { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 7px var(--accent); animation: sum1-pulse 1.2s ease-in-out infinite; }
  .sum1-face.off { filter: grayscale(1); opacity: .6; }
  @keyframes sum1-pulse { 50% { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 11px transparent; } }
  .sum1-status { font-size: 13px; color: var(--text-muted); min-height: 20px; display: flex; gap: 8px; align-items: center; justify-content: center; }
  .sum1-label { font-size: 11.5px; color: var(--text-faint); margin: -6px 0 12px; align-self: stretch; text-align: left; }
  .sum1-more { margin: -14px 0 0; font-size: 13px; line-height: 2; color: var(--text-muted); text-align: center; }
  .sum1-more > span[hidden] { display: none; }
  #sum1-onepager a { color: var(--accent-strong); font-weight: 600; }
  .sum1-linkedin { text-decoration: none; padding: 5px 12px; }
  /* the question's label on the left; New conversation on the right, above Ask */
  .sum1-ask .sum1-kept { margin: 4px 0 0; font-size: 12px; }   /* under the question box: the questions are kept (2026-10-13) */
  .sum1-ask-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  /* Sum 1 Pro's Settings: the same pattern as the other services (Alter an image):
     label and technical name on the left, controls the column's width, a switch
     on a row as tall as a list */
  .btn-ghost.sum1-forget { height: 38px; width: 100%; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; }   /* the same grey box as the voice list */
  [data-panel="avt"] #sum1-voice-kind:disabled { opacity: .5; cursor: not-allowed; }
  /* Sum 1 Pro's boxes: the digital twin and the conversation are exactly the size of
     Your text and Result on the other services (the same rows, below) */
  [data-panel="avt"] .work-row { --rows: 5; }
  .panel.sum1-avatar, .panel.sum1-chat { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 16.5px 36px calc(46px + var(--rows) * 46px) 66px; gap: 10px; align-content: start; }
  .sum1-avatar > .panel-title, .sum1-chat > .result-title-row { grid-row: 1; height: 16.5px; line-height: 16.5px; }
  .sum1-avatar .sum1-label { grid-row: 2; margin: 0; }
  .sum1-stage { grid-row: 3; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
  .sum1-stage .sum1-face { width: auto; height: min(100%, 260px); max-width: 100%; flex: 0 1 auto; min-height: 0; }
  .sum1-avatar .sum1-more { grid-row: 4; margin: 0; align-self: center; }
  .sum1-chat .thread { grid-row: 2 / 5; min-height: 0; max-height: none; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); padding: 12px 14px; }
  .sum1-chat.text-off .msg:not(.welcome) { display: none; }
  .msg .text .said { border-radius: 4px; transition: background .2s; }
  .msg .text .said.speaking { background: var(--accent-soft); color: var(--accent-strong); }
  #sum1-thread .msg.assistant .text { white-space: pre-line; }   /* its follow-up question sits on its own line */
  .sum1-ask { gap: 10px; }
  /* Try asking: one line (like Settings) that opens to the cards */
  .panel.sum1-try { gap: 0; padding: 12px 18px; }
  .sum1-try-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
  .sum1-try-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
  .sum1-try .sum1-try-title .hint { margin: 0; font-size: 12.5px; }
  .sum1-try-head .sum1-try-toggle { flex: none; max-width: none; }
  /* Pause beside Hide: the ask box is often out of sight while the cards are open (Stop stays there) */
  .sum1-try-acts { display: inline-flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
  /* narrow screens: when Pause doesn't fit beside the title, the buttons go under it */
  .sum1-try-head { flex-wrap: wrap; row-gap: 8px; }
  .sum1-try-head .sum1-try-title { flex: 1 1 180px; }
  /* wider screens: the title stays on one line (the bar doesn't jump while Pause shows) */
  @media (min-width: 701px) {
    .sum1-try-head .sum1-try-title { flex-wrap: nowrap; min-width: 0; }
    .sum1-try .sum1-try-title .hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sum1-try-title > .panel-title { flex: none; white-space: nowrap; }
  }
  .sum1-try-pause { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
  .sum1-try-toggle[aria-expanded="true"] span[aria-hidden] { transform: rotate(180deg); }
  .sum1-try-body:not([hidden]) { margin-top: 12px; }
  .sum1-try .hint { margin: -4px 0 12px; font-size: 13px; }
  .sum1-try-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  @media (max-width: 860px) { .sum1-try-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 520px) { .sum1-try-grid { grid-template-columns: minmax(0, 1fr); } }
  /* Try asking: each question its own colour (--h, a hue); choosing one spreads
     a lighter wash of it from the card over the whole box, answer included */
  /* one blue, a shade deeper for each card (--i: 0, 1, 2... left to right, top to bottom) */
  :root { --try-card-l0: 96%; --try-card-step: -3.6%; --try-wash-l: 97.5%; --try-line-l: 80%; --try-ink-l: 22%; --try-sat: 42%; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --try-card-l0: 15%; --try-card-step: 3%; --try-wash-l: 13%; --try-line-l: 32%; --try-ink-l: 88%; } }
  :root[data-theme="dark"] { --try-card-l0: 15%; --try-card-step: 3%; --try-wash-l: 13%; --try-line-l: 32%; --try-ink-l: 88%; }
  /* the wash covers the questions and the answer, starting just above the questions */
  .sum1-try-body { position: relative; overflow: hidden; margin: 0 -12px -12px; padding: 12px; border-radius: 12px; transition: background-color .25s; }
  .sum1-try-body.washed { background: hsl(var(--ph) var(--try-sat, 32%) var(--try-wash-l)); }
  .sum1-try-body > :not(.try-wash) { position: relative; z-index: 1; }
  .try-wash { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: hsl(var(--h) var(--try-sat, 32%) var(--try-wash-l));
    clip-path: circle(0 at var(--x) var(--y)); transition: clip-path .65s cubic-bezier(.3,.7,.3,1); }
  .try-wash.open { clip-path: circle(150% at var(--x) var(--y)); }
  .sum1-try-q { text-align: left; background: hsl(var(--h) var(--try-sat, 32%) calc(var(--try-card-l0) + var(--i) * var(--try-card-step))); border: 1px solid hsl(var(--h) 25% var(--try-line-l)); border-radius: 10px; padding: 12px 14px;
    font-size: 13.5px; font-weight: 600; color: hsl(var(--h) 35% var(--try-ink-l)); cursor: pointer; line-height: 1.35; transition: background-color .25s, color .25s, transform .15s; }
  .sum1-try-q:hover { border-color: hsl(var(--h) 35% 55%); }
  /* the chosen one keeps its colour; a navy frame says it's the one */
  .sum1-try-q[aria-expanded="true"] { border-color: hsl(var(--h) 45% 30%); box-shadow: 0 0 0 2px hsl(var(--h) 45% 30%); }
  .sum1-try-answer .doc-view { background: var(--surface); color: var(--text); }   /* the answer itself stays plain: black on white */
  .sum1-try-body.washed .sum1-try-answer .doc-view { border-color: hsl(var(--ph) 25% var(--try-line-l)); }

  .sum1-try-answer { margin-top: 14px; }
  .sum1-try-answer .doc-view { max-height: none; }
  .sum1-try-answer .doc-view .speaking { background: hsl(var(--ph, 160) 70% 86%); color: hsl(var(--ph, 160) 50% 25%); border-radius: 4px; }
  .sum1-try-answer .actions { justify-content: flex-start; margin-top: 10px; }
  .sum1-ask textarea { min-height: 58px; }
  .sum1-ask .actions { justify-content: space-between; align-items: center; }

  .ask-dialog.popup-small[open] { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
  .popup-message-body { min-height: 0; overflow-y: auto; }
  .ask-dialog .ask-buttons { flex-shrink: 0; }
  .viewer-box.popup-large > .popup-header { grid-column: 1 / -1; }
  /* Shared popup sizes: responsive outer frame, scrolling content. */
  .popup-small { --popup-width: 420px; --popup-limit: 50dvh; }
  .ask-dialog.ask-one-line { --popup-width: 540px; }   /* its buttons on one line (Sign out's three); phones still wrap */
  @media (min-width: 600px) { .ask-dialog.ask-one-line .ask-buttons { flex-wrap: nowrap; } .ask-dialog.ask-one-line .ask-buttons button { white-space: nowrap; } }
  .popup-medium { --popup-width: 640px; --popup-limit: 75dvh; }
  .popup-large { --popup-width: 1000px; --popup-limit: 85dvh; }
  /* extra large (the standard for a workflow in one pop-up, e.g. Recruit Sumesh): centred in the window,
     48px from the top and bottom and 60px in from each side of the page, so a strip of the site shows all
     round; the page is held still while it's open. fitXlarge() sets --xl-top/left/width as it opens and
     as the window changes. */
  .popup-xlarge { --popup-width: 1240px; --popup-limit: calc(100dvh - 32px); }
  dialog.popup-small, dialog.popup-medium, dialog.popup-large, dialog.popup-xlarge,
  .open-in-box.popup-medium, .viewer-box.popup-large {
    width: min(var(--popup-width), calc(100vw - 32px));
    max-width: calc(100vw - 32px); max-height: min(var(--popup-limit), calc(100dvh - 32px));
    box-sizing: border-box; padding: 18px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface); color: var(--text); overflow: auto;
  }
  dialog.popup-large { height: min(85dvh, calc(100dvh - 32px)); }
  dialog.popup-xlarge { width: min(var(--popup-width), calc(100vw - 64px)); height: calc(100dvh - 32px); }
  html.xl-open { overflow: hidden; }   /* the page stays still behind an extra-large pop-up */
  dialog.popup-xlarge.fitted { margin: 0; inset: auto; top: var(--xl-top); left: var(--xl-left); width: var(--xl-width); max-width: none;
    height: calc(100dvh - 2 * var(--xl-top)); max-height: none; }
  @media (max-width: 640px) { dialog.popup-xlarge { width: calc(100vw - 32px); } dialog.popup-xlarge.fitted { margin: auto; inset: 0; width: calc(100vw - 32px); height: calc(100dvh - 32px); } }

  /* Match a Job to His Skills: the sign-in page's link */
  .recruit-link { color: #3b5bab; text-decoration: underline; text-underline-offset: 2px; }
  #recruit-open { font-weight: 700; display: block; width: 100%; text-align: center; color: var(--ui-blue); }   /* the card's link: bold, on a line of its own (wraps only on a narrow screen) */
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .recruit-link { color: #9db8f2; } }
  :root[data-theme="dark"] .recruit-link { color: #9db8f2; }
  /* Recruit Sumesh: Coming soon, the height the page had, so nothing moves */
  .hire-soon { height: 548px; box-sizing: border-box; display: flex; flex-direction: column; }
  .hire-soon-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; color: var(--text-muted); }
  .hire-soon-body .status { font-size: 13px; }
  .hire-soon-body p { margin: 0; max-width: 440px; line-height: 1.6; }
  dialog.popup-small p, dialog.popup-medium p { overflow-wrap: anywhere; }
  .popup-small button, .popup-medium button, .popup-large button, .popup-xlarge button { min-height: 40px; }
  .popup-large.docview-dialog[open] { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
  #docview-dialog > .result-head, #docview-dialog > .docview-meta, #docview-tabs { flex-shrink: 0; }
  #docview-dialog .result-head { flex-wrap: wrap; }
  #docview-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #docview-close { margin-left: 0; }
  #docview-dialog #docview-body { flex: 1; min-height: 0; overflow: auto; }
  #docview-dialog .docview-frame { height: 100%; min-height: 100%; box-sizing: border-box; }
  #docview-dialog .docview-img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
  #docview-dialog .docview-text { margin: 0; min-height: 100%; box-sizing: border-box; }
  #comment-dialog[open], #rag-searching-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
  #comment-dialog .doc-dialog-head, #rag-searching-dialog .doc-dialog-head { flex-shrink: 0; }
  #comment-dialog .comment-list { flex: 1; min-height: 0; max-height: none; overflow-y: auto; }
  #rag-searching-dialog .rag-searching { min-height: 0; overflow-y: auto; }
  #folder-upload-dialog.popup-medium { width: min(640px, calc(100vw - 32px)); }
  .popup-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
  .open-in-box.popup-medium { display: flex; flex-direction: column; overflow: hidden; }
  #open-in-list { min-height: 0; overflow-y: auto; }
  .viewer-box.popup-large { height: min(85dvh, calc(100dvh - 32px)); grid-template-columns: minmax(0, 1fr) 260px; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  .viewer-box.popup-large .viewer-img { overflow: auto; }
  .viewer-box.popup-large .viewer-img img { max-height: 100%; max-width: 100%; object-fit: contain; }
  .viewer-box.popup-large .viewer-side { min-height: 0; overflow-y: auto; }
  @media (max-width: 760px) {
    .viewer-box.popup-large { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
    .viewer-box.popup-large .viewer-side { max-height: 30dvh; }
    dialog.popup-small, dialog.popup-medium { max-height: calc(100dvh - 32px); }
  }


