* { box-sizing: border-box; scrollbar-color: #d0d7de transparent; scrollbar-width: thin; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #afb8c1; }
::-webkit-scrollbar-corner { background: transparent; }

html, body { height: 100%; margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, sans-serif;
  background: #f6f8fa;
  color: #1f2328;
  display: flex;
  flex-direction: column;
}

header {
  padding: 0.5rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #d0d7de;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
header h1 { font-size: 1rem; margin: 0; color: #1f2328; }
#meta { font-size: 0.8rem; color: #656d76; margin-left: auto; font-family: ui-monospace, monospace; }

.status {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}
.status.idle { background: #d0d7de; color: #1f2328; }
.status.running { background: #0969da; color: white; }
.status.PASS { background: #1a7f37; color: white; }
.status.FAIL, .status.ERROR { background: #cf222e; color: white; }

main {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 0;
}

#sidebar {
  background: #ffffff;
  border-right: 1px solid #d0d7de;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-bottom {
  flex-shrink: 0;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid #d0d7de;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.section h2 {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #656d76;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

#test-list, #report-list { list-style: none; padding: 0; margin: 0; }
#test-list li {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 2px;
  word-break: break-word;
}
#test-list li:hover { background: #eaeef2; }
#test-list li.active { background: #0969da; color: white; }

#report-list li {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.78rem;
  margin-bottom: 2px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-left: 3px solid transparent;
}
#report-list li:hover { background: #eaeef2; }
#report-list li.viewing { background: #eaeef2; border-left-color: #8250df; }
#report-list li.PASS { border-left-color: #1a7f37; }
#report-list li.FAIL, #report-list li.ERROR { border-left-color: #cf222e; }
#report-list li .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}
#report-list li .name { color: #1f2328; font-weight: 500; word-break: break-word; }
#report-list li .pill {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
  font-weight: 700;
  flex-shrink: 0;
}
#report-list li .pill.PASS { background: #1a7f37; color: white; }
#report-list li .pill.FAIL, #report-list li .pill.ERROR { background: #cf222e; color: white; }
#report-list li .dim { color: #8c959f; font-size: 0.7rem; }

button,
a.ghost {
  text-transform: capitalize;
}
button {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 0.4rem;
  background: #1a7f37;
  color: white;
  border: 1px solid #1a7f37;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}
button:hover:not(:disabled) { background: #1a7f37; color: #fff; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.ghost {
  width: auto;
  background: transparent;
  border: 1px solid #d0d7de;
  color: #656d76;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  font-weight: normal;
  margin: 0;
}
button.ghost:hover:not(:disabled) {
  background: #0969da;
  border-color: #0969da;
  color: #fff;
}
#cancel-btn { background: #ffebe9; border-color: #cf222e; color: #cf222e; }
#cancel-btn:hover:not(:disabled) { background: #cf222e; color: #fff; }

button.secondary {
  background: #eaeef2;
  border-color: #d0d7de;
  color: #1f2328;
}
button.secondary:hover:not(:disabled) {
  background: #0969da;
  border-color: #0969da;
  color: #fff;
}

.mode-group { display: flex; flex-direction: column; gap: 0.3rem; }
.mode-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.1s, background 0.1s;
}
.mode-opt:hover { border-color: #0969da; }
.mode-opt input[type=radio] { margin-top: 0.15rem; accent-color: #0969da; }
.mode-opt:has(input:checked) {
  border-color: #0969da;
  background: #ddf4ff;
}
.mode-label { display: flex; flex-direction: column; gap: 0.1rem; line-height: 1.3; }
.mode-label strong { font-size: 0.85rem; color: #1f2328; font-weight: 600; }
.mode-label em {
  font-size: 0.7rem;
  color: #656d76;
  font-style: normal;
}

#content {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.75rem;
  min-height: 0;
}

.prompt-wrap { display: flex; flex-direction: column; gap: 0.3rem; }
.prompt-wrap label {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #656d76;
}
#prompt {
  width: 100%;
  background: #ffffff;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
#prompt:focus { outline: none; border-color: #0969da; }

#live-view, #report-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }

#split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  min-height: 0;
}

.report-pane { flex: 1; min-height: 0; }

.video-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  width: 100%;
  isolation: isolate;
}
#report-video {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  background: #000;
  /* Force own GPU layer so frames aren't clipped by parent overflow:auto (Chrome bug) */
  transform: translateZ(0);
  will-change: transform;
}
.report-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#report-result {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
}
.result-status {
  display: inline-block;
  width: fit-content;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.result-status.PASS { background: #1a7f37; color: white; }
.result-status.FAIL, .result-status.ERROR { background: #cf222e; color: white; }
.result-summary { font-size: 1rem; line-height: 1.5; color: #1f2328; }
.result-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: #656d76;
}

.report-section { display: flex; flex-direction: column; gap: 0.5rem; }
.report-section h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #656d76;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.report-section .dim { color: #8c959f; font-size: 0.7rem; font-weight: normal; text-transform: none; letter-spacing: 0; }

#report-case {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #1f2328;
  margin: 0;
}

.report-section small.dim { color: #8c959f; font-size: 0.72rem; line-height: 1.5; }
.report-section small.dim a { color: #0969da; }

#report-session {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #1f2328;
  margin: 0;
  max-height: 500px;
  overflow-y: auto;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}
.thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  cursor: pointer;
  background: white;
  transition: border-color 0.1s;
}
.thumb:hover { border-color: #0969da; }
.no-thumbs { color: #8c959f; font-size: 0.85rem; font-style: italic; }

.settings-btn {
  margin-left: auto;
  font-size: 0.85rem;
}
#header-logout-btn {
  font-size: 0.85rem;
  margin-left: 0.4rem;
}
.modal-panel-settings {
  width: min(480px, 92vw);
}
.modal-body.settings-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  overflow-x: hidden;
}
.settings-tabs {
  display: flex;
  gap: 0.15rem;
  border-bottom: 1px solid #d0d7de;
  margin: -0.4rem -0.2rem 0;
  padding: 0 0.2rem;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}
.settings-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.55rem 0.85rem;
  margin-bottom: -1px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #5e6772;
  font-weight: 500;
  transition: color 0.1s, border-color 0.1s;
}
.settings-tab:hover {
  color: #0969da;
}
.settings-tab.active {
  color: #0969da;
  border-bottom-color: #0969da;
}
.settings-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.setting-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}
.setting-row:hover {
  border-color: #0969da;
  background: #f6f8fa;
}
.setting-row input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  flex: none;
}
.setting-radio-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  margin: 0;
}
.setting-radio-row legend {
  padding: 0;
  font-size: 0.85rem;
  color: #1f2328;
  margin-bottom: 0.2rem;
}
.setting-radio-row legend em {
  font-weight: 400;
}
.setting-lang-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #1f2328;
}
.setting-lang-opt:hover {
  background: #f6f8fa;
}
.setting-lang-opt input[type="radio"] {
  margin: 0;
}
.setting-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.7rem 0.85rem 0.85rem;
  margin: 0;
  background: #ffffff;
  cursor: default;
}
.setting-section:hover {
  border-color: #d0d7de;
  background: #ffffff;
}
.setting-section legend {
  padding: 0 0.4rem;
  font-size: 0.85rem;
  color: #1f2328;
}
.setting-section legend em {
  font-weight: 400;
}
.setting-section label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: #656d76;
}
.setting-section label > span {
  font-weight: 600;
  color: #1f2328;
  font-size: 0.82rem;
}
.setting-section input[type='text'],
.setting-section select {
  background: #ffffff;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: 5px;
  padding: 0.4rem 0.55rem;
  font-family: inherit;
  font-size: 0.85rem;
}
.setting-section input[type='text']:focus,
.setting-section select:focus {
  outline: 1px solid #0969da;
  border-color: #0969da;
}
.slack-toggle-row {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.55rem;
}
.slack-toggle-row input[type='checkbox'] {
  margin: 0.15rem 0 0 0;
  flex: none;
  width: 1rem;
  height: 1rem;
}
.slack-webhook-hint {
  font-size: 0.72rem;
  font-style: normal;
  color: #656d76;
  margin-top: 0.15rem;
}
.settings-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.settings-row-actions button {
  width: auto !important;
  margin: 0 !important;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 5px;
  cursor: pointer;
}
.settings-row-actions button.primary {
  background: #1a7f37;
  color: #fff;
  border: 1px solid #1a7f37;
}
.settings-row-actions button.primary:hover:not(:disabled) {
  background: #117027;
}
.slack-hint-error { color: #cf222e !important; }
.slack-hint-ok { color: #1a7f37 !important; }

.setting-account-row {
  align-items: center;
  border-style: solid;
  border-color: #d0d7de;
  background: #f6f8fa;
  cursor: default;
}
.setting-account-row:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
}
.setting-account-row #logout-btn {
  flex: none;
  width: auto !important;
  margin: 0 !important;
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
}
.setting-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.35;
}
.setting-label strong {
  color: #1f2328;
  font-size: 0.92rem;
}
.setting-label em {
  color: #656d76;
  font-style: normal;
  font-size: 0.78rem;
}
.setting-hint {
  font-size: 0.75rem;
  margin: 0;
}

