/* Selected ChroMAI Composer v2 rules from styles.css and workspace.css. See LICENSE.ChroMAI.txt. */
:root {
  --paper: #f3f6f8;
  --panel: #ffffff;
  --ink: #1d252d;
  --muted: #606d7a;
  --line: #d6e0e8;
  --coral: #d95b43;
  --teal: #137977;
  --yellow: #e2b43b;
  --green: #29885b;
  --shadow: 0 8px 26px rgba(20, 36, 52, .06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 system-ui, -apple-system, "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 24px max(24px, calc((100vw - 1380px) / 2)); border-bottom: 1px solid var(--line); background: #fcfaf6; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 38px); letter-spacing: 0; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0 0 12px; font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 16px; color: var(--muted); }
.top-actions a, .results a, .guide-panel a { color: var(--teal); font-weight: 700; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; width: min(1380px, calc(100% - 48px)); margin: 24px auto 48px; align-items: start; }
.main-column, .side-column { display: grid; gap: 20px; min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); padding: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.step { color: var(--coral); font: 800 12px/1 ui-monospace, monospace; letter-spacing: .05em; }
.muted, small { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; color: #5e5a52; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); padding: 9px 10px; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(22,125,124,.13); }
.field input[type=file] { padding: 7px; }
.field textarea { resize: vertical; min-height: 86px; font: 12px/1.45 ui-monospace, monospace; }
.checkbox-field { display: flex; align-items: center; gap: 8px; color: #5e5a52; font-weight: 700; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--teal); }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
.condition-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.condition-presets { margin: 14px 0 16px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 5px; background: #fbfbf8; }
.condition-presets .inline-status { min-height: 0; margin: 9px 0 0; font-size: 12px; }
.level-recipe-row { display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: center; }
.level-recipe-slider div { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.condition-advanced { margin: 14px 0 20px; }
.condition-advanced summary { cursor: pointer; color: var(--teal); font-weight: 700; font-size: 13px; }
.condition-advanced[open] summary { margin-bottom: 12px; }
input[type=range] { accent-color: var(--teal); width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.inline-status { min-height: 48px; margin: 12px 0 0; white-space: pre-line; color: var(--muted); }
.param-intro { margin: 0 0 14px; padding: 12px 14px; border-left: 3px solid var(--teal); background: #f2f7f6; color: #45514d; font-size: 12.5px; line-height: 1.65; }
.param-intro em { color: var(--ink); font-style: normal; font-weight: 700; }
.secondary-button { border-color: var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover { border-color: var(--teal); color: var(--teal); }
.small-button { padding: 6px 10px; border-color: var(--line); background: #fff; }
button:disabled { cursor: not-allowed; opacity: .45; }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: #f0ede7; color: var(--muted); cursor: not-allowed; }
.field small code, .notice code { padding: 1px 4px; border-radius: 3px; background: #eee9df; font: 11px/1.4 ui-monospace, monospace; }
.field small { font-weight: 400; line-height: 1.5; }
.field small strong { color: #8a4335; }
.checkbox-field { align-items: start; }
.checkbox-field input { margin-top: 2px; flex: 0 0 auto; }
.checkbox-field span { font-weight: 700; }
.checkbox-field small { display: block; margin-top: 4px; font-weight: 400; }
body { font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif; }
.layout { width: min(1600px, calc(100% - 40px)); grid-template-columns: minmax(0, 1fr) 360px; }
.topbar { background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%); box-shadow: 0 2px 12px rgba(20, 36, 52, .04); }
.topbar-brand { display: grid; gap: 3px; }
.topbar-subtitle { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.workflow-group { margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: #fffefa; scroll-margin-top: 80px; }
.workflow-group-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.workflow-group-heading .step { min-width: 26px; }
.workflow-group-heading h3 { color: var(--ink); margin: 0 0 6px; font-size: 17px; }
.workflow-group-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.form-grid .field { align-content: start; }
.form-grid .field small { font-size: 12px; line-height: 1.6; }
.form-grid .field input, .form-grid .field select { min-height: 40px; }
.form-grid .field input[type=checkbox] { width: 19px; min-height: 19px; height: 19px; accent-color: var(--teal); }
.workflow-group .checkbox-field, .settings-section .checkbox-field { display: grid; grid-template-columns: 20px minmax(0,1fr); align-content: start; }
.workflow-group .checkbox-field > small, .settings-section .checkbox-field > small { grid-column: 2; margin-top: 0; }
.workflow-group .inline-status, .task-panel .inline-status { min-height: 0; margin: 10px 0; font-size: 13px; }
.settings-section { margin: 12px 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.settings-section > summary { cursor: pointer; padding: 14px 16px; color: var(--ink); font-weight: 700; line-height: 1.6; }
.settings-section > summary > small { display: block; margin: 3px 0 0 16px; font-weight: 400; font-size: 12px; }
.settings-section[open] > summary { border-bottom: 1px solid var(--line); background: #f7faf9; }
.settings-section .settings-content { padding: 18px; }
.settings-section .settings-section { background: #fcfcfa; }
.settings-section .group-title:first-child { margin-top: 0; }
.task-panel .section-heading h2 { font-size: 17px; }
.task-panel .section-heading { margin-bottom: 10px; }
.settings-section .condition-guide { margin-top: 0; }
.preset-bar { margin: 14px 0 18px; padding: 14px 16px; border: 1px solid #c3ddd9; border-radius: 10px; background: linear-gradient(180deg, #f4fbfa 0%, #ffffff 100%); }
.preset-bar-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; font-size: 13px; }
.preset-bar-header strong { color: var(--ink); }
.preset-bar-header span { color: var(--muted); font-size: 12px; }
.preset-chip-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.preset-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 11px 13px; border: 1px solid #ccd8e2; border-radius: 9px; background: #fff; color: var(--ink); text-align: left; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.preset-chip:hover { border-color: var(--teal); background: #f6fbfa; }
.preset-chip.is-active { border-color: var(--teal); background: #eaf6f5; box-shadow: 0 0 0 2px rgba(19, 121, 119, .14); }
.preset-chip strong { font-size: 13px; color: var(--teal); line-height: 1.4; }
.preset-chip span { font-size: 11.5px; font-weight: 400; color: var(--muted); line-height: 1.5; }
.preset-status { margin: 8px 0 0; font-size: 12px; line-height: 1.55; }
.preset-status:empty { display: none; }
.v2-step-grid { display: grid; gap: 16px; margin: 14px 0 18px; }
.v2-step-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fcfdfe; box-shadow: 0 2px 8px rgba(20, 36, 52, .03); }
.v2-step-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #e7edf2; }
.v2-step-head .step { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 7px; background: #eaf6f5; color: var(--teal); font-weight: 800; }
.v2-step-head h4 { margin: 0 0 3px; font-size: 15px; color: var(--ink); }
.v2-step-head p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.v2-step-card > .muted { margin: 12px 0 0; font-size: 12px; }

/* Browser workbench and private task delivery. */
.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; }
.login-panel { max-width: 440px; margin: 7vh auto; width: calc(100% - 32px); }
.login-panel h2 { margin-bottom: 14px; }
.topbar { align-items: center; }
.top-actions { flex-wrap: wrap; }
.quota-status { background: #e9f6f5; color: #175a56; padding: 5px 10px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.layout { grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); max-width: 1510px; }
.generation-panel, .side-column > .panel { min-width: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.generation-panel .workflow-group:first-of-type, fieldset .workflow-group:first-of-type { margin-top: 0; }
.generation-panel .form-grid, .settings-section .settings-content.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-content .form-grid { margin-top: 0; }
.v2-step-card:only-child { margin: 0; }
.field .authorized-range { color: #226762; }
.v2-step-card label, .field { overflow-wrap: anywhere; }
.primary-button, .secondary-button, .small-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 38px;
  border: 1px solid #c3d4dc; border-radius: 7px; padding: 7px 13px;
  color: #36515a; background: #fff; font: inherit; font-weight: 700; text-decoration: none;
}
.primary-button { background: var(--teal); border-color: var(--teal); color: #fff; min-height: 44px; }
.secondary-button:hover, .small-button:hover { border-color: var(--teal); color: var(--teal); }
.primary-button:hover { background: #0b6665; }
.small-button { min-height: 32px; padding: 5px 9px; font-size: 12px; }
:where(button,a,summary,input,select,textarea):focus-visible { outline: 2px solid #16807c; outline-offset: 2px; }
.generation-submit { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.generation-submit p { margin: 5px 0 0; font-size: 12px; }
.inline-status { min-height: 0; margin: 8px 0 0; }
.inline-status:empty { display: none; }
.inline-status.error { color: #98452d; }
#uploadProgress, .job-progress { width: 100%; margin-top: 8px; accent-color: var(--teal); }
.audio-workspace { margin-top: 16px; display: grid; gap: 8px; }
audio { width: 100%; max-height: 45px; }
#sourceWave { display: block; width: 100%; height: auto; background: #eef5f5; border: 1px solid var(--line); border-radius: 7px; }
.waveform-seek { gap: 0; font-size: 12px; }
.waveform-seek input[type=range] { padding: 0; min-height: 28px; }
.structured-field { grid-column: 1 / -1; min-width: 0; }
.structured-field textarea { min-height: 78px; }
.structured-scroll { min-width: 0; max-width: 100%; overflow-x: auto; }
.structured-table { width: 100%; border-collapse: collapse; }
.structured-table :is(th, td) { text-align: left; padding: 4px; }
.structured-table input { width: 100%; min-width: 52px; min-height: 32px; border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }
.structured-field .button-row { margin: 6px 0; }
#structuredClockFields, #extraFields { min-width: 0; }
.condition-fields { margin-top: 6px; }
.condition-fields > div { min-width: 0; }
.condition-fields label { margin-bottom: 9px; }
.condition-fields h4 { margin: 0 0 8px; }
.condition-row { margin: 0 0 12px; padding: 7px 0 10px; border-bottom: 1px solid var(--line); }
.condition-row legend { font-weight: 700; }
.condition-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(64px, 74px); align-items: center; gap: 8px; }
.condition-inputs input[type=range] { min-width: 0; padding: 0; }
.condition-row .condition-mode { display: flex; flex-wrap: wrap; gap: 3px 6px; margin: 7px 0 4px; font-size: 12px; }
.condition-mode small { font-weight: 400; }
.condition-reference, .condition-help { display: block; overflow-wrap: anywhere; }
.condition-reference { color: var(--teal); }
#bpm, #first { appearance: textfield; }
#bpm::-webkit-inner-spin-button, #first::-webkit-inner-spin-button { appearance: none; }
#advancedWarning { max-width: min(440px, calc(100% - 30px)); padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
#advancedWarning::backdrop { background: rgb(25 40 47 / 56%); }
#advancedWarning h2 { font-size: 18px; margin-bottom: 10px; }
#advancedWarning p { margin-bottom: 0; }
#advancedWarning .button-row { justify-content: flex-end; }
.job-list { margin: 0; padding: 0; list-style: none; }
#moreJobs { margin-top: 8px; }
.job-entry { padding: 12px 0; border-top: 1px solid var(--line); }
.job-entry[aria-current="true"] { border-left: 3px solid var(--teal); padding-left: 10px; }
.job-entry > p { margin: 5px 0; overflow-wrap: anywhere; }
.job-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.job-title-row strong { overflow-wrap: anywhere; }
.job-state { flex: 0 0 auto; color: #255b59; font-size: 12px; font-weight: 700; }
.job-state:is([data-status=failed],[data-status=canceled]) { color: #98452d; }
.job-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.job-actions .small-button { white-space: nowrap; }
.link-like { color: var(--teal); }

@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .layout { width: calc(100% - 20px); margin-top: 12px; }
  .topbar { padding: 14px; flex-wrap: wrap; }
  .panel, .workflow-group { padding: 13px; }
  .v2-step-card { padding: 12px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .preset-chip-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .generation-panel .form-grid, .settings-section .settings-content.form-grid, .condition-columns { grid-template-columns: 1fr; }
  .generation-submit { align-items: flex-start; flex-direction: column; }
  .level-recipe-row { grid-template-columns: minmax(75px, 1fr) minmax(0, 1.5fr); gap: 12px; }
}
