.color-chat-main { width: min(1680px, calc(100% - 48px)); margin: 0 auto; padding: calc(var(--site-header-height) + 18px) 0 28px; }
.chat-workspace { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(380px, 1.5fr) minmax(280px, .9fr); gap: 16px; }
.chat-panel { display: flex; flex-direction: column; min-width: 0; height: clamp(584px, calc(100dvh - var(--site-header-height) - 72px), 900px); padding: 18px; border: 1px solid var(--line); border-top: 2px solid var(--ink); border-radius: 4px; background: var(--paper-light); }
.chat-panel label { display: block; margin: 0 0 5px; font-size: 11px; font-weight: 700; }
.chat-panel textarea, .chat-panel input, .chat-panel select, .chat-panel button { font: inherit; }
.chat-panel textarea, .chat-panel select, .chat-panel input[type="text"] { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: rgba(255, 255, 255, .45); font-size: 12px; line-height: 1.6; }
.chat-panel textarea { display: block; resize: none; flex: 0 0 auto; }
.chat-panel #message { height: 144px; font-size: 16px; }
.chat-panel input[aria-invalid="true"] { border-color: var(--red); }
.chat-panel input:focus-visible, .chat-panel textarea:focus-visible, .chat-panel select:focus-visible, .chat-panel button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.chat-panel select { min-height: 34px; flex: 0 0 auto; }
.chat-panel input[type="color"] { display: block; width: 34px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: transparent; cursor: pointer; }
.chat-panel .chat-note { margin: 6px 0; color: var(--muted); font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; flex: 0 0 auto; }
.chat-row { display: flex; gap: 8px; margin-bottom: 10px; flex: 0 0 auto; }
.chat-field { flex: 1 1 0; min-width: 0; }
.chat-group-field { flex: 0 0 105px; }
.chat-colors { display: flex; align-items: center; gap: 5px; }
.chat-colors input[type="color"] { flex: 0 0 34px; }
.chat-colors input[type="text"] { padding: 6px 4px; font: 11px/1.6 Consolas, monospace; height: 34px; }
.chat-color-row:has(#middleField:not([hidden])) .chat-colors { flex-wrap: wrap; }
.chat-color-row:has(#middleField:not([hidden])) input[type="color"] { width: 100%; flex-basis: 100%; height: 24px; }
.chat-panel .chat-check { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 11px; font-weight: 400; }
.chat-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--red); }
.chat-section-title { margin: 0 0 7px; font: 700 11px/1.5 "Noto Sans KR", sans-serif; }
.chat-section-title small { margin-left: 4px; color: var(--red-dark); font-size: 10px; font-weight: 400; }
.chat-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 6px; min-height: 52px; flex: 1 1 0; overflow-y: auto; padding: 3px; scrollbar-width: thin; }
.chat-panel button { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; background: transparent; font-size: 11px; cursor: pointer; }
.chat-panel button:hover { border-color: var(--red-dark); background-color: rgba(138, 45, 36, .04); }
.chat-panel button:disabled, .chat-panel select:disabled, .chat-panel input:disabled { opacity: .45; cursor: default; }
.chat-panel .chat-preset { padding: 6px; text-align: left; font-size: 10px; overflow-wrap: anywhere; }
.chat-panel .chat-preset[aria-pressed="true"] { border-color: var(--red-dark); background: rgba(138, 45, 36, .08); }
.chat-preset i { display: block; height: 6px; margin-bottom: 4px; border-radius: 2px; }
.chat-palette { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; margin-bottom: 12px; flex: 0 0 auto; }
.chat-panel .chat-swatch { width: 100%; height: 26px; min-height: 26px; border: 2px solid var(--paper-light); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); padding: 0; }
.chat-panel .chat-swatch:hover { border-color: var(--ink); }
.chat-panel .chat-color-note { min-height: 34px; margin-bottom: 0; }
.chat-color-actions { display: flex; gap: 4px; margin: 0 0 8px auto; flex: 0 0 auto; }
.chat-color-actions button { padding-inline: 7px; white-space: nowrap; }
.chat-color-actions button[aria-pressed="true"] { border-color: var(--red-dark); color: var(--paper-light); background: var(--red-dark); }
.chat-message-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; margin-bottom: 5px; flex: 0 0 auto; }
.chat-message-label label { margin: 0; }
.chat-panel .chat-text-button { min-height: 24px; padding: 0 4px; border-color: transparent; color: var(--muted); }
.chat-preview-stage { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 80px; flex: 1 1 80px; overflow-y: auto; padding: 12px; background: #0e0f0f; }
.chat-preview-message { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 18px; align-items: start; flex: 0 0 auto; width: 100%; max-width: 414px; min-width: 0; margin-block: auto; }
.chat-preview-avatar { grid-row: 1 / span 2; display: block; width: 48px; height: 48px; border-radius: 1px; color: #a6a8a4; background: #373b3a; }
.chat-preview-sender { display: flex; align-items: baseline; gap: 14px; min-width: 0; min-height: 48px; color: #999b97; font: 400 21px/1.45 "Gowun Batang", "Noto Serif KR", "Batang", serif; letter-spacing: .04em; }
.chat-preview-sender time { font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chat-preview { --chat-bubble: rgba(62, 62, 62, .78); grid-column: 2; position: relative; width: fit-content; min-width: 0; max-width: min(100%, 348px); padding: 10px 16px; color: #eee8dc; background: var(--chat-bubble); font: 400 21px/1.45 "Gowun Batang", "Noto Serif KR", "Batang", serif; letter-spacing: .025em; white-space: break-spaces; word-break: break-all; line-break: anywhere; overflow-wrap: anywhere; }
.chat-preview:empty { visibility: hidden; }
.chat-game-glyph { font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", sans-serif; font-variant-emoji: text; }
.chat-panel #output { height: 52px; font: 11px/1.7 Consolas, monospace; overflow-wrap: anywhere; }
.chat-panel .chat-primary { width: 100%; min-height: 40px; border-color: var(--red-dark); color: var(--paper-light); background: var(--red-dark); font-weight: 700; flex: 0 0 auto; }
.chat-panel .chat-primary:hover { background: var(--red); }
.chat-status { min-height: 18px; margin: 6px 0 0; color: var(--red-dark); font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; flex: 0 0 auto; }
.chat-category-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat-decorations { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-start; gap: 5px; min-height: 0; flex: 1 1 0; overflow-y: auto; margin: 10px 0; padding: 3px; scrollbar-width: thin; }
.chat-panel .chat-decoration { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 44px; max-width: 100%; min-height: 34px; padding: 5px 7px; }
.chat-decoration-symbol { max-width: 100%; font: 13px/1.4 Arial, "Noto Sans KR", sans-serif; white-space: nowrap; }
.chat-decoration small { display: none; }
.chat-decoration-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.chat-decoration-actions button { flex: 0 0 auto; }
.chat-footer { display: flex; justify-content: space-between; padding: 18px max(24px, calc((100vw - 1680px) / 2)); color: var(--paper-light); background: #171813; font-size: 13px; }
.chat-footer span { color: #c55e51; }
.color-chat-main [hidden] { display: none !important; }
@media (max-width: 1100px) {
  .chat-workspace { grid-template-columns: minmax(280px, 1fr) minmax(380px, 1.5fr); }
  .chat-decoration-panel { grid-column: 1 / -1; height: 360px; }
}
@media (max-width: 760px) {
  .color-chat-main { width: calc(100% - 32px); padding: calc(var(--site-header-height) + 16px) 0 24px; }
  .chat-workspace { display: flex; flex-direction: column; }
  .chat-panel { height: auto; padding: 18px 16px; }
  .chat-compose { order: -1; }
  .chat-panel textarea, .chat-panel select, .chat-panel input[type="text"] { font-size: 16px; }
  .chat-colors input[type="text"] { font-size: 12px; }
  .chat-group-field { flex-basis: 118px; }
  .chat-presets { max-height: 210px; flex: 0 1 auto; }
  .chat-preview-stage { min-height: 110px; max-height: 220px; flex: 0 1 auto; }
  .chat-preview-message { grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; }
  .chat-preview-avatar { width: 36px; height: 36px; }
  .chat-preview-sender { min-height: 42px; font-size: 18px; }
  .chat-preview-sender time { font-size: 16px; }
  .chat-preview { font-size: 18px; }
  .chat-decorations { max-height: 320px; flex: 0 1 auto; }
  .chat-palette .chat-swatch { height: 32px; }
}
