/* Both rooms have the same three parts: toolbar, reading area and composer. */
body.chat-workspace {
  display: flex;
  flex-direction: column;
  height: var(--chat-height, 100dvh);
}
.chat-workspace main.studio-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-block-size: 0;
  inline-size: 100%;
  padding-block: 0 8px;
}
.chat-workspace .studio-start, .chat-room {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-block-size: 0;
  min-inline-size: 0;
  inline-size: min(100%, 810px);
  margin-inline: auto;
}
.chat-room {
  --room-inset: clamp(14px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  overflow: clip;
}
.chat-heading, .chat-tools { display: flex; align-items: center; gap: 8px; }
.chat-heading {
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px var(--room-inset);
  border-block-end: 1px solid #e2e7f8;
}
.chat-heading h1 { font-size: 1.13rem; margin: 0; }
.chat-heading > .studio-coach-identity .studio-help { font-size: .75rem; }
.chat-heading .studio-coach-mark { inline-size: 40px; block-size: 40px; }
.chat-new, .chat-heading .button.secondary.studio-live-voice-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--forest);
  font-size: .81rem;
  font-weight: 600;
}
.chat-heading .button.secondary.studio-live-voice-trigger { inline-size: 44px; }
.chat-heading .studio-live-voice-trigger::after { display: none; }
.chat-heading .studio-live-voice-trigger span {
  position: absolute;
  clip-path: inset(50%);
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}
.chat-feed, .chat-room > .coach-tour {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  min-block-size: 0;
  padding: 18px var(--room-inset);
}
.chat-room > .coach-tour { align-content: start; }
.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-feed > * { flex: none; min-inline-size: 0; }
.chat-feed .studio-section-heading:has(p:empty):not(:has(:is(a, button):not([hidden]))),
.chat-feed .studio-transcript:has(.studio-welcome[hidden]):not(:has(#studio-chat-history > *, #studio-chat-pending:not([hidden]))) { display: none; }
.chat-room .studio-welcome {
  justify-items: center;
  margin-block: auto;
  text-align: center;
  gap: 10px;
  padding: 8px 4px;
}
.chat-room .studio-welcome h2 { font-size: clamp(1.25rem, 3.4vw, 1.7rem); }
.chat-room .studio-welcome p { max-inline-size: 45ch; }
.chat-room .coach-tour-link { min-block-size: 44px; }
.studio-welcome .coach-tour-link { justify-self: center; }
.chat-room:has(#studio-chat-pending:not([hidden])) .coach-tour-link { display: none; }
.chat-feed > .studio-transcript:has(.studio-welcome:not([hidden])) { margin-block: auto; }
.chat-room:has(#studio-chat-pending:not([hidden])) #studio-welcome { display: none; }
#studio-free-messages { display: grid; gap: 18px; list-style: none; padding: 0; margin: 0; }
#studio-free-messages:empty { display: none; }
.chat-room .studio-bubble {
  gap: 4px;
  inline-size: fit-content;
  max-inline-size: min(91%, 66ch);
}
.chat-room .studio-bubble-coach {
  border: 0;
  border-radius: 0;
  padding: 2px 0;
  background: transparent;
}
.chat-room .studio-bubble-learner {
  padding: 9px 16px;
  border: 0;
  border-radius: 16px 16px 16px 4px;
}
#studio-free-pending { align-self: end; }
.chat-room .studio-bubble p {
  line-height: 1.85;
  text-align: start;
  unicode-bidi: plaintext;
}
.studio-free-confirm { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.studio-free-confirm p { margin-block-end: 8px; }
.chat-room .chat-composer {
  flex: none;
  gap: 4px;
  padding: 8px var(--room-inset) max(5px, env(safe-area-inset-bottom));
  border-block-start: 1px solid #e2e7f8;
  background: var(--paper);
}
.chat-composer p:empty, .studio-free-feedback:not(:has(p:not(:empty), button:not([hidden]))) { display: none; }
.chat-entry {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 4px;
  background: #f6f7fc;
  border: 1px solid #d1d9ee;
  border-radius: 19px;
}
.chat-entry:focus-within { border-color: #465a79; box-shadow: 0 0 0 2px #465a7920; }
.chat-entry textarea {
  flex: 1;
  field-sizing: content;
  resize: none;
  max-block-size: min(7.5em, calc(var(--chat-height, 100dvh) * .22));
  min-block-size: 44px;
  padding: 9px 10px;
  border: 0;
  outline: 0;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.65;
  background: transparent;
}
.chat-entry textarea:placeholder-shown { direction: rtl; }
.chat-entry .chat-send {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  border: 0;
  border-radius: 15px;
  color: white;
  background: var(--forest);
}
.chat-send:not(:disabled):hover { background: var(--forest-hover); }
.chat-privacy { color: var(--muted); font-size: .75rem; }
.chat-privacy summary { cursor: pointer; width: fit-content; padding: 2px 6px; }
.chat-workspace .studio-footer {
  inline-size: 100%;
  padding-block: 0;
  gap: 2px 12px;
  justify-content: center;
}
.chat-workspace .studio-creator { flex-basis: auto; }
.chat-workspace.bahn-native-android main.studio-main { padding: 0; gap: 0; }
.bahn-native-android .chat-room { border: 0; border-radius: 0; }
/* The native app bar already names the selected room. */
.bahn-native-android .chat-heading h1 {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.bahn-native-android .chat-heading > .studio-coach-identity .studio-help { font-size: .85rem; font-weight: 600; }
@media (max-width: 720px) {
  .chat-workspace main.studio-main { padding-inline: 0; padding-block-end: 0; gap: 0; }
  .chat-workspace .studio-work-nav { margin: 4px 10px; }
  .chat-room { border-inline: 0; border-radius: 0; }
  .chat-heading { padding-block: 6px; gap: 4px; }
  .chat-heading .studio-coach-identity { gap: 7px; }
  .chat-room .studio-bubble-coach { max-inline-size: 98%; }
  .chat-workspace .studio-footer { font-size: .72rem; gap: 0 6px; }
}
.chat-short.chat-workspace:has(.chat-entry:focus-within) :is(.site-header, .studio-footer) { display: none; }
.chat-short .chat-heading { padding-block: 2px; }
.chat-short .chat-privacy[open] { max-block-size: 44px; overflow: auto; }


.coach-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-block: 4px;
}
.coach-starters button {
  min-block-size: 44px;
  padding: 6px 14px;
  border: 1px solid #b9c3df;
  border-radius: 22px;
  background: white;
  color: var(--forest);
  font-weight: 620;
}
.coach-starters button:hover, .coach-starters button:focus-visible { background: #eff2fc; }
.studio-work-nav button.work-link { font-family: inherit; background: transparent; border-block-start: 0; border-inline: 0; }
.work-link[aria-current="page"] { font-weight: 760; }
@media (min-width: 721px) {
  .studio-work-nav {
    justify-self: center;
    align-self: center;
    align-items: center;
    width: fit-content;
    gap: 4px;
    margin-block: 12px 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
  }
  .studio-work-nav .work-link {
    min-block-size: 44px;
    padding: 7px 16px;
    border: 0;
    border-radius: 10px;
    font-size: .94rem;
  }
  .studio-work-nav .work-link:hover { background: #eff2fc; }
  .studio-work-nav .work-link[aria-current] { background: var(--forest); color: white; }
  .chat-workspace .chat-room { box-shadow: 0 14px 40px -32px #20365fa6; }
}
@media (max-width: 720px) {
  .studio-work-nav .work-link { flex-direction: column; gap: 2px; font-size: .84rem; }
  .studio-work-nav .work-link[aria-current] { background: var(--forest); color: white; }
}
