/* Regression workspace */
.workspace-tabs { display: flex; align-items: stretch; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.tab { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 19px 2px 16px; color: var(--muted); border-bottom: 2px solid transparent; font-size: 13px; font-weight: 550; }
.tab svg { width: 15px; height: 15px; opacity: .8; }
.tab:hover { color: var(--text); }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.reg-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.reg-heading .eyebrow { display: flex; align-items: center; gap: 10px; }
.reg-engine { color: #9ac3b4; border: 1px solid #355347; padding: 2px 7px; border-radius: 4px; font-size: 9px; letter-spacing: .8px; background: #152820; }
.reg-heading p.muted { font-size: 13px; margin: 10px 0 0; }
.reg-run-actions { display: flex; gap: 10px; flex-shrink: 0; }
.reg-run-actions .primary { min-height: 43px; white-space: nowrap; padding: 10px 21px; }
.reg-run-actions .primary::before { content: ""; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 6px solid currentColor; margin-right: 2px; }
.reg-summary { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.15fr; background: #121a23; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 0; margin-bottom: 24px; }
.reg-summary > div { display: flex; flex-direction: column; justify-content: space-between; gap: 11px; padding: 0 24px; min-width: 0; }
.reg-summary > div + div { border-left: 1px solid var(--border); }
.reg-summary .muted { font-size: 11px; color: #a3b1bf; }
.reg-summary strong { font: 500 28px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.6px; overflow-wrap: anywhere; }
.reg-summary > div:first-child strong { display: flex; align-items: center; gap: 8px; font-size: 17px; letter-spacing: -.3px; }
.reg-summary > div:first-child strong svg { width: 16px; height: 16px; color: #849aa9; }
.reg-summary > div:last-child strong { font-family: inherit; font-size: 16px; line-height: 1.5; letter-spacing: 0; }
#regPassed { color: #91d9b4; }
#regFailed { color: #edb09c; }
.reg-grid { display: grid; grid-template-columns: minmax(340px, .78fr) minmax(0, 1.45fr); gap: 20px; align-items: start; }
.reg-small { font-size: 12px; line-height: 1.8; }
.reg-library, .reg-results { padding: 22px; min-width: 0; }
.reg-library > .panel-heading, .reg-results > .panel-heading { margin-bottom: 14px; }
.reg-library > p { margin: 0; max-width: 350px; }
.reg-cases { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 16px; }
.reg-case { border: 1px solid #2c3946; background: #151f29; padding: 14px; border-radius: 8px; display: flex; gap: 11px; align-items: start; transition: border-color .15s, background .15s; }
.reg-case:hover { border-color: #51616f; }
.reg-case:has(input:checked) { border-color: #508b75; background: #172c27; }
.reg-case > input { margin: 3px 0 0; }
.reg-case-body { flex: 1; min-width: 0; }
.reg-case-body strong { font-size: 14px; font-weight: 550; display: block; line-height: 1.7; overflow-wrap: anywhere; }
.reg-case-meta { font-size: 11px; color: #a0b0bf; margin: 7px 0 9px; display: flex; gap: 6px; flex-wrap: wrap; }
.reg-case-meta span { padding: 1px 6px; border: 1px solid #35414d; border-radius: 4px; background: #121b24; }
.reg-case-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.reg-case-actions button { background: transparent; border: 0; padding: 4px 0; font-size: 12px; color: #adbecb; min-height: 28px; }
.reg-case-actions button:hover { color: var(--accent); }
.reg-case-actions button:first-child { color: #95d7bc; }
.reg-case-actions button.danger { color: #d69b9b; margin-left: auto; }
.reg-case-actions button.danger:hover { color: #ffc1c1; }
.reg-case.disabled { opacity: .6; }
.reg-tools { display: flex; gap: 5px; flex-wrap: wrap; }
.reg-tools .quiet { padding: 7px 8px; }
.reg-help { border-top: 1px solid var(--border); padding-top: 17px; margin-top: 18px; color: var(--muted); font-size: 11px; line-height: 1.9; }
.reg-help summary { cursor: pointer; color: #b9c8d4; font-weight: 500; }
.reg-help code { color: #a8dccc; overflow-wrap: anywhere; background: #1b302c; padding: 2px 4px; border-radius: 3px; font-size: 10px; }

/* Execution and history */
#regRunInfo { margin: 0 0 20px; color: #a3b3c2; }
.reg-empty { text-align: center; padding: 70px 18px 80px; color: var(--muted); }
.reg-empty > span { width: 48px; height: 48px; display: grid; place-items: center; background: #1b2c2b; color: #78a093; border: 1px solid #354f46; border-radius: 12px; margin: 0 auto 20px; font-size: 25px; }
.reg-empty h3 { font-size: 14px; color: #c6d2db; margin-bottom: 10px; }
.reg-empty p { font-size: 12px; max-width: 300px; margin: auto; line-height: 1.9; }
.reg-progress { height: 4px; border-radius: 4px; background: #26323e; overflow: hidden; margin: 18px 0 16px; }
.reg-progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.reg-result-list { display: flex; flex-direction: column; gap: 12px; }
.reg-result { border: 1px solid #2d3a46; border-radius: 8px; padding: 17px; min-width: 0; background: #151e28; }
.reg-result:has(.reg-result-top > .failed), .reg-result:has(.reg-result-top > .interrupted) { border-color: #63494b; background: #221d25; }
.reg-result:has(.reg-result-top > .running) { border-color: #477b69; background: #182924; }
.reg-result-top { display: flex; gap: 14px; justify-content: space-between; align-items: start; }
.reg-result-top > div { min-width: 0; }
.reg-result-top h3 { margin: 0 0 5px; font-size: 14px; font-weight: 550; line-height: 1.6; }
.reg-pill { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 11px; line-height: 1.6; border-radius: 5px; padding: 3px 7px; border: 1px solid #3a4552; background: #242d39; color: #b0bdcb; }
.reg-pill::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.reg-pill.passed { background: #173a2c; border-color: #38614c; color: #9bddb8; }
.reg-pill.failed, .reg-pill.interrupted { background: #3c252d; border-color: #6e454e; color: #f0aeb0; }
.reg-pill.running { background: #1b3b32; border-color: #3e7160; color: #9ce6ca; }
.reg-pill.cancelled { background: #383020; border-color: #615338; color: #e1c293; }
.reg-artifacts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 13px; }
.reg-artifacts:empty { display: none; }
.reg-artifacts .quiet, .reg-artifacts .secondary { min-height: 32px; font-size: 12px; padding: 6px 9px; }
.reg-artifacts [data-defect] { border-color: #6f564b; background: #342923; color: #ecc7af; }
.reg-artifacts [data-defect]:hover { background: #4a372b; }
.reg-result details { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--border); font-size: 12px; }
.reg-result details summary { cursor: pointer; color: #afbecd; line-height: 1.8; }
.reg-step-result { padding: 12px 0; border-bottom: 1px solid var(--border); }
.reg-step-result:last-child { border-bottom: 0; }
.reg-step-result > div { display: flex; gap: 8px; align-items: start; }
.reg-step-result > div strong { font-weight: 500; }
.reg-step-result > div > .muted { margin-left: auto; font-size: 10px; flex-shrink: 0; }
.reg-step-result p { margin: 8px 0 0; }
.reg-step-result code { display: block; font-size: 11px; color: #a3b6c5; overflow-wrap: anywhere; }
.reg-step-result pre, .reg-error { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--danger); font-family: ui-monospace, SFMono-Regular, Menlo, "PingFang SC", monospace; font-size: 11px; line-height: 1.8; }
.reg-result > .reg-error { border: 1px solid #5b3942; border-radius: 6px; background: #2c1e25; padding: 10px 12px; max-height: 190px; overflow-y: auto; }
.reg-history { border-top: 1px solid var(--border); margin-top: 26px; padding-top: 18px; }
.reg-history h3 { font-size: 12px; font-weight: 550; margin: 0 0 10px; }
.reg-history small { font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 7px; }
.reg-history-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 11px; flex-wrap: wrap; }
.reg-history-row:last-child { border-bottom: 0; }
.reg-history-row time { flex: 1; color: #a7b5c3; font-size: 11px; font-variant-numeric: tabular-nums; }
.reg-history-row > span:not(.reg-pill) { color: #a5b5c3; }
.reg-history-row button { font-size: 12px; padding: 4px 7px; min-height: 30px; }

/* Case editor and account dialogs */
.reg-case-dialog { max-width: 1080px; }
.reg-options { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 22px 0 16px; }
.reg-options label { font-size: 11px; margin: 0; display: flex; align-items: center; gap: 7px; }
.reg-options input[type=number] { width: 70px; padding: 6px 8px; font-size: 12px; }
#regCaseForm > .notice { margin-bottom: 24px; }
.reg-edit-step { display: grid; grid-template-columns: 28px 170px minmax(0, 1fr) minmax(0, 1fr) 82px; gap: 10px; border: 1px solid #354250; border-radius: 8px; padding: 14px; margin-bottom: 12px; align-items: start; background: #161f29; }
.reg-edit-step .reg-index { display: grid; place-items: center; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: #b2c1ce; background: #26323e; border: 1px solid #40505d; border-radius: 6px; height: 25px; margin-top: 27px; }
.reg-edit-step label { font-size: 11px; color: #a4b5c3; margin: 0 0 6px; }
.reg-edit-step input, .reg-edit-step select { font-size: 12px; padding: 9px; min-width: 0; }
.reg-step-toolbar { grid-column: 2/-1; display: flex; align-items: center; gap: 12px; }
.reg-step-toolbar input { flex: 1; min-width: 60px; }
.reg-step-toolbar button { font-size: 11px; border: 0; background: transparent; color: #b5c3d0; padding: 6px 0; min-height: 30px; white-space: nowrap; }
.reg-step-toolbar button:hover:not(:disabled) { color: var(--accent); }
.reg-step-toolbar button:last-child { color: #e4a3a3; }
.reg-variable-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.reg-variable-row code { color: var(--accent); overflow-wrap: anywhere; }
.reg-variable-row .muted { font-size: 10px; }
#regVideo { width: 100%; max-height: 65vh; border-radius: 8px; background: #080d12; border: 1px solid var(--border); }
#regAccountsDialog h3 { margin-top: 25px; }
#regVariableForm > .secondary { margin-top: 16px; }
.reg-result .notice { font-size: 11px; }

@media (min-width: 1280px) { .reg-library { position: sticky; top: 20px; } }
@media (max-width: 1100px) {
  .reg-grid { grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr); gap: 16px; }
  .reg-library, .reg-results { padding: 18px; }
  .reg-summary > div { padding-inline: 19px; }
  .reg-summary > div:first-child strong { font-size: 15px; }
  .reg-edit-step { grid-template-columns: 24px 150px minmax(0, 1fr) minmax(0, 1fr); }
  .reg-timeout { grid-column: 2; }
  .reg-step-toolbar { grid-column: 3/-1; align-self: end; gap: 8px; flex-wrap: wrap; }
  .reg-step-toolbar input { flex-basis: 100%; }
}
@media (max-width: 860px) {
  .reg-grid { grid-template-columns: minmax(0, 1fr); }
  .reg-summary > div { padding-inline: 15px; }
  .reg-summary strong { font-size: 24px; }
  .reg-cases { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .reg-empty { padding: 45px 18px; }
}
@media (max-width: 760px) {
  .workspace-tabs { margin-bottom: 24px; gap: 26px; }
  .tab { padding-block: 17px 14px; font-size: 12px; }
  .reg-heading { align-items: start; flex-direction: column; gap: 20px; margin-bottom: 20px; }
  .reg-heading p.muted { font-size: 12px; max-width: 280px; }
  .reg-run-actions { width: 100%; }
  .reg-run-actions .primary { flex: 1; }
  .reg-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; gap: 0; margin-bottom: 20px; }
  .reg-summary > div { padding: 17px 18px; gap: 8px; }
  .reg-summary > div + div { border-left: 0; }
  .reg-summary > div:nth-child(even) { border-left: 1px solid var(--border); }
  .reg-summary > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .reg-summary > div:last-child { grid-column: 1/-1; flex-direction: row; align-items: center; }
  .reg-summary > div:last-child strong { font-size: 13px; }
  .reg-summary > div:first-child strong { font-size: 14px; gap: 6px; }
  .reg-summary > div:first-child strong svg { width: 14px; height: 14px; }
  .reg-cases { display: flex; }
  .reg-case { padding: 14px; }
  .reg-case-actions { gap: 18px; }
  .reg-case-actions button { min-height: 32px; }
  .reg-history-row { gap: 8px; }
  .reg-history-row time { flex-basis: 100%; }
  .reg-history-row button { margin-left: auto; }
  .reg-results .panel-heading h2 { white-space: nowrap; }
  .reg-result { padding: 14px; }
  .reg-artifacts { gap: 5px; }
  .reg-artifacts .quiet, .reg-artifacts .secondary { min-height: 36px; }
  .reg-step-result > div { flex-wrap: wrap; }
  .reg-step-result > div strong { flex: 1; }
  .reg-case-dialog { padding: 18px; }
  .reg-case-dialog .field-grid { grid-template-columns: minmax(0, 1fr); }
  .reg-edit-step { grid-template-columns: 24px minmax(0, 1fr); padding: 12px; gap: 10px; }
  .reg-edit-step .reg-action, .reg-edit-step .reg-target, .reg-edit-step .reg-value, .reg-timeout, .reg-step-toolbar { grid-column: 2/-1; }
  .reg-edit-step .reg-index { grid-column: 1; grid-row: 1; margin-top: 25px; }
  .reg-edit-step .reg-action { grid-row: 1; }
  .reg-step-toolbar { flex-wrap: wrap; gap: 12px; }
  .reg-step-toolbar input { flex-basis: 100%; }
  .reg-options { gap: 14px; }
  .reg-options .check { width: 100%; }
}
