:root {
  --page: #f6f8f6;
  --surface: #ffffff;
  --surface-soft: #f5f7f7;
  --surface-strong: #edf1f2;
  --ink: #17211f;
  --muted: #68736f;
  --line: #dce3df;
  --line-strong: #cbd6d1;
  --primary: #11594f;
  --primary-hover: #0b443d;
  --primary-soft: #e6f1ed;
  --accent: #e45c43;
  --accent-soft: #fff0ec;
  --green: #1f7655;
  --red: #b33b30;
  --shadow: 0 18px 50px rgba(27, 45, 40, 0.08);
  --drawer-shadow: -20px 0 50px rgba(20, 31, 28, 0.18);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 280px;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--page);
  background-image:
    linear-gradient(rgba(17, 89, 79, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 89, 79, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, #fdfdfb, var(--page) 600px);
  background-size: 32px 32px, 32px 32px, auto;
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(17, 89, 79, 0.17);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.hidden {
  display: none !important;
}

.mobile-only {
  display: none;
}

body[data-mobile-shared="true"] .local-control-only {
  display: none !important;
}

body[data-server-mode="true"] .mobile-access-only {
  display: none !important;
}

.shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.hero {
  padding: 5px 2px 20px;
  border-bottom: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(17, 89, 79, 0.18);
  font-size: 18px;
  font-weight: 850;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.service-settings-trigger {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}

.service-settings-trigger:hover {
  background: var(--surface);
}

.service-settings-state {
  padding-left: 7px;
  border-left: 1px solid var(--line);
  color: var(--red);
  font-size: 11px;
}

.service-settings-trigger[data-configured="true"] .service-settings-state,
.mobile-access-trigger[data-active="true"] .service-settings-state {
  color: var(--green);
}

.tools-label-mobile {
  display: none;
}

.mobile-view-tabs {
  position: sticky;
  top: 8px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(640px, 100%);
  margin: 12px auto 0;
  padding: 4px;
  border: 1px solid rgba(203, 214, 209, 0.55);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.mobile-view-tab {
  display: flex;
  min-width: 0;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.mobile-view-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.mobile-view-tab.active {
  color: var(--primary);
  border-bottom-color: transparent;
  border-radius: 13px;
  background: var(--primary-soft);
  box-shadow: none;
}

.stage-number {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #8c9894;
  font-size: 11px;
  font-weight: 850;
}

.mobile-view-tab.active .stage-number {
  background: var(--accent);
}

.stage-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.stage-copy strong,
.stage-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-copy strong {
  font-size: 13px;
}

.stage-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.process-hud {
  display: flex;
  width: min(960px, 100%);
  min-height: 42px;
  align-items: center;
  gap: 12px;
  margin: 8px auto 0;
}

.process-hud .status {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
}

.process-hud .status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #919c98;
  vertical-align: 1px;
}

.process-hud .status.good::before {
  background: var(--green);
}

.process-hud .status.bad::before {
  background: var(--red);
}

.progress-steps {
  display: none;
  flex: 0 0 250px;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 7px;
  background: var(--surface-strong);
}

body[data-busy="true"] .progress-steps {
  display: grid;
}

.step {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.step.active {
  color: var(--primary);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(27, 45, 40, 0.06);
}

.step.done {
  color: var(--green);
}

.status {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.status.good {
  color: var(--green);
}

.status.bad {
  color: var(--red);
}

.recovery-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: min(1000px, calc(100% - 56px));
  margin: 0 auto 10px;
  padding: 9px 12px;
  border: 1px solid rgba(203, 214, 209, 0.68);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.recovery-actions .text-command {
  margin-left: auto;
}

.recovery-actions.hidden {
  display: none;
}

.source-guidance {
  margin-top: 5px;
}

.text-command {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.text-command:hover {
  color: var(--primary-hover);
}

.workspace {
  margin-top: 12px;
  padding: 0 0 24px;
}

#workspace > #setup-panel,
#workspace > .result-grid,
#workspace > .result-grid > .result-card {
  display: none;
}

#workspace[data-mobile-view="setup"] > #setup-panel {
  display: block;
}

#workspace[data-mobile-view="transcript"] > .result-grid,
#workspace[data-mobile-view="result"] > .result-grid {
  display: block;
}

#workspace[data-mobile-view="transcript"] .transcript-card,
#workspace[data-mobile-view="result"] .output-card {
  display: flex;
}

.panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 0 0;
}

.panel-header h1,
.panel-header h2,
.creative-pane-heading h2 {
  margin: 0;
  line-height: 1.24;
}

.panel-header h1 {
  font-size: 30px;
  font-weight: 650;
}

.panel-header h2,
.creative-pane-heading h2 {
  font-size: 19px;
}

.panel-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
}

.panel-lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.panel-body {
  padding: 20px 0 24px;
}

#setup-panel {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 10px 32px 0;
  border: 1px solid rgba(203, 214, 209, 0.28);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 42px rgba(27, 45, 40, 0.035);
}

