:root {
  color-scheme: dark;
  --bg: #191c20;
  --panel: #23272c;
  --bubble: #30363d;
  --text: #f0f2f4;
  --muted: #b9c1c9;
  --line: #424951;
  --accent: #c8dedb;
}
* { box-sizing: border-box }
body { margin: 0; color: var(--text); background: var(--bg); font: 16px/1.65 "Malgun Gothic", system-ui, sans-serif }
main { max-width: 760px; height: 100vh; height: 100dvh; margin: auto; display: flex; flex-direction: column }
header { padding: 16px 24px; border-bottom: 1px solid var(--line) }
h1 { font-size: 17px; letter-spacing: -.035em; margin: 0 }
#scroll { flex: 1; overflow: auto; min-height: 60px; padding: 16px 24px 26px }
details { color: var(--muted); font-size: 14px }
summary { width: fit-content; cursor: pointer }
details p { margin: 6px 0; padding: 10px 14px; border-radius: 10px; background: var(--panel) }
.row { position: relative; margin-top: 24px; padding-left: 36px }
.row:not(.me) .author { position: absolute; left: 1px; top: 7px; width: 23px; height: 17px; border: 1.6px solid var(--muted); border-radius: 6px }
.row:not(.me) .author::after { content: ""; position: absolute; left: 4px; bottom: -4px; width: 5px; height: 5px; border-left: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); background: var(--bg); transform: skewY(-35deg) }
.bubble { white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; font-size: 18px; line-height: 1.75 }
.final .bubble { font-size: 17px }
.row.me { display: flex; justify-content: flex-end; margin-top: 20px }
.me .bubble { max-width: 90%; padding: 9px 14px; border-radius: 15px 5px 15px 15px; background: var(--bubble); color: #dce1e6; font-size: 15px }
.me .author { position: absolute; clip-path: inset(50%) }
footer { border-top: 1px solid var(--line); padding: 12px 24px max(14px,env(safe-area-inset-bottom)); max-height: 55dvh; overflow: auto }
label { font-size: 14px; font-weight: 600 }
#sample, #status, #example { color: var(--muted); font-size: 14px; margin: 4px 0 10px }
form { display: flex; align-items: center; gap: 8px; border: 1px solid #69737d; border-radius: 16px; padding: 5px; background: var(--panel) }
form:focus-within { border-color: var(--accent) }
textarea { flex: 1; min-width: 0; max-height: 22vh; resize: none; font: inherit; border: 0; border-radius: 10px; padding: 8px; color: var(--text); background: var(--panel); caret-color: var(--accent) }
textarea::placeholder { color: #adb6bf }
button { min-height: 44px; border: 0; border-radius: 11px; padding: 9px 15px; cursor: pointer; font: inherit; font-weight: 650; background: var(--accent); color: #182521 }
button:disabled { opacity: .6 }
#error { color: #ffc2a9; font-size: 14px; margin: 6px 0 }
#error:empty, #status:empty, [hidden] { display: none !important }
#next { width: 100% }
:focus-visible { outline: 2px solid #a8dfd7; outline-offset: 2px }
@media (max-width: 550px) {
  header { padding: 11px 15px }
  #scroll { padding: 12px 15px 20px }
  footer { padding: 10px 12px max(10px,env(safe-area-inset-bottom)) }
  .row { padding-left: 31px; margin-top: 20px }
  .bubble { font-size: 17px }
  #sample { font-size: 13px }
}

#situation { white-space: pre-line }
