:root {
  --bg1: #0f172a;
  --bg2: #1e293b;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --right-panel: rgba(6, 182, 212, 0.03);
  --panel: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e5e7eb;
  --muted: #94a3b8;
  /* Corner radius tokens used to make corners slightly rounder */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
}

body {
  background: var(--bg1);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  /* prevent whole-page scroll */
}

/* Slightly smaller base font for denser UI */
body {
  font-size: 14px;
}

/* Global Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.layout {
  display: flex;
  flex: 1 1 auto;
  /* fill remaining space under header/banner */
  min-height: 0;
  /* allow children to manage their own overflow */
  gap: 16px;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
  /* contain panel scrolling to children */
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 120;
}

.site-title {
  font-size: 16px;
  letter-spacing: 0.2px;
  color: var(--text);
  font-weight: 700;
}

.test-progress {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: auto;
}

.progress-text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.progress-bar {
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 3px;
}

.site-header .room-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-selection-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-room-name {
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
}

.current-room-name .room-icon {
  font-size: 12px;
  margin-right: 6px;
  opacity: 0.9;
}

.current-room-name .room-name-text {
  font-weight: 600;
}

.site-header .user-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-note {
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed var(--border);
  padding: 6px 10px;
  border-radius: 999px;
}

.site-header .user-controls .user-info {
  color: var(--text);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.groupier-bubble {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.groupier-bubble:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
}

@media (max-width: 720px) {
  .site-header {
    gap: 8px;
    padding: 8px 12px;
  }

  .site-header .room-controls {
    gap: 6px;
  }

  .room-selection-area {
    gap: 6px;
  }

  .site-title {
    font-size: 16px;
  }

  .current-room-name {
    font-size: 12px;
    padding: 4px 8px;
  }

  .current-room-name .room-icon {
    font-size: 10px;
    margin-right: 4px;
  }

  #createRoomBtn {
    font-size: 13px;
    padding: 4px 8px;
  }

  #changeRoomBtn {
    font-size: 13px;
    padding: 4px 8px;
  }
}

.site-header .room-controls label {
  margin: 0;
}

.left,
.right {
  backdrop-filter: blur(8px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.left {
  width: 40%;
  padding: 16px;
  box-sizing: border-box;
  /* Allow the left panel to scroll internally so tall form elements
     (e.g., image previews) don't push the submit button off-screen.
     Previously this was `overflow: hidden;` which prevented scrolling
     of the left column and made form controls unreachable. */
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  /* left panel doesn't scroll */
}

.left-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 12px;
}

.section-title {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.right {
  flex: 1;
  padding: 16px;
  box-sizing: border-box;
  /* make the right panel a column so header stays fixed and inner
     content can scroll independently */
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--right-panel);
}

.right-scroll {
  /* inner scrollable area for right-panel content */
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

/* Right header (keeps title and controls aligned) */
.right-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
}

/* Small select used for issue filtering */
.issues-filter select {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
}

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

.issues-filter .filter-label {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Keep the right panel title visible when the panel scrolls.
   Use a non-child selector so the title keeps its background even if
   the DOM structure changes slightly (e.g., wrapped or moved). */
.right .section-title {
  margin-top: 0;
  margin-bottom: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
  /* Remove heavy background so the title visually blends with the panel */
  background: transparent;
  /* Remove the bottom border so the title sits flush with the header */
  border-bottom: none;
}

.hidden {
  display: none !important;
}

.issue {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  transition: opacity 1.5s ease, transform 0.4s ease, box-shadow 0.2s ease;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.issue.not-mine {
  background: rgba(255, 255, 255, 0.12);
}

.issue:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.issue.fade {
  filter: saturate(0.6) brightness(0.9);
}

.issue.fade .dimmable {
  opacity: 0.25;
  transition: opacity 1.5s ease;
}

.issue.enter {
  animation: popIn 350ms ease-out;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* De-emphasize placeholder cards for "no issue reported" entries.
   Keep them in the flow but reduce contrast, remove heavy shadows
   and disable hover transforms so they don't compete with real issues. */
.issue.placeholder {
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.03);
  box-shadow: none;
  color: var(--muted);
  padding: 10px;
}
.issue.placeholder:hover {
  transform: none;
  box-shadow: none;
}
.issue.placeholder .issue-footer {
  opacity: 0.85;
}

.row {
  display: flex;
  gap: 8px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Make the Save Issue button green within the issue form */
#issueForm .form-actions button[type="submit"] {
  background: #16a34a;
  /* green-600 */
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.25);
}

#issueForm .form-actions button[type="submit"]:hover {
  /* Remove glow on hover for submit button to keep interaction subtle */
  box-shadow: none;
  transform: none;
}

label {
  display: block;
  margin-top: 10px;
  font-weight: 600;
  color: var(--muted);
}

/* Form-side labels should have bottom spacing */
.left label {
  margin-bottom: 10px;
}

.reasons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.reasons > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px 0;
  /* prevent extra top margins from stacking */
  font-weight: 500;
  color: var(--text);
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  outline: none;
}