.modal-panel-prompt {
  width: min(420px, 92vw);
}
.modal-panel-prompt .modal-header {
  padding: 0.5rem 0.85rem;
}
.modal-panel-prompt .modal-header h2 {
  font-size: 0.92rem;
}
.prompt-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem 0.85rem;
}
.prompt-body label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: #656d76;
}
.prompt-body label > span {
  font-weight: 600;
  color: #1f2328;
  font-size: 0.82rem;
}
.prompt-body input[type='text'] {
  background: #ffffff;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: 5px;
  padding: 0.4rem 0.55rem;
  font-family: inherit;
  font-size: 0.85rem;
}
.prompt-body input[type='text']:focus {
  outline: 1px solid #0969da;
  border-color: #0969da;
}
.prompt-hint {
  font-size: 0.72rem;
  margin: 0;
}
.prompt-body p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #1f2328;
}
.prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.15rem;
}
.prompt-actions button {
  width: auto !important;
  margin: 0 !important;
  padding: 0.38rem 0.85rem;
  border-radius: 5px;
  font-size: 0.82rem;
  cursor: pointer;
}
.prompt-actions button.primary {
  background: #1a7f37;
  color: #fff;
  border: 1px solid #1a7f37;
  font-weight: 600;
}
.prompt-actions button.primary:hover {
  background: #117027;
}
.prompt-actions button.primary.danger {
  background: #cf222e;
  border-color: #cf222e;
}
.prompt-actions button.primary.danger:hover {
  background: #a40e26;
}
.prompt-actions button.secondary {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  color: #1f2328;
}
.prompt-actions button.secondary:hover {
  background: #0969da;
  border-color: #0969da;
  color: #fff;
}

.modal-panel-rerun {
  width: min(440px, 92vw);
}
.rerun-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.rerun-body .mode-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem;
}
.rerun-body .mode-group legend {
  padding: 0 0.4rem;
  font-size: 0.75rem;
  color: #656d76;
}
.rerun-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.rerun-actions button {
  width: auto;
  margin: 0;
}

.modal-panel-replay {
  width: min(1200px, 95vw);
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}
.replay-banner {
  background: #fff8c5;
  border-bottom: 1px solid #d4a72c;
  color: #59450d;
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.45;
}
#replay-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.replay-img-wrap {
  flex: 1;
  background: #f6f8fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  min-height: 360px;
  padding: 0.75rem;
}
#replay-img {
  display: block;
  max-width: 100%;
  height: auto;
}
.replay-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border-top: 1px solid #d0d7de;
}
.replay-controls button {
  width: auto;
  padding: 0.3rem 0.6rem;
  margin: 0;
  background: #eaeef2;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  color: #1f2328;
  font-size: 0.85rem;
  font-weight: normal;
  min-width: 32px;
}
.replay-controls button:hover:not(:disabled) {
  background: #d0d7de;
  border-color: #0969da;
}
.replay-controls #replay-play {
  background: #0969da;
  border-color: #0969da;
  color: white;
  font-size: 0.9rem;
}
.replay-controls #replay-play:hover { background: #0969da; border-color: #0969da; }
.replay-controls #replay-prev::before {} /* keep ◀ */
.replay-controls #replay-next { /* hint: forward triangle uses same glyph; differentiate via title */ }
.replay-controls #replay-pos {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  min-width: 50px;
  text-align: center;
}
.replay-controls #replay-name {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.replay-controls #replay-close {
  background: transparent;
  border-color: transparent;
  font-size: 1rem;
}
.replay-controls #replay-close:hover {
  background: #cf222e;
  border-color: #cf222e;
  color: white;
}
.replay-controls select {
  background: #eaeef2;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.report-section details summary,
details.report-section summary {
  cursor: pointer;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #656d76;
  padding: 0.5rem 0;
  list-style: revert;
}
details.report-section[open] summary { color: #1f2328; }
#report-trace {
  list-style: none;
  padding: 0.5rem 0 0;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  border-top: 1px solid #d0d7de;
}
#report-trace li {
  padding: 0.2rem 0.5rem;
  line-height: 1.5;
  border-left: 2px solid transparent;
}
#report-trace li.text { color: #1f2328; white-space: pre-wrap; }
#report-trace li.tool_use { color: #0969da; border-left-color: #0969da; }
#report-trace li.tool_use .args { color: #8c959f; font-size: 0.72rem; margin-left: 0.5rem; }
#report-trace li.tool_result { color: #656d76; padding-left: 1.75rem; font-size: 0.74rem; }
#report-trace li.tool_result.error { color: #cf222e; }
#report-trace li.status { color: #8250df; }

.pane {
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pane h3 {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #656d76;
  border-bottom: 1px solid #d0d7de;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#event-log {
  list-style: none;
  padding: 0.4rem 0;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  overflow-y: auto;
  flex: 1;
}
#event-log li {
  padding: 0.25rem 0.75rem;
  line-height: 1.5;
  word-break: break-word;
  border-left: 2px solid transparent;
}
#event-log li.tool_use { color: #0969da; border-left-color: #0969da; }
#event-log li.tool_use .args { color: #656d76; font-size: 0.75rem; margin-left: 0.5rem; }
#event-log li.tool_result { color: #656d76; padding-left: 1.75rem; font-size: 0.75rem; }
#event-log li.tool_result.error { color: #cf222e; }
#event-log li.text { color: #1f2328; white-space: pre-wrap; }
#event-log li.status { color: #8250df; font-weight: 600; }
#event-log li.status.starting { color: #8250df; }
#event-log li.status.PASS { color: #1a7f37; font-weight: 700; }
#event-log li.status.FAIL { color: #cf222e; font-weight: 700; }
#event-log li.status.ERROR { color: #cf222e; font-weight: 700; }
#event-log li.error { color: #cf222e; }
#event-log li.system { color: #8c959f; font-size: 0.7rem; }
#event-log li.screenshot { color: #bf8700; }

.img-wrap {
  flex: 1;
  overflow: auto;
  padding: 0.5rem;
  background: #ffffff;
  position: relative;
}
#screenshot {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border: 1px solid #eaeef2;
  background: white;
  cursor: zoom-in;
  transition: outline 0.15s;
}
#screenshot:hover {
  outline: 2px solid #0969da;
}
#screenshot[hidden] { display: none; }
.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8c959f;
  font-size: 0.85rem;
  font-style: italic;
  pointer-events: none;
}

/* ===== Queue page ===== */

.page-nav {
  display: flex;
  gap: 0.75rem;
  margin-left: 1rem;
  flex: 1;
}
.page-nav a[href="/docs.html"] {
  margin-left: auto;
}
.page-nav a {
  color: #656d76;
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  border: 1px solid transparent;
  text-transform: capitalize;
}
.page-nav a:hover {
  color: #1f2328;
  background: #ffffff;
}
.page-nav a.active {
  color: #1f2328;
  border-color: #d0d7de;
  background: #ffffff;
}

body.queue-page main.queue-main {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1rem;
  padding: 1rem;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.submit-pane,
.queue-pane {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.submit-pane h2,
.queue-pane h2 {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  color: #1f2328;
}

#submit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}
#submit-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #656d76;
}
#submit-form label > span {
  font-weight: 600;
  color: #1f2328;
}
#submit-form input[type='text'],
#submit-form textarea {
  background: #ffffff;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
}
#submit-form textarea {
  flex: 1;
  min-height: 120px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