#setup-panel .panel-header {
  padding: 14px 0 0;
}

#setup-panel .panel-body {
  padding: 18px 0;
}

.setup-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 194px;
  gap: 36px;
  align-items: start;
}

.setup-form-column {
  min-width: 0;
}

.setup-rail {
  min-width: 0;
  padding: 4px 0 0 24px;
  border-left: 1px solid rgba(203, 214, 209, 0.62);
}

.setup-rail-heading {
  display: grid;
  gap: 5px;
}

.setup-rail-heading .panel-kicker {
  margin-bottom: 0;
}

.setup-rail-heading strong,
.setup-rail-row strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.setup-rail-heading strong.is-ready,
.setup-rail-row strong.is-ready {
  color: var(--green);
}

.setup-rail-heading strong.is-warning,
.setup-rail-row strong.is-warning {
  color: var(--red);
}

.setup-rail-heading span,
.setup-rail-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.setup-rail-list {
  display: grid;
  gap: 0;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.setup-rail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.setup-rail-row span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.setup-rail-row strong {
  text-align: right;
}

.setup-rail-note {
  margin: 16px 0 0;
}

.form-grid {
  display: grid;
  gap: 13px;
}

#process-form {
  grid-template-columns: minmax(0, 1fr) 170px;
}

.direct-writing {
  grid-column: 1 / -1;
  justify-self: start;
}

.source-switch,
.source-panel {
  grid-column: 1 / -1;
}

.source-switch {
  display: grid;
  grid-template-columns: 140px 140px;
  justify-self: start;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 14px;
  background: var(--surface-strong);
}

.source-switch-btn {
  min-height: 38px;
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
}

.source-switch-btn.active {
  color: #ffffff;
  background: var(--primary);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(27, 45, 40, 0.07);
}

.source-switch-hint {
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-panel {
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.source-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.source-panel-head label {
  margin-bottom: 0;
}

.source-panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.field-clear {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--primary);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 750;
}

.field-clear:hover {
  border-color: var(--line-strong);
  background: var(--primary-soft);
}

.source-format {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

label {
  display: block;
  margin-bottom: 6px;
  color: #26312e;
  font-size: 12px;
  font-weight: 800;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(17, 89, 79, 0.45);
  box-shadow: 0 0 0 3px rgba(17, 89, 79, 0.09);
}

.source-panel textarea {
  min-height: 150px;
  border-radius: 16px;
  padding: 18px;
  font-size: 15px;
  line-height: 1.6;
  border-color: #e1e8e3;
  background: #fbfcfa;
  box-shadow: inset 0 1px 2px rgba(27, 45, 40, 0.025);
}

.source-panel textarea[aria-invalid="true"] {
  border-color: rgba(179, 59, 48, 0.58);
  box-shadow: 0 0 0 3px rgba(179, 59, 48, 0.08);
}

.source-error {
  color: var(--red);
}

.upload-zone {
  position: relative;
  display: flex;
  min-height: 170px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--primary);
  background: #fbfcfa;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.upload-zone:hover {
  border-color: rgba(17, 89, 79, 0.56);
  background: var(--primary-soft);
}

.upload-zone:focus-within {
  outline: 3px solid var(--primary-soft);
  border-color: var(--primary);
}

.upload-zone strong { font-size: 15px; }
.upload-zone span { color: var(--muted); font-weight: 400; }

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

input[type="file"] {
  padding: 5px;
  color: var(--muted);
  background: var(--surface);
}

input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  padding: 6px 11px;
  border: 0;
  border-radius: 5px;
  color: #ffffff;
  background: var(--primary);
  cursor: pointer;
  font-weight: 750;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 18px,
    calc(100% - 11px) 18px;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
}