button {
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: white;
  cursor: pointer;
}

/* Make the Create Room button wider */
#createRoomBtn {
  min-width: 36px;
}

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

.btn-tag {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.btn-tag:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.btn-tag.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

/* Distinct shading for the Open status button */
.btn-tag[data-tag="clear-status"] {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.btn-tag[data-tag="clear-status"]:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-tag.active[data-tag="clear-status"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

/* Clear button styling */
.btn-tag[data-action="clearStatus"] {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.btn-tag[data-action="clearStatus"]:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.6);
}

.btn-jira {
  background: #0052cc;
  box-shadow: 0 6px 18px rgba(38, 132, 255, 0.25);
}

.btn-danger {
  background: #b91c1c;
  box-shadow: 0 6px 18px rgba(185, 28, 28, 0.25);
}

.btn-danger:hover {
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.35);
}

.btn-jira:hover {
  box-shadow: 0 10px 22px rgba(38, 132, 255, 0.35);
}

/* Styled file input button */
#images::file-selector-button,
#images::-webkit-file-upload-button {
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.25);
  margin-right: 10px;
}

#images:hover::file-selector-button,
#images:hover::-webkit-file-upload-button {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(6, 182, 212, 0.35);
}

#images:active::file-selector-button,
#images:active::-webkit-file-upload-button {
  transform: translateY(0);
}

#images:disabled::file-selector-button,
#images:disabled::-webkit-file-upload-button {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Visual affordance when dragging files over the input */
#images.drag-over {
  outline: 2px dashed var(--accent-2);
  outline-offset: 6px;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.03);
}

/* Dropzone */
.images-dropzone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-height: 56px;
  max-height: 220px;
  overflow: hidden;
}
.images-dropzone.drag-over {
  background: rgba(6, 182, 212, 0.03);
  border-color: var(--accent-2);
  color: var(--text);
}

/* Small preview area shown below the file input when files are selected/dropped */
.images-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  max-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  align-items: stretch;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.images-preview-item {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  flex: 0 0 auto;
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.images-preview-remove {
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(185, 28, 28, 0.12);
  color: #ffdddd;
  cursor: pointer;
}
.images-preview-remove:hover {
  background: rgba(185, 28, 28, 0.22);
}
.images-preview-thumb {
  max-height: 72px;
  max-width: 96px;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.images-preview-name {
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Temporarily hide tag legend */
#tagLegend {
  display: none !important;
}

.images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.images img {
  max-height: 96px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  cursor: zoom-in;
}

.images img:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.tags {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.v-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 8px;
}

/* Issue footer (action bar at the bottom of each issue) */
.issue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  background: transparent;
}

/* Visual state when an issue has been sent to Jira successfully */
.issue.jira-sent {
  border-color: rgba(245, 158, 11, 0.14);
}
.issue.jira-sent .issue-footer,
.issue-footer.jpa-sent {
  background: rgba(245, 158, 11, 0.04);
  border-top-color: rgba(245, 158, 11, 0.14);
}
.issue.jira-sent .jira-note a {
  color: #f97316; /* orange link color for Jira */
}

.issue-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.issue-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.issue-footer .jira-note {
  color: var(--muted);
  font-size: 13px;
}

.issue-footer .jira-note a {
  color: #2684ff;
  text-decoration: none;
}

.issue-footer .jira-note a:hover {
  text-decoration: underline;
}

.footer-label {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 600px) {
  .issue-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .issue-footer-right {
    justify-content: flex-end;
  }
}

/* shimmer removed */

/* Lightbox for full-size images */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
}