#submit-form input:focus,
#submit-form textarea:focus {
  outline: 1px solid #0969da;
  border-color: #0969da;
}

#submit-form fieldset.mode-group {
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
#submit-form fieldset.mode-group legend {
  padding: 0 0.4rem;
  font-size: 0.75rem;
  color: #656d76;
}

.submit-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
#submit-btn,
#suite-btn {
  flex: 1;
}

.submit-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #d0d7de;
}
.submit-tabs .tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: #656d76;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
}
.submit-tabs .tab:hover {
  color: #1f2328;
}
.submit-tabs .tab.active {
  background: #ffffff;
  border-color: #d0d7de;
  color: #1f2328;
  margin-bottom: -1px;
}

#suite-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}
#suite-form input[type='file'] {
  background: #ffffff;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.4rem;
  font-family: inherit;
  font-size: 0.8rem;
}
.suite-preview {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-size: 0.78rem;
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.5;
}
.suite-preview code {
  background: #ffffff;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  color: #0969da;
  font-size: 0.75rem;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.queue-section {
  margin-bottom: 1rem;
}
.queue-section:last-child {
  margin-bottom: 0;
}
.queue-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #656d76;
  margin: 0 0 0.4rem 0;
}

.queue-filters {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
}
.queue-filters .filter-opt {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 999px;
  cursor: pointer;
  color: #656d76;
}
.queue-filters .filter-opt:has(input:checked) {
  background: #0969da;
  border-color: #0969da;
  color: #fff;
}
.queue-filters .filter-opt input {
  display: none;
}

.job-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.job-list:empty::before {
  content: '— none —';
  color: #afb8c1;
  font-size: 0.8rem;
  font-style: italic;
}

.job {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
}
.job.job-running {
  border-color: #0969da;
  background: #ddf4ff;
}
.job.job-failed {
  border-color: #cf222e;
}
.job.job-done {
  border-left: 3px solid #1a7f37;
}