.field-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.field-hint.selected {
  color: var(--green);
  font-weight: 700;
}

.check-row {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-radius: 6px;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.check-row span {
  font-size: 12px;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

#process-form > .actions {
  align-items: stretch;
  margin: 0;
}

#transcribe-submit {
  width: 100%;
}

.primary {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(17, 89, 79, 0.13);
}

.primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 11px 24px rgba(17, 89, 79, 0.2);
}

.secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.secondary:hover {
  border-color: var(--line-strong);
  background: #e7ece9;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.transcription-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-column: 1 / -1;
  align-items: start;
  gap: 0 8px;
}

.transcription-settings .check-row {
  margin: 0;
}

.transcription-options {
  min-width: 0;
  color: var(--muted);
}

.transcription-options[open] {
  grid-column: 1 / -1;
}

.transcription-options summary {
  min-height: 44px;
  padding: 12px 2px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.transcription-options summary span {
  margin-left: 6px;
  font-weight: 400;
}

.transcription-options-body {
  display: grid;
  gap: 8px;
  padding: 0 2px 12px;
}

.transcription-options textarea {
  min-height: 84px;
  font-size: 14px;
}

.transcription-options .field-hint {
  margin: 0;
}

#creative-settings-anchor,
#process-form > #creative-settings {
  display: none;
}

.result-grid {
  width: 100%;
}

.result-card {
  min-height: 0;
  flex-direction: column;
}

#setup-panel .panel-body {
  padding-top: 16px;
}

.setup-rail {
  padding-left: 28px;
}

.transcript-card {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 0 28px;
  border: 1px solid rgba(203, 214, 209, 0.42);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(27, 45, 40, 0.04);
}

.result-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.transcript-source {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 750;
}

.transcript-meta {
  display: inline-block;
  margin-left: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  vertical-align: 2px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  padding: 20px 0 24px;
}

.editor-mobile-tabs {
  display: none;
}

.result-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

#transcript {
  display: block;
  min-height: 360px;
  height: auto;
  flex: 1;
  padding: 17px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1.85;
}

.editor-layout > .result-block {
  display: flex;
  flex-direction: column;
}

.transcript-toolbar {
  display: flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

.transcript-toolbar .icon-button {
  background: transparent;
}

.mobile-creative-host {
  min-width: 0;
  padding-left: 0;
  border-left: 0;
}

.creative-pane-heading {
  margin-bottom: 12px;
}

.creative-settings {
  display: grid;
  gap: 10px;
}

.creative-primary-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 360px;
}

#custom_rewrite_category {
  margin-top: 8px;
}

#rewrite_style {
  min-height: 76px;
}