/* Test Script Lines */
.test-script-lines {
  margin-bottom: 16px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.1);
  padding: 12px;
}

/* Custom scrollbar for test script lines */
.test-script-lines::-webkit-scrollbar {
  width: 8px;
}

.test-script-lines::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.test-script-lines::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 4px;
  opacity: 0.6;
}

.test-script-lines::-webkit-scrollbar-thumb:hover {
  background: var(--text);
  opacity: 0.8;
}

.test-script-lines-title {
  /* Match the other section titles for consistent visual hierarchy */
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.test-script-hide-checked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}

.test-script-hide-checked input {
  cursor: pointer;
}

/* Auth placeholder card for unauthenticated visitors */
.auth-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  min-height: 140px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: var(--radius-md);
}
.auth-card-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.auth-card-desc {
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 14px;
}
.auth-card-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.auth-card-actions button {
  min-width: 120px;
}

/* Small icon-only button used for create room */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.icon-btn svg {
  display: block;
}

/* Remove glow/box-shadow from all buttons and related interactive controls.
   Users requested a flatter, non-glowy UI — apply an explicit override so
   no button shows a glowing shadow on hover or focus. */
button,
input[type="button"],
input[type="submit"],
.btn-tag,
.btn-jira,
.btn-danger,
.icon-btn,
#images::file-selector-button,
#images::-webkit-file-upload-button {
  box-shadow: none !important;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.btn-tag:hover,
.btn-jira:hover,
.btn-danger:hover,
.icon-btn:hover,
#images:hover::file-selector-button,
#images:hover::-webkit-file-upload-button {
  box-shadow: none !important;
  transform: none !important;
}

/* Also clear any focus rings that were implemented via box-shadow on focus */
button:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
.btn-tag:focus,
.btn-jira:focus,
.btn-danger:focus,
.icon-btn:focus {
  box-shadow: none !important;
  outline: 2px solid rgba(124, 58, 237, 0.12); /* keep keyboard focus visible but subtle */
}

/* Make header room controls more compact */
.room-selection-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-selection-area select,
.room-selection-area #roomSelect {
  max-width: 240px;
  min-width: 120px;
}

/* Make the Change Test Fest control low-contrast and compact */
#changeRoomBtn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}

#changeRoomBtn:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

/* When using the icon-only variant, match the compact icon button sizing */
#changeRoomBtn.icon-btn {
  padding: 6px;
  width: 40px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#changeRoomBtn.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Icon-only create button should be compact and square */
.icon-btn {
  padding: 6px;
  width: 40px;
  height: 36px;
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Full-screen centered auth container */
.auth-center {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
  background: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25));
}
.auth-center .auth-card {
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(6px);
}

@media (max-width: 720px) {
  .auth-center {
    padding: 16px;
  }
  .auth-card {
    width: 100%;
    max-width: 420px;
  }
  .auth-card-actions {
    flex-direction: column;
  }
  .auth-card-actions button {
    width: 100%;
  }
}

/* Slightly adjust room chooser select to match form fields */
#roomChooserSelect {
  background: rgba(0, 0, 0, 0.12);
}