.job-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.job-main { flex: 1; min-width: 0; }
.job-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.job-meta {
  font-size: 0.75rem;
  margin-top: 0.2rem;
}
.job-summary {
  font-size: 0.8rem;
  color: #1f2328;
  margin-top: 0.3rem;
  word-break: break-word;
}
.job-prompt {
  margin: 0.5rem 0 0 0;
  padding: 0.5rem 0.7rem;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  color: #1f2328;
}
.job-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
}
.job-actions a,
.job-actions button {
  font-size: 0.75rem;
  text-decoration: none;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #d0d7de;
  color: #1f2328;
}
.badge.queued { background: #d0d7de; color: #656d76; }
.badge.running { background: #0969da; color: #fff; }
.badge.pass { background: #1a7f37; color: #fff; }
.badge.fail { background: #cf222e; color: #fff; }
.badge.cancelled { background: #d0d7de; color: #656d76; }
.badge.platform-web { background: #ddf4ff; color: #0969da; }
.badge.platform-android { background: #e6f4e6; color: #1a7f37; }
.badge.platform-ios { background: #f0f0f0; color: #1f2328; }
.badge.installed-on-device { background: #1a7f37; color: #fff; }

/* ===== Live progress modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 25, 0.4);
  cursor: pointer;
}
.modal-panel {
  position: relative;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  width: min(1100px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #d0d7de;
}
.modal-header h2 {
  margin: 0;
  font-size: 1rem;
  color: #1f2328;
}
.modal-body {
  padding: 1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#live-modal #live-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#live-modal .split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}
#live-modal .pane {
  display: flex;
  flex-direction: column;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem;
  min-height: 0;
}
#live-modal .pane h3 {
  margin: 0 0 0.4rem 0;
  font-size: 0.8rem;
  color: #656d76;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#live-modal #event-log {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 0 0 0 1.2rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.75rem;
  min-height: 360px;
}
#live-modal .img-wrap {
  flex: 1;
  position: relative;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
  min-height: 360px;
}
#live-modal .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
#live-modal #live-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: #8c959f;
  border: 1px dashed #d0d7de;
  border-radius: 6px;
}

.suite-card { cursor: pointer; }
.suite-card .suite-actions button { cursor: pointer; }

/* ===== Suite report modal ===== */
.modal-panel-report {
  width: min(1200px, 95vw);
  max-height: 92vh;
}
.suite-report-body {
  overflow-y: auto;
}
.report-overall {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.report-overall.pass { background: #1a7f37; color: #fff; }
.report-overall.fail { background: #cf222e; color: #fff; }
.report-overall.in-progress { background: #0969da; color: #fff; }

.report-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 0 0 1.25rem 0;
  padding: 0.75rem 1rem;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 0.85rem;
}
.report-meta dt {
  color: #656d76;
  font-weight: 500;
}
.report-meta dd {
  margin: 0;
  color: #1f2328;
  font-weight: 600;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.report-table thead th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: #f6f8fa;
  border-bottom: 2px solid #d0d7de;
  color: #656d76;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.report-table tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #eaeef2;
  vertical-align: top;
}
.report-table .num {
  width: 32px;
  color: #8c959f;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}
.report-table .case-name {
  font-weight: 600;
  color: #1f2328;
  white-space: nowrap;
}
.report-table .case-summary {
  color: #1f2328;
  word-break: break-word;
  max-width: 500px;
}
.report-table .case-dur {
  font-family: ui-monospace, monospace;
  color: #656d76;
  white-space: nowrap;
}
.report-table .case-link a {
  font-size: 0.72rem;
  text-decoration: none;
  color: #0969da;
  white-space: nowrap;
}
.report-row-failed { background: #ffebe9; }
.report-row-cancelled { color: #8c959f; }
.report-row-running { background: #ddf4ff; }

.result-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.result-pill.pass { background: #1a7f37; color: #fff; }
.result-pill.fail { background: #cf222e; color: #fff; }
.result-pill.cancelled { background: #d0d7de; color: #656d76; }
.result-pill.running { background: #0969da; color: #fff; }
.result-pill.queued { background: #d0d7de; color: #656d76; }

.report-source {
  margin-top: 1rem;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}
.report-source summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: #656d76;
}
.report-source pre {
  margin: 0.5rem 0 0 0;
  padding: 0.5rem;
  background: #ffffff;
  border-radius: 4px;
  font-size: 0.78rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  body.queue-page main.queue-main {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  #live-modal .split { grid-template-columns: 1fr; }
}

/* ===== User picker ===== */
.user-picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  margin-left: auto;
}
.user-picker label { color: #656d76; }
.user-picker select {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  color: #1f2328;
  min-width: 120px;
}
.user-picker button {
  width: auto;
  margin: 0;
}
header #ws-status { margin-left: 0.5rem; }
header #meta { margin-left: 0; }

/* ===== Suites panel ===== */
.suites-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.suites-list:empty::before {
  content: '— no suites uploaded —';
  color: #afb8c1;
  font-size: 0.8rem;
  font-style: italic;
}
.suite-card {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-left: 4px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
}
.suite-card.suite-running { border-left-color: #0969da; background: #ddf4ff; }
.suite-card.suite-completed { border-left-color: #1a7f37; }
.suite-card.suite-failed { border-left-color: #cf222e; }
.suite-card.suite-pending { border-left-color: #afb8c1; }

.suite-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.suite-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.action-menu {
  position: relative;
}
.action-menu-trigger {
  font-size: 1rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  line-height: 1;
}
.action-menu-items {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 100;
  min-width: 160px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.action-menu-items button,
.action-menu-items a {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  color: #1f2328;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.action-menu-items button:hover,
.action-menu-items a:hover {
  background: #f6f8fa;
}
.action-menu-items .suite-cancel-btn,
.action-menu-items .suite-cancel-btn:hover,
.action-menu-items .suite-remove-btn,
.action-menu-items .suite-remove-btn:hover {
  background: transparent !important;
  border-color: transparent !important;
}
.action-menu-items .suite-cancel-btn,
.action-menu-items .suite-remove-btn {
  color: #cf222e !important;
}
.action-menu-items .suite-cancel-btn:hover,
.action-menu-items .suite-remove-btn:hover {
  background: #ffebe9 !important;
  color: #cf222e !important;
}
.suite-cancel-btn {
  color: #cf222e !important;
  border-color: #cf222e !important;
}
.suite-cancel-btn:hover {
  background: #cf222e !important;
  color: #fff !important;
}
.suite-main { flex: 1; min-width: 0; }
.suite-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.suite-status { font-size: 0.95rem; }
.suite-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.suite-progress .bar {
  flex: 1;
  height: 6px;
  background: #eaeef2;
  border-radius: 3px;
  overflow: hidden;
}
.suite-progress .bar .fill {
  height: 100%;
  background: #1a7f37;
  transition: width 0.3s;
}
.suite-card.suite-running .bar .fill { background: #0969da; }
.suite-card.suite-failed .bar .fill { background: #cf222e; }

.suite-children {
  list-style: none;
  margin: 0.6rem 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.suite-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: #f6f8fa;
  border-radius: 4px;
  font-size: 0.78rem;
}
.suite-child .dim { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suite-child a.ghost { font-size: 0.7rem; }

/* ===== Author page ===== */
body.author-page main.author-main {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 960px) {
  body.author-page main.author-main {
    grid-template-columns: 1fr;
  }
}
.author-right-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.author-form-pane,
.author-preview-pane,
.author-library-pane {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}
.author-form-pane {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
@media (max-width: 960px) {
  .author-form-pane {
    position: static;
    max-height: none;
  }
}
.author-library-pane h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.author-library-pane h2 .ghost {
  margin-left: auto;
  font-size: 0.8rem;
}
.library-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.library-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: #f6f8fa;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: border-color 0.1s, background 0.1s;
}
.library-item:hover {
  border-color: #0969da;
  background: #ddf4ff;
}
.library-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}
.library-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.library-meta-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.library-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f2328;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
}
.library-date {
  font-size: 0.72rem;
  color: #656d76;
}
.lib-platform-badge {
  flex: none;
  font-size: 0.95rem;
  line-height: 1;
}
.lib-count-badge {
  flex: none;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 9px;
  background: #ddf4ff;
  color: #0550ae;
  border: 1px solid #54aeff;
}
.lib-count-badge.lib-count-empty {
  background: #fff8c5;
  border-color: #d4a72c;
  color: #633c01;
}
.lib-run-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.1rem 0.5rem;
  border-radius: 9px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  color: #656d76;
  white-space: nowrap;
}
.lib-run-passed {
  background: #dcffe4;
  border-color: #2da44e;
  color: #1a7f37;
}
.lib-run-failed {
  background: #ffebe9;
  border-color: #cf222e;
  color: #82071e;
}
.lib-run-running {
  background: #ddf4ff;
  border-color: #54aeff;
  color: #0550ae;
}
.lib-run-pending {
  background: #fff8c5;
  border-color: #d4a72c;
  color: #633c01;
}
.lib-run-cancelled {
  background: #f6f8fa;
  border-color: #d0d7de;
  color: #656d76;
}
.lib-run-none {
  font-style: italic;
  color: #8c959f;
}
.library-actions {
  display: flex;
  gap: 0.3rem;
  flex: none;
}
.library-actions button {
  width: auto !important;
  margin: 0 !important;
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
}
.lib-del-btn:hover {
  background: #cf222e !important;
  border-color: #cf222e !important;
  color: #fff !important;
}
.library-item-flash {
  animation: library-flash 1.6s ease-out;
}
@keyframes library-flash {
  0% { background: #fff8c5; border-color: #d4a72c; }
  100% { background: #f6f8fa; border-color: transparent; }
}
.library-empty,
.job-empty {
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  font-style: italic;
  background: #f6f8fa;
  border: 1px dashed #d0d7de;
  border-radius: 6px;
  list-style: none;
}
.job-empty a {
  color: #0969da;
  text-decoration: none;
}
.job-empty a:hover {
  text-decoration: underline;
}
.library-hint {
  font-size: 0.75rem;
  margin: 0;
}
.library-hint code {
  background: #f6f8fa;
  padding: 0 0.25rem;
  border-radius: 3px;
  font-size: 0.72rem;
}

.preview-mode-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.push-mode-row {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #f6f8fa;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.push-mode-legend {
  flex: 0 0 100%;
  font-weight: 600;
  font-size: 0.82rem;
  color: #1f2328;
  margin-bottom: 0.2rem;
  padding: 0;
}
.push-mode-hint {
  font-weight: 400;
  margin-left: 0.3rem;
}
.push-mode-opt {
  flex: 1 1 30%;
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #d0d7de;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 0.82rem;
  transition: border-color 0.1s, background 0.1s;
}
.push-mode-opt:hover {
  border-color: #0969da;
}
.push-mode-opt:has(input:checked) {
  border-color: #0969da;
  background: #ddf4ff;
}
.push-mode-opt.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #eaeef2;
}
.push-mode-opt input[type='radio'] {
  accent-color: #0969da;
  flex: none;
}
.push-mode-opt strong {
  display: block;
  font-size: 0.85rem;
}
.push-mode-opt em {
  display: block;
  font-size: 0.72rem;
}

.badge.mode-badge {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.08rem 0.45rem;
  border-radius: 9px;
  background: #f6f8fa;
  color: #656d76;
  border: 1px solid #d0d7de;
}
.badge.mode-badge.mode-fast {
  background: #f6f8fa;
  border-color: #d0d7de;
  color: #656d76;
}
.badge.mode-badge.mode-step {
  background: #fff8c5;
  border-color: #d4a72c;
  color: #633c01;
}
.badge.mode-badge.mode-headed {
  background: #fbe4ff;
  border-color: #c44ed8;
  color: #7d2497;
}
.preview-mode-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #1f2328;
}
#edit-toggle-btn {
  margin-left: auto;
  width: auto !important;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
}

.preview-view {
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #ffffff;
  padding: 0.85rem 1rem;
  max-height: 560px;
  overflow-y: auto;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #1f2328;
}
.preview-view > * {
  margin-bottom: 0.65rem;
}
.preview-view > *:last-child {
  margin-bottom: 0;
}
.preview-view p {
  margin: 0;
}
.preview-view code {
  background: #f6f8fa;
  border: 1px solid #eaeef2;
  border-radius: 3px;
  padding: 0 0.3rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.78rem;
}
.preview-view strong {
  color: #1f2328;
  font-weight: 600;
}
.md-block {
  margin: 0;
  padding: 0.7rem 0.95rem;
  background: #ffffff;
  color: #1f2328;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
}
.md-block strong {
  color: #1f2328;
  font-weight: 700;
}
.md-block code {
  background: #f6f8fa;
  border: 1px solid #eaeef2;
  border-radius: 3px;
  padding: 0 0.25rem;
  font-size: 0.78rem;
}
.md-suite-block {
  background: #ddf4ff;
  border: 1px solid #54aeff;
  border-radius: 6px;
}

.story-section {
  background: #fff8c5;
  border: 1px solid #d4a72c;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
}
.story-section[open] {
  padding-bottom: 0.85rem;
}
.story-section > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.story-section > summary::-webkit-details-marker {
  display: none;
}
.story-section > summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: #59450d;
  transition: transform 0.15s;
}
.story-section[open] > summary::before {
  transform: rotate(90deg);
}
.story-pill {
  background: #59450d;
  color: #fff8c5;
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.story-body {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.story-meta-row {
  font-size: 0.78rem;
  color: #59450d;
}
.story-meta-row a {
  color: #0969da;
}
.story-text {
  margin: 0;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px solid #eaeac2;
  border-radius: 4px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #1f2328;
}
.md-test-card {
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}
.md-test-header {
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.83rem;
  background: #eaeef2;
  border-bottom: 1px solid #d0d7de;
}
.md-test-pill {
  background: #1f2328;
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: none;
}
.md-test-name {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #0969da;
  font-weight: 600;
  font-size: 0.85rem !important;
  word-break: break-all;
  flex: 1;
}
.md-test-actions {
  display: inline-flex;
  gap: 0.25rem;
  flex: none;
}
.md-edit-mini {
  width: auto !important;
  margin: 0 !important;
  padding: 0.18rem 0.45rem !important;
  font-size: 0.78rem !important;
  min-width: 1.7rem;
}
.md-del-btn:hover:not(:disabled) {
  background: #cf222e !important;
  border-color: #cf222e !important;
  color: #fff !important;
}
.md-suite-block-wrap {
  position: relative;
}
.md-suite-block-wrap .md-edit-mini {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}
.md-test-editing {
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12);
}
.md-edit-name {
  flex: 1;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  color: #0550ae;
  font-weight: 600;
}
.md-edit-name:focus {
  outline: 2px solid #0969da;
  outline-offset: -1px;
}
.md-edit-body {
  width: 100%;
  border: none;
  border-top: 1px solid #d0d7de;
  padding: 0.7rem 0.85rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.83rem;
  line-height: 1.55;
  resize: vertical;
  background: #ffffff;
  color: #1f2328;
}
.md-edit-body:focus {
  outline: none;
  background: #fff8e6;
}
.md-edit-actions {
  display: flex;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  background: #f6f8fa;
  border-top: 1px solid #d0d7de;
}
.md-edit-actions button {
  width: auto !important;
  margin: 0 !important;
  padding: 0.32rem 0.85rem !important;
  font-size: 0.8rem !important;
}
.md-header-edit {
  border: 1px solid #0969da;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12);
}
.md-edit-label {
  display: block;
  padding: 0.55rem 0.75rem 0;
  font-size: 0.78rem;
  color: #656d76;
  font-style: italic;
}
.md-add-test,
.md-add-header {
  width: 100%;
  margin-top: 0.6rem !important;
  padding: 0.55rem !important;
  font-size: 0.83rem !important;
  border-style: dashed !important;
  color: #656d76 !important;
}
.md-add-test:hover,
.md-add-header:hover {
  background: #ddf4ff !important;
  border-color: #0969da !important;
  color: #0550ae !important;
}
.md-empty-tests {
  padding: 0.85rem;
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
}
.author-preview-pane label,
.author-form-pane label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #656d76;
}
.author-preview-pane label > span,
.author-form-pane label > span {
  font-weight: 600;
  color: #1f2328;
}
.author-preview-pane label > span em,
.author-form-pane label > span em {
  font-weight: 400;
  font-style: normal;
  color: #656d76;
}
.author-form-pane h2,
.author-preview-pane h2 {
  margin: 0;
  font-size: 0.95rem;
  color: #1f2328;
}
.author-preview-pane h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#preview-close-btn {
  margin-left: auto;
  width: auto !important;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
}
#author-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#author-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #656d76;
}
#author-form label > span {
  font-weight: 600;
  color: #1f2328;
}
#author-form label > span em {
  font-weight: 400;
  font-style: normal;
}
#author-form input[type='url'],
#author-form input[type='text'],
#author-form textarea,
#preview-md {
  background: #ffffff;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.55rem;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
}
#author-form textarea,
#preview-md {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.83rem;
  line-height: 1.5;
}
#author-form input:focus,
#author-form textarea:focus,
#preview-md:focus {
  outline: 1px solid #0969da;
  border-color: #0969da;
}
#author-form fieldset.mode-group {
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
#author-form fieldset.mode-group legend {
  padding: 0 0.4rem;
  font-size: 0.75rem;
  color: #656d76;
}
.auto-run-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem;
  border: 1px dashed #d0d7de;
  border-radius: 6px;
  background: #f6f8fa;
}
.auto-run-row input[type='checkbox'] {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  flex: none;
}
.auto-run-row span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.4;
}
.auto-run-row strong {
  color: #1f2328;
  font-size: 0.85rem;
}
#generate-btn {
  background: #0969da;
  color: #fff;
  border: 1px solid #0969da;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}
#generate-btn:hover:not(:disabled) {
  background: #0860c5;
}
#generate-btn:disabled {
  background: #94a3b8;
  border-color: #94a3b8;
  cursor: wait;
}

#preview-md {
  min-height: 360px;
}
.preview-parsed {
  font-size: 0.78rem;
  padding: 0.45rem 0.6rem;
  background: #f6f8fa;
  border-radius: 6px;
  line-height: 1.45;
}
.preview-parsed code {
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 3px;
  padding: 0 0.3rem;
  font-size: 0.75rem;
  margin: 0 0.15rem;
}
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.25rem;
  border-top: 1px solid #eaeef2;
  margin-top: 0.25rem;
}
.preview-actions button {
  width: auto !important;
  margin: 0 !important;
}
.preview-actions button.primary {
  background: #1a7f37;
  color: #fff;
  border: 1px solid #1a7f37;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.preview-actions button.primary:hover {
  background: #117027;
}
.preview-actions button.secondary {
  background: #f6f8fa;
  color: #1f2328;
  border: 1px solid #d0d7de;
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}
.preview-actions button.secondary:hover {
  background: #0969da;
  border-color: #0969da;
  color: #fff;
}
.preview-actions button.ghost {
  font-size: 0.78rem;
  padding: 0.4rem 0.7rem;
}
.preview-actions .spacer {
  flex: 1;
}

/* ===== Site picker (autocomplete) ===== */
.site-picker-row {
  position: relative;
}
.site-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  margin-top: 0.25rem;
  box-shadow: 0 8px 20px rgba(31, 35, 40, 0.08);
  max-height: 240px;
  overflow-y: auto;
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.site-picker-item {
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  gap: 0.1rem;
  padding: 0.45rem 0.6rem !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  width: 100% !important;
  margin: 0 !important;
  color: #1f2328 !important;
  font-weight: 400 !important;
  font-size: 0.85rem !important;
  text-transform: none !important;
}
.site-picker-item:hover,
.site-picker-item.active {
  background: #ddf4ff !important;
  border-color: #54aeff !important;
  color: #1f2328 !important;
}
.site-picker-name {
  font-weight: 600;
  color: #1f2328;
}
.site-picker-url {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  color: #656d76;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-picker-empty {
  padding: 0.6rem;
  font-size: 0.82rem;
  font-style: italic;
}
.site-picker-empty a {
  color: #0969da;
}

/* ===== Sites + Apps pages share the same grid layout ===== */
body.apps-page main.sites-main,
body.sites-page main.sites-main {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 960px) {
  body.apps-page main.sites-main,
  body.sites-page main.sites-main {
    grid-template-columns: 1fr;
  }
}
.apps-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.45;
}
.device-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  background: #f6f8fa;
  border-radius: 5px;
}
.device-status-row #device-status {
  flex: 1;
}
#device-avd-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d0d7de;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.85rem;
}
.app-pkg {
  font-size: 0.75rem;
  background: #f6f8fa;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
}
.app-version {
  font-size: 0.75rem;
  margin-left: 0.3rem;
}
.sites-form-pane,
.sites-list-pane {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}
.sites-form-pane h2,
.sites-list-pane h2 {
  margin: 0;
  font-size: 0.95rem;
  color: #1f2328;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sites-list-pane h2 .ghost {
  margin-left: auto;
}
#site-form,
#app-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#site-form label,
#app-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #656d76;
}
#site-form label > span,
#app-form label > span {
  font-weight: 600;
  color: #1f2328;
  font-size: 0.83rem;
}
#site-form label > span em,
#app-form label > span em {
  font-weight: 400;
  font-style: normal;
}
#site-form input[type='text'],
#site-form input[type='url'],
#site-form textarea,
#app-form input[type='text'],
#app-form input[type='file'],
#app-form textarea {
  background: #ffffff;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
}
#app-form input[type='file'] {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}
#app-form input[type='file']::file-selector-button {
  margin-right: 0.6rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  color: #1f2328;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.82rem;
}
#app-form input[type='file']::file-selector-button:hover {
  background: #eaeef2;
}
#site-form input:focus,
#site-form textarea:focus,
#app-form input:focus,
#app-form textarea:focus {
  outline: 1px solid #0969da;
  border-color: #0969da;
}
#app-form .apk-file-info {
  font-size: 0.78rem;
  color: #656d76;
  margin-top: 0.1rem;
}
#site-save-btn,
#app-save-btn {
  background: #1a7f37;
  color: #fff;
  border: 1px solid #1a7f37;
  border-radius: 6px;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  cursor: pointer;
  font-weight: 600;
  align-self: flex-start;
}
#site-save-btn:hover:not(:disabled),
#app-save-btn:hover:not(:disabled) {
  background: #117027;
  color: #fff;
}
.sites-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lib-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0.6rem 0 0.85rem;
}
.lib-platform-tabs {
  display: inline-flex;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  overflow: hidden;
  flex: none;
}
.lib-tab {
  background: #fff;
  border: none;
  border-right: 1px solid #d0d7de;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: #1f2328;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.1s;
}
.lib-tab:last-child {
  border-right: none;
}
.lib-tab:hover {
  background: #f6f8fa;
}
.lib-tab.active {
  background: #0969da;
  color: #fff;
}
.lib-tab.active .lib-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.lib-tab-count {
  display: inline-block;
  min-width: 1.1rem;
  padding: 0.05rem 0.3rem;
  border-radius: 8px;
  background: #eaeef2;
  color: #656d76;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
}
.lib-search {
  flex: 1;
  min-width: 140px;
  padding: 0.35rem 0.55rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 0.82rem;
}
.lib-search:focus {
  outline: 2px solid #0969da;
  outline-offset: -1px;
  border-color: #0969da;
}
.lib-sort {
  flex: none;
  padding: 0.35rem 0.45rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 0.78rem;
  background: #fff;
  cursor: pointer;
}
.jira-fetch-row {
  border: 1px dashed #d0d7de;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  background: #f6f8fa;
  margin-bottom: 0.75rem;
}
.jira-fetch-label > span {
  font-weight: 600;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.35rem;
}
.jira-fetch-controls {
  display: flex;
  gap: 0.4rem;
}
.jira-fetch-controls input {
  flex: 1;
  padding: 0.35rem 0.55rem;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.85rem;
}
.jira-fetch-controls button {
  width: auto !important;
  padding: 0.35rem 0.85rem !important;
  font-size: 0.82rem !important;
}
.jira-fetch-hint {
  font-size: 0.75rem;
  margin-top: 0.3rem;
  display: block;
}