.creative-advanced {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.creative-advanced summary {
  padding: 11px 2px;
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.creative-advanced-body {
  display: grid;
  gap: 10px;
  padding: 2px 0 13px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.preset-btn {
  min-height: 36px;
  padding: 7px 5px;
  border: 1px solid var(--line);
  color: var(--primary);
  background: var(--surface-soft);
  font-size: 11px;
}

.preset-btn:hover,
.preset-btn.active {
  border-color: #b9d2ca;
  background: var(--primary-soft);
}

.creative-actions {
  display: grid;
  margin-top: 12px;
}

.creative-actions .primary {
  width: 100%;
}

#mobile-generate {
  display: none;
}

.output-card {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(27, 45, 40, 0.04);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

.toolbar button:disabled {
  cursor: not-allowed;
}

.toolbar .icon-button.labeled-action {
  display: inline-flex;
  width: auto;
  min-height: 44px;
  height: auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.labeled-action svg {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
}

.output-layout {
  padding: 12px 0 26px;
}

.output-layout .result-block {
  border: 0;
  background: transparent;
}

.structured-result {
  min-height: 0;
}

.result-section {
  position: relative;
  border-bottom: 1px solid rgba(220, 227, 223, 0.72);
}

.result-edit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
}

.result-edit-toolbar button {
  flex-shrink: 0;
  min-height: 44px;
}

#result-editor {
  width: 100%;
  min-height: 340px;
  height: 52dvh;
  margin-top: 10px;
  padding: 18px;
  font-size: 16px;
  line-height: 1.85;
  resize: vertical;
}

.result-section:last-child {
  border-bottom: 0;
}

.result-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 16px 1px;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  transition: color 150ms ease, background-color 150ms ease;
}

.result-section-header:hover {
  color: var(--ink);
  background: rgba(245, 247, 247, 0.72);
}

.result-section-header::-webkit-details-marker,
.export-menu summary::-webkit-details-marker {
  display: none;
}

.result-section[open] .result-section-header {
  padding-right: 48px;
  color: var(--ink);
}

.result-section[open] .result-section-header > svg {
  transform: rotate(180deg);
}

.result-section-header > svg {
  flex: 0 0 18px;
}

.result-section-title {
  font-size: 15px;
  font-weight: 850;
}

.copy-section {
  position: absolute;
  top: 13px;
  right: 0;
  display: grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 8px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
}

.result-section-body {
  margin: 0;
  padding: 4px 1px 18px;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.95;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.placeholder-result {
  display: grid;
  min-height: 250px;
  place-items: center;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  text-align: center;
}

.empty-result-action {
  min-height: 38px;
  margin-top: 4px;
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
}

.text-command {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
}

.toolbar .icon-button,
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 10px;
  color: var(--ink);
  background: var(--surface-strong);
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}

.export-menu {
  position: relative;
}

.export-options {
  position: absolute;
  right: 0;
  top: 48px;
  z-index: 40;
  display: grid;
  width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.export-options button {
  text-align: left;
  background: transparent;
}

.export-options button:hover {
  background: var(--surface-soft);
}

.loading-mark {
  width: 26px;
  height: 26px;
  border: 2px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.utility-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  pointer-events: none;
}

.utility-drawer[aria-hidden="false"] {
  visibility: visible;
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  opacity: 0;
  background: rgba(18, 27, 25, 0.42);
  transition: opacity 180ms ease;
}

.utility-drawer[aria-hidden="false"] .drawer-backdrop {
  opacity: 1;
}

.drawer-sheet {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  width: min(560px, calc(100% - 24px));
  height: 100dvh;
  flex-direction: column;
  background: var(--surface);
  border-radius: 20px 0 0 20px;
  box-shadow: var(--drawer-shadow);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.utility-drawer[aria-hidden="false"] .drawer-sheet {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.drawer-header h2 {
  margin: 0;
  font-size: 20px;
}

.drawer-close {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface-strong);
  font-size: 23px;
  font-weight: 400;
}

.drawer-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 2px;
  margin: 10px 12px 0;
  padding: 3px;
  border-radius: 7px;
  background: var(--surface-strong);
  flex-shrink: 0;
}

.drawer-shortcuts button {
  min-width: 0;
  min-height: 36px;
  padding: 6px 5px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}

.drawer-shortcuts button:hover,
.drawer-shortcuts button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface);
}

.drawer-content {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 12px 14px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-content details {
  border-bottom: 1px solid rgba(220, 227, 223, 0.8);
}

.drawer-content summary {
  padding: 17px 12px;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.drawer-content > details[open] > summary {
  color: var(--primary);
}

.details-body {
  padding: 0 12px 16px;
}

.settings-grid {
  display: grid;
  gap: 11px;
}

.drawer-content .actions {
  margin-top: 10px;
}

.drawer-content .status {
  border-radius: 6px;
  border: 0;
  margin-top: 8px;
  background: var(--surface-soft);
}

#local-data-summary,
#browser-data-summary {
  white-space: pre-line;
}

#clear-local-data,
#clear-browser-data {
  color: var(--red);
  background: #fff3f0;
}

