@font-face {
  font-family: Pretendard;
  src: url("/assets/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #1b1e21;
  --field: #121517;
  --raised: #262a2e;
  --line: #3f454c;
  --text: #f3f1eb;
  --muted: #b1b6be;
  --accent: #edbd77;
  --accent-ink: #201a12;
  --radius: 16px;
  font-family: Pretendard, sans-serif;
  font-size: 18px;
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
}
button {
  background: var(--raised);
  min-height: 44px;
  padding: 9px 14px;
  font-size: 15px;
  font-weight: 600;
}
button:hover:not(:disabled) {
  background: #353a40;
  border-color: #757b83;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
input,
select,
textarea {
  background: var(--field);
  padding: 13px 14px;
  max-width: 100%;
}
input::placeholder,
textarea::placeholder {
  color: #999fa8;
}
textarea {
  resize: vertical;
  line-height: 1.65;
  width: 100%;
}
select {
  width: 100%;
  min-height: 50px;
}
p {
  line-height: 1.65;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: -1px;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 19px;
}
strong {
  font-weight: 650;
}
.hidden,
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px;
  z-index: 10;
}
.skip-link:focus {
  top: 12px;
}
.topbar {
  height: 86px;
  border-bottom: 1px solid #30353b;
  padding: 0 max(28px, calc((100vw - 1472px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  gap: 18px;
  align-items: center;
  text-decoration: none;
  font-weight: 750;
  font-size: 23px;
  letter-spacing: -0.8px;
}
.brand span {
  font-size: 14px;
  font-weight: 450;
  color: var(--muted);
  letter-spacing: 0;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
.connection {
  font-size: 14px;
  color: #c1d2be;
  display: flex;
  align-items: center;
  gap: 9px;
}
.connection:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94ba89;
}
.connection.offline {
  color: #ffb4a5;
}
.connection.offline:before {
  background: #ffb4a5;
}
main {
  max-width: 1528px;
  margin: auto;
  padding: 38px 28px 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 30px;
}
.page-heading p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 17px;
}
.collection-count {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  padding-bottom: 4px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(420px, 1fr);
  gap: 24px;
  align-items: start;
}
.studio-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.panel {
  background: var(--panel);
  border: 1px solid #343a40;
  border-radius: var(--radius);
  padding: 24px;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.panel-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.panel-heading > span {
  font-size: 14px;
  color: var(--muted);
}
.step {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid #776344;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
}
.muted,
.small {
  color: var(--muted);
  font-size: 14px;
}
.cast-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.search-field {
  flex: 1;
  min-width: 0;
  max-width: 290px;
}
.cast-filter-toggle {
  min-height: 49px;
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}
.cast-filter-toggle.has-filters,
.cast-filter-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.cast-filter-summary {
  color: var(--accent);
  font-size: 14px;
  margin: -7px 0 18px;
}
.cast-filters {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cast-filter-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cast-filter-fields label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 15px;
  min-width: 0;
}
.cast-filter-fields select {
  font-size: 16px;
}
.cast-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}
.cast-filter-footer > span {
  font-size: 14px;
  color: var(--muted);
}
.cast-filter-footer button {
  font-size: 14px;
  padding-inline: 4px;
  color: var(--accent);
}
.search-field input {
  width: 100%;
  font-size: 16px;
}
.cast-toolbar > span {
  color: var(--accent);
  font-size: 15px;
  white-space: nowrap;
}
.character-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  max-height: 524px;
  overflow: auto;
  padding: 4px;
  margin: -4px;
  scrollbar-color: #63666c transparent;
  scrollbar-width: thin;
  scroll-padding: 5px;
}
.character-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding: 7px 7px 11px;
  border: 1px solid #43494f;
  border-radius: 10px;
  background: #22262a;
  min-width: 0;
}
.character-card:hover:not(:disabled) {
  border-color: #9a9fa5;
  background: #2b3035;
}
.character-card[aria-pressed="true"] {
  border: 2px solid var(--accent);
  padding: 6px 6px 10px;
  background: #353027;
}
.character-portrait {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background: #353b41;
  color: #cbd0d4;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 2px;
}
.character-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.character-card:nth-child(3n + 2) .character-portrait {
  background: #3d3a37;
  color: #d9c9b9;
}
.character-card:nth-child(3n) .character-portrait {
  background: #303e3b;
  color: #c2d4ca;
}
.character-card strong {
  font-size: 17px;
}
.cast-check {
  position: absolute;
  top: 11px;
  right: 11px;
  border-radius: 50%;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--accent-ink);
}
.character-card[aria-pressed="true"] .cast-check {
  background: var(--accent);
}
.cast-note {
  font-size: 14px;
  color: var(--muted);
  margin-top: 19px;
}
.cast-speakers {
  margin-bottom: 18px;
}
.cast-speakers button {
  flex: 1;
}
#cast-empty {
  padding: 25px 0;
  color: var(--muted);
}
.voice-preview {
  margin-top: 22px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.preview-heading,
.preview-options,
.preview-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.preview-free {
  font-size: 14px;
  color: #c7d8bc;
}
.preview-options {
  margin: 15px 0;
}
.preview-auto {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  cursor: pointer;
  min-height: 44px;
}
.preview-auto input {
  width: 19px;
  height: 19px;
  accent-color: var(--accent);
  margin: 0;
}
.preview-speakers {
  display: flex;
  gap: 8px;
}
.preview-emotions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 17px;
}
.preview-emotions button[aria-pressed="true"],
.preview-speakers button[aria-pressed="true"],
.segmented button[aria-pressed="true"],
.preset-chips .selected {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.preview-playback {
  display: flex;
  align-items: center;
  gap: 14px;
}
.preview-toggle {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  font-size: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
}
.preview-track {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.preview-track strong {
  font-size: 18px;
}
.preview-track span {
  font-size: 14px;
  color: var(--muted);
}
.preview-seek {
  width: 100%;
  padding: 0;
  accent-color: var(--accent);
  border: none;
  min-height: 30px;
  margin: 10px 0;
}
.preview-transcript {
  font-size: 17px;
  line-height: 1.7;
  color: #d2d6db;
  background: var(--field);
  border-radius: 8px;
  padding: 17px 18px;
  min-height: 80px;
}
.preview-bottom {
  margin-top: 12px;
}
.preview-bottom span {
  font-size: 14px;
  color: var(--muted);
}
#preview-status {
  font-size: 14px;
  color: var(--accent);
  min-height: 24px;
  margin-top: 10px;
}
.text-button {
  background: transparent;
  border-color: transparent;
  color: var(--text);
  font-size: 15px;
}
.preview-bottom .text-button {
  color: var(--accent);
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.segmented {
  display: flex;
  gap: 4px;
  background: var(--field);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.segmented button {
  border-color: transparent;
  background: transparent;
  white-space: nowrap;
}
.script-input {
  min-height: 210px;
  font-size: 18px;
  line-height: 1.8;
}
.script-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tags > span {
  font-size: 14px;
  color: var(--muted);
  margin-right: 6px;
}
.tags button {
  font-size: 14px;
  padding: 7px 10px;
}
.editor-note {
  font-size: 14px;
  color: var(--muted);
  margin-top: 18px;
  line-height: 1.7;
}
.editor-note code {
  font: inherit;
  color: #dad2c5;
}
.turn-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.turn-head select {
  width: auto;
  min-width: 130px;
}
.dialogue .turn {
  margin-bottom: 18px;
}
.dialogue .script-input {
  min-height: 132px;
}
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  background: var(--raised);
}
#add-turn {
  width: 100%;
  margin-top: 15px;
}
.field-label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 11px;
}
.field-hint {
  font-size: 14px;
  color: var(--muted);
  margin: 10px 0 22px;
  line-height: 1.65;
}
.field-hint:last-child {
  margin-bottom: 0;
}
.style-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}
.style-heading .field-label {
  margin: 0 0 11px;
}
.style-heading > span {
  margin-bottom: 11px;
}
#style {
  font-size: 17px;
  min-height: 110px;
}
.preset-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.preset-chips button {
  font-size: 14px;
  padding: 8px 11px;
}
.cost-total > span {
  font-size: 15px;
  color: var(--muted);
}
.cost-total > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
}
.cost-total strong {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  order: 2;
  color: var(--muted);
}
#total-krw {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--accent);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 24px 0;
  padding: 22px 0;
  border-block: 1px solid var(--line);
  gap: 8px;
}
.metrics > div {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.metrics span {
  font-size: 14px;
  color: var(--muted);
}
.metrics strong {
  font-size: 21px;
}
.metrics small {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.cost-lines {
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.cost-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.cost-lines > div > span:first-child {
  color: var(--muted);
}
details {
  font-size: 14px;
  line-height: 1.65;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
}
summary span {
  float: right;
}
.estimate-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}
.estimate-settings label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 15px;
}
.estimate-settings p {
  font-size: 14px;
  color: var(--muted);
}
.estimate-settings input,
.estimate-settings select {
  width: 100%;
  font-size: 16px;
}
.generate {
  width: 100%;
  background: var(--accent);
  border: 0;
  color: var(--accent-ink);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  font-size: 19px;
  font-weight: 750;
  min-height: 58px;
  margin-top: 19px;
}
.generate:hover:not(:disabled),
.preview-toggle:hover:not(:disabled) {
  background: #f6cb8f;
}
.cost-disclaimer {
  font-size: 14px;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.65;
}
.format-label {
  font-size: 14px;
  color: var(--muted);
}
#audio-empty {
  padding: 24px 4px;
  text-align: center;
}
#audio-empty p {
  font-size: 18px;
}
#audio-empty > span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 9px;
}
.empty-wave {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin-bottom: 20px;
}
.empty-wave i {
  width: 3px;
  background: #6f747b;
  border-radius: 2px;
}
.result-title {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-bottom: 20px;
}
.result-title strong {
  font-size: 18px;
}
.result-title p {
  margin-top: 8px;
}
audio#player {
  width: 100%;
  height: 50px;
}
.usage-result {
  font-size: 15px;
  line-height: 1.75;
  margin-top: 18px;
}
.usage-result strong {
  display: block;
  color: var(--accent);
  margin-top: 9px;
}
.usage-result pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}
#feedback {
  font-size: 15px;
  color: #cedbc9;
  line-height: 1.65;
}
#feedback:not(:empty) {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #4d6151;
  border-radius: 8px;
}
#feedback.error {
  color: #ffb5a8;
  border-color: #8b5148;
}
.busy {
  border-color: var(--accent);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
  padding: 30px 0;
  margin-top: 22px;
  border-top: 1px solid #343a40;
}
footer > div {
  display: flex;
  gap: 20px;
}
@media (min-width: 1600px) {
  .character-grid {
    max-height: 590px;
  }
}
@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: minmax(0, 1.2fr) minmax(380px, 1fr);
    gap: 18px;
  }
  .panel {
    padding: 20px;
  }
  .character-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
  }
  .collection-count {
    display: none;
  }
  .panel-heading .small {
    display: none;
  }
  .topbar {
    padding-inline: 24px;
  }
  main {
    padding-inline: 24px;
  }
  .cast-toolbar {
    gap: 10px;
  }
  .cast-toolbar > span {
    font-size: 14px;
  }
  .search-field {
    max-width: 220px;
  }
}
@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .character-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-height: 460px;
  }
  .studio-column:first-child .result {
    order: 2;
  }
  .workspace > .studio-column {
    display: contents;
  }
  .cast-panel {
    order: 0;
  }
  .editor {
    order: 1;
  }
  .direction-panel {
    order: 2;
  }
  .estimate {
    order: 3;
  }
  .result {
    order: 4 !important;
  }
  .page-heading {
    margin-bottom: 24px;
  }
  .panel {
    padding: 24px;
  }
  .panel-heading .small {
    display: block;
  }
  .cast-toolbar > span {
    font-size: 16px;
  }
  .search-field {
    max-width: 320px;
  }
  footer {
    flex-wrap: wrap;
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 72px;
    padding: 0 18px;
    gap: 10px;
  }
  .brand {
    font-size: 20px;
  }
  .brand span {
    display: none;
  }
  .connection {
    font-size: 14px;
  }
  main {
    padding: 27px 14px 0;
  }
  h1 {
    font-size: 27px;
  }
  .page-heading p {
    font-size: 16px;
    max-width: 300px;
  }
  h2 {
    font-size: 21px;
  }
  .panel {
    padding: 20px 16px;
    border-radius: 12px;
  }
  .workspace {
    gap: 16px;
  }
  .character-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 420px;
    gap: 10px;
  }
  .character-portrait {
    font-size: 25px;
  }
  .character-card strong {
    font-size: 17px;
  }
  .cast-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .search-field {
    max-width: none;
    flex-basis: 100%;
  }
  .cast-toolbar > span {
    font-size: 15px;
  }
  .cast-speakers {
    width: 100%;
  }
  .cast-speakers button {
    font-size: 14px;
    padding-inline: 5px;
  }
  .preview-heading h3 {
    font-size: 18px;
  }
  .preview-heading {
    gap: 8px;
  }
  .preview-free {
    font-size: 14px;
  }
  .panel-heading > span.small {
    display: none;
  }
  .format-label {
    font-size: 14px;
    max-width: 92px;
    text-align: right;
    line-height: 1.5;
  }
  .script-input {
    font-size: 18px;
    min-height: 230px;
  }
  .editor-toolbar {
    gap: 7px;
  }
  .editor-toolbar > .text-button {
    padding-inline: 4px;
    font-size: 14px;
  }
  .segmented button {
    padding: 9px 11px;
  }
  .preview-transcript {
    font-size: 17px;
    padding: 14px;
  }
  .preview-bottom {
    align-items: flex-start;
  }
  .preview-bottom .text-button {
    padding-left: 0;
  }
  .preview-track strong {
    font-size: 17px;
  }
  .preview-track span {
    font-size: 14px;
  }
  .preview-playback {
    gap: 10px;
  }
  .preview-random {
    padding: 9px 10px;
    font-size: 14px;
  }
  .metrics strong {
    font-size: 20px;
  }
  #total-krw {
    font-size: 36px;
  }
  footer {
    font-size: 14px;
    line-height: 1.7;
    padding: 23px 3px;
    gap: 14px;
  }
  footer > div {
    gap: 17px;
  }
  .result-title {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
/* Keep search and the filter trigger adjacent, including on narrow screens. */
.cast-toolbar .search-field {
  flex: 1 1 140px;
  max-width: none;
}
.cast-toolbar #cast-selection {
  flex-basis: 100%;
  font-size: 15px;
}
@media (max-width: 600px) {
  .cast-filter-fields {
    gap: 10px;
  }
  .cast-filters {
    padding: 13px;
  }
  .cast-filter-fields select {
    padding-inline: 10px;
  }
}