.test-script-line {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease, transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.test-script-line:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.test-script-line.checked {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.test-script-line.selected {
  /* Strong dark-green selected state for clear emphasis */
  background: linear-gradient(90deg, #064e3b, #065f46);
  border-color: rgba(6, 95, 70, 0.7);
  box-shadow: 0 12px 30px rgba(6, 95, 70, 0.14);
  color: #ffffff;
  transform: translateX(2px);
  transition: transform 220ms ease, box-shadow 300ms ease, background 300ms ease;
  animation: testScriptSelectPulse 900ms ease;
}

@keyframes testScriptSelectPulse {
  0% {
    transform: translateX(2px) scale(1);
    box-shadow: 0 6px 18px rgba(6, 95, 70, 0.08);
  }
  50% {
    transform: translateX(2px) scale(1.02);
    box-shadow: 0 22px 44px rgba(6, 95, 70, 0.18);
  }
  100% {
    transform: translateX(2px) scale(1);
    box-shadow: 0 12px 30px rgba(6, 95, 70, 0.14);
  }
}

/* Temporary highlight used when scrolling the right panel to a matched issue */
.issue.scroll-highlight {
  animation: scrollHighlightFade 1400ms ease forwards;
}

@keyframes scrollHighlightFade {
  0% {
    background: rgba(34, 197, 94, 0.08);
    box-shadow: 0 20px 46px rgba(34, 197, 94, 0.18);
    transform: translateY(-2px);
  }
  60% {
    background: rgba(34, 197, 94, 0.06);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.12);
    transform: translateY(0);
  }
  100% {
    background: transparent;
    box-shadow: none;
    transform: translateY(0);
  }
}

/* Small badge showing the selected script ID next to the description label */
.selected-script-badge {
  display: inline-block;
  margin-left: 8px;
  background: rgba(124, 58, 237, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.test-script-line-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.test-script-line-content {
  flex: 1;
  min-width: 0;
}

.test-script-line-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.test-script-line-script-id {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.test-script-line-name {
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.test-script-line-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  margin-top: 4px;
}

.test-script-line-db-notes {
  color: var(--text);
  font-size: 13px;
  margin-top: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border-left: 3px solid var(--accent);
  font-style: normal;
}

/* Prevent long database note text from overflowing the card
   - clamp to a few lines visually and hide overflow to avoid layout breakage */
.test-script-line-db-notes {
  /* Allow the DB notes container to grow vertically to fit wrapped text.
     Ensure long/unbroken strings wrap to avoid horizontal overflow. */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.test-script-line-db-notes a {
  color: #c4b5fd;
  text-decoration: underline;
  text-decoration-color: rgba(196, 181, 253, 0.6);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.test-script-line-db-notes a:hover {
  color: #ddd6fe;
  text-decoration-color: #ddd6fe;
}

.test-script-line-notes {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  margin-top: 6px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid var(--accent-2);
}

.test-script-line-notes a {
  color: #67e8f9;
  text-decoration: underline;
  text-decoration-color: rgba(103, 232, 249, 0.6);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
  font-style: normal;
}

.test-script-line-notes a:hover {
  color: #a5f3fc;
  text-decoration-color: #a5f3fc;
}

.test-script-lines-empty {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* Room Creation Modal Styles */
.room-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.room-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.room-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.room-modal-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.room-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.room-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.room-modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-help {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-actions button[type="button"] {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.form-actions button[type="button"]:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.form-actions button[type="submit"] {
  background: var(--accent);
  color: white;
}

.form-actions button[type="submit"]:hover {
  background: #6d28d9;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}
.toast {
  min-width: 220px;
  max-width: 360px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: transform 220ms ease, opacity 220ms ease;
  cursor: pointer;
}
.toast-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}
.toast-msg {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}
.toast-enter {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast-leave {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}
.toast-info {
  background: linear-gradient(
    90deg,
    rgba(6, 182, 212, 0.08),
    rgba(124, 58, 237, 0.06)
  );
  color: var(--text);
  border: 1px solid rgba(124, 58, 237, 0.12);
}
.toast-warn {
  background: linear-gradient(
    90deg,
    rgba(245, 158, 11, 0.08),
    rgba(245, 158, 11, 0.04)
  );
  color: #fff;
  border: 1px solid rgba(245, 158, 11, 0.14);
}
.toast-success {
  background: linear-gradient(
    90deg,
    rgba(34, 197, 94, 0.06),
    rgba(6, 95, 70, 0.04)
  );
  color: #fff;
  border: 1px solid rgba(34, 197, 94, 0.12);
}