.jira-paste-wrap {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed #d0d7de;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.jira-paste-hint {
  font-size: 0.78rem;
  line-height: 1.45;
}
.jira-paste-hint code {
  background: #fff;
  border: 1px solid #d0d7de;
  padding: 0 0.25rem;
  border-radius: 3px;
  font-size: 0.78rem;
}
#jira-paste-input {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.78rem;
}
#jira-paste-input:focus {
  outline: 2px solid #0969da;
  outline-offset: -1px;
  border-color: #0969da;
}

/* Queue-page toolbar: compact, low-chrome — two tab groups + search */
.queue-toolbar {
  align-items: center;
  gap: 0.45rem;
  margin: 0.4rem 0 0.7rem;
  padding: 0.35rem 0.5rem;
  background: #f6f8fa;
  border: 1px solid #eaeef2;
  border-radius: 8px;
}
.queue-toolbar .lib-platform-tabs {
  border: none;
  background: #ffffff;
  border-radius: 6px;
  padding: 0.12rem;
  box-shadow: inset 0 0 0 1px #d8dee4;
}
.queue-toolbar .lib-tab {
  border: none;
  background: transparent;
  padding: 0.28rem 0.55rem;
  font-size: 0.76rem;
  border-radius: 4px;
  color: #5e6772;
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
}
.queue-toolbar .lib-tab:hover {
  background: #eaeef2;
  color: #1f2328;
}
.queue-toolbar .lib-tab.active {
  background: #ffffff;
  color: #0969da;
  box-shadow: 0 0 0 1px #54aeff, 0 1px 2px rgba(9, 105, 218, 0.15);
}
.queue-toolbar .lib-tab.active .lib-tab-count {
  background: #ddf4ff;
  color: #0550ae;
}
.queue-toolbar .lib-tab-count {
  font-size: 0.65rem;
  padding: 0 0.32rem;
  min-width: 1rem;
  background: #eaeef2;
  color: #6e7781;
}
.queue-toolbar .lib-search {
  flex: 1;
  min-width: 140px;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  background: #ffffff;
  border-color: #d8dee4;
}
.queue-status-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}
.queue-status-tab input[type='radio'] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.site-card {
  display: flex;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
}
.site-card .site-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.site-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
}
.site-title strong {
  color: #1f2328;
  font-size: 0.92rem;
}
.site-url-link {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.78rem;
  color: #0969da;
  text-decoration: none;
  word-break: break-all;
}
.site-url-link:hover {
  text-decoration: underline;
}
.site-description {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #656d76;
  white-space: pre-wrap;
}
.site-footer {
  font-size: 0.72rem;
  color: #656d76;
}
.site-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: none;
}
.site-actions button {
  width: auto !important;
  margin: 0 !important;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
}
.site-del-btn:hover {
  background: #cf222e !important;
  border-color: #cf222e !important;
  color: #fff !important;
}

