/* Voice Atelier: a warm, accessible presentation layer. Functional visibility
   and existing form controls remain owned by the application. */
:root {
  --atelier-ink: #41372f;
  --atelier-muted: #74695f;
  --atelier-paper: #fffdf9;
  --atelier-canvas: #f8f5ef;
  --atelier-line: #e8e0d5;
  --atelier-coral: #a84532;
  --atelier-coral-hover: #8e3729;
  --atelier-peach: #fff0e6;
  --atelier-sage: #eaf0e5;
  --atelier-green: #42634d;
  --atelier-shadow: 0 5px 24px rgba(78, 56, 35, .045);
  font-family: "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  font-size: 18px;
  color: var(--atelier-ink);
  background: var(--atelier-canvas);
  accent-color: var(--atelier-coral);
  color-scheme: light;
}
html { scroll-padding-top: 90px; }
body {
  max-width: 1660px;
  padding: 32px 44px 90px;
  color: var(--atelier-ink);
  line-height: 1.75;
  background: radial-gradient(ellipse at 95% 0%, #fbe9dc80, transparent 36%);
}
::selection { background: #f9d6c3; color: #412c22; }
button, input, textarea, select { font-family: inherit; }
small, code, pre, .muted, .tag { font-size: 16px; }
.muted { color: var(--atelier-muted); }
h1, h2, h3, h4 { color: var(--atelier-ink); letter-spacing: .025em; }
a { color: var(--atelier-coral); text-underline-offset: 4px; }
input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #70845e;
  outline-offset: 4px;
}
.masthead { gap: 15px; margin-bottom: 18px; padding: 0 0 18px; border-bottom: 1px solid var(--atelier-line); }
.brand-mark {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 20px 20px 20px 8px;
  color: #fff7ee;
  background: var(--atelier-coral);
  box-shadow: 0 4px 0 #dfb9a3;
  font-size: 42px;
}
.brand-mark svg { display: block; width: 35px; height: 35px; }
.masthead .eyebrow { margin: 0 0 3px; font-size: 16px; letter-spacing: .15em; color: #8a5b46; }
.masthead h1 { font-size: 29px; font-weight: 800; color: #44382e; line-height: 1.45; }
.masthead p { color: var(--atelier-muted); font-size: 16px; margin-top: 4px; }
.local-badge, .beauty-local {
  border: 1px solid #d4dfcd;
  background: var(--atelier-sage);
  color: var(--atelier-green);
  padding: 7px 13px;
  font-size: 16px;
  font-weight: 600;
}
#connection-panel {
  background: #fffcf6;
  border: 1px solid var(--atelier-line);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 18px;
  box-shadow: none;
}
#connection-panel > summary { color: #705b4a; font-size: 16px; }
#connection-panel section { background: transparent; max-width: 820px; }
#workspace { grid-template-columns: 192px minmax(0, 1fr); gap: 32px; }
.studio-nav {
  top: 22px;
  gap: 6px;
  padding: 14px 0;
  border: 0;
}
.nav-caption { color: #81715f; letter-spacing: .12em; font-size: 16px; padding: 6px 14px 12px; }
.studio-nav a {
  padding: 13px 15px;
  color: #695f54;
  font-size: 17px;
  border: 1px solid transparent;
  border-radius: 14px;
  line-height: 1.7;
  transition: background .16s, color .16s, border-color .16s;
}
.studio-nav a span, .nav-icon { font-size: 19px; margin-right: 8px; }
.studio-nav a:hover { color: #7e4030; background: #f3e9dd; }
.studio-nav a.active {
  background: var(--atelier-peach);
  color: #953b2c;
  border-color: #e8cdbb;
  box-shadow: 0 3px 10px #8c4e2307;
  font-weight: 800;
}
.secondary-nav { margin-top: 24px; }
.nav-note { color: #7c7165; font-size: 16px; padding: 17px 14px; line-height: 1.9; }
.studio-panel > h2, .beauty-heading h2 { color: var(--atelier-ink); font-size: 28px; font-weight: 800; margin: 2px 0 7px; }
.studio-panel > p, .beauty-heading p { color: var(--atelier-muted); font-size: 17px; }
.beauty-heading { margin-bottom: 19px; align-items: center; }
.beauty-local { border-radius: 24px; }

/* Original mascot is deliberately confined to a short welcome card. */
.atelier-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  gap: 18px;
  min-height: 192px;
  max-height: none;
  padding: 24px 30px;
  margin: 0 0 24px;
  border: 1px solid #edddca;
  border-radius: 25px;
  background: linear-gradient(112deg, #fff1e2 0%, #fff8ed 64%, #eef2e7 100%);
  overflow: hidden;
  box-shadow: var(--atelier-shadow);
}
.atelier-kicker { display: block; color: #86513d; font-size: 16px; font-weight: 700; letter-spacing: .08em; margin: 0 0 5px; }
.atelier-welcome-copy h2, .atelier-welcome-copy h3 { font-size: clamp(25px, 2.15vw, 34px); line-height: 1.45; margin: 0 0 8px; color: #51382a; }
.atelier-welcome-copy > p { color: #75604e; font-size: 17px; line-height: 1.8; margin: 0 0 12px; }
.atelier-art { height: 180px; min-width: 0; display: grid; place-items: center; }
.atelier-art img { display: block; width: 100%; height: 100%; max-height: 190px; object-fit: contain; }
.atelier-shortcuts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.atelier-shortcuts button { min-height: 42px; padding: 7px 14px; background: #fffaf3; color: #80503b; border: 1px solid #dfc8b3; font-size: 16px; box-shadow: none; }
.atelier-shortcuts button:hover { background: #f7e4d4; }
#atelier-start { background: var(--atelier-coral); color: #fffaf6; border-color: transparent; }
#atelier-start:hover { background: var(--atelier-coral-hover); }
.atelier-note { display: block; font-size: 16px; color: #6d6658; line-height: 1.8; margin: 9px 0 0; }
.beauty-steps { gap: 8px; margin-bottom: 18px; }
.beauty-steps span { background: #eeeae1; color: #736354; padding: 5px 12px; font-size: 16px; }

/* Creation is a single calm sheet; secondary actions use low emphasis. */
.workflow-card, #voice-library > section, #training, #system-monitor, #comparison {
  background: var(--atelier-paper);
  border: 1px solid var(--atelier-line);
  border-radius: 22px;
  box-shadow: var(--atelier-shadow);
}
.workflow-card { padding: 28px; margin-bottom: 24px; }
.workflow-card h3, .beauty-work-pane h3, #beauty .unified-shared h3 {
  color: #584235;
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 13px;
}
.section-hint { color: var(--atelier-muted) !important; font-size: 16px !important; margin-bottom: 16px; }
label { font-size: 17px; color: #584f45; font-weight: 600; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select {
  color: #44392f;
  border: 1px solid #dcd2c4;
  background: #fffefa;
  border-radius: 11px;
  font-size: 17px;
  min-height: 48px;
  padding: 11px 13px;
  margin: 7px 0 12px;
  box-shadow: 0 1px 2px #5c381307;
}
input::placeholder, textarea::placeholder { color: #827365; opacity: 1; }
input[type=checkbox], input[type=radio] { accent-color: var(--atelier-coral); width: 19px; height: 19px; vertical-align: middle; }
input[type=range], #beauty input[type=range] { accent-color: var(--atelier-coral); height: 26px; min-height: 26px; margin: 10px 0 12px; }
input:disabled, textarea:disabled, select:disabled { background: #f0ece5; color: #7e756a; }
label small, #beauty .beauty-settings-group small, .beauty-slider small, .beauty-switches small { color: var(--atelier-muted); font-size: 16px; }
button {
  background: var(--atelier-coral);
  color: #fffaf6;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 16px;
  min-height: 44px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
  transition: background .16s, box-shadow .16s;
}
button:hover { background: var(--atelier-coral-hover); }
button.secondary { color: #655447; background: #f3ede4; border: 1px solid #e1d6c7; }
button.secondary:hover { background: #ebe0d2; color: #533c2c; }
button.danger { background: #a44440; }
button:disabled { opacity: .52; }
#beauty .muted { color: var(--atelier-muted); font-size: 16px; }
#beauty .unified-shared { margin: 0 0 22px; padding: 0; }
#beauty .unified-shared > .grid { gap: 20px; }
.beauty-source-info { color: #7a6c5c; padding-bottom: 0; }
.beauty-source-info p { margin: 3px 0; }
#beauty .beauty-custom-presets {
  background: #f0f3e9;
  border: 1px solid #dbe3d1;
  border-radius: 14px;
  padding: 15px 18px;
  margin: 15px 0 0;
  gap: 4px 18px;
}
.beauty-custom-presets > label { color: #496048; }
.beauty-custom-presets .row button { font-size: 16px; }
#beauty .beauty-custom-presets > p { font-size: 16px; line-height: 1.8; color: #59674e; }
.beauty-work-tabs {
  gap: 5px;
  padding: 6px;
  margin: 0 0 25px;
  border: 1px solid #e5dccf;
  border-radius: 15px;
  background: #f2eee6;
  top: 8px;
  box-shadow: 0 3px 12px #63452b06;
}
.beauty-work-tabs button { background: transparent; color: #756354; border: 1px solid transparent; min-height: 48px; font-size: 18px; border-radius: 10px; padding: 9px 12px; }
.beauty-work-tabs button:hover { background: #e8dfd2; }
.beauty-work-tabs button[aria-selected=true] { color: #8c3c2c; background: #fffdfa; border-color: #e4d4c0; box-shadow: 0 2px 6px #63452b12; }
.beauty-work-tabs button:focus-visible { outline-color: #70845e; }
#beauty-text { min-height: 188px; background: #fffefb; padding: 17px 18px; font-size: 18px; line-height: 1.95; border-radius: 14px; }
.beauty-text-tools { margin-top: 4px; margin-bottom: 17px; }
.beauty-text-tools button, .beauty-text-tools span { font-size: 16px; }
.unified-example-tools { gap: 12px; margin: 8px 0 14px; }
.beauty-preset-choices { gap: 12px; }
.beauty-preset-choices label { border: 1px solid #e2d9cc; background: #fffdf8; border-radius: 14px; padding: 17px 15px; }
.beauty-preset-choices label:hover { background: #fbf3e9; border-color: #d9bda7; }
.beauty-preset-choices label:has(input:checked) { border-color: #bd7054; background: #fff1e6; box-shadow: 0 0 0 1px #bd7054; }
.beauty-preset-choices input[type=radio] { width: 19px; height: 19px; accent-color: var(--atelier-coral); }
.beauty-preset-choices strong { color: #5d4030; font-size: 18px; }
.beauty-preset-choices span { color: #756353; font-size: 16px; line-height: 1.8; }
.beauty-preset-choices em { color: #4a6746; font-size: 16px; }
.beauty-mode-row { gap: 18px; margin: 10px 0 16px; }
#beauty .beauty-timing-details { background: #f7f4ed; border-color: #e5ddce; border-radius: 14px; padding: 18px; margin-top: 22px; }
.beauty-slider { border-bottom-color: #e7dfd3; padding: 11px 0; }
#beauty output { color: #985039; font-size: 17px; }
#beauty .beauty-settings-group { border-top-color: var(--atelier-line); }
.beauty-settings-group h4 { color: #5b4435; font-size: 20px; }
.beauty-switches { gap: 17px; }
#beauty .unified-engine { background: #f1f3e9; border-color: #dce2ce; border-radius: 14px; }
#unified-direct-settings { border-top-color: #dce2ce; }
#beauty .beauty-submit {
  position: static;
  flex-wrap: wrap;
  background: #fffdf9f5;
  backdrop-filter: blur(10px);
  border-top-color: var(--atelier-line);
  padding: 15px 0 0;
  bottom: 0;
  margin-top: 23px;
  gap: 14px;
  box-shadow: none;
}
#beauty .beauty-submit > p { flex: 1 1 260px; }
.atelier-library-link { color: #705943; background: #f5eee3; border: 1px solid #deccb8; border-radius: 11px; font-size: 16px; padding: 10px 15px; min-height: 46px; white-space: nowrap; }
.atelier-library-link:hover { color: #63442c; background: #eadecd; }
#beauty-selection-summary { color: #6d5b49; font-size: 16px; }
#beauty-generate { background: var(--atelier-coral); border-radius: 13px; min-height: 52px; padding: 12px 24px; box-shadow: 0 4px 0 #773324; font-size: 18px; min-width: 190px; }
#beauty-generate:hover { background: var(--atelier-coral-hover); }
.beauty-status, #tts-progress { background: #eef2e8; border: 1px solid #d8e1cb; color: #496344; border-radius: 12px; }
.beauty-status:empty { padding: 0; border: 0; margin: 0; }
.quiet-details, .advanced-options { border-top-color: var(--atelier-line); }
#beauty details:not(.studio-modal-source) > summary { color: #6c5543; background: #f4eee5; border-color: #e1d4c4; border-radius: 11px; font-size: 17px; }
.quiet-details pre, .control-hint, .work-full-text { background: #f7f3eb; color: #70604e; border-radius: 11px; }

/* Search and playback are one library rather than a second dashboard. */
#audio-results { border-top: 1px solid var(--atelier-line); padding-top: 26px; }
#audio-results > h3 { color: #534033; font-size: 24px; margin: 0 0 12px; }
.work-filters { background: #f4f1e9; border: 1px solid #e5dece; border-radius: 16px; padding: 20px; gap: 14px 18px; }
.work-filters label { color: #625341; font-size: 16px; }
.work-filters input, .work-filters select { font-size: 16px; }
.work-filters #works-count { color: #776957; font-size: 16px; }
.work-list-table { border: 1px solid #e5dbcc; border-radius: 17px; background: #fffdf9; box-shadow: var(--atelier-shadow); }
.work-list-head { background: #eeeadd; color: #6e5c46; border-bottom-color: #e0d4c2; border-radius: 17px 17px 0 0; font-size: 16px; }
.work-list-head button { color: #69503b; background: #fffcf5; border: 1px solid #e0d2bf; border-radius: 9px; font-size: 16px; }
.work-list-head span { color: #7b6b59; }
.work-list-table #tts-history.unified-works .unified-work { border-bottom-color: #ece3d7; transition: background .16s; }
.work-list-table #tts-history.unified-works .unified-work:hover { background: #fcf7ef; }
.work-title-button { color: #904432 !important; font-size: 18px !important; }
.work-title-button:focus-visible { outline-color: #70845e; }
.unified-work .work-effects { color: #7b6b5b; font-size: 16px; }
.work-language { color: #536948; background: #eff2e8; border: 1px solid #dce3d1; border-radius: 8px; padding: 2px 8px; font-size: 16px; }
.work-preset-label { color: #6f5d4b; margin-bottom: 9px; }
.unified-work .work-time { color: #635440; }
.work-time-cell > .muted { color: #80725f; }
.job-badge { color: #6c6559; background: #eeeae2; font-size: 16px; padding: 3px 9px; }
.job-badge.completed { color: #49613e; background: #eaf0e1; }
.job-badge.running, .job-badge.queued { color: #826020; background: #fff0c9; }
.job-badge.failed, .work-error { color: #a13e36; }
.work-actions-cell .work-actions button { min-height: 43px; font-size: 16px; border-radius: 10px; }
.unified-work .studio-expand-button { color: #78614d; background: #f7f1e8; border-color: #e3d4c2; border-radius: 9px; }
.unified-work .studio-expand-button:hover { color: #75462d; background: #eee0ce; }
audio { accent-color: var(--atelier-coral); border-radius: 12px; }
.empty-state { border: 1px dashed #dccbb4; background: #fcf6ec; color: #89745c; border-radius: 13px; }
.studio-expand-button { color: #7b4630; background: #f9ebdc; border-color: #cba587; border-radius: 13px; }
.studio-expand-button:hover { color: #663a25; background: #f1dfca; border-color: #ae7e59; }
.studio-expand-icon { color: #8b6247; }
dialog.studio-modal { color: #4d4033; background: var(--atelier-paper); border: 1px solid #dbc6ad; border-radius: 22px; box-shadow: 0 28px 90px #3b2b2060; }
dialog.studio-modal::backdrop { background: #362c2594; backdrop-filter: blur(5px); }
.studio-modal-header { background: #f5eee2; border-bottom-color: #e5d6c2; padding: 21px 26px; }
.studio-modal-header h2 { color: #654a34; font-size: 23px !important; }
.studio-modal-header .studio-modal-close { color: #73583f; background: #fffaf1; border-color: #d6c2a9; border-radius: 11px; }
.studio-modal-body { padding: 25px 28px; }
.studio-modal-feedback { background: #edf2e5; border-color: #d4dfc4; color: #4f663c; }
.studio-modal-footer { background: #f8f3e9; border-top-color: #e5d6c2; }
.studio-modal-inline { border-top-color: #e5d6c2; }
.studio-modal-inline > h3 { color: #654a34; }
.work-settings-table th, .work-settings-table td { border-bottom-color: #e6ddce; }
.work-settings-table th { background: #f5eee2; color: #71573e; }
.tag { background: #edf1e6; color: #526546; border-radius: 9px; padding: 5px 10px; }
#notice { background: #fffaf1; color: #6b5139; border: 1px solid #d9b995; border-left: 4px solid #a84532; border-radius: 13px; box-shadow: 0 8px 32px #6040201a; font-size: 16px; padding: 12px 18px; }
#notice.error { background: #fff0ec; color: #923f33; border-color: #d79b90; }
.benchmark-page { max-width: 1200px; }
.benchmark-page section, .benchmark-page .card { background: var(--atelier-paper); border-color: var(--atelier-line); border-radius: 20px; box-shadow: var(--atelier-shadow); }
.benchmark-page header { gap: 20px; flex-wrap: wrap; }
.benchmark-page #status { background: var(--atelier-sage); color: var(--atelier-green); }
.benchmark-page th, .benchmark-page td { border-bottom-color: var(--atelier-line); }
.work-list-head .work-column-sort { display: inline-flex; margin: 0 4px 5px 0; min-height: 36px; padding: 5px 7px; font-size: 16px; text-align: left; }
.work-list-head .work-column-sort.work-sort-active { color: var(--atelier-coral); background: #fff0e3; border-color: #c78469; }
.masthead > .studio-expand-button { flex: 0 0 auto; width: auto; margin: 0 0 0 auto; min-height: 46px; padding: 9px 16px; gap: 9px; font-size: 17px; }
.masthead > .studio-expand-button::before { content: '?'; display: inline-grid; place-items: center; width: 23px; height: 23px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 16px; }
.masthead > .studio-expand-button .studio-expand-icon { display: none; }
.masthead > .local-badge { margin-left: 0; }
.masthead > .studio-guide-source { flex: 0 0 0; width: 0; }
.studio-guide-source dialog.studio-modal { width: calc(100vw - 28px); height: calc(100dvh - 28px); max-height: calc(100dvh - 28px); }
.studio-guide-source .studio-modal-body { background: var(--atelier-canvas); padding: 26px 32px; }
.studio-guide-source .studio-modal-footer { padding: 10px 24px; }
@media(max-width:760px) {
  .masthead { flex-wrap: wrap; }
  .masthead > .studio-expand-button { margin-left: auto; font-size: 16px; padding: 8px 12px; }
  .studio-guide-source dialog.studio-modal { width: calc(100vw - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); }
  .studio-guide-source .studio-modal-body { padding: 18px 14px; }
}

@media (min-width: 1450px) {
  .work-list-head, #tts-history.unified-works .unified-work { grid-template-columns: minmax(240px, 1.4fr) minmax(165px, .8fr) minmax(175px, .8fr) 250px; gap: 18px; padding: 20px; }
}
@media (max-width: 1250px) {
  body { padding: 26px 26px 80px; }
  #workspace { grid-template-columns: 174px minmax(0, 1fr); gap: 24px; }
  .studio-nav a { padding: 12px 11px; font-size: 16px; }
  .workflow-card { padding: 24px; }
  .atelier-welcome { grid-template-columns: minmax(0, 1fr) 185px; padding: 22px 24px; }
  .atelier-art { height: 160px; }
}
@media (max-width: 1000px) {
  #workspace { grid-template-columns: 1fr; }
  .studio-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--atelier-line); padding: 0 0 18px; }
  .nav-caption, .nav-note { display: none; }
  .studio-nav a { padding: 9px 13px; }
  .secondary-nav { margin-top: 0; }
  .atelier-welcome { grid-template-columns: minmax(0, 1fr) 190px; }
}
@media (max-width: 760px) {
  body { padding: 20px 17px 75px; }
  .masthead { padding-bottom: 21px; margin-bottom: 20px; gap: 12px; }
  .masthead h1 { font-size: 25px; }
  .masthead .eyebrow { letter-spacing: .08em; font-size: 16px; }
  .masthead p { font-size: 16px; }
  .brand-mark { flex-basis: 48px; width: 48px; height: 48px; font-size: 36px; border-radius: 16px 16px 16px 6px; }
  .masthead .local-badge { display: none; }
  .beauty-heading h2 { font-size: 25px; }
  .atelier-welcome { padding: 20px; grid-template-columns: minmax(0, 1fr) 135px; gap: 10px; border-radius: 20px; min-height: 180px; }
  .atelier-welcome-copy h2, .atelier-welcome-copy h3 { font-size: 25px; }
  .atelier-art { height: 145px; }
  .atelier-welcome-copy > p { font-size: 16px; }
  .atelier-kicker { font-size: 16px; letter-spacing: .04em; }
  .workflow-card { padding: 21px; border-radius: 18px; }
  #beauty .beauty-custom-presets { padding: 15px; }
  .beauty-work-tabs { gap: 3px; padding: 5px; border-radius: 13px; }
  .beauty-work-tabs button { font-size: 16px; padding: 9px 6px; }
  .beauty-mode-row { flex-direction: column; align-items: stretch; gap: 0; }
  .beauty-mode-row label { min-width: 0; }
  .beauty-mode-row p { margin: 0 0 12px; }
  #beauty .beauty-submit { flex-wrap: wrap; padding-top: 13px; }
  #beauty-generate { width: 100%; }
  #audio-results > h3 { font-size: 22px; }
  .work-filters { padding: 16px; }
}
@media (max-width: 520px) {
  body { padding-left: 12px; padding-right: 12px; }
  .masthead h1 { font-size: 23px; }
  .masthead .eyebrow { font-size: 16px; letter-spacing: 0; }
  .atelier-welcome { grid-template-columns: minmax(0, 1fr); padding: 20px; position: relative; }
  .atelier-art { width: 105px; height: 105px; position: absolute; top: 10px; right: 10px; opacity: .23; pointer-events: none; }
  .atelier-welcome-copy { position: relative; z-index: 1; }
  .atelier-welcome-copy h2, .atelier-welcome-copy h3 { font-size: 25px; padding-right: 35px; }
  .atelier-shortcuts { gap: 8px; }
  .atelier-shortcuts button { padding: 8px 12px; }
  .studio-nav { gap: 4px; }
  .studio-nav a { padding: 8px 10px; font-size: 16px; }
  .studio-nav a span, .nav-icon { margin-right: 4px; font-size: 17px; }
  .workflow-card { padding: 17px; }
  #beauty .beauty-custom-presets .row { gap: 8px; }
  #beauty .beauty-custom-presets .row button { flex: 1; }
  .beauty-preset-choices label { padding: 14px; }
  .beauty-heading .beauty-local { margin-top: 8px; }
  .studio-modal-header { padding: 16px; }
  .studio-modal-header h2 { font-size: 20px !important; }
  .studio-modal-body { padding: 18px 16px; }
  dialog.studio-modal { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
