.caption-settings {max-width:1320px;margin-inline:auto}
.caption-settings .page-title {align-items:center;margin-bottom:24px}
.caption-settings .page-title h1 {text-wrap:balance}
.caption-settings-actions,.cs-panel-head,.cs-tabs,.cs-tabs button,.cs-proof-tabs,.cs-preview-profile {display:flex;align-items:center}
.caption-settings-actions {gap:12px;flex-shrink:0}
.caption-settings-actions [role=status] {color:var(--muted);font-size:.8rem}
.caption-settings-actions .edited {color:var(--amber)}
.caption-settings button {min-height:44px}
.cs-layout {display:grid;grid-template-columns:minmax(0,1.23fr) minmax(0,1fr);align-items:start;gap:20px}
.cs-layout.cs-read-only {grid-template-columns:minmax(0,760px)}
.cs-panel {min-width:0;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:var(--shadow-panel);overflow:hidden}
.cs-panel-head {align-items:flex-start;gap:13px;padding:22px 24px 17px}
.cs-panel-head h2 {margin:0;color:var(--ink);font-size:1.125rem;line-height:1.4;letter-spacing:-.02em}
.cs-panel-head p {margin:3px 0 0;color:var(--muted);line-height:1.5;font-size:.86rem}
.cs-glyph {display:grid;place-items:center;flex:0 0 38px;height:38px;border-radius:11px;background:var(--primary-soft);color:var(--primary)}
.cs-glyph svg {width:19px;height:19px}
.cs-tabs {margin:3px 24px 0;gap:4px;border-bottom:1px solid var(--border);flex-wrap:wrap}
.cs-tabs button,.cs-proof-tabs button {background:none;border:0;color:var(--muted);font:inherit;font-size:.85rem;cursor:pointer}
.cs-tabs button {gap:6px;margin-bottom:-1px;padding:10px 9px;border-bottom:3px solid transparent;font-weight:650}
.cs-tabs button[aria-pressed=true] {color:var(--primary);border-bottom-color:var(--primary)}
.cs-tabs button:hover,.cs-proof-tabs button:hover {color:var(--primary);background:var(--bg)}
.cs-tabs svg {width:15px;height:15px}
.cs-fields,.cs-test-body {display:grid;gap:18px;padding:21px 24px 24px}
.cs-fields label,.cs-test-body label {display:grid;gap:6px;color:var(--ink);font-weight:650;font-size:.84rem;line-height:1.4}
.cs-fields label small,.cs-test-body label small,.cs-feedback {color:var(--muted);font-size:.78rem;font-weight:400;line-height:1.45}
.cs-fields textarea,.cs-test-body textarea,.cs-fields select,.cs-test-body select {box-sizing:border-box;width:100%;min-width:0;padding:10px 12px;border:1px solid var(--border);border-radius:9px;font:inherit;font-size:.92rem;font-weight:450;line-height:1.48;color:var(--ink);background:var(--surface)}
.cs-fields textarea,.cs-test-body textarea {resize:vertical;min-height:49px}
.cs-fields textarea[readonly] {background:var(--bg)}
.cs-fields select,.cs-test-body select {min-height:44px;appearance:auto}
.cs-test .cs-panel-head {background:var(--primary-soft);border-bottom:1px solid var(--primary-border)}
.cs-test .cs-glyph {background:var(--surface)}
.cs-test-body #cs-run {justify-self:start;color:var(--primary);border-color:var(--primary-border)}
.cs-feedback {margin:0}
.cs-feedback:empty,#cs-result:empty,.cs-error:empty {display:none}
.cs-error {margin-bottom:12px;padding:12px 15px;color:var(--danger);background:var(--danger-soft);border-radius:9px}
.cs-error button {margin:5px}
.cs-proof {padding-top:14px;border-top:1px solid var(--border)}
.cs-proof-controls {display:flex;flex-wrap:wrap;align-items:end;gap:10px;justify-content:space-between;margin-bottom:15px}
.cs-proof-tabs {align-self:end;gap:2px;background:var(--bg);border:1px solid var(--border);border-radius:9px;padding:3px}
.cs-proof-tabs button {border-radius:6px;padding:6px 9px;min-height:36px}
.cs-proof-tabs [aria-pressed=true] {background:var(--surface);box-shadow:var(--shadow-panel);color:var(--primary);font-weight:700}
.cs-preview-text {overflow-wrap:anywhere;padding:16px 18px;border-radius:11px;background:var(--bg)}
.cs-preview-text p {margin:12px 0 0;white-space:pre-wrap;font-size:.9rem;line-height:1.55}
.cs-preview-text h3 {margin:12px 0 0;font-size:1rem}
.cs-preview-profile {gap:8px;font-size:.84rem}
@media(max-width:1060px) {
  .cs-layout {grid-template-columns:minmax(0,1fr) minmax(0,.9fr);gap:12px}
  .cs-tabs {margin-inline:16px}
  .cs-panel-head,.cs-fields,.cs-test-body {padding-inline:16px}
  .cs-tabs svg {display:none}
}
@media(max-width:800px) {
  .cs-layout {grid-template-columns:minmax(0,1fr)}
}
@media(max-width:560px) {
  .caption-settings .page-title {align-items:start;gap:12px;margin-bottom:16px}
  .caption-settings-actions {flex-direction:row-reverse;justify-content:start}
  .cs-tabs {gap:2px}
  .cs-tabs button {padding-inline:8px;font-size:.8rem}
  .cs-fields textarea,.cs-test-body textarea,.cs-fields select,.cs-test-body select {font-size:1rem}
  .cs-proof-tabs button {min-height:44px}
}