/* ===== Login page ===== */
body.login-page {
  background: #f6f8fa;
  min-height: 100vh;
}
body.login-page .login-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  padding: 2rem;
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 8px 24px rgba(31, 35, 40, 0.06);
}
.login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}
.login-logo {
  font-size: 2rem;
  margin-bottom: 0.2rem;
}
.login-card h1 {
  margin: 0;
  font-size: 1.15rem;
  color: #1f2328;
}
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #656d76;
}
.login-card label > span {
  font-weight: 600;
  color: #1f2328;
  font-size: 0.83rem;
}
.login-card input[type='text'],
.login-card input[type='password'] {
  background: #ffffff;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.login-card input:focus {
  outline: 1px solid #0969da;
  border-color: #0969da;
}
#login-btn {
  margin-top: 0.5rem;
  background: #1a7f37;
  color: #fff;
  border: 1px solid #1a7f37;
  border-radius: 6px;
  padding: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
#login-btn:hover:not(:disabled) {
  background: #117027;
}
.login-error {
  background: #ffebe9;
  border: 1px solid #ffcecb;
  color: #cf222e;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.82rem;
  margin: 0;
}

/* ===== Docs page ===== */
body.docs-page main.docs-main {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem;
  padding: 1rem 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 900px) {
  body.docs-page main.docs-main {
    grid-template-columns: 1fr;
  }
}
.docs-toc {
  position: sticky;
  top: 1rem;
  align-self: start;
  font-size: 0.85rem;
}
@media (max-width: 900px) {
  .docs-toc { position: static; }
}
.docs-toc h3 {
  margin: 0 0 0.5rem;
  color: #656d76;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.docs-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  counter-reset: tocCounter;
}
.docs-toc li {
  counter-increment: tocCounter;
}
.docs-toc a {
  display: flex;
  gap: 0.45rem;
  color: #656d76;
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  border-left: 2px solid transparent;
  font-size: 0.84rem;
}
.docs-toc a::before {
  content: counter(tocCounter) ".";
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  flex: none;
  width: 1.1rem;
}
.docs-toc a:hover {
  color: #1f2328;
  background: #f6f8fa;
  border-left-color: #0969da;
}