.push-preview {
  max-height: 240px;
  margin: 10px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.share-mode + .share-mode {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.share-mode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.share-mode-head strong {
  font-size: 13px;
}

.share-state {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 10px;
  font-weight: 800;
}

.share-state.active {
  color: var(--green);
  background: #e4f2eb;
}

.share-connection {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 14px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px dashed var(--line-strong);
}

.share-qr {
  display: block;
  width: 122px;
  height: 122px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
}

.share-info {
  min-width: 0;
}

.share-label {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.share-url {
  display: block;
  margin-bottom: 9px;
  color: var(--primary);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.share-code {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
  font-weight: 850;
}

.share-copy {
  min-height: 32px;
  padding: 6px 9px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
}

.share-stop-all {
  width: 100%;
  margin-top: 14px;
}

.history-list {
  display: grid;
  gap: 7px;
}

.history-item {
  display: grid;
  width: 100%;
  min-height: 0;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.history-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

@media (min-width: 721px) {
  #setup-panel .panel-body {
    padding-top: 16px;
  }

  .setup-body-grid {
    gap: 32px;
  }

  .setup-form-column {
    padding-right: 8px;
  }

  .source-switch {
    margin-bottom: 2px;
  }

  .source-panel {
    padding-top: 4px;
  }

  .source-panel textarea {
    min-height: 132px;
  }

  .setup-rail {
    border-left-color: rgba(203, 214, 209, 0.72);
  }
}

@media (max-width: 900px) {
  .setup-body-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .setup-rail {
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .setup-rail-heading,
  .setup-rail-list,
  .setup-rail-note {
    display: none;
  }

  .setup-rail .text-command { padding: 0; }

  .setup-rail-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    border-top: 0;
  }

  .setup-rail-row {
    display: grid;
    justify-content: stretch;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }

  .setup-rail-row strong {
    text-align: left;
  }

  .editor-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
  }

  .mobile-creative-host {
    padding-left: 16px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: 100%;
    padding: 12px 18px calc(24px + env(safe-area-inset-bottom));
  }

  .hero {
    padding: 4px 0 14px;
  }

  .topbar {
    gap: 8px;
  }

  .brand {
    flex: 1 1 auto;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .brand-copy strong {
    font-size: 13px;
  }

  .brand-copy small,
  #open-mobile-access,
  #open-service-settings,
  .tools-label-desktop {
    display: none;
  }

  .topbar-actions {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .tools-label-mobile {
    display: inline;
  }

  .service-settings-trigger {
    min-height: 34px;
    justify-content: center;
    padding: 6px 11px;
    background: var(--surface-strong);
    white-space: nowrap;
  }

  .service-settings-state {
    display: none;
  }

  .mobile-view-tabs {
    top: 5px;
    margin-top: 12px;
    padding: 4px;
  }

  .mobile-view-tab {
    min-height: 43px;
    gap: 5px;
    padding: 5px 3px;
  }

  .stage-number {
    width: 21px;
    height: 21px;
    font-size: 10px;
  }

  .stage-copy strong {
    font-size: 12px;
  }

  .stage-copy small {
    display: none;
  }

  .process-hud {
    display: grid;
    min-height: 26px;
    gap: 4px;
    margin-top: 4px;
  }

  .process-hud .status {
    display: block;
    max-height: none;
    min-height: 26px;
    padding: 3px 2px;
    overflow: visible;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
  }

  .process-hud .status.bad {
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff0ec;
  }

  .recovery-actions {
    width: 100%;
    margin: 0 0 5px;
    padding: 0;
  }

  .recovery-actions .secondary {
    flex: 1 1 190px;
    min-width: 0;
  }

  .recovery-actions .text-command {
    margin-left: 0;
  }

  .process-hud .status::before {
    display: none;
  }

  .process-hud .progress-steps {
    width: 100%;
    min-height: 30px;
    grid-template-columns: repeat(3, 1fr);
  }

  .step {
    min-height: 27px;
    font-size: 9px;
  }

  .workspace {
    margin-top: 5px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  #setup-panel,
  .transcript-card,
  .output-card {
    padding-right: 0;
    padding-left: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .setup-body-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  #process-form {
    grid-template-columns: 1fr;
  }

  .source-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .panel {
    box-shadow: none;
  }

  #setup-panel .panel-header,
  .panel-header {
    padding: 10px 0 0;
  }

  .result-card .panel-kicker {
    display: none;
  }

  #setup-panel .panel-kicker { display: none; }

  #setup-panel .panel-body,
  .panel-body,
  .output-layout {
    padding: 16px 0;
  }

  .setup-rail {
    display: block;
    padding: 0;
    border: 0;
  }

  .setup-rail .text-command {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    margin: 2px 0 0;
    padding: 13px 14px;
    border: 1px solid rgba(203, 214, 209, 0.72);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 6px 18px rgba(27, 45, 40, 0.035);
  }

  .setup-rail .text-command {
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
  }

  .setup-rail .text-command svg {
    width: 17px;
    height: 17px;
  }

  .panel-header h1 {
    font-size: 24px;
  }

  .panel-header h2,
  .creative-pane-heading h2 {
    font-size: 18px;
  }

  .panel-lead {
    font-size: 12px;
  }

  #process-form {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .source-switch,
  .source-panel,
  #process-form > .actions {
    grid-column: auto;
  }

  .source-switch {
    grid-template-columns: 1fr 1fr;
    justify-self: stretch;
  }

  .source-switch-hint {
    display: none;
  }

  .source-panel {
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .source-panel textarea {
    min-height: 128px;
    padding: 14px;
    background: var(--surface);
  }

  .source-guidance {
    font-size: 12px;
  }

  .upload-zone { min-height: 146px; }
  .direct-writing { justify-self: center; }

  .check-row {
    min-height: 44px;
    margin-top: 1px;
    padding: 8px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #transcribe-submit {
    min-height: 48px;
  }

  .editor-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 0 18px;
  }

  .editor-mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    border-radius: 6px;
    background: var(--surface-strong);
  }

  .editor-mobile-tabs button {
    min-height: 37px;
    padding: 6px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
  }

  .editor-mobile-tabs button.active {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 2px 9px rgba(27, 45, 40, 0.06);
  }

  .editor-layout[data-editor-pane="transcript"] .mobile-creative-host,
  .editor-layout[data-editor-pane="creative"] > .result-block,
  .editor-layout[data-editor-pane="creative"] > .editor-next-action {
    display: none;
  }

  .editor-layout[data-editor-pane="creative"] .mobile-creative-host {
    display: block;
  }

  #transcript {
    min-height: 180px;
    height: min(360px, max(180px, calc(100dvh - 470px)));
    flex: none;
    padding: 14px;
  }

  .mobile-only {
    display: block;
  }

  .editor-next-action button {
    width: 100%;
    min-height: 44px;
    color: var(--primary);
    background: var(--primary-soft);
  }

  .mobile-creative-host {
    padding: 2px 0 0;
    border-left: 0;
  }

  .split {
    grid-template-columns: 1fr 1fr;
  }

  .creative-advanced-body .split {
    grid-template-columns: 1fr;
  }

  .creative-primary-options {
    max-width: none;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creative-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 13px 0 0;
    padding: 10px 0 calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
    backdrop-filter: blur(14px);
  }

  .creative-actions .primary {
    min-height: 48px;
  }

  .output-card .panel-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .output-card .toolbar {
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 6px;
  }

  .output-card .labeled-action {
    min-width: 0;
    padding: 8px 10px;
    background: rgba(230, 241, 237, 0.75);
  }

  .placeholder-result {
    min-height: 220px;
  }

  .placeholder-result {
    padding: 34px 12px;
  }

  .result-section-header {
    padding-top: 13px;
  }

  .result-section-body {
    font-size: 15px;
    line-height: 1.85;
  }

  .drawer-sheet {
    width: 100%;
    border-radius: 0;
  }

  .drawer-header {
    padding: 15px 16px;
  }

  .drawer-shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-mobile-shared="true"] .drawer-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawer-content .actions button {
    flex: 1 1 120px;
    min-height: 44px;
    font-size: 13px;
  }

  .share-connection {
    grid-template-columns: 1fr;
  }

  .share-qr {
    width: min(180px, 100%);
    height: auto;
    margin: 0 auto;
    aspect-ratio: 1;
  }

  input[type="text"], input[type="password"], textarea, select {
    font-size: 16px;
  }

  .toolbar {
    gap: 5px;
  }

  .result-title-row {
    flex-wrap: wrap;
  }

  .transcript-meta {
    display: block;
    margin: 6px 0 0;
  }
}

@media (max-width: 720px) and (max-height: 740px) {
  .source-panel textarea {
    min-height: 104px;
  }

  .hero { padding-bottom: 6px; }
  .mobile-view-tabs { margin-top: 6px; }
  #setup-panel { padding-top: 0; }
  #setup-panel .panel-header { padding-top: 6px; }
  #process-form { gap: 7px; }
  .source-panel { padding: 8px; }

  #setup-panel .panel-body {
    padding-top: 14px;
  }

  .panel-kicker {
    margin-bottom: 4px;
  }
}

@media (max-width: 720px) and (max-height: 700px) {
  .creative-actions {
    position: static;
    padding-bottom: 10px;
    background: transparent;
    backdrop-filter: none;
  }
}

@media (max-width: 360px) {
  .brand-copy strong {
    max-width: 150px;
    font-size: 12px;
  }

  .mobile-view-tab {
    gap: 3px;
  }

  .stage-number {
    width: 19px;
    height: 19px;
  }

  .stage-copy strong {
    font-size: 10px;
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  /* The desktop grid is declared after the legacy media rules, so reset it here. */
  .setup-body-grid {
    grid-template-columns: 1fr;
  }

  #process-form {
    grid-template-columns: 1fr;
  }

  .source-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

/* Sales version: keep guidance visible without turning the workbench into a stack of cards. */
.workflow-guide {
  display: flex;
  width: min(960px, calc(100% - 56px));
  min-height: 58px;
  align-items: center;
  gap: 13px;
  margin: 10px auto 0;
  padding: 9px 13px;
  border: 0;
  border-left: 2px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.55);
}

.workflow-guide-mark {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 850;
}

.workflow-guide-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workflow-guide-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.workflow-guide-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.workflow-guide-close {
  min-height: 32px;
  margin-left: auto;
  padding: 6px 10px;
  color: var(--accent);
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}

.workflow-guide-close:hover {
  background: var(--accent-soft);
}

.source-detection {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.source-detection strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 11px;
}

.source-detection span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-detection-dot,
.diagnostic-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa5a1;
}

