.main-column:has(.penguin-chat) {
  display: flex; flex-direction: column; min-width: 0; height: 100dvh;
}
.main-column:has(.penguin-chat) > .topbar { flex: 0 0 auto; }
#view:has(.penguin-chat) { flex: 1; min-height: 0; width: 100%; max-width: none; padding: 0; }
.penguin-chat {
  --pg-bg: var(--desk-bg, #171715);
  --pg-ink: var(--desk-ink, #f4f1ea);
  --pg-muted: var(--desk-muted, #b1aea5);
  --pg-rule: var(--desk-rule, #41403b);
  --pg-accent: var(--desk-orange, #ff925a);
  --pg-width: 44rem;
  --pg-pad: clamp(1rem, 4vw, 2.4rem);
  color: var(--pg-ink); background: var(--pg-bg); min-width: 0; min-height: 0; height: 100%;
  display: grid; grid-template-rows: minmax(0,1fr);
}
.penguin-chat :is(button, summary, select, textarea) { -webkit-tap-highlight-color: transparent; }
.penguin-chat :is(button, summary, select):focus-visible { outline: 2px solid var(--pg-accent); outline-offset: 3px; }
.pg-conversation { grid-template-rows: minmax(0,1fr) auto; }
.pg-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--pg-rule) transparent; scroll-padding-block: 1rem; }
.pg-start-scroll { display: flex; flex-direction: column; padding: 2.5rem var(--pg-pad) clamp(3rem,12vh,8.5rem); }
.pg-start-content { margin: auto; width: min(100%,var(--pg-width)); }
.pg-welcome { display: grid; justify-items: center; text-align: center; margin: 0 auto clamp(1.7rem,4vh,2.5rem); }
.pg-mascot {
  position: relative; isolation: isolate; width: 72px; height: 70px;
  display: grid; place-items: center; margin-bottom: 1.15rem;
}
.pg-mascot::before, .pg-mascot::after { content: ""; position: absolute; z-index: -1; }
.pg-mascot::before {
  inset: 9px 4px 3px; border: 1px solid #ad714b; border-radius: 16px 17px 15px 15px;
  transform: rotate(8deg);
}
.pg-mascot::after {
  inset: 5px 7px; background: #eab484; border: 1px solid #f5c89e; border-radius: 14px 17px 15px 13px;
  box-shadow: 0 7px 14px #0004; transform: rotate(-8deg);
}
.pg-mascot img { grid-area: 1/1; width: 67px; height: 67px; object-fit: contain; transform: rotate(-4deg); }
.pg-welcome h1 {
  margin: 0; font-family: var(--desk-display, Georgia, 'Times New Roman', serif); font-weight: 400;
  font-size: clamp(2.5rem,4.5vw,3.8rem); line-height: 1.12; letter-spacing: -.038em; text-wrap: balance; color: var(--pg-ink);
}
.pg-form {
  position: relative; width: 100%; min-width: 0; display: grid; gap: .85rem; margin: 0;
  padding: 1.12rem .82rem .65rem 1.08rem; border: 1px solid #47443e; border-radius: 22px;
  background: #252521; box-shadow: inset 0 1px 0 #ffffff05, 0 6px 20px #0002;
  transition: border-color .18s ease, box-shadow .2s ease;
}
.pg-form:focus-within { border-color: #9b7961; box-shadow: inset 0 1px 0 #ffffff06, 0 8px 24px #0003; }
.pg-form textarea {
  display: block; resize: none; min-width: 0; width: 100%; min-height: 2rem; max-height: 155px;
  margin: 0; padding: 0 .35rem; background: transparent; color: var(--pg-ink); border: 0;
  border-radius: 0; outline: none; box-shadow: none; font: inherit; font-size: 1.02rem; line-height: 1.55;
  caret-color: var(--pg-accent); scrollbar-width: thin; scrollbar-color: var(--pg-rule) transparent;
}
.pg-form textarea:focus-visible { outline: none; }
.pg-form textarea::placeholder { color: #b3afa5; opacity: 1; }
.pg-controls, .pg-controls-end, .pg-source, .pg-tools, .pg-speaker, .pg-guide, .pg-wait { display: flex; align-items: center; }
.pg-controls { min-width: 0; gap: .18rem; }
.pg-controls-end { margin-left: auto; flex: 0 0 auto; gap: .15rem; }
.pg-source, .pg-mic, .pg-send, .pg-settings summary, .pg-tool {
  color: var(--pg-muted); border: 0; cursor: pointer; background: transparent;
  transition: background .15s ease, color .15s ease; 
}
.pg-mic,.pg-send,.pg-settings summary,.pg-tool { display: inline-grid; place-items: center; padding: 0; border-radius: 50%; }
.pg-source {
  position: relative; gap: .35rem; padding: .25rem .45rem; border-radius: 8px; min-height: 38px;
  min-width: 0; max-width: 51%; font-size: .82rem; font-weight: 520; line-height: 1.2;
}
.pg-source span { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.pg-source svg { width: 16px; height: 16px; }
.pg-source select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; cursor: pointer; }
.pg-source select :is(option,optgroup), .pg-menu select { background: #292924; color: var(--pg-ink); }
.pg-source:focus-within { outline: 2px solid var(--pg-accent); outline-offset: 1px; }
.pg-source:is(:hover,.chosen) { color: var(--pg-ink); background: #ffffff08; }
.pg-source.chosen svg { color: var(--pg-accent); }
.pg-mic,.pg-settings summary,.pg-send { width: 38px; height: 38px; }
.pg-settings > summary svg, .pg-mic svg { width: 18px; height: 18px; }
.pg-settings summary:hover,.pg-mic:hover,.pg-tool:hover,.pg-settings[open] summary { color: var(--pg-ink); background: #ffffff0d; }
.pg-mic.listening { color: var(--pg-accent); }
.pg-send { width: 39px; height: 39px; background: var(--pg-accent); color: #211910; }
.pg-send svg { width: 19px; height: 19px; }
.pg-send:disabled { background: #c39470; color: #332a22; cursor: default; }
.pg-send:not(:disabled):hover { background: #ffab77; }
.pg-send:not(:disabled):active { transform: translateY(1px); }
.pg-settings { position: relative; }
.pg-settings summary { list-style: none; }
.pg-settings summary::-webkit-details-marker { display: none; }
.pg-menu {
  position: absolute; z-index: 10; left: 0; bottom: calc(100% + 7px); width: 14rem; max-width: calc(100vw - 2.5rem);
  padding: .6rem; border-radius: 12px; border: 1px solid var(--pg-rule); background: #292924; color: var(--pg-ink);
  box-shadow: 0 12px 28px #0006;
}
.pg-menu :is(button, select, small, label) { display: block; }
.pg-menu label { padding: .35rem .45rem .5rem; color: var(--pg-muted); font-size: .82rem; }
.pg-menu :is(button, select) { width: 100%; text-align: left; font-size: .86rem; min-height: 37px; padding: .4rem .5rem; border: 0; border-radius: 6px; background: transparent; color: var(--pg-ink); }
.pg-menu select { border: 1px solid var(--pg-rule); background: #292924; margin-top: .3rem; }
.pg-menu button:hover { background: #ffffff0a; }
.pg-menu-usage { border-top: 1px solid var(--pg-rule); margin-top: .4rem; padding: .45rem .45rem .2rem; }
.pg-menu small { font-size: .75rem; line-height: 1.45; color: var(--pg-muted); }
.pg-starters { display: flex; justify-content: center; flex-wrap: wrap; gap: .45rem; margin-top: 1.05rem; }
.pg-starters button {
  min-height: 34px; display: flex; align-items: center; gap: .45rem; border-radius: 999px; padding: .34rem .7rem;
  font-size: .79rem; font-weight: 480; line-height: 1.35; color: var(--pg-muted); background: transparent; border: 1px solid var(--pg-rule);
}
.pg-starters svg { width: 14px; height: 14px; color: var(--pg-muted); }
.pg-starters button:hover { color: var(--pg-ink); background: #ffffff08; border-color: #726757; }
.pg-starters button:hover svg { color: var(--pg-accent); }
.pg-thread, .pg-compose-dock {
  width: min(100%, calc(var(--pg-width) + 2 * var(--pg-pad))); margin-inline: auto; padding-inline: var(--pg-pad);
}
.pg-thread { padding-block: 1.75rem 1.2rem; display: flex; flex-direction: column; gap: clamp(1.45rem,3vh,2.25rem); }
.pg-user {
  align-self: flex-end; max-width: 85%; padding: .72rem 1rem; color: var(--pg-ink); background: #2d2c28; 
  border: 1px solid #383732; border-radius: 17px 17px 5px 17px; line-height: 1.55; overflow-wrap: anywhere;
}
.pg-assistant { min-width: 0; }
.pg-speaker { gap: .5rem; margin: 0 0 .7rem; font-size: .85rem; }
.pg-speaker img, .pg-wait img { width: 26px; height: 26px; object-fit: contain; background: #edc5a0; border-radius: 8px; }
.pg-tools { margin-top: .55rem; align-items: flex-start; gap: .18rem; flex-wrap: wrap; }
.pg-tool { min-width: 34px; min-height: 34px; font-size: .8rem; }
.pg-tools .reply-speech { padding: 0; margin: 0; border: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; max-width: 100%; }
.pg-tools :is(.speech-listen,.speech-parts button) { background: transparent; border: 0; color: var(--pg-muted); min-height: 34px; padding: .3rem .6rem; border-radius: 8px; }
.pg-tools :is(.speech-listen,.speech-parts button):hover { background: #ffffff0c; }
.pg-tools .speech-player { max-width: min(100%,260px); }
.pg-guide,.pg-earlier {
  width: fit-content; min-height: 38px; color: var(--pg-ink); background: transparent; border: 1px solid var(--pg-rule); border-radius: 8px;
  font-size: .85rem; line-height: 1.35; padding: .4rem .75rem;
}
.pg-guide { gap: .42rem; margin-top: .8rem; }
.pg-guide svg,.pg-tool svg { width: 16px; height: 16px; }
.pg-guide svg:first-child { color: var(--pg-accent); }
.pg-earlier { margin: auto; }
.pg-guide:hover,.pg-earlier:hover { background: #ffffff09; }
.pg-wait { gap: .4rem; color: var(--pg-muted); font-size: .85rem; }
.pg-wait i { width: 4px; height: 4px; border-radius: 50%; background: var(--pg-accent); animation: pg-wait 1.1s ease-in-out infinite alternate; }
.pg-wait i:nth-last-child(2) { animation-delay: .15s; }
.pg-wait i:last-child { animation-delay: .3s; }
@keyframes pg-wait { to { opacity: .4; transform: translateY(-2px); } }
.pg-compose-dock { padding-block: .4rem max(1.1rem,env(safe-area-inset-bottom)); }
.pg-conversation .pg-form { padding-top: .85rem; gap: .4rem; }
@media (prefers-reduced-motion:no-preference) {
  .pg-mascot img { animation: pg-arrive .44s cubic-bezier(.18,.83,.26,1) both; }
  @keyframes pg-arrive { from { transform: rotate(-10deg) translateY(-5px); } to { transform: rotate(-4deg); } }
}
@media (max-width:600px) {
  .pg-start-scroll { padding-inline: 1rem; padding-bottom: max(2rem,10dvh); }
  .pg-welcome { margin-bottom: 1.65rem; }
  .pg-mascot { transform: scale(.9); margin-bottom: .8rem; }
  .pg-welcome h1 { font-size: clamp(2.15rem,8.7vw,2.8rem); }
  .pg-thread { padding-block: 1.1rem 1rem; }
  .pg-compose-dock { padding-inline: .65rem; padding-bottom: max(.65rem, env(safe-area-inset-bottom)); }
  .pg-start .pg-form { padding: .88rem .63rem .5rem .8rem; }
  .pg-form { border-radius: 17px; }
  .pg-source { max-width: 39%; }
  .pg-starters { gap: .35rem; margin-top: .85rem; }
  .pg-starters button { padding: .4rem .5rem; font-size: .76rem; gap: .28rem; }
  .pg-starters svg { width: 13px; height: 13px; }
  .pg-user { max-width: 92%; }
  .pg-settings { position: static; }
  .pg-menu { left: .5rem; bottom: 3.35rem; }
}
@media (pointer:coarse) {
  .pg-source,.pg-settings summary,.pg-send,.pg-mic,.pg-starters button { min-height: 44px; }
  .pg-settings summary,.pg-send,.pg-mic { min-width: 44px; }
}
@media (max-height:540px) {
  .pg-start-scroll { padding-top: 1rem; padding-bottom: 1rem; }
  .pg-mascot { display: none; }
  .pg-welcome { margin-bottom: 1rem; }
  .pg-start .pg-menu { max-height: 45dvh; overflow-y: auto; }
}
@media (prefers-reduced-motion:reduce) {
  .pg-wait i { animation: none; }
  .pg-form,.pg-controls button { transition: none; }
}
.surshi-rich {color:var(--desk-ink,#f8f4ec);font-size:1rem;line-height:1.68;overflow-wrap:break-word;min-width:0}
.surshi-rich>:first-child {margin-top:0}.surshi-rich>:last-child {margin-bottom:0}
.surshi-rich p,.surshi-rich ul,.surshi-rich ol {margin:.55em 0 .9em}
.surshi-rich h1,.surshi-rich h2,.surshi-rich h3,.surshi-rich h4,.surshi-rich h5,.surshi-rich h6 {color:inherit;font:650 1.07em/1.4 var(--font-ui,system-ui);margin:1.3em 0 .4em;letter-spacing:-.014em}
.surshi-rich h1,.surshi-rich h2 {font-size:1.23em}
.surshi-rich ol,.surshi-rich ul {padding-inline-start:1.55em}
.surshi-rich li+li {margin-top:.34rem}
.surshi-rich blockquote {border-left:3px solid var(--desk-orange,#ff864e);padding-left:1rem;margin:1em 0;color:var(--desk-muted,#b4b1a9)}
.surshi-rich a {text-decoration:underline;text-underline-offset:3px;color:var(--desk-orange,#ff864e)}
.surshi-rich code {font: .86em/1.5 ui-monospace,monospace;border-radius:4px;padding:.12em .3em;background:#ffffff0d}
.surshi-rich pre {white-space:pre;overflow:auto;max-width:100%;padding:.8rem 1rem;background:#0d0f10;border:1px solid var(--desk-rule,#3b3d3b);border-radius:9px}
.surshi-rich pre code {background:transparent;padding:0}
.surshi-rich .rich-table {max-width:100%;overflow-x:auto;margin:.9rem 0}
.surshi-rich table {border-collapse:collapse;min-width:min(100%,25rem);width:auto;font-size:.92em;text-align:left}
.surshi-rich th,.surshi-rich td {padding:.55rem .72rem;border-bottom:1px solid var(--desk-rule,#3b3d3b);vertical-align:top;line-height:1.45}
.surshi-rich th {font-weight:650;background:#ffffff07}
.surshi-rich hr {border:0;border-top:1px solid var(--desk-rule,#3b3d3b);margin:1.2rem 0}
.surshi-rich .math-display {display:block;max-width:100%;overflow:auto;text-align:center;margin:.8em 0;padding:.15em}
.surshi-rich math {font-family:math,'STIX Two Math','Cambria Math',serif;font-size:1.08em}
.surshi-rich .math-inline {white-space:normal}