.docs-content {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1.5rem 2rem 2rem;
  min-width: 0;
  line-height: 1.6;
  color: #1f2328;
}
.docs-hero {
  border-bottom: 1px solid #eaeef2;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}
.docs-hero h2 {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
}
.docs-hero p {
  margin: 0;
  font-size: 0.95rem;
}
.docs-content section {
  margin-top: 2.25rem;
  scroll-margin-top: 1rem;
}
.docs-content section:first-of-type {
  margin-top: 0.5rem;
}
.docs-content h3 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  color: #1f2328;
  border-bottom: 2px solid #0969da;
  padding-bottom: 0.35rem;
  display: inline-block;
}
.docs-content h4 {
  margin: 1.25rem 0 0.55rem;
  font-size: 0.98rem;
  color: #1f2328;
}
.docs-content p {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}
.docs-content ul,
.docs-content ol {
  padding-left: 1.4rem;
  margin: 0 0 0.85rem;
}
.docs-content li {
  font-size: 0.92rem;
  margin-bottom: 0.45rem;
}
.docs-content code {
  background: #f6f8fa;
  border: 1px solid #eaeef2;
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  font-size: 0.82rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

.docs-template {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0.5rem 0 1rem;
  color: #1f2328;
}
.docs-template strong {
  color: #0550ae;
  font-weight: 600;
}
.docs-template.snippet {
  font-size: 0.75rem;
  margin-top: 0.3rem;
}

.callout {
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0.85rem 0 0;
}
.callout-tip {
  background: #ddf4ff;
  border: 1px solid #54aeff;
  color: #0550ae;
}
.callout-tip code {
  background: #fff;
  border-color: #b6e3ff;
}
.callout-warn {
  background: #fff8c5;
  border: 1px solid #d4a72c;
  color: #633c01;
}
.callout-warn code {
  background: #fff;
  border-color: #eac54f;
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.85rem;
  font-size: 0.85rem;
}
.docs-table th,
.docs-table td {
  border: 1px solid #d0d7de;
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
.docs-table th {
  background: #f6f8fa;
  font-weight: 600;
}
.docs-table code {
  background: #f6f8fa;
  padding: 0 0.25rem;
  border-radius: 3px;
}

.principle {
  margin-top: 1.1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed #eaeef2;
}
.principle:last-child {
  border-bottom: none;
}
.ex-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.4rem;
}
@media (max-width: 700px) {
  .ex-row { grid-template-columns: 1fr; }
}
.ex {
  border: 1px solid;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ex.bad {
  border-color: #ffabaa;
  background: #fff5f5;
}
.ex.good {
  border-color: #aceeb2;
  background: #f0fff4;
}
.bad-label {
  color: #cf222e;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.good-label {
  color: #1a7f37;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ex code {
  background: #fff;
}

.ex-block {
  margin: 1.1rem 0;
  padding-bottom: 0.4rem;
}
.ex-block h4 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pitfalls {
  list-style: none;
  padding: 0;
}
.pitfalls li {
  padding: 0.55rem 0.75rem;
  border-left: 3px solid #cf222e;
  background: #fff5f5;
  border-radius: 4px;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
}

.template-card {
  border: 1px solid #d0d7de;
  border-radius: 6px;
  margin-bottom: 0.7rem;
  background: #ffffff;
}
.template-card > summary {
  cursor: pointer;
  padding: 0.55rem 0.85rem;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f6f8fa;
  border-radius: 6px;
  font-size: 0.9rem;
}
.template-card[open] > summary {
  border-bottom: 1px solid #d0d7de;
  border-radius: 6px 6px 0 0;
}
.template-card > summary::-webkit-details-marker {
  display: none;
}
.template-card > summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: #656d76;
  transition: transform 0.15s;
}
.template-card[open] > summary::before {
  transform: rotate(90deg);
}
.template-card .docs-template {
  margin: 0;
  border-radius: 0 0 6px 6px;
  border: none;
}

/* ===== Automation page ===== */
body.automation-page main.automation-main {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  gap: 1rem;
  height: calc(100vh - 56px);
  overflow: hidden;
}
.automation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #d0d7de;
}
.automation-title h2 { margin: 0; font-size: 1.05rem; }
.automation-title p { margin: 0.2rem 0 0; font-size: 0.82rem; }
.automation-auto-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}
.automation-auto-toggle input { transform: scale(1.2); }

.automation-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}
.automation-steps {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow-y: auto;
}
.automation-step {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: #1f2328;
  font-family: inherit;
  transition: background 0.1s;
}
.automation-step:hover:not(:disabled):not(.active) { background: #f6f8fa; }
.automation-step.active {
  background: #ddf4ff;
  border-color: #54aeff;
  color: #0550ae;
}
.automation-step:disabled {
  cursor: not-allowed;
  color: #8c959f;
}
.automation-step .step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eaeef2;
  color: #57606a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.automation-step.active .step-num { background: #0969da; color: #ffffff; }
.automation-step:disabled .step-num { background: #eaeef2; color: #8c959f; }
.automation-step .step-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.automation-step .step-label strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: inherit;
}
.automation-step .step-label em {
  font-size: 0.76rem;
  font-style: normal;
  color: #57606a;
}
.automation-step.active .step-label em { color: #0969da; }
.automation-step:disabled .step-label em { color: #8c959f; }

.automation-detail {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.automation-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eaeef2;
}
.automation-panel-header h3 { margin: 0; font-size: 0.95rem; }

.automation-controls {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}
.automation-jql {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.automation-jql input, .automation-max input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
}
.automation-jql > span, .automation-max > span {
  font-size: 0.75rem;
  color: #656d76;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.automation-max {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 70px;
}
.automation-controls #fetch-btn {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  height: 32px;
  line-height: 1;
  align-self: flex-end;
  white-space: nowrap;
}
.fetch-helper {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}

/* Single-ticket detail card (Step 1) */
.ticket-card {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.ticket-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.ticket-key {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0969da;
  text-decoration: none;
}
.ticket-key:hover { text-decoration: underline; }
.ticket-type, .ticket-site { font-size: 0.78rem; }
.ticket-summary {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2328;
  line-height: 1.4;
}
.ticket-section h5 {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #656d76;
}
.ticket-body {
  margin: 0;
  padding: 0.7rem 0.9rem;
  background: #f6f8fa;
  border: 1px solid #eaeef2;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow-y: auto;
}
.ticket-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eaeef2;
}

/* Step 2 — Generate form */
.gen-context {
  margin-bottom: 0.8rem;
}
.ticket-label, .ticket-component {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #ddf4ff;
  color: #0550ae;
  border: 1px solid #b6e3ff;
}
.ticket-component {
  background: #fff8c5;
  color: #7d4e00;
  border-color: #f0d68c;
}

/* Platform detection banner */
.detect-banner {
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: 0.8rem;
  border: 1px solid;
}
.detect-banner code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-size: 0.78rem;
}
.detect-banner-ok {
  background: #dafbe1;
  border-color: #aceebb;
  color: #1a7f37;
}
.detect-banner-warn {
  background: #fff8c5;
  border-color: #f0d68c;
  color: #7d4e00;
}
.detect-banner-none {
  background: #ffebe9;
  border-color: #ffabb3;
  color: #cf222e;
}
.detect-banner-pending {
  background: #ddf4ff;
  border-color: #b6e3ff;
  color: #0550ae;
}
.eval-list {
  margin: 0.3rem 0 0;
  padding-left: 1.4rem;
  font-size: 0.8rem;
  line-height: 1.55;
}
.eval-suggestions { margin-top: 0.4rem; }
.eval-rows {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.eval-row {
  display: grid;
  grid-template-columns: 18px 110px 1fr;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  padding: 0.2rem 0;
}
.eval-row .eval-icon {
  font-weight: 700;
  text-align: center;
}
.eval-row .eval-field {
  font-weight: 600;
}
.eval-row-ok .eval-icon { color: #1a7f37; }
.eval-row-bad .eval-icon { color: #cf222e; }
.us-fix-dialog {
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.us-fix-dialog h5 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}
.us-fix-dialog #us-fix-send-btn,
.us-fix-dialog #us-fix-cancel-btn {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  height: 34px;
  line-height: 1;
  white-space: nowrap;
}
.gen-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 0.8rem;
}
.gen-fieldset {
  border: 1px solid #eaeef2;
  border-radius: 6px;
  padding: 0.4rem 0.7rem 0.6rem;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.gen-fieldset legend {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #656d76;
  padding: 0 0.4rem;
}
.gen-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.gen-radio em { font-weight: normal; }
.gen-target {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.gen-target > span {
  font-size: 0.78rem;
  color: #656d76;
  font-weight: 600;
}
.gen-target input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 0.85rem;
}
.gen-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-top: 0.3rem;
  border-top: 1px solid #eaeef2;
}
.gen-actions #gen-submit-btn,
.gen-actions #push-submit-btn {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  height: 34px;
  line-height: 1;
  white-space: nowrap;
}

.gen-preview {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.gen-preview-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.gen-preview-head h5 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #656d76;
}
.gen-preview-md {
  max-height: 420px;
}
.gen-preview-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eaeef2;
}

/* Step 3 — Push to queue */
.push-summary {
  font-size: 0.85rem;
  color: #1f2328;
  padding: 0.5rem 0.8rem;
  background: #f6f8fa;
  border: 1px solid #eaeef2;
  border-radius: 6px;
  margin-bottom: 0.7rem;
}
.push-summary code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-size: 0.78rem;
}
.push-open-queue {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #f6f8fa;
  color: #0969da;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  height: 32px;
  line-height: 1;
}
.push-open-queue:hover {
  background: #eaeef2;
  border-color: #8c959f;
}
.push-jobs-section {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #ffffff;
}
.push-jobs-section h5 {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #656d76;
}
.push-jobs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.push-job {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  background: #f6f8fa;
  border: 1px solid #eaeef2;
  border-radius: 6px;
  font-size: 0.82rem;
}
.push-job .badge { justify-self: start; }
.push-job-name {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
  color: #1f2328;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.push-job-meta { font-size: 0.75rem; }
.gen-actions .push-open-queue { margin: 0; }

/* Step 4 — Report to Jira */
.report-jobs {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.report-comment-row, .report-transition-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}
.report-comment-row > span, .report-transition-row > span {
  font-size: 0.78rem;
  color: #656d76;
  font-weight: 600;
}
.report-comment-area {
  padding: 0.7rem 0.9rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  resize: vertical;
  background: #ffffff;
}
.report-transition-row select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #ffffff;
}
.gen-actions #report-post-btn,
.gen-actions #report-refresh-btn {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  height: 34px;
  line-height: 1;
  white-space: nowrap;
}