.source-detection[data-state="douyin"] .source-detection-dot,
.source-detection[data-state="kuaishou"] .source-detection-dot,
.source-detection[data-state="xiaohongshu"] .source-detection-dot {
  background: var(--green);
}

.source-detection[data-state="douyin"] strong,
.source-detection[data-state="kuaishou"] strong,
.source-detection[data-state="xiaohongshu"] strong {
  color: var(--green);
}

.source-detection[data-state="unknown"] .source-detection-dot {
  background: var(--accent);
}

.source-detection[data-state="unknown"] strong {
  color: var(--accent);
}

.source-detection[data-state="invalid"] .source-detection-dot {
  background: var(--red);
}

.source-detection[data-state="invalid"] strong {
  color: var(--red);
}

.diagnostics-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.diagnostic-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 5px 8px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.68);
}

.diagnostic-item .diagnostic-dot {
  grid-row: span 2;
}

.diagnostic-item.ready .diagnostic-dot { background: var(--green); }
.diagnostic-item.warning .diagnostic-dot { background: var(--red); }
.diagnostic-item.optional .diagnostic-dot { background: var(--accent); }

.diagnostic-name {
  color: var(--muted);
  font-size: 10px;
}

.diagnostic-value {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostics-actions {
  margin-top: 10px;
}

#diagnostics-feedback {
  margin-top: 8px;
  font-size: 10px;
}

.diagnostics-actions button {
  flex: 1 1 150px;
}

.help-tips {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.help-tips strong {
  font-size: 12px;
}

.help-tips p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .workflow-guide {
    width: calc(100% - 32px);
    margin-top: 7px;
  }

  .workflow-guide-copy span {
    white-space: normal;
  }

  .source-detection {
    margin-left: 0;
    margin-right: 0;
  }

  .diagnostics-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .workflow-guide {
    display: none;
  }

  .source-detection span:last-child {
    display: none;
  }
}

@media (max-width: 360px) {
  .source-detection {
    display: none;
  }

  .output-card .toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .output-card .toolbar .icon-button.labeled-action {
    width: 100%;
    flex-direction: column;
    gap: 5px;
    padding: 8px 5px;
  }

  .labeled-action span {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
