/* Shared layout */
:root {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #24352e;
  background: #f8f9f6;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
.shell { display: flex; min-height: 100vh; }
aside {
  width: 280px;
  flex-shrink: 0;
  min-width: 0;
  overflow-x: clip;
  background: #152922;
  color: #c8d6cc;
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 25px; font-weight: 700; color: #fff; text-decoration: none; }
.brand > span:last-child { font-weight: 400; color: #a1b7a6; }
.mark { background: #d8efab; color: #183122; width: 38px; height: 38px; border-radius: 10px; text-align: center; font-size: 28px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .15em; color: #77847b; }
.workspace { display: flex; flex-direction: column; gap: 10px; margin-top: 40px; padding-bottom: 24px; border-bottom: 1px solid #34483e; flex-shrink: 0; }
.workspace strong { color: white; font-size: 18px; }
.workspace > span:last-child { font-size: 12px; }
.history { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; min-width: 0; overflow-x: clip; }
.history > .eyebrow { color: #9bad9f; }
.history p { font-size: 13px; line-height: 1.8; color: #a3b4a8; }
.history-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.history-group-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px;
  margin: 0; padding: 8px 4px; border: 0; background: none; color: #9bad9f;
  font-size: 11px; font-weight: 600; letter-spacing: .15em; text-align: left;
  text-decoration: none; cursor: pointer; text-transform: none;
}
.history-group-toggle:hover, .history-group-toggle:focus-visible { color: #d8efab; }
.history-group-chevron { display: inline-block; flex-shrink: 0; transition: transform .15s ease; }
.history-group-toggle[aria-expanded="false"] .history-group-chevron { transform: rotate(-90deg); }
.history-group-title {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: normal;
}
.history-group.is-collapsed .dialog-list { display: none; }
.share-panel { display: flex; align-items: center; min-width: 0; max-width: 280px; }
.share-label { font-size: 11px; color: #68756c; }
.share-copy { display: flex; flex-flow: row wrap; align-items: center; gap: 6px; min-width: 0; }
.share-label { line-height: 1.3; }
.share-url { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #dce3d6; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12px; color: #24352e; background: #fff; }
.share-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 0; border: 0; border-radius: 0; background: transparent; color: #375c42; font-size: 13px; font-weight: 400; text-decoration: underline; }
.share-button:hover { background: transparent; color: #152922; }
.share-button svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.share-fallback { flex-basis: 100%; min-width: 0; }
.aside-bottom { margin-top: auto; padding-top: 20px; font-size: 12px; flex-shrink: 0; }
.dot { display: inline-block; background: #d8efab; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }
main { flex: 1; min-width: 0; overflow-x: clip; }
header { height: 100px; padding: 0 50px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e7ebe3; font-size: 13px; color: #68756c; }
.badge { padding: 7px 12px; border: 1px solid #dce3d6; border-radius: 20px; font-size: 11px; }
.conversation-header { height: auto; min-height: 112px; gap: 20px; padding-top: 20px; padding-bottom: 20px; flex-wrap: wrap; }
.snapshot-info { min-width: 0; color: #68756c; font-size: 12px; line-height: 1.5; }
.welcome > .snapshot-info { margin-top: 24px; padding-top: 18px; border-top: 1px solid #e0e6dc; }
.snapshot-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; font-weight: 600; }
.snapshot-zone { font-size: 10px; font-weight: 400; color: #788379; }
.snapshot-dates { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 0; }
.snapshot-dates > div { display: grid; gap: 3px; }
.snapshot-dates dt { font-size: 11px; }
.snapshot-dates dt > span { color: #788379; }
.snapshot-dates dd { margin: 0; color: #344b3c; font-variant-numeric: tabular-nums; display: grid; gap: 3px; }
.snapshot-dates time { white-space: nowrap; }
.snapshot-meeting { display: block; color: #344b3c; }
.snapshot-unknown { color: #788379; }
.welcome { max-width: 860px; padding: 64px 50px; margin: 0 auto; }
h1 { font-size: clamp(36px, 4vw, 54px); font-weight: 550; letter-spacing: -.045em; line-height: 1.14; margin: 22px 0; }
.intro { color: #718076; font-size: 16px; line-height: 1.8; }
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
article { padding: 24px; border: 1px solid #dfe5da; border-radius: 12px; background: #fff; }
article > span { font-size: 10px; letter-spacing: .08em; color: #71846e; }
h2 { font-size: 18px; font-weight: 500; line-height: 1.5; }
article p { font-size: 12px; color: #7a847b; }
.notice { background: #edf1e7; padding: 22px 24px; margin-top: 28px; border-radius: 12px; }
.notice strong { font-size: 14px; font-weight: 600; }
.notice p { font-size: 13px; color: #64715f; line-height: 1.7; margin-bottom: 0; }
footer { margin-top: 28px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11px; color: #69766c; }
button { border: 0; background: none; text-decoration: underline; color: #375c42; cursor: pointer; padding: 8px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid #90b261; outline-offset: 4px; }
.mobile-shell-bar, .mobile-shell-backdrop, .mobile-shell-close { display: none; }
.mobile-shell-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 14px; border: 1px solid #4a6053; border-radius: 10px;
  background: #233d30; color: #e2ebdc; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.mobile-shell-toggle:hover { border-color: #839c72; }
.mobile-shell-close, .mobile-shell-toggle, .mobile-shell-backdrop { text-decoration: none; }
.mobile-shell-close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 2;
  display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #4a6053;
  border-radius: 10px; background: #1c3127; color: #e2ebdc; font-size: 28px; line-height: 1; cursor: pointer;
}
.mobile-shell-backdrop {
  position: fixed; inset: 0; z-index: 35; margin: 0; border: 0; padding: 0;
  background: #15292288; cursor: pointer;
}
.mobile-shell-backdrop[hidden] { display: none; }
@media (max-width: 760px) {
  .shell { display: flex; flex-direction: column; min-height: 100dvh; position: relative; }
  .shell:not([data-controller~="mobile-shell"]) { display: block; }
  .shell:not([data-controller~="mobile-shell"]) aside {
    position: static; width: auto; height: auto; padding: 20px 24px; transform: none;
  }
  .shell[data-controller~="mobile-shell"] aside {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(100%, 320px); max-width: 100%;
    height: 100dvh; max-height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
    transform: translateX(-100%); transition: transform .22s ease; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; touch-action: pan-y;
  }
  .shell[data-controller~="mobile-shell"] aside .history { overflow: visible; flex: 1 0 auto; min-height: auto; }
  .shell[data-controller~="mobile-shell"] aside .dialog-list { overflow: visible; max-height: none; }
  .shell[data-controller~="mobile-shell"].shell--sidebar-open main { overflow: hidden; pointer-events: none; }
  .shell[data-controller~="mobile-shell"].shell--sidebar-open aside { transform: translateX(0); }
  .mobile-shell-bar {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px;
    border-bottom: 1px solid #e7ebe3; background: #f8f9f6; flex-shrink: 0;
  }
  .mobile-shell-toggle { background: #fff; color: #24352e; border-color: #dce3d6; }
  .mobile-shell-toggle:hover { background: #f4f7ef; border-color: #91a58e; color: #152922; }
  .mobile-shell-close { display: grid; }
  .mobile-shell-backdrop:not([hidden]) { display: block; }
  main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
  .workspace, .aside-bottom { display: none; }
  header { height: auto; min-height: 70px; padding: 0 16px; }
  .conversation-header { height: auto; padding: 18px 24px; gap: 12px; }
  .snapshot-dates { gap: 10px 18px; }
  .welcome { padding: 36px 24px; flex: 1; }
  .thread { flex: 1; padding: 24px; }
  .examples { grid-template-columns: 1fr; }
  .desktop { display: none; }
  h1 { font-size: 32px; }
}

/* Personal entry */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 440px; padding: 36px; border: 1px solid #dfe5da; border-radius: 16px; background: #fff; }
.login-brand { display: flex; align-items: center; gap: 10px; color: #24352e; text-decoration: none; font-weight: 650; font-size: 22px; margin-bottom: 36px; }
.login-card h1 { font-size: 32px; margin: 16px 0; }
.login-card .eyebrow { color: #56655b; font-size: 10px; }
.login-intro, .login-help { color: #56655b; font-size: 14px; line-height: 1.65; }
.login-help { margin: 24px 0 0; font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.login-form label { font-size: 14px; font-weight: 600; }
.login-form input { width: 100%; min-height: 46px; border: 1px solid #a7b4a7; border-radius: 8px; padding: 10px 12px; font: inherit; color: #24352e; }
.login-form input[type=password] { margin-bottom: 10px; }
.login-form input[type=submit] { background: #152922; color: #fff; cursor: pointer; border: 0; font-weight: 600; }
.login-form input[type=submit]:disabled { opacity: .65; cursor: wait; }
.login-form input:focus-visible { outline: 2px solid #375c42; outline-offset: 3px; }
.login-error { color: #802e25; background: #fff1ed; padding: 14px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.logout-button { min-height: 44px; }
.new-dialog { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #4a6053; border-radius: 10px; color: #e2ebdc; font-size: 13px; font-weight: 600; text-decoration: none; flex-shrink: 0; }
.new-dialog:hover { background: #233d30; border-color: #839c72; }
.new-dialog > span { font-size: 20px; line-height: 1; }
.dialog-list { list-style: none; padding: 4px; margin: -4px; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #526b5b transparent; }
.dialog-item { position: relative; flex-shrink: 0; min-width: 0; transition: transform .28s ease, opacity .28s ease, max-height .28s ease, margin .28s ease; }
.dialog-item--removing { transform: translateX(-108%); opacity: 0; max-height: 0; margin-top: -8px; pointer-events: none; }
.thread--removing { transform: translateX(-104%); opacity: 0; pointer-events: none; }
.dialog-item-link { display: flex; align-items: center; gap: 10px; padding: 12px 52px 12px 12px; border: 1px solid #31463a; border-radius: 10px; background: #1c3127; color: #e0e9db; text-decoration: none; font-size: 13px; line-height: 1.5; }
.dialog-item:hover .dialog-item-link, .dialog-item:focus-within .dialog-item-link { background: #2a4133; border-color: #637c58; }
.dialog-item-link[aria-current="page"] { background: #d8efab; border-color: #d8efab; color: #152922; }
.dialog-item-indicators { flex-shrink: 0; width: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dialog-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.dialog-item-unread { flex-shrink: 0; width: 7px; height: 7px; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1px #526b5b; }
.dialog-item-unread.is-unread { background: #060f0a; box-shadow: inset 0 0 0 1px #060f0a, 0 0 0 1px #6d8577; }
.dialog-item-link[aria-current="page"] .dialog-item-unread.is-unread { background: #152922; box-shadow: inset 0 0 0 1px #152922, 0 0 0 1px #a8c47e; }
.dialog-item-thinking { flex-shrink: 0; width: 11px; height: 11px; box-sizing: border-box; border-radius: 999px; border: 2px solid #3a5244; border-top-color: #d8efab; opacity: 0; }
.dialog-item-thinking.is-active { opacity: 1; animation: dialog-think-spin .7s linear infinite; }
.dialog-item-link[aria-current="page"] .dialog-item-thinking { border-color: #b7cf8a; border-top-color: #152922; }
@keyframes dialog-think-spin { to { transform: rotate(360deg); } }
.dialog-item-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s ease; }
.dialog-item:hover .dialog-item-actions, .dialog-item:focus-within .dialog-item-actions { opacity: 1; }
.dialog-item-action { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; padding: 0; text-decoration: none; }
.dialog-item-action:hover { background: #ffffff14; }
.dialog-item-link[aria-current="page"] ~ .dialog-item-actions .dialog-item-action:hover { background: #15292214; }
.dialog-item-action--armed { background: #ff5a5a33 !important; color: #ff9b9b !important; }
.dialog-item-link[aria-current="page"] ~ .dialog-item-actions .dialog-item-action--armed { background: #d6454533 !important; color: #b42318 !important; }
.dialog-item-action--error { background: #ff5a5a44 !important; color: #ffcccc !important; }
.dialog-item-action:disabled { opacity: .45; cursor: wait; }
.dialog-item-action svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dialog-item-rename-input { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 500; padding: 0; outline: none; }
.dialog-list-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-weight: 500; }
.dialog-list-date { color: #a3b4a8; font-size: 11px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.dialog-item-link[aria-current="page"] .dialog-list-date { color: #435939; }
.thread { max-width: 860px; padding: 32px 50px; margin: 0 auto; transition: transform .32s ease, opacity .32s ease; }
.messages { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.message { padding: 18px 20px; border: 1px solid #dfe5da; border-radius: 12px; background: #fff; }
.message-user { background: #f4f7ef; }
.message-body { font-size: 15px; line-height: 1.7; margin-top: 8px; overflow-wrap: break-word; min-width: 0; }
.message-body h1, .message-body h2, .message-body h3, .message-body h4, .message-body h5, .message-body h6 { margin: 24px 0 12px; color: #24352e; line-height: 1.35; }
.message-body h1 { font-size: 26px; }
.message-body h2 { font-size: 22px; }
.message-body h3 { font-size: 18px; }
.message-body ul, .message-body ol { margin: 0 0 12px; padding-left: 24px; }
.message-body li { margin: 4px 0; }
.message-body code { background: #edf1e7; padding: 2px 6px; border-radius: 4px; font-size: 13px; overflow-wrap: anywhere; }
.message-body pre { margin: 16px 0; padding: 14px 16px; background: #f4f7ef; border: 1px solid #dfe5da; border-radius: 8px; overflow-x: auto; }
.message-body pre code { display: block; padding: 0; background: transparent; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-body .document-link { color: #276342; text-decoration: underline; text-decoration-color: #90b261; text-underline-offset: 3px; cursor: pointer; overflow-wrap: anywhere; }
.message-body .document-link code { color: inherit; }
.message-body table, .document-preview-rendered table, .source-preview-rendered table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.message-body th, .message-body td, .document-preview-rendered th, .document-preview-rendered td, .source-preview-rendered th, .source-preview-rendered td { border: 1px solid #dfe5da; padding: 8px 12px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.message-body th, .document-preview-rendered th, .source-preview-rendered th { background: #f4f7ef; font-weight: 600; }
.message-body blockquote, .document-preview-rendered blockquote, .source-preview-rendered blockquote { margin: 12px 0; padding: 4px 16px; border-left: 3px solid #c9d5c0; color: #526659; }
.message-body hr, .document-preview-rendered hr, .source-preview-rendered hr { border: 0; border-top: 1px solid #dfe5da; margin: 24px 0; }
.message-note { font-size: 12px; color: #8a4a3a; margin: 8px 0 0; }
.resend { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #dfe5da; }
.resend-hint { margin: 0; font-size: 13px; line-height: 1.5; color: #8a4a3a; }
.resend-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.resend-select { min-height: 44px; padding: 6px 30px 6px 10px; border: 1px solid #c9d5c0; border-radius: 8px; background: #fff; color: #24352e; font-size: 13px; cursor: pointer; max-width: 100%; }
.resend-select:focus-visible { outline: 2px solid #375c42; outline-offset: 1px; }
.resend-button { min-height: 44px; padding: 8px 14px; border: 1px solid #c9d5c0; border-radius: 8px; background: transparent; color: #375c42; font-size: 13px; font-weight: 600; cursor: pointer; }
.resend-button:hover { background: #f4f7ef; border-color: #91a58e; }
.resend-button:focus-visible { outline: 2px solid #375c42; outline-offset: 2px; }
.selection-menu { position: fixed; z-index: 30; display: flex; padding: 4px; border: 1px solid #dfe5da; border-radius: 10px; background: #fff; box-shadow: 0 8px 24px #15292218, 0 2px 6px #1529220a; }
.selection-menu[hidden] { display: none; }
.selection-menu button { padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; color: #24352e; white-space: nowrap; }
.selection-menu button:hover { background: #f4f7ef; }
.composer-quote { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin: -8px -8px 0; border-bottom: 1px solid #e7ebe3; border-radius: 10px 10px 0 0; background: #f4f7ef; }
.composer-quote[hidden] { display: none; }
.composer-quote-icon { flex-shrink: 0; margin-top: 2px; color: #68756c; font-size: 16px; line-height: 1; }
.composer-quote-text { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; font-size: 13px; line-height: 1.55; color: #526659; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.composer-quote-clear { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; padding: 0; font-size: 18px; line-height: 1; color: #68756c; text-decoration: none; }
.composer-quote-clear:hover { background: #e5ecdf; color: #24352e; }
.composer:has(.composer-quote:not([hidden])) textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.composer { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; padding: 8px; border: 1px solid #d4dcd2; border-radius: 16px; background: #fff; box-shadow: 0 2px 8px #15292205; }
.composer:focus-within { border-color: #91a58e; box-shadow: 0 0 0 3px #375c4209; }
.composer textarea { width: 100%; min-height: 104px; border: 0; border-radius: 10px; padding: 10px 12px; font: inherit; line-height: 1.6; color: inherit; background: transparent; resize: vertical; }
.composer textarea::placeholder { color: #8a948c; }
.composer textarea:focus-visible { outline: 2px solid #375c42; outline-offset: -2px; }
.composer-toolbar { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; }
.composer input.composer-send { flex: 0 0 36px; width: 36px; height: 36px; margin-left: auto; padding: 0; border: 0; border-radius: 10px; background: #152922; color: #fff; font-size: 23px; cursor: pointer; }
.composer input.composer-send:hover { background: #2b4938; }
.assigned-model { margin: 0; color: #58675b; font-size: 12px; line-height: 1.4; }
.composer input.composer-send:disabled { opacity: .45; cursor: not-allowed; }
.composer input.composer-send:focus-visible { outline: 2px solid #375c42; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Model picker */
.model-picker { border: 0; padding: 0; margin: 0; min-width: 0; }
.model-menu > summary { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 9px; border-radius: 8px; color: #68756c; font-size: 12px; cursor: pointer; list-style: none; }
.model-menu > summary::-webkit-details-marker { display: none; }
.model-menu > summary:hover, .model-menu[open] > summary { background: #f0f3ed; color: #24352e; }
.model-menu > summary:focus-visible { outline: 2px solid #375c42; outline-offset: 2px; }
.model-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.model-chevron { flex-shrink: 0; }
.model-popover { position: absolute; z-index: 20; top: calc(100% + 8px); left: 40px; width: min(340px, calc(100% - 40px)); max-height: 360px; overflow-y: auto; overscroll-behavior: contain; padding: 14px; border: 1px solid #dfe5da; border-radius: 12px; background: #fff; box-shadow: 0 12px 36px #15292222, 0 2px 6px #1529220a; }
.model-popover:has(.model-controls:not([hidden])) { min-height: 220px; }
.model-popover-above { top: auto; bottom: calc(100% + 8px); }
.model-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; min-width: 0; }
.model-search { display: block; min-width: 0; flex: 1; padding: 6px 8px; border: 0; border-bottom: 1px solid #e7ebe3; background: transparent; color: inherit; font: inherit; font-size: 12px; }
.model-search:focus-visible { outline: none; border-bottom-color: #6e8b70; border-radius: 8px; background: #f5f7f2; box-shadow: 0 1px 0 #6e8b70; }
.provider-menu { position: relative; width: fit-content; flex-shrink: 0; }
.provider-menu > summary { display: inline-flex; align-items: center; gap: 10px; padding: 6px 9px; border-radius: 999px; color: #526659; font-size: 12px; cursor: pointer; list-style: none; }
.provider-menu > summary::-webkit-details-marker { display: none; }
.provider-menu > summary:hover, .provider-menu[open] > summary { background: #f0f4ec; }
.provider-menu > summary:focus-visible, .provider-options button:focus-visible { outline: 2px solid #78967b; outline-offset: 2px; }
.provider-options { position: absolute; top: calc(100% + 4px); left: 0; z-index: 2; min-width: 180px; padding: 5px; border: 1px solid #e2e8de; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px #15292218; }
.provider-options button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; border: 0; padding: 9px 10px; border-radius: 8px; text-align: left; background: transparent; color: #24352e; font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.provider-availability { display: inline-flex; flex-shrink: 0; align-items: center; }
.provider-options button:hover, .provider-options button[aria-pressed=true] { background: #edf3e6; }
.model-no-results { font-size: 12px; color: #68756c; padding: 8px; }
.model-picker.is-enhanced .model-provider-name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.model-popover > label { font-size: 11px; color: #68756c; }
.model-picker .model-option { position: relative; display: flex; flex-wrap: wrap; align-items: center; min-height: 48px; padding: 8px; margin: 4px 0; border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.model-option-label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; min-height: 32px; cursor: pointer; }
.model-option:has(.model-info) .model-option-label { padding-right: 32px; }
.model-info { width: 100%; }
.model-info > summary { position: absolute; top: 12px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #68756c; font-size: 15px; cursor: pointer; list-style: none; }
.model-info > summary::-webkit-details-marker { display: none; }
.model-info > summary:hover { background: #e5ecdf; color: #24352e; }
.model-info > summary:focus-visible { outline: 2px solid #375c42; outline-offset: 2px; }
.model-info p { margin: 4px 4px 6px; font-size: 12px; line-height: 1.5; color: #68756c; cursor: text; }
.model-picker.is-enhanced .model-info > p { display: none; }
.model-tooltip { position: fixed; z-index: 40; width: min(280px, calc(100vw - 24px)); margin: 0; padding: 11px 13px; border: 1px solid #dfe5da; border-radius: 10px; background: #fff; box-shadow: 0 8px 26px #15292222; color: #526659; font-size: 12px; line-height: 1.5; }
.model-option:hover { background: #f4f7ef; }
.model-option:has(input:checked) { background: #edf3e6; }
.model-option:has(input:disabled) { cursor: not-allowed; color: #7a847b; }
.model-option > span { min-width: 0; }
.model-choice { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; }
.model-name { display: block; font-weight: 500; }
.model-search-provider { display: none; margin-left: auto; color: #68756c; font-size: 11px; }
.model-picker.is-searching .model-search-provider { display: block; }
.model-picker input[type=radio] { accent-color: #152922; }
.model-picker [hidden] { display: none; }
.model-group { border: 0; margin: 6px 0 0; padding: 0; min-width: 0; }
.model-group legend { font-size: 11px; color: #68756c; padding: 0 8px; }
.model-picker select { display: block; width: 100%; min-height: 38px; margin-top: 5px; font: inherit; font-size: 13px; color: #24352e; border: 1px solid #d4dcd2; border-radius: 7px; background: #f8f9f6; padding: 8px; }
.model-picker select:focus-visible { outline: 2px solid #375c42; outline-offset: 2px; }
.model-availability { display: inline-flex; flex-shrink: 0; align-items: center; }
.availability-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c58a12; }
[data-availability=available] .availability-dot { background: #2e8b45; }
[data-availability=unavailable] .availability-dot { background: #c2473c; }
[data-provider-availability=available] .availability-dot { background: #2e8b45; }
[data-provider-availability=unavailable] .availability-dot { background: #c2473c; }
.composer input[type=submit]:disabled { opacity: .55; cursor: not-allowed; }
.model-picker input[type=radio]:focus-visible { outline: 2px solid #375c42; outline-offset: 2px; }
.model-picker [data-model-picker-target=empty] { font-size: 12px; line-height: 1.6; color: #68756c; }
.request-status { font-size: 12px; color: #68756c; margin-bottom: 12px; }
.request-outcome { display: block; padding: 10px 12px; border-radius: 8px; background: #f8ece8; color: #6a3f34; line-height: 1.5; }
.header-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; min-width: 0; }
.statistics-link { color: #375c42; font-size: 13px; }
.cancel-button { min-height: 44px; color: #802e25; }
.answer-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.answer-actions button { min-height: 36px; padding: 7px 11px; border: 1px solid #c9d5c0; border-radius: 7px; text-decoration: none; }
.answer-actions [role=status] { font-size: 13px; color: #375c42; }
.answer-reactions { display: flex; flex-wrap: wrap; gap: 6px; }
.answer-reactions form { margin: 0; }
.answer-actions .copy-answer-button,
.answer-actions .reaction-button { display: grid; place-items: center; width: 40px; min-height: 40px; padding: 0; color: #375c42; background: #fff; cursor: pointer; }
.answer-actions .copy-answer-button svg,
.answer-actions .reaction-button svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.answer-actions .copy-answer-button svg rect { fill: none; }
.answer-actions .copy-answer-button:hover,
.answer-actions .reaction-button:hover { background: #edf3e6; }
.answer-actions .reaction-button[aria-pressed=true] { background: #d8efab; border-color: #78967b; color: #152922; }
.answer-actions .copy-answer-button:focus-visible,
.answer-actions .reaction-button:focus-visible { outline: 2px solid #375c42; outline-offset: 2px; }
.request-metrics { margin: 12px 0 0; color: #56655b; font-size: 13px; }
.document-preview { width: min(860px, calc(100vw - 32px)); max-height: min(80vh, 720px); padding: 0; border: 1px solid #c9d5c0; border-radius: 14px; box-shadow: 0 24px 64px #15292244; color: #24352e; }
.document-preview::backdrop { background: #15292288; }
.document-preview-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid #e0e7dc; }
.document-preview-header > div:first-child { min-width: 0; display: grid; gap: 4px; }
.document-preview-header strong { overflow-wrap: anywhere; font: 600 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.document-preview-toolbar { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.document-preview-mode { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 8px; background: #eef2ea; }
.document-preview-mode button { min-height: 28px; padding: 4px 10px; border: 0; border-radius: 6px; background: transparent; color: #526659; font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.document-preview-mode button[aria-pressed=true] { background: #fff; color: #24352e; box-shadow: 0 1px 2px #15292214; }
.document-preview-mode button:focus-visible { outline: 2px solid #375c42; outline-offset: 2px; }
.document-preview-close { flex: 0 0 auto; padding: 0 7px; color: #526659; font-size: 26px; line-height: 1; text-decoration: none; }
.document-preview-body { max-height: min(52vh, 520px); overflow: auto; }
.document-preview pre { margin: 0; padding: 18px 22px; background: #f7f9f5; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.document-preview-rendered { padding: 18px 22px; margin: 0; }
.document-preview-rendered[hidden], .document-preview pre[hidden] { display: none; }
.document-preview-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; }
.document-preview-actions button, .document-preview-actions a { min-height: 36px; padding: 7px 11px; border: 1px solid #c9d5c0; border-radius: 7px; color: #375c42; font: inherit; text-decoration: none; }
.document-preview-actions [role=status] { font-size: 13px; color: #56655b; }
.source-preview-page { max-width: 1120px; margin: 0 auto; padding: 40px 24px; }
.source-preview-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.source-preview-page h1 { overflow-wrap: anywhere; font: 600 20px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; }
.source-preview-body { border: 1px solid #dfe5da; border-radius: 10px; background: #fff; overflow: auto; }
.source-preview-page pre { margin: 0; padding: 20px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.source-preview-rendered { padding: 20px 24px; }
.source-preview-rendered[hidden], .source-preview-page pre[hidden] { display: none; }
.source-preview-note { margin-top: 12px; color: #56655b; font-size: 13px; }
.statistics-page { max-width: 960px; margin: 40px auto; padding: 24px; line-height: 1.7; }
.statistics-table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.statistics-table th, .statistics-table td { border-bottom: 1px solid #dfe5da; padding: 12px 8px; text-align: left; }
.statistics-scroll { max-width: 100%; overflow-x: auto; }
.statistics-scroll .statistics-table { min-width: 560px; }
@media (max-width: 480px) {
  .login-page { padding: 20px 16px; }
  .login-card { padding: 28px 22px; }
  .login-card h1 { font-size: 29px; }
}

/* Private image attachments */
.composer-attachments { display: flex; flex-shrink: 0; align-items: center; }
.attach-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; font-size: 22px; cursor: pointer; color: #68756c; }
.attach-button:hover { background: #edf1e7; }
.attach-button:focus-within { outline: 2px solid #375c42; outline-offset: 3px; }
.attach-button input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.image-previews { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px; }
.image-previews:empty { display: none; }
.image-preview { position: relative; width: 112px; height: 88px; padding: 4px; border: 1px solid #a7b4a7; border-radius: 8px; background: #fff; }
.image-preview img { width: 100%; height: 100%; object-fit: contain; }
.image-preview button { position: absolute; top: -9px; right: -9px; width: 28px; height: 28px; padding: 0; border-radius: 50%; background: #152922; color: white; font-size: 20px; text-decoration: none; }
.attachment-error { color: #802e25; font-size: 13px; margin: 0; }
.message-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.message-images a { display: block; max-width: 100%; }
.message-images img { display: block; max-width: 100%; width: auto; max-height: 280px; object-fit: contain; border: 1px solid #dfe5da; border-radius: 8px; }

/* Quiet, collapsible execution history. Timers never enter an aria-live region. */
.request-progress { color: #68736e; font-size: 13px; line-height: 1.5; margin: 4px 0 24px; }
.request-progress.is-switching { color: #ad2929; }
.request-progress .progress-row.is-switch { color: #ad2929; }
.request-progress summary { cursor: pointer; width: fit-content; max-width: 100%; }
.request-progress summary:focus-visible { outline: 2px solid #68736e; outline-offset: 4px; }
.progress-row { margin: 10px 0; }
.progress-row p { margin: 2px 0 0 20px; font-size: 12px; }
.progress-indicator { display: inline-block; width: 20px; }
.progress-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-older { margin-top: 10px; }
.progress-indicator.is-active { animation: progress-pulse 1.5s ease-in-out infinite; }
@keyframes progress-pulse { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .progress-indicator.is-active, .dialog-item-thinking.is-active { animation: none; } .shell[data-controller~="mobile-shell"] aside { transition: none; } }

/* Personal provider connections and standard-profile model choice */
.personal-connection-nav { padding: 16px 24px; }
.personal-connection-nav a { color: #d8efab; text-decoration: underline; text-underline-offset: 3px; }
.personal-connection-page { width: min(100%, 760px); margin: 0 auto; padding: 48px 28px 64px; color: #24352e; }
.personal-connection-page h1 { margin: 8px 0 16px; }
.personal-connection-page > p { line-height: 1.6; color: #526659; }
.personal-connection-status { margin: 24px 0; padding: 12px 16px; border-radius: 10px; background: #edf3e6; }
.personal-connection-status p { margin: 0; }
.personal-provider-card { margin: 24px 0; padding: 24px; border: 1px solid #dfe5da; border-radius: 14px; background: #fff; overflow-wrap: anywhere; }
.personal-provider-card h2 { margin: 0 0 12px; font-size: 21px; }
.personal-provider-card p { line-height: 1.55; color: #526659; }
.personal-probe-notice { padding: 12px 14px; border-radius: 9px; background: #f3f5dc; color: #4d542b !important; }
.personal-model-list { margin: 12px 0; padding: 0; list-style: none; }
.personal-model-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 8px 0; border-bottom: 1px solid #e7ebe3; }
.personal-model-list code { font-size: 12px; overflow-wrap: anywhere; }
.personal-connection-form { display: grid; gap: 10px; margin-top: 18px; }
.personal-connection-form label, .personal-model-picker label { font-size: 13px; font-weight: 600; }
.personal-connection-form input[type=password] { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #c9d5c0; border-radius: 8px; font: inherit; }
.personal-connection-form input[type=submit], .personal-connection-revoke { min-height: 40px; width: fit-content; padding: 9px 16px; border: 0; border-radius: 8px; background: #152922; color: #fff; font: inherit; cursor: pointer; }
.personal-connection-revoke { margin-top: 18px; background: #f8ece8; color: #802e25; }
.personal-connection-form :focus-visible, .personal-connection-revoke:focus-visible, .personal-connection-nav a:focus-visible { outline: 2px solid #375c42; outline-offset: 3px; }
.personal-model-picker { display: grid; gap: 4px; flex: 1 1 220px; min-width: 0; max-width: 340px; }
.personal-model-picker select { width: 100%; min-width: 0; min-height: 36px; padding: 6px 8px; border: 1px solid #c9d5c0; border-radius: 7px; color: #24352e; background: #f8f9f6; font: inherit; font-size: 13px; }
.personal-model-picker select:focus-visible { outline: 2px solid #375c42; outline-offset: 2px; }
@media (max-width: 760px) {
  .personal-connection-page { padding: 28px 18px 48px; }
  .personal-provider-card { padding: 18px; }
  .personal-model-picker { max-width: none; }
}

/* Compact phone layout. Kept last: base rules for thread, messages and form
   controls are defined above and must stay overridden on narrow screens. */
@media (max-width: 760px) {
  .conversation-header { min-height: 0; padding: 14px 16px; gap: 10px; }
  .thread { padding: 16px; }
  .messages { gap: 12px; margin-bottom: 16px; }
  .message { padding: 14px; }
  .message-body { font-size: 14px; line-height: 1.6; }
  .message-body h1 { font-size: 20px; }
  .message-body h2 { font-size: 17px; }
  .message-body h3, .message-body h4, .message-body h5, .message-body h6 { font-size: 15px; }
  .message-body ul, .message-body ol { padding-left: 20px; }
  .message-body code { font-size: 12px; padding: 1px 4px; }
  .message-body pre { margin: 12px 0; padding: 10px 12px; }
  .message-body pre code { font-size: 12px; }
  .message-body table, .document-preview-rendered table, .source-preview-rendered table { font-size: 12px; }
  .message-body th, .message-body td, .document-preview-rendered th, .document-preview-rendered td, .source-preview-rendered th, .source-preview-rendered td { padding: 6px 8px; }
  .composer { margin-top: 16px; }
  .composer textarea { min-height: 0; font-size: 16px; }
  .composer input.composer-send { flex: 0 0 44px; width: 44px; height: 44px; }
  .attach-button { width: 44px; height: 44px; }
  .model-menu > summary { min-height: 44px; }
  .model-info > summary { width: 44px; height: 44px; top: 8px; right: 4px; }
  .model-popover { left: 0; width: 100%; }
  .model-current { max-width: calc(100vw - 190px); }
  .model-picker { flex: 1; }
  .dialog-item-actions { opacity: 1; }
  .dialog-item-action { width: 44px; height: 44px; }
  .dialog-item-link { padding-right: 96px; min-height: 48px; }
  /* 16px keeps iOS Safari from auto-zooming focused inputs out of the viewport. */
  .model-search, .resend-select, .share-url, .model-picker select, .personal-model-picker select, .dialog-item-rename-input { font-size: 16px; }
}