/* Auto mode pane */
.auto-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #ffffff;
}
.auto-pane-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}
.auto-key-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.auto-key-label > span {
  font-size: 0.75rem;
  color: #656d76;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auto-key-label input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85rem;
}
#auto-run-btn {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 0.9rem;
  height: 32px;
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
}
.auto-pane-help { margin: 0; font-size: 0.78rem; }
.auto-split-row {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 6fr 4fr;
  gap: 0.8rem;
  align-items: stretch;
}
.auto-split-row > section { min-width: 0; min-height: 0; }
@media (max-width: 1100px) {
  .auto-split-row { grid-template-columns: 1fr; }
}
.auto-log-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid #eaeef2;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  background: #fcfcfd;
}
.auto-log-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.auto-log-head h4 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #656d76;
}
.auto-log {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
}
.auto-evt {
  display: grid;
  grid-template-columns: 70px 20px 110px 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: #f6f8fa;
}
.auto-evt-ts {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.72rem;
  color: #656d76;
}
.auto-evt-icon { text-align: center; font-weight: 700; }
.auto-evt-step { font-weight: 600; white-space: nowrap; }
.auto-evt-detail {
  font-size: 0.78rem;
  white-space: nowrap;
}
.auto-evt-ok .auto-evt-icon { color: #1a7f37; }
.auto-evt-fail { background: #ffebe9; }
.auto-evt-fail .auto-evt-icon { color: #cf222e; }
.auto-evt-skip { background: #fff8c5; }
.auto-evt-skip .auto-evt-icon { color: #7d4e00; }
.auto-evt-info .auto-evt-icon { color: #0550ae; }

/* Auto pipeline config (rendered inside modal) */
#auto-config-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.auto-config-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.auto-config-globals label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.auto-config-globals label span {
  font-size: 0.72rem;
  color: #656d76;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auto-config-globals input {
  padding: 0.3rem 0.5rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 0.85rem;
  width: 130px;
}
.auto-config-focus { flex: 1; min-width: 200px; }
.auto-config-focus input { width: 100%; font-family: ui-monospace, SFMono-Regular, monospace; }
#auto-config-poll-now {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.7rem;
  height: 30px;
  font-size: 0.78rem;
  line-height: 1;
  align-self: flex-end;
}
.auto-step-config {
  border: 1px solid #eaeef2;
  border-radius: 6px;
  padding: 0.5rem 0.8rem 0.7rem;
  margin: 0;
  background: #ffffff;
}
.auto-step-config legend {
  font-size: 0.85rem;
  padding: 0 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.auto-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 0.7rem;
  margin-top: 0.3rem;
}
.auto-step-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.auto-step-grid label span {
  font-size: 0.72rem;
  color: #656d76;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auto-step-grid input[type="text"],
.auto-step-grid select.auto-status-select {
  padding: 0.35rem 0.55rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #ffffff;
}
.auto-step-grid input[type="text"]:disabled {
  background: #eaeef2;
  color: #8c959f;
  cursor: not-allowed;
}
.step-label-with-toggle > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.step-label-toggle {
  transform: scale(0.9);
  cursor: pointer;
}
.auto-config-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
#auto-config-save {
  width: auto;
  margin: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  height: 34px;
  line-height: 1;
}

/* Auto-poll master switch (prominent on/off at the top of auto pane) */
.auto-master-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #f6f8fa;
  transition: background 0.15s, border-color 0.15s;
}
.auto-master-row.is-on {
  background: #ddf4e4;
  border-color: #1a7f37;
}
.auto-master-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto;
}
.auto-master-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.auto-master-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #8c959f;
  border-radius: 999px;
  transition: background 0.15s;
  flex: 0 0 auto;
}
.auto-master-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.auto-master-switch input:checked + .auto-master-track {
  background: #1a7f37;
}
.auto-master-switch input:checked + .auto-master-track .auto-master-thumb {
  transform: translateX(20px);
}
.auto-master-switch input:disabled + .auto-master-track {
  opacity: 0.6;
  cursor: not-allowed;
}
/* Auto poll status indicator + recent runs */
.auto-status-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}
.auto-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.auto-status-dot.status-on { background: #1a7f37; box-shadow: 0 0 0 3px #aceebb55; }
.auto-status-dot.status-off { background: #8c959f; }
.auto-status-dot.status-warn { background: #bf8700; box-shadow: 0 0 0 3px #f0d68c55; }
.auto-status-dot.status-busy {
  background: #0969da;
  box-shadow: 0 0 0 3px #b6e3ff55;
  animation: status-pulse 1.2s infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.auto-status-text { font-weight: 600; flex: 0 0 auto; }
.auto-status-meta { font-size: 0.78rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#auto-config-btn,
#auto-jql-toggle {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.2rem 0.5rem;
  height: 26px;
  font-size: 0.95rem;
  line-height: 1;
}
.auto-step-jql-section,
.auto-recent-section {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  background: #ffffff;
}
.auto-step-jql-section > summary,
.auto-recent-section > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  outline: none;
  user-select: none;
}
.auto-step-jql-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.auto-step-jql-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: #f6f8fa;
  border-radius: 4px;
  font-size: 0.8rem;
}
.auto-step-jql-name { font-weight: 600; }
.auto-jql-view-btn {
  width: auto;
  margin: 0;
  padding: 0.15rem 0.4rem;
  height: 24px;
  font-size: 0.85rem;
  line-height: 1;
}
.auto-jql-view-text {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85rem;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1f2328;
}
.auto-jql-view-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
#auto-jql-view-copy { width: auto; margin: 0; padding: 0.35rem 0.8rem; }
.auto-recent-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 240px;
  overflow-y: auto;
}
.auto-recent-row {
  display: grid;
  grid-template-columns: 90px 110px 1fr 80px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: #f6f8fa;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.1s;
}
.auto-recent-row:hover {
  background: #ddf4ff;
}
.auto-run-detail-meta { font-size: 0.78rem; padding: 0 0 0.5rem; }
.auto-run-detail-log { max-height: 60vh; overflow-y: auto; }
.auto-recent-key {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 600;
  color: #0969da;
}
.auto-evt-key {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.72rem;
  color: #0550ae;
  padding: 0 0.3rem;
  background: #ddf4ff;
  border-radius: 3px;
}
.auto-evt {
  grid-template-columns: 70px 20px auto 110px 1fr;
}

.automation-result {
  margin-top: 0.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.automation-result-summary { margin-bottom: 0.5rem; font-size: 0.78rem; }
.automation-issues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.automation-issue {
  display: grid;
  grid-template-columns: 90px 90px 1fr auto 140px 80px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: #f6f8fa;
  border: 1px solid #eaeef2;
  border-radius: 6px;
  font-size: 0.82rem;
}
.automation-issue:hover { background: #eaeef2; }
.automation-issue .issue-key {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 600;
  color: #0969da;
  text-decoration: none;
}
.automation-issue .issue-key:hover { text-decoration: underline; }
.automation-issue .issue-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-block {
  background: #ffebe9;
  border: 1px solid #ffabb3;
  border-radius: 6px;
  padding: 0.7rem;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.jira-register-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #f6f8fa;
  color: #0969da;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
}
.jira-register-link:hover {
  background: #eaeef2;
  border-color: #8c959f;
}

.placeholder {
  padding: 2rem;
  text-align: center;
  color: #656d76;
  background: #f6f8fa;
  border-radius: 8px;
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  body.automation-page main.automation-main {
    height: auto;
    overflow: visible;
  }
  .automation-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .automation-issue {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}
