:root {
  color-scheme: light;
  --ink: #24281f;
  --line: #d9d9ce;
  --paper: #f6f4ee;
  --green: #354b34;
  --lime: #d5f28b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
header,
footer,
main {
  width: min(1200px, calc(100% - 9vw));
  margin: auto;
}
header {
  height: 92px;
  display: flex;
  align-items: center;
  gap: 23px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -1.4px;
}
.logo {
  width: 33px;
  height: 33px;
  background: var(--ink);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.logo i,
.dots i {
  width: 3px;
  border-radius: 10px;
  background: var(--lime);
  height: 9px;
}
.logo i:nth-child(2) {
  height: 19px;
}
.logo i:nth-child(3) {
  height: 14px;
}
.header-name {
  padding-left: 22px;
  border-left: 1px solid var(--line);
  color: #62685e;
  font-size: 14px;
}
.connection {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.connection:before,
.light {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #97988d;
}
.connection.online:before {
  background: #648442;
  box-shadow: 0 0 0 4px #dfe8d6;
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(285px, 0.85fr);
  gap: 20px;
  padding: 32px 0 26px;
}
.studio,
.dialogue {
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: clamp(450px, calc(100dvh - 295px), 780px);
  position: relative;
}
.studio {
  color: #f5f6ee;
  background: radial-gradient(
    ellipse at 50% 34%,
    #324335 0%,
    #25332a 45%,
    #1b2822 100%
  );
}
.studio-top,
.studio-bottom {
  display: flex;
  align-items: center;
  margin: 0 29px;
  min-height: 62px;
  gap: 10px;
  font-size: 13px;
}
.studio-label {
  font-weight: 550;
  color: #dce5d9;
}
.studio-bottom,
footer {
  font-family: "IBM Plex Mono", monospace;
}
.mic-setting {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: #dce5d9;
  font-size: 12px;
  cursor: pointer;
}
.mic-setting input {
  accent-color: var(--lime);
}
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 0;
  padding: 4px 20px 16px;
}
.characters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 500px, 62vh);
  min-width: 0;
  gap: clamp(10px, 1.5vw, 18px);
  border: 0;
  margin: 0 0 4px;
  padding: 0;
}
.character {
  display: block;
  position: relative;
  isolation: isolate;
  aspect-ratio: 1.23;
  border-radius: 13px;
  text-align: left;
  cursor: pointer;
  background: #252822;
  box-shadow: 0 5px 20px #13171244;
}
.character img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center 38%;
}
.character::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px #ffffff48;
  background: linear-gradient(0deg, #171713ed, #17171385 18%, transparent 51%);
}
.character:has(:checked)::after {
  box-shadow: inset 0 0 0 3px var(--lime);
}
.character:has(:focus-visible) {
  outline: 2px solid white;
  outline-offset: 4px;
}
.character input {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  appearance: none;
  margin: 0;
  width: 22px;
  height: 22px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: #17171388;
  cursor: pointer;
}
.character input:checked {
  border-color: var(--lime);
  background: var(--lime);
}
.character input:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #243020;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.character-caption {
  display: grid;
  position: absolute;
  z-index: 1;
  left: 7%;
  bottom: 7%;
  color: white;
  line-height: 1;
  text-shadow: 0 1px 4px #171713;
}
.character-caption strong {
  font-size: clamp(25px, 2.7vw, 39px);
  font-style: italic;
  font-weight: 850;
  letter-spacing: -.045em;
}
.character-caption small {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
}
@media (hover: hover) {
  .character:hover::after {
    box-shadow: inset 0 0 0 2px white;
  }
  .character:has(:checked):hover::after {
    box-shadow: inset 0 0 0 3px var(--lime);
  }
}
.stage h1 {
  font:
    400 clamp(42px, 5vw, 70px) / 1.04 Georgia,
    "PT Serif",
    serif;
  letter-spacing: -0.046em;
  margin: 12px 0 10px;
}
.stage p {
  font-size: 15px;
  line-height: 1.5;
  color: #d0d9cc;
  margin: 0 0 26px;
  max-width: 85%;
}
button {
  font: inherit;
  cursor: pointer;
}
.action {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 30px;
  background: var(--lime);
  color: #243020;
  font-size: 15px;
  font-weight: 650;
  padding: 0 23px;
  min-height: 47px;
  transition:
    background 0.15s,
    transform 0.15s;
}
.action:hover:enabled {
  background: #e1ff9f;
  transform: translateY(-1px);
}
.action:disabled {
  opacity: 0.55;
  cursor: wait;
}
.mic {
  display: block;
  width: 14px;
  height: 16px;
  position: relative;
  border: 1.6px solid currentColor;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  transform: scale(0.82);
}
.mic:before {
  content: "";
  position: absolute;
  left: 2.5px;
  top: -4px;
  width: 6px;
  height: 13px;
  border: 1.6px solid currentColor;
  border-radius: 8px;
}
.mic:after {
  content: "";
  position: absolute;
  width: 2px;
  height: 4px;
  background: currentColor;
  left: 5px;
  bottom: -5px;
}
.stop-icon {
  width: 11px;
  height: 11px;
  background: currentColor;
  border-radius: 2px;
}
.studio-bottom {
  margin-top: auto;
  border-top: 1px solid #a9b7a22c;
  min-height: 48px;
  color: #b4c1b1;
  font-size: 11px;
}
.light {
  background: #a7cb85;
}
.studio-bottom time {
  margin-left: auto;
}
.dialogue {
  background: #fcfbf7;
  border: 1px solid var(--line);
}
.dialogue-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-height: 76px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.markup-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  font-size: 12px;
  color: #465543;
  cursor: pointer;
}
.markup-toggle input {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}
#history:not(.with-markup) .speech-markup {
  display: none;
}
.speech-markup {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-left: 2px solid #bcc8a9;
  background: #f2f3eb;
}
.speech-markup dt {
  font-size: 12px;
  color: #53634d;
}
.speech-markup dd {
  margin: 2px 0 0;
  font: 13px/1.5 "IBM Plex Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.speech-markup dd + dt {
  margin-top: 8px;
}
h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.06em;
  margin: 0;
}
.reset {
  background: transparent;
  border: 1px solid var(--line);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #52614e;
}
.reset:disabled {
  opacity: 0.35;
  cursor: default;
}
#history {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 23px;
}
#empty {
  margin: auto;
  text-align: center;
}
.dots {
  width: 48px;
  height: 40px;
  background: #eeefe6;
  border-radius: 15px 15px 15px 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.dots i {
  width: 4px;
  height: 4px;
  background: #7e8e73;
}
h3 {
  font-size: 18px;
  letter-spacing: -0.04em;
  font-weight: 550;
  margin: 16px 0 7px;
}
#empty p {
  font-size: 14px;
  line-height: 1.5;
  color: #74796c;
  margin: 0;
}
.composer {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
}
.compose-line {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 8px;
  padding-left: 20px;
  background: white;
  border: 1px solid #cccec4;
  border-radius: 18px;
}
.compose-line:focus-within {
  border-color: #758b70;
}
.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 130px;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
}
.composer button {
  flex: none;
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 12px;
  background: var(--green);
  color: white;
  font-size: 15px;
  font-weight: 600;
}
.composer button:hover:enabled {
  background: #253b29;
}
.composer button:disabled {
  opacity: 0.55;
  cursor: default;
}
#sendStatus:not(:empty) {
  margin: 6px 8px 0;
  color: #535d50;
  font-size: 13px;
}
#sendStatus:empty {
  display: none;
}
.session-divider {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: #667362;
}
.entry.user p {
  white-space: pre-wrap;
}
.entry {
  font-size: 15px;
  line-height: 1.5;
}
.entry strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
  color: #69735f;
  margin-bottom: 6px;
}
.entry p {
  margin: 0;
  overflow-wrap: anywhere;
}
.entry.user {
  margin-left: 13%;
  align-self: flex-end;
  border-radius: 14px 14px 3px 14px;
  background: #ebefe2;
  padding: 10px 14px;
}
.entry.user strong {
  color: #56664b;
}
footer {
  border-top: 1px solid var(--line);
  padding: 19px 0;
  display: flex;
  justify-content: space-between;
  color: #686e61;
  font-size: 11px;
}
footer b {
  font-weight: 400;
  color: #909788;
}
button:focus-visible {
  outline: 3px solid #83a952;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  header,
  footer,
  main {
    width: calc(100% - 28px);
  }
  header {
    height: 64px;
    gap: 12px;
  }
  .header-name {
    padding-left: 12px;
    font-size: 12px;
  }
  .connection {
    font-size: 11px;
  }
  main {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 0;
  }
  .studio {
    height: auto;
    min-height: 300px;
  }
  .studio-top,
  .studio-bottom {
    margin: 0 18px;
    min-height: 42px;
  }
  .stage {
    padding: 8px 12px 20px;
  }
  .characters {
    width: min(100%, 360px);
  }
  .character {
    aspect-ratio: 1.3;
  }
  .character-caption small {
    font-size: 11px;
  }
  .stage h1 {
    font-size: 46px;
  }
  .stage p {
    font-size: 14px;
    margin-bottom: 18px;
  }
  .dialogue {
    height: clamp(220px, calc(100dvh - 505px), 370px);
  }
  .dialogue-head {
    padding: 0 18px;
    min-height: 52px;
  }
  #history {
    padding: 16px 18px;
  }
  .compose-line {
    padding-left: 14px;
    gap: 8px;
  }
  .composer button {
    padding: 0 14px;
  }

  footer {
    font-size: 9px;
  }
  .brand {
    font-size: 23px;
  }
  .logo {
    width: 29px;
    height: 29px;
  }
}
@media (max-width: 390px) {
  .header-name {
    display: none;
  }
}

footer a {
  color: inherit;
  text-underline-offset: 3px;
}
