:root {
  --brand: #2f6b50;
  --brand-dark: #24583f;
  --brand-soft: #e4f1e9;
  --mint: #d8fdd2;
  --ink: #151817;
  --muted: #7b817e;
  --line: #e5e8e7;
  --surface: #ffffff;
  --surface-soft: #f5f6f6;
  --chat-canvas: #efebe2;
  --chat-text-size: 14px;
  --sidebar-width: 320px;
  --shadow: 0 12px 34px rgba(27, 40, 34, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface-soft);
}
:root[data-chat-size="0"] { --chat-text-size: 12px; }
:root[data-chat-size="1"] { --chat-text-size: 13px; }
:root[data-chat-size="2"] { --chat-text-size: 14px; }
:root[data-chat-size="3"] { --chat-text-size: 15.5px; }
:root[data-chat-size="4"] { --chat-text-size: 17px; }
:root[data-chat-size="5"] { --chat-text-size: 19px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { overflow: hidden; background: var(--surface-soft); }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 3px solid rgba(47, 107, 80, .25); outline-offset: 2px; }

.shell {
  position: relative; width: 100%; height: 100vh; height: 100dvh; display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr); overflow: hidden; background: var(--surface);
}
.sidebar {
  min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 20px;
  padding: 24px 22px 20px; border-right: 1px solid var(--line); background: var(--surface); z-index: 4;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark, .login-mark, .loading-mark, .chat-avatar {
  display: block; flex: 0 0 auto; object-fit: cover; object-position: center;
  border-radius: 50%; background: var(--brand); box-shadow: 0 5px 14px rgba(47, 107, 80, .18);
}
.brand-mark { width: 46px; height: 46px; }
.brand-copy { min-width: 0; }
.brand-copy h1 { margin: 0; color: #101312; font-size: 25px; font-weight: 800; letter-spacing: -.04em; }
.brand-copy p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-close {
  width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; margin-left: auto;
  border: 0; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 25px; line-height: 1;
}
.sidebar-close:hover { background: var(--brand-soft); color: var(--brand); }
.sidebar-resizer {
  position: absolute; top: 0; bottom: 0; left: calc(var(--sidebar-width) - 4px); z-index: 12;
  width: 8px; cursor: col-resize; touch-action: none;
}
.sidebar-resizer::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px;
  background: transparent; transition: background .15s ease;
}
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .sidebar-resizing .sidebar-resizer::after { background: var(--brand); }
.sidebar-resizing, .sidebar-resizing * { cursor: col-resize !important; user-select: none !important; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; }

.user-block {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.user-copy { min-width: 0; display: grid; gap: 2px; }
.user-copy strong, .user-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy span { color: var(--muted); font-size: 10px; }
.user-block button { border: 0; background: transparent; color: var(--brand); font-size: 10px; font-weight: 700; padding: 6px; }
.user-block button:hover { color: var(--brand-dark); }

.threads-panel { min-height: 0; flex: 0 0 auto; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-heading h2 { font-size: 15px; font-weight: 800; }
.new-thread-button {
  width: 31px; height: 31px; border: 0; border-radius: 10px; background: var(--surface-soft);
  color: var(--brand); font-size: 19px; line-height: 1;
}
.new-thread-button:hover { background: var(--brand-soft); }
.thread-list { display: grid; gap: 4px; overflow: visible; margin-top: 10px; }
.thread-list.expanded { max-height: min(42vh, 420px); overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; }
.thread-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; border-radius: 11px; }
.thread-row:hover { background: var(--surface-soft); }
.thread-row.active { background: var(--brand-soft); }
.thread-row.active::before { content: ""; width: 3px; height: 24px; position: absolute; border-radius: 3px; background: var(--brand); }
.thread-select, .thread-menu { border: 0; background: transparent; }
.thread-select { min-width: 0; overflow: hidden; display: grid; gap: 2px; padding: 8px 8px 8px 12px; color: #343937; text-align: left; }
.thread-title {
  overflow: hidden; font-family: inherit; font-size: var(--chat-text-size); font-weight: 500;
  line-height: 1.3; text-overflow: ellipsis; white-space: nowrap;
}
.thread-date { color: var(--muted); font-family: inherit; font-size: 10px; font-weight: 500; }
.thread-row.active .thread-title { color: var(--brand-dark); font-weight: 750; }
.thread-actions { position: relative; display: grid; place-items: center; }
.thread-menu { width: 30px; height: 30px; border-radius: 8px; color: var(--muted); }
.thread-menu:hover, .thread-menu[aria-expanded="true"] { background: rgba(47, 107, 80, .09); color: var(--brand); }
.thread-action-menu {
  position: absolute; top: 31px; right: 0; z-index: 30; width: 126px; padding: 5px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow);
}
.thread-action-menu button { width: 100%; border: 0; border-radius: 7px; padding: 8px 9px; background: transparent; color: var(--ink); font-size: 11px; text-align: left; }
.thread-action-menu button:hover { background: var(--surface-soft); }
.thread-action-menu button.danger { color: #a23f35; }
.thread-action-menu button.danger:hover { background: #fff0ee; }
.thread-list.expanded .thread-row:nth-last-child(-n+2) .thread-action-menu { top: auto; bottom: 31px; }
.thread-list-toggle { width: 100%; margin-top: 7px; border: 0; border-radius: 9px; padding: 8px; background: transparent; color: var(--brand); font-size: 10px; font-weight: 750; }
.thread-list-toggle:hover { background: var(--brand-soft); }

.sidebar-spacer { flex: 1; }
.privacy-copy { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.privacy-copy span { color: var(--brand); font-size: 18px; }
.privacy-copy p { margin: 0; }

.loading-screen, .login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 50% 25%, #edf5f0, var(--surface-soft) 46%);
}
.loading-card { display: grid; justify-items: center; gap: 12px; color: var(--muted); }
.loading-card p { margin: 0; font-size: 16px; font-weight: 650; }
.loading-mark { width: 58px; height: 58px; }
.loading-dots { display: flex; gap: 5px; }
.loading-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); animation: loading-pulse 1.1s infinite ease-in-out; }
.loading-dots i:nth-child(2) { animation-delay: .15s; }
.loading-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes loading-pulse { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.login-card {
  width: min(430px, 100%); padding: 40px; text-align: center; border: 1px solid var(--line);
  border-radius: 26px; background: var(--surface); box-shadow: var(--shadow);
}
.login-mark { width: 64px; height: 64px; margin: 0 auto 20px; }
.login-card h1 { font-size: 31px; font-weight: 800; letter-spacing: -.035em; }
.login-card > p:not(.eyebrow):not(.login-error) { margin: 16px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-card button { border: 0; border-radius: 14px; padding: 13px 19px; background: var(--brand); color: white; font-weight: 750; }
.login-card button:hover { background: var(--brand-dark); }
.login-error { min-height: 1.4em; margin: 13px 0 0; color: #9c3f35; font-size: 12px; }

.sidebar-scrim { display: none; }
.chat-panel { min-width: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; background: var(--chat-canvas); }
.chat-header {
  min-height: 76px; padding: 10px 20px; display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--line); background: var(--surface); box-shadow: 0 2px 10px rgba(24, 31, 27, .04); z-index: 5;
}
.sidebar-toggle {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  border: 0; border-radius: 11px; background: var(--surface-soft); color: var(--brand); font-size: 24px; line-height: 1;
}
.sidebar-toggle-expand { display: none; }
.sidebar-toggle-menu { display: inline; font-size: 17px; }
.sidebar-toggle:hover { background: var(--brand-soft); }
.chat-identity { min-width: 0; flex: 1; display: flex; align-items: center; gap: 11px; }
.chat-avatar { width: 44px; height: 44px; }
.chat-guide-copy { min-width: 0; }
.chat-header h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.connection { display: flex; align-items: center; gap: 6px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.connection-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #35a566; }
.chat-size-control {
  display: flex; align-items: center; flex: 0 0 auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft);
}
.chat-size-control button { height: 38px; border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--brand); line-height: 1; box-shadow: none; }
.chat-size-control button:not(.chat-size-value) { width: 36px; font-size: 19px; }
.chat-size-control .chat-size-value {
  width: 48px; border-right: 1px solid var(--line); border-left: 1px solid var(--line);
  color: #58615d; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.chat-size-control button:hover:not(:disabled) { background: var(--brand-soft); }
.chat-size-control button:disabled { color: #bbc2be; cursor: default; }

.messages {
  overflow-y: auto; padding: 24px clamp(18px, 5vw, 72px); scroll-behavior: smooth;
  background-color: var(--chat-canvas);
  background-image: radial-gradient(circle at 16px 16px, rgba(47,107,80,.035) 1px, transparent 1.2px);
  background-size: 48px 48px;
}
.message { display: flex; align-items: flex-end; margin-bottom: 12px; animation: rise .18s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.message.history-message { animation: none; }
.bubble {
  position: relative; max-width: min(720px, 80%); padding: 13px 17px 10px; color: #171a18;
  font-size: var(--chat-text-size); line-height: 1.48; white-space: pre-wrap; box-shadow: 0 1px 2px rgba(31, 38, 34, .09);
}
.bubble p { margin: 0 0 8px; }
.message-time { float: right; margin: .75em 0 0 .9em; color: #7c837f; font-size: 9px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.user-message { justify-content: flex-end; }
.user-message .bubble { border-radius: 22px 22px 6px 22px; background: var(--mint); color: #17231b; }
.user-message .message-time { color: #65806d; }
.guide-message .bubble { border-radius: 22px 22px 22px 6px; background: var(--surface); white-space: normal; }
.user-message .bubble::after, .guide-message .bubble::before { display: none; }
.guide-message .bubble > :first-child { margin-top: 0; }
.guide-message .bubble > :nth-last-child(2) { margin-bottom: 0; }
.guide-message .bubble > :last-child:not(.message-time) { margin-bottom: 0; }
.guide-message .bubble h1, .guide-message .bubble h2, .guide-message .bubble h3, .guide-message .bubble h4 { margin: 14px 0 7px; color: #111412; font-family: inherit; line-height: 1.24; }
.guide-message .bubble h1 { font-size: 1.28em; }
.guide-message .bubble h2 { font-size: 1.19em; }
.guide-message .bubble h3 { font-size: 1.1em; }
.guide-message .bubble ul, .guide-message .bubble ol { margin: 7px 0 9px; padding-left: 1.45em; }
.guide-message .bubble li { margin: 3px 0; }
.guide-message .bubble blockquote { margin: 9px 0; padding: 7px 12px; border-left: 3px solid var(--brand); background: #f2f6f3; color: #4e5752; }
.guide-message .bubble blockquote p { margin: 0; }
.guide-message .bubble a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.guide-message .bubble code { padding: 2px 5px; border-radius: 5px; background: #edf0ee; font-size: .88em; }
.guide-message .bubble pre { overflow-x: auto; padding: 10px 12px; border-radius: 10px; background: #202723; color: #f5f7f6; }
.guide-message .bubble pre code { padding: 0; background: transparent; color: inherit; }
.guide-message .bubble hr { border: 0; border-top: 1px solid var(--line); margin: 13px 0; }
.guide-message .bubble table { width: 100%; margin: 9px 0; border-collapse: collapse; font-size: .92em; }
.guide-message .bubble th, .guide-message .bubble td { padding: 6px 8px; border: 1px solid var(--line); text-align: left; }
.guide-message .bubble th { background: #f2f5f3; }
.typing .bubble { color: var(--muted); font-style: italic; }
.error-message .bubble { border: 1px solid #efc8c3; background: #fff4f2; color: #8e392f; }

.quick-prompts { display: flex; gap: 7px; padding: 8px clamp(16px, 4vw, 54px); overflow-x: auto; background: var(--chat-canvas); }
.quick-prompts button { flex: 0 0 auto; border: 1px solid #dfe3e1; border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.92); color: var(--brand-dark); font-size: 10px; font-weight: 700; }
.quick-prompts button:hover { border-color: #abc5b7; background: var(--brand-soft); }
.composer { display: flex; align-items: flex-end; gap: 9px; padding: 10px 16px 8px; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea {
  width: 100%; min-height: 46px; max-height: 150px; resize: none; border: 1px solid #eceeee; outline: 0;
  padding: 12px 16px; border-radius: 23px; background: var(--surface-soft); color: var(--ink);
  font-size: var(--chat-text-size); line-height: 1.42;
}
.composer textarea:focus, .composer textarea:focus-visible {
  border-color: #b5cbbf; background: var(--surface); outline: 0; box-shadow: none;
}
.composer textarea::placeholder { color: #a2a7a5; }
.composer button {
  width: 46px; height: 46px; min-height: 46px; flex: 0 0 46px; display: grid; place-items: center;
  border: 0; border-radius: 50%; padding: 0; background: var(--brand); color: white; font-size: 16px; font-weight: 800;
  box-shadow: 0 3px 8px rgba(47,107,80,.2);
}
.composer button span:first-child { display: none; }
.composer button:hover { background: var(--brand-dark); }
.composer button:disabled { opacity: .5; cursor: wait; }
.disclaimer { margin: 0; padding: 0 8px 7px; text-align: center; background: var(--surface); color: #9a9f9c; font-size: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }

@media (min-width: 801px) {
  .sidebar-toggle { display: none; }
  .shell.sidebar-collapsed .sidebar-toggle { display: grid; }
  .sidebar-toggle-expand { display: inline; }
  .sidebar-toggle-menu { display: none; }
  .shell { transition: grid-template-columns .18s ease; }
  .sidebar { transition: transform .18s ease, opacity .18s ease; }
  .shell.sidebar-resizing, .shell.sidebar-resizing .sidebar { transition: none; }
  .shell.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  .shell.sidebar-collapsed .sidebar { transform: translateX(-100%); opacity: 0; visibility: hidden; }
  .shell.sidebar-collapsed .sidebar-resizer { display: none; }
}

/* Campbell Guide explorer */
.explorer-nav { display: grid; gap: 6px; padding: 6px; border-radius: 15px; background: #f4f1e9; }
.explorer-nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-radius: 11px; background: transparent; color: #4f554f; text-align: left; font-weight: 650; }
.explorer-nav button span { width: 21px; color: #8c6e43; font-size: 18px; text-align: center; }
.explorer-nav button:hover { background: rgba(255,255,255,.7); color: var(--brand-dark); }
.explorer-nav button.active { background: #fff; color: var(--brand-dark); box-shadow: 0 4px 14px rgba(63,53,36,.08); }
.explorer-panel { min-width: 0; height: 100vh; height: 100dvh; overflow: hidden; background: #f7f3ea; }
.explorer-header { height: 78px; display: flex; align-items: center; gap: 15px; padding: 10px 28px; border-bottom: 1px solid #ded7c8; background: rgba(253,251,246,.92); }
.explorer-header .eyebrow { margin: 0 0 3px; color: #887553; font-size: 10px; }
.explorer-header h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 500; }
.explorer-cover { width: 36px; height: 52px; margin-left: auto; border-radius: 3px; object-fit: cover; box-shadow: 0 4px 10px rgba(40,33,23,.18); }
.explorer-sidebar-toggle { display: none; }
.explorer-scroll { height: calc(100vh - 78px); height: calc(100dvh - 78px); padding: 42px clamp(22px,5vw,72px) 72px; overflow: auto; scroll-behavior: smooth; }
.explorer-intro { max-width: 790px; margin: 0 auto 36px; text-align: center; }
.eyebrow { color: #8c6e43; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.explorer-intro h1 { margin: 8px 0 13px; color: #24352c; font-family: Georgia, "Times New Roman", serif; font-size: clamp(32px,4vw,52px); font-weight: 500; line-height: 1.08; letter-spacing: -.025em; }
.explorer-intro > p:last-child { max-width: 690px; margin: 0 auto; color: #667068; font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.6; }
.phase-grid { max-width: 1320px; margin: auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; align-items: start; }
.phase-column { overflow: hidden; border: 1px solid #dcd4c4; border-radius: 20px; background: rgba(255,255,255,.74); box-shadow: 0 14px 35px rgba(75,61,38,.06); }
.phase-column > header { display: flex; align-items: center; gap: 13px; padding: 21px 21px 17px; border-bottom: 1px solid #e5ded1; }
.phase-column > header > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #2f5d48; color: #fff; font-family: Georgia,serif; }
.phase-column:nth-child(2) > header > span { background: #9a7040; }.phase-column:nth-child(3) > header > span { background: #574d6d; }
.phase-column h2 { margin: 0; font-family: Georgia,serif; font-size: 23px; font-weight: 500; }.phase-column header p { margin: 3px 0 0; color: #858078; font-size: 11px; }
.stage-list { display: grid; padding: 8px; }
.stage-card { width: 100%; min-width: 0; display: grid; grid-template-columns: 28px minmax(0,1fr) 18px; align-items: start; gap: 9px; padding: 13px 11px; border: 0; border-bottom: 1px solid #eee9df; background: transparent; color: #28342e; text-align: left; }
.stage-card:last-child { border-bottom: 0; }.stage-card:hover { border-radius: 11px; background: #f3eee2; }.stage-card > span:last-child { color: #a28a65; }
.stage-number { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #cfc4b1; border-radius: 50%; color: #89734f; font-family: Georgia,serif; font-size: 12px; }
.stage-card strong { display: block; margin-bottom: 4px; font-family: Georgia,serif; font-size: 15px; font-weight: 600; }.stage-card small { display: -webkit-box; overflow: hidden; color: #777c77; font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.myth-intro { margin-bottom: 27px; }.myth-tools { max-width: 1100px; display: grid; grid-template-columns: minmax(260px,1fr) minmax(170px,.45fr) minmax(200px,.55fr); gap: 10px; margin: 0 auto 14px; }
.myth-tools input,.myth-tools select { width: 100%; height: 46px; border: 1px solid #d8d0c2; border-radius: 12px; padding: 0 13px; background: rgba(255,255,255,.85); color: #354139; font: inherit; }
.search-box { position: relative; }.search-box span[aria-hidden] { position: absolute; z-index: 1; left: 14px; top: 11px; color: #95856b; font-size: 20px; }.search-box input { padding-left: 42px; }
.library-summary { max-width: 1100px; display: flex; align-items: baseline; gap: 16px; margin: 0 auto 19px; color: #756f64; }.library-summary strong { flex: 0 0 auto; color: #344238; }.library-summary p { margin: 0; font-size: 11px; line-height: 1.4; }
.myth-grid { max-width: 1100px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin: auto; }
.myth-card { min-width: 0; min-height: 205px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px; border: 1px solid #ddd4c4; border-radius: 16px; background: rgba(255,255,255,.8); color: #3e4842; text-align: left; box-shadow: 0 8px 24px rgba(72,56,34,.04); }
.myth-card:hover { transform: translateY(-2px); border-color: #bba77f; box-shadow: 0 12px 30px rgba(72,56,34,.09); }.myth-card strong { color: #27372e; font-family: Georgia,serif; font-size: 21px; font-weight: 500; }.myth-card > span:not(.myth-meta):not(.tag-list) { display: -webkit-box; overflow: hidden; font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }.myth-meta { color: #927b56; font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }.tag { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #e9eee8; color: #53645a; font-size: 10px; }.stage-tag { background: #eee7d9; color: #745f3c; }
.empty-library { grid-column: 1/-1; padding: 55px 20px; border: 1px dashed #cfc3ae; border-radius: 16px; text-align: center; }.empty-library h3 { font-family: Georgia,serif; font-size: 24px; font-weight: 500; }.empty-library p { color: #75736d; }
.detail-dialog { width: min(680px,calc(100vw - 30px)); max-height: min(820px,calc(100vh - 30px)); padding: 0; border: 0; border-radius: 22px; color: #2b342f; background: #fcfaf5; box-shadow: 0 30px 90px rgba(25,27,24,.3); }.detail-dialog::backdrop { background: rgba(27,31,28,.52); backdrop-filter: blur(3px); }.detail-dialog article { padding: 38px 42px 42px; overflow: auto; }.detail-dialog h2 { margin: 6px 45px 13px 0; color: #263a2f; font-family: Georgia,serif; font-size: 35px; font-weight: 500; line-height: 1.12; }.detail-dialog h3 { margin: 0 0 7px; color: #435249; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }.detail-dialog section { margin: 23px 0; }.detail-dialog p,.detail-dialog li { color: #5c655f; font-family: Georgia,serif; font-size: 15px; line-height: 1.65; }.detail-lead { color: #37443d !important; font-size: 18px !important; }.aliases { margin-top: -6px; color: #8a8173 !important; font-size: 12px !important; }.critical-note,.review-note { padding: 15px 17px; border-left: 3px solid #a37a42; background: #f1eadc; }.source-note { padding-top: 16px; border-top: 1px solid #e0d9cd; color: #8a8173 !important; font-family: inherit !important; font-size: 11px !important; }.dialog-close { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eee9df; color: #6b675f; font-size: 24px; }.primary-action { min-height: 45px; padding: 0 18px; border: 0; border-radius: 11px; background: var(--brand); color: #fff; font-weight: 750; }.primary-action:hover { background: var(--brand-dark); }

@media (max-width: 1080px) { .phase-grid { grid-template-columns: 1fr; max-width: 720px; }.myth-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }

@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(330px, 88vw); z-index: 50;
    padding: 20px 18px; transform: translateX(-104%); transition: transform .22s ease; box-shadow: 12px 0 36px rgba(20,28,24,.16);
  }
  .shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-resizer { display: none; }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 40; border: 0; padding: 0;
    background: rgba(12,18,15,.32); opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .shell.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .thread-list { max-height: none; }
  .chat-panel { height: 100vh; height: 100dvh; }
  .explorer-panel { grid-column: 1; }
  .explorer-header { height: 70px; padding: 8px 13px; }
  .explorer-sidebar-toggle { display: grid; }
  .explorer-scroll { height: calc(100dvh - 70px); padding: 27px 14px 50px; }
  .explorer-intro { margin-bottom: 25px; }.explorer-intro h1 { font-size: 34px; }.explorer-intro > p:last-child { font-size: 15px; }
  .myth-tools { grid-template-columns: 1fr; }.library-summary { display: block; }.library-summary p { margin-top: 7px; }.myth-grid { grid-template-columns: 1fr; }
  .detail-dialog article { padding: 31px 22px 31px; }.detail-dialog h2 { font-size: 29px; }
  .chat-header { min-height: 70px; padding: 9px 12px; gap: 8px; }
  .chat-identity { gap: 8px; }
  .chat-avatar { width: 38px; height: 38px; }
  .chat-header h2 { font-size: 15px; }
  .connection { max-width: 138px; font-size: 9px; }
  .chat-size-control { border-radius: 10px; }
  .chat-size-control button { height: 36px; }
  .chat-size-control button:not(.chat-size-value) { width: 30px; }
  .chat-size-control .chat-size-value { width: 38px; font-size: 9px; }
  .messages { padding: 15px 12px; }
  .message { margin-bottom: 9px; }
  .bubble { max-width: 92%; padding: 11px 14px 9px; }
  .quick-prompts { padding: 7px 10px; }
  .composer { padding: 8px 10px 7px; }
  .composer textarea { min-height: 44px; padding: 11px 14px; }
  .composer button { width: 44px; height: 44px; min-height: 44px; flex-basis: 44px; }
}

@media (max-width: 360px) {
  .chat-avatar { display: none; }
  .connection { max-width: 108px; }
  .chat-size-control .chat-size-value { width: 34px; }
}
