#panel-playground {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: clamp(560px, calc(100dvh - 64px), 1080px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  background: #fffdf7;
}
.chat-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px clamp(14px, 2.4vw, 28px);
  border-bottom: 2px solid var(--ink); background: #ffcf55;
}
.chat-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
#pg-heading { margin: 0; font: 900 clamp(1.5rem, 2.6vw, 2.1rem)/1.08 var(--display); letter-spacing: -.045em; }
.chat-symbol, .chat-empty-icon b, .chat-empty-icon i {
  position: relative; display: inline-grid; place-content: center; flex: none;
  border: 2px solid var(--ink); border-radius: 7px 7px 7px 1px;
  color: var(--ink); background: #fff9e9; line-height: .6; font-weight: 900;
}
.chat-symbol { width: 32px; height: 27px; font-size: 1.5rem; box-shadow: 2px 2px 0 var(--ink); }
.chat-new, .chat-prompts button, .chat-feedback button {
  border: 1.5px solid var(--ink); border-radius: 6px; color: var(--ink);
  background: #fffdf4; font: 700 .83rem/1.15 system-ui, sans-serif; padding: 7px 11px; min-height: 36px;
}
.chat-new { display: inline-flex; gap: 5px; align-items: center; flex: none; box-shadow: 2px 2px 0 var(--ink); }
.chat-settings {
  display: flex; align-items: flex-start; gap: 10px 20px; flex-wrap: wrap;
  padding: 12px clamp(14px, 2.4vw, 28px);
  border-bottom: 1px solid #ddd5dc; background: #fffbef;
}
.chat-setting { flex: 1 1 145px; min-width: 0; max-width: 410px; }
.chat-setting label { display: block; color: #514451; font: 750 .74rem/1.2 system-ui, sans-serif; padding: 0; margin: 0 0 4px; }
.chat-setting select {
  display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 35px; padding: 5px 8px;
  color: var(--ink); border: 1px solid #827789; border-radius: 6px;
  box-shadow: none; background-color: #fffdf7; font: 650 .87rem/1.25 system-ui, sans-serif; text-overflow: ellipsis;
}
.chat-option-notices { padding-inline: clamp(14px, 2.4vw, 28px); }
.chat-option-notices .pg-notice { margin: 6px 0; }
.chat-log {
  flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior-y: contain;
  padding: 22px clamp(14px, 3.6vw, 50px); scrollbar-width: thin; scrollbar-color: #bbb0c8 transparent;
}
.chat-empty { min-height: 100%; display: flex; flex-flow: column; justify-content: center; align-items: center; text-align: center; gap: 9px; }
.chat-empty h3 { margin: 3px 0 0; font: 900 clamp(1.6rem, 3vw, 2.15rem)/1.1 var(--display); letter-spacing: -.04em; }
.chat-empty p { color: #5c5260; font-size: .91rem; }
.chat-empty-icon { position: relative; width: 64px; height: 51px; }
.chat-empty-icon b { position: absolute; top: 0; left: 2px; width: 43px; height: 32px; font-size: 1.95rem; background: #ffce51; transform: rotate(-5deg); }
.chat-empty-icon i { position: absolute; bottom: 4px; right: 3px; width: 38px; height: 30px; background: #dcd1ff; transform: rotate(9deg); }
.chat-prompts, .chat-feedback-actions { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; }
.chat-prompts { margin-top: 5px; }
.chat-prompts button { background: #f1edff; border-color: #c9c0d4; }
.chat-message { max-width: 820px; margin: 0 auto 20px; min-width: 0; font-size: .96rem; }
.chat-message:last-child { margin-bottom: 0; }
.chat-message-user { display: flex; flex-direction: column; align-items: flex-end; }
.chat-message-user .chat-attribution { margin: 0 3px 6px; }
.chat-attribution { color: #54475a; font-size: .75rem; font-weight: 750; }
.chat-user-text {
  max-width: min(88%, 640px); margin: 0; padding: 10px 15px; background: #eee7ff;
  color: #251c35; border: 1px solid #c4b1df; border-radius: 13px 3px 13px 13px;
  line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap;
}
.chat-assistant-head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; font-size: .85rem; }
.chat-assistant-mark {
  display: grid; place-content: center; width: 24px; height: 24px; flex: none; border: 1.5px solid var(--ink);
  border-radius: 4px; background: #ffcf55; color: var(--ink); box-shadow: 1px 1px 0 var(--ink); font: 900 .96rem/1 var(--display);
}
.chat-reply { min-width: 0; line-height: 1.55; overflow-wrap: anywhere; }
.chat-receipt { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; margin-top: 10px; color: #605865; font-size: .74rem; }
.chat-charge { padding: 3px 7px; border-radius: 5px; background: #e1f3e8; color: #22533b; font-weight: 750; }
.chat-wait { color: #62556b; font-size: .89rem; }
.chat-feedback { font-size: .88rem; }
.chat-feedback p { color: #75233b; line-height: 1.45; }
.chat-feedback-actions { justify-content: flex-start; margin-top: 8px; }
.chat-feedback button { min-height: 32px; padding: 6px 9px; }
.chat-composer { flex: none; padding: 8px clamp(12px, 2.4vw, 28px) 10px; border-top: 1px solid #e0d8e1; background: #fffdf7; }
.chat-compose-box {
  display: flex; align-items: flex-end; gap: 8px; padding: 5px 6px;
  background: #fff; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 2px 2px 0 var(--ink);
}
.chat-compose-box:focus-within { border-color: #6e4b8f; box-shadow: 2px 2px 0 #6e4b8f; }
#pg-message {
  display: block; flex: 1 1 0%; min-width: 0; max-height: 8em; min-height: 44px; height: auto; padding: 11px 4px;
  resize: none; border: none; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; line-height: 1.375;
}
#pg-message:focus-visible { outline: none; }
.chat-send { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 7px 12px; border: 1.5px solid var(--ink); border-radius: 6px; box-shadow: 1px 1px 0 var(--ink); color: var(--ink); background: var(--yellow); font-size: .88rem; font-weight: 800; white-space: nowrap; }
.chat-send span { font-size: 1.14rem; }
.chat-send:disabled { cursor: default; opacity: .58; }
.chat-attach {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 44px; min-height: 44px; padding: 6px 8px; border: 1px solid #c9c0d4; border-radius: 6px;
  background: #f4effb; color: #49365d; font: 700 .82rem/1.2 system-ui, sans-serif;
}
.chat-attach:disabled { opacity: .55; }
.chat-attachments, .chat-turn-images {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 7px; padding: 0; list-style: none;
}
.chat-attachments { max-height: 108px; overflow: auto; }
.chat-turn-images { justify-content: flex-end; max-width: 100%; }
.chat-attachment {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%;
  padding: 4px 8px 4px 4px; border: 1px solid #cfc1dc; border-radius: 7px; background: #f5f0fc;
}
.chat-attachment img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.chat-attachment-name { display: grid; min-width: 0; font: 650 .8rem/1.3 system-ui, sans-serif; }
.chat-attachment-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.chat-attachment-name small { color: #65576e; font-size: .69rem; }
.chat-attachment button {
  padding: 2px; width: 30px; height: 32px; flex: none; border: 0; border-radius: 4px;
  background: transparent; color: #514057; font: 600 1.25rem/1 system-ui, sans-serif;
}
.chat-attachment button:hover { background: #e4daed; }
.chat-image-note { margin: 0 0 7px; color: #65576e; font-size: .79rem; }
.chat-footnote, .chat-input-error { font-size: .74rem; margin-top: 7px; line-height: 1.35; }
.chat-footnote { color: #635963; }
.chat-input-error { color: #75233b; }
.chat-clear-dialog { width: min(92%, 390px); }
.chat-clear-dialog h3 { margin: 0 0 8px; font-family: var(--display); font-size: 1.5rem; }
.chat-clear-dialog p { font-size: .92rem; }
.chat-clear-dialog form > div { display: flex; gap: 8px; justify-content: flex-end; margin-top: 15px; }
@media (max-width: 760px) {
  #panel-playground { height: clamp(490px, calc(100dvh - 90px), 1000px); }
  .chat-top { padding: 12px; }
  .chat-settings { gap: 8px 10px; padding: 10px 12px; }
  .chat-setting { flex-basis: calc(50% - 6px); max-width: none; }
  .chat-log { padding: 16px 12px; }
  .chat-user-text { max-width: 93%; }
  .chat-title { gap: 7px; }
  .chat-symbol { width: 24px; height: 22px; font-size: 1.2rem; }
  .chat-empty { gap: 8px; }
  .chat-new { padding: 6px 8px; }
}
@media (max-width: 460px) {
  .chat-composer { padding-inline: 8px; }
  .chat-compose-box { gap: 4px; }
  .chat-attach span { display: none; }
  .chat-send { padding-inline: 9px; }
}
@media (max-height: 570px) { #panel-playground { min-height: 420px; height: calc(100dvh - 56px); } .chat-empty-icon { display: none; } }
