/*
 * Payrexx Release Testing — styled after Payrexx Start ("Sky", after
 * payrexx.com): sky-blue gradient band, Hanken Grotesk headlines, pill
 * shapes, white cards on light grey and brand lime as the highlight.
 * Colours from the Payrexx palette.
 */
:root {
  --bg: #F7F7F7;
  --surface: #FFFFFF;
  --border: #E2E3E3;
  --text: #2C2E2F;
  --muted: #65696B;
  --ink: #2C2E2F;               /* dark buttons / active states */
  --ink-dark: #161718;
  --primary: #00AFF0;           /* cyan-400 */
  --primary-dark: #04729B;      /* cyan-700 */
  --primary-soft: #E5F7FD;      /* cyan-50 */
  --primary-soft-hover: #C5EEF9; /* cyan-100 */
  --lime: #A5F94D;              /* green-400, brand lime */
  --dark-blue: #031B91;         /* Payrexx Dark Blue: emphasis (admin role) */

  --pass: #477900;     --pass-soft: #E7FFD6;  --pass-text: #315600; /* green-700 / 100 / 800 */
  --fail: #BA3437;     --fail-soft: #FBE4E3;  --fail-text: #A32A2E; /* red-600 / 100 / 700 */
  --blocked: #C2670A;  --blocked-soft: #FDF0DC; --blocked-text: #8A4A06;
  --skipped: #A3A7A9;  --skipped-soft: #F0F1F1;
  --pending: #E2E3E3;

  --radius: 20px;
  --shadow: 0 1px 2px rgba(44, 46, 47, 0.06), 0 2px 8px rgba(44, 46, 47, 0.04);
  --shadow-lg: 0 14px 34px rgba(4, 114, 155, 0.18);
  --ring: 0 0 0 3px rgba(0, 175, 240, 0.25);

  /* Buttons, after the Payrexx application (backoffice design tokens) as the Payrexx
     tenant sees it: its backend profile sets primary #00AFF0 / hover #4EC3F0, the rest is
     derived by TenantTokenStyleSheetService (tints 12/20/25 % on white, text darkened to
     4.5:1, accent to 3:1). */
  --radius-md: 6px;
  --focus-ring: #2181E0;                 /* blue-400 */
  --btn-primary: #00AFF0;                /* tenant primary */
  --btn-primary-hover: #4EC3F0;          /* tenant primary hover */
  --btn-primary-active: #4EC3F0;         /* pressed = hover + inset shadow */
  --btn-primary-label: #FFFFFF;
  --btn-primary-shadow-active: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  --btn-secondary: #E0F5FD;              /* primary-subtle, tonal */
  --btn-secondary-hover: #CCEFFC;        /* primary-subtle-hover */
  --btn-secondary-active: #BFEBFB;       /* primary-subtle-active */
  --btn-secondary-label: #166E8F;        /* primary-text-strong */
  --btn-segment-active-border: #079CD3;  /* primary-accent */
  --btn-danger-soft: #FBE4E3;            /* red-100, tonal destructive */
  --btn-danger-soft-hover: #F5C7C8;      /* red-200 */
  --btn-danger-soft-active: #EC8F92;     /* red-300 */
  --btn-danger-soft-label: #91211E;      /* red-800 */
  --btn-danger: #DC3F44;                 /* red-400, filled */
  --btn-danger-hover: #BA3437;           /* red-600 */
  --btn-danger-active: #A32A2E;          /* red-700 */
  --btn-outline: #FFFFFF;
  --btn-outline-hover: #F9F9F9;          /* neutral-100 */
  --btn-outline-active: #E5E7EB;         /* neutral-200 */
  --btn-outline-label: #383A3C;          /* neutral-800 */
  --btn-outline-border: #8B929E;         /* neutral-500, the field frame */
  --btn-disabled: #F9F9F9;               /* neutral-100 */
  --btn-disabled-label: #8B929E;         /* neutral-500 */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Sky gradient band behind the floating header and the page head */
body::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0; left: 0; right: 0;
  height: 330px;
  background:
    radial-gradient(55% 70% at 18% 20%, rgba(78, 195, 240, 0.9) 0%, rgba(78, 195, 240, 0) 70%),
    linear-gradient(180deg, #00AFF0 0%, #4EC3F0 58%, rgba(247, 247, 247, 0) 100%);
}

/* Topbar: floating pill, like payrexx.com */
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  width: calc(100% - 32px);
  max-width: 1080px;
  margin: 14px auto 0;
  padding: 10px 12px 10px 22px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(4, 114, 155, 0.16);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-logo { height: 24px; width: auto; display: block; }
.brand-sep { width: 1px; height: 20px; background: var(--border); }
.brand-word { font-weight: 800; font-size: 16px; letter-spacing: -0.3px; color: var(--text); white-space: nowrap; }

.nav { display: flex; gap: 4px; margin-left: 4px; flex: 1; }
.nav a {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px;
  padding: 7px 14px; border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.nav a.active { color: var(--primary-dark); background: var(--primary-soft); }

.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user img { width: 28px; height: 28px; border-radius: 50%; }
.user-name { color: var(--text); font-weight: 600; white-space: nowrap; }
.link {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font: inherit; font-size: 14px; padding: 0; text-decoration: underline;
}
.link:hover { color: var(--text); }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 36px 24px 64px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }
.muted { color: var(--muted); }

/* Back link sits on the sky band */
.back {
  display: inline-block; color: rgba(255, 255, 255, 0.9); text-decoration: none;
  font-size: 14px; font-weight: 600; margin-bottom: 14px;
}
.back:hover { color: #fff; }

/* Page head on the sky band */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-head h1 {
  font-size: 40px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.05;
  margin: 0 0 10px; color: #fff;
}
.page-head p, .page-head p.muted { margin: 0; font-size: 16px; max-width: 640px; color: rgba(255, 255, 255, 0.9); }
.page-head .actions { display: flex; gap: 8px; flex: 0 0 auto; }
/* on the sky band a cyan primary melts into the sky: every button there takes the tonal
   secondary look (light primary tint, dark label), which reads like the white cards on it */
.page-head .btn, .page-head .btn:hover, .page-head .btn:active { border-color: transparent; color: var(--btn-secondary-label); box-shadow: none; }
.page-head .btn { background: var(--btn-secondary); }
.page-head .btn:hover { background: var(--btn-secondary-hover); }
.page-head .btn:active { background: var(--btn-secondary-active); }

.schedule-hint {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-lg);
  padding: 12px 20px; font-size: 14px; color: var(--muted); margin-bottom: 28px;
}
.schedule-hint strong { color: var(--text); }
.schedule-hint .sep { color: var(--border); }

/* Buttons — the backoffice variants (primary · secondary · outline · danger) and scale
   (lg · default · sm · xs). Every variant carries a 1px frame (transparent unless it
   shows), so the padding is 1px less and all variants are equally tall. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 19px; border-radius: var(--radius-md); border: 1px solid var(--btn-primary);
  background: var(--btn-primary); color: var(--btn-primary-label);
  font: inherit; font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: 0.005em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.1s ease-in-out, border-color 0.1s ease-in-out, color 0.1s ease-in-out;
}
.btn:hover { background: var(--btn-primary-hover); border-color: var(--btn-primary-hover); color: var(--btn-primary-label); }
.btn:active { background: var(--btn-primary-active); border-color: var(--btn-primary-active); box-shadow: var(--btn-primary-shadow-active); }
.btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* .btn-navy (former dark CTA) is the primary button now */
.btn-primary, .btn-navy { background: var(--btn-primary); border-color: var(--btn-primary); color: var(--btn-primary-label); }

/* secondary: tonal — primary tint without a frame and a dark primary label */
.btn-secondary, .btn-light { background: var(--btn-secondary); border-color: transparent; color: var(--btn-secondary-label); }
.btn-secondary:hover, .btn-light:hover { background: var(--btn-secondary-hover); border-color: transparent; color: var(--btn-secondary-label); }
.btn-secondary:active, .btn-light:active { background: var(--btn-secondary-active); border-color: transparent; box-shadow: none; }
/* destructive secondary action: the same tonal button in red */
.btn-secondary.btn-danger { background: var(--btn-danger-soft); border-color: transparent; color: var(--btn-danger-soft-label); }
.btn-secondary.btn-danger:hover { background: var(--btn-danger-soft-hover); border-color: transparent; color: var(--btn-danger-soft-label); }
.btn-secondary.btn-danger:active { background: var(--btn-danger-soft-active); border-color: transparent; box-shadow: none; }

/* outline: toolbar controls next to a field (filter, search, find) — white with the field's frame */
.btn-outline { background: var(--btn-outline); border-color: var(--btn-outline-border); color: var(--btn-outline-label); font-weight: 500; }
.btn-outline:hover { background: var(--btn-outline-hover); border-color: var(--btn-outline-border); color: var(--btn-outline-label); }
.btn-outline:active { background: var(--btn-outline-active); border-color: var(--btn-outline-border); box-shadow: none; }

/* danger: filled red for the one destructive main action */
.btn-danger { background: var(--btn-danger); border-color: var(--btn-danger); color: #fff; }
.btn-danger:hover { background: var(--btn-danger-hover); border-color: var(--btn-danger-hover); color: #fff; }
.btn-danger:active { background: var(--btn-danger-active); border-color: var(--btn-danger-active); }

/* disabled, every variant */
.btn:disabled, .btn[disabled], .btn.disabled,
.btn:disabled:hover, .btn[disabled]:hover, .btn.disabled:hover {
  background: var(--btn-disabled); border-color: var(--btn-disabled); color: var(--btn-disabled-label);
  box-shadow: none; cursor: not-allowed;
}

/* scale: lg · default · sm · xs */
.btn-lg { padding: 15px 23px; font-size: 18px; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; font-weight: 600; }
/* icon-only button: square at the button's height */
.btn-icon { padding-left: 11px; padding-right: 11px; }
.btn-icon.btn-sm { padding-left: 5px; padding-right: 5px; }
.btn-icon .ti { margin: 0; }

.btn-google {
  width: 100%; padding: 13px 18px; font-weight: 600;
  background: #fff; color: #3c4043; border-color: #dadce0;
}
.btn-google:hover, .btn-google:active { background: #f8f9fa; border-color: #dadce0; color: #3c4043; box-shadow: none; }

/* Badges + pills */
.badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 9px; border-radius: 999px; }
.type-patch { background: var(--primary-soft); color: var(--primary-dark); }
.type-full { background: var(--lime); color: var(--pass-text); }
.status-draft { background: var(--skipped-soft); color: var(--muted); }
.status-active { background: var(--primary-soft); color: var(--primary-dark); }
.status-done { background: var(--pass-soft); color: var(--pass-text); }
.status-cancelled { background: var(--fail-soft); color: var(--fail-text); }
.status-pass { background: var(--pass-soft); color: var(--pass-text); }
.status-fail { background: var(--fail-soft); color: var(--fail-text); }
.status-blocked { background: var(--blocked-soft); color: var(--blocked-text); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); }

/* Progress bar */
.bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--pending); }
.seg { height: 100%; }
.seg.pass { background: #6CC417; }
.seg.fail { background: var(--fail); }
.seg.blocked { background: var(--blocked); }
.seg.skipped { background: var(--skipped); }

/* Release grid (dashboard) */
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rel-card {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow); transition: box-shadow 0.15s ease;
}
.rel-card:hover { box-shadow: 0 0 0 1px rgba(0, 175, 240, 0.45), 0 6px 18px rgba(4, 114, 155, 0.12); }
.rel-card:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; }
.rel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rel-version { font-weight: 800; font-size: 18px; letter-spacing: -0.3px; color: var(--text); margin-right: auto; }
.rel-meta { font-size: 13px; margin-bottom: 12px; }
.rel-stats { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.rel-stats .pct { font-weight: 800; font-size: 18px; color: var(--text); }
.blockers { color: var(--fail-text); font-weight: 700; margin-left: auto; }
.ok { color: var(--pass-text); font-weight: 700; margin-left: auto; }

.empty { color: var(--muted); font-size: 15px; padding: 40px; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: 16px; }

/* Cards + forms */
.card { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.form { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.form h1, .form h3 { margin: 0; color: var(--text); font-weight: 800; letter-spacing: -0.5px; }
.form h1 { font-size: 26px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form label > span { color: var(--text); }
.form input[type=text], .form input[type=email], .form input[type=date], .form textarea, .form select {
  font: inherit; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); width: 100%;
  transition: border-color 0.15s ease;
}
.form input:hover, .form textarea:hover, .form select:hover { border-color: var(--primary-soft-hover); }
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--ring);
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.add-subject, .add-case, .add-user { margin-top: 26px; }

.type-toggle { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); margin-bottom: 18px; }
.type-toggle a { padding: 8px 16px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-radius: 999px; }
.type-toggle a:hover { color: var(--primary-dark); }
.type-toggle a.active { background: var(--primary); color: #fff; }
.epic-row { display: flex; gap: 8px; }
.epic-row input { flex: 1; }

/* Release detail */
.rel-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.rel-detail-title { display: flex; align-items: center; gap: 12px; }
.rel-detail-title h1 { margin: 0; font-size: 40px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.05; color: #fff; }
.rel-detail-title .badge { background: rgba(255, 255, 255, 0.92); }
.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.inline select, .inline input[type=text] {
  font: inherit; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
}
.inline select:focus, .inline input[type=text]:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

.summary { margin-bottom: 20px; box-shadow: var(--shadow-lg); }
.summary-bar { display: flex; align-items: center; gap: 20px; }
.summary-pct { font-size: 34px; font-weight: 800; letter-spacing: -1px; color: var(--text); line-height: 1; text-align: center; white-space: nowrap; }
.summary-pct small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 4px; }
.summary-bar-main { flex: 1; }
.summary-bar-main .bar { height: 12px; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.chip b { color: var(--text); }
.chip.pass b { color: var(--pass-text); } .chip.fail b { color: var(--fail-text); }
.chip.blocked b { color: var(--blocked-text); } .chip.skipped b { color: var(--muted); }
.summary-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.summary-meta .sep { color: var(--border); }
.epic-inline input { width: 120px; }
.epic-inline a { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
.epic-inline a:hover { text-decoration: underline; }
.rel-notes { margin: 12px 0 0; }

/* Blockers spotlight */
.blockers-box { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow), inset 4px 0 0 var(--fail); padding: 14px 20px; margin-bottom: 20px; }
.blockers-box.is-empty { box-shadow: var(--shadow); }
.blockers-box h2 { margin: 0 0 8px; font-size: 16px; font-weight: 800; color: var(--fail-text); display: flex; align-items: center; gap: 8px; }
.blockers-box.is-empty h2 { color: var(--muted); }
.blockers-box h2 .count { background: var(--fail); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.blockers-box.is-empty .count { background: var(--skipped); }
.blocker-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.blocker-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.blocker-list a { color: var(--text); text-decoration: none; }
.blocker-list a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
/* filter chips are segments (backoffice segmented toggle): white with a frame,
   the selected one primary tint with a primary frame */
.chip-btn {
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; padding: 6px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--btn-outline-active); background: var(--surface); color: var(--text); cursor: pointer;
  transition: background-color 0.1s ease-in-out, border-color 0.1s ease-in-out;
}
.chip-btn:hover { background: var(--btn-outline-hover); border-color: var(--btn-outline-border); }
.chip-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.chip-btn.active, .chip-btn.active:hover { background: var(--btn-secondary); color: var(--btn-secondary-label); border-color: var(--btn-segment-active-border); }
.filters > .btn.ghost { margin-left: auto; }

/* Subject groups + runs */
.subject-group { margin-bottom: 26px; }
.subject-group[hidden] { display: none; }
.subject-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.subject-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }
.subject-prog { font-size: 13px; }
.subject-bar { flex: 1; max-width: 220px; }
.subject-bar .bar { height: 6px; }
.subject-assign { margin-left: auto; }

.run { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 8px; overflow: hidden; }
.run[hidden] { display: none; }
.run[data-status="fail"] { box-shadow: var(--shadow), inset 4px 0 0 var(--fail); }
.run[data-status="blocked"] { box-shadow: var(--shadow), inset 4px 0 0 var(--blocked); }
.run[data-status="pass"] { box-shadow: var(--shadow), inset 4px 0 0 #6CC417; }
.run-main { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.run-main { cursor: pointer; }
.run-main:hover { background: #FBFBFB; }
.run-main:hover .case-title { color: var(--primary-dark); }
.run-toggle { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; width: 18px; flex: 0 0 auto; padding: 0; }
.run-toggle:hover { color: var(--primary-dark); }
.run-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.case-title { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bug-link { font-size: 12px; font-weight: 700; color: var(--fail-text); text-decoration: none; background: var(--fail-soft); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }

.status-group { display: inline-flex; flex: 0 0 auto; gap: 2px; padding: 3px; background: var(--bg); border-radius: 999px; }
.st {
  font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border: none; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.st:hover { background: var(--surface); color: var(--text); }
.st.active.st-pass { background: var(--lime); color: var(--pass-text); }
.st.active.st-fail { background: var(--fail); color: #fff; }
.st.active.st-blocked { background: var(--blocked); color: #fff; }
.st.active.st-skipped { background: var(--skipped); color: #fff; }
.st.active.st-pending { background: var(--ink); color: #fff; }

.assignee {
  font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); max-width: 160px; flex: 0 0 auto;
}
.assignee:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.save-error { box-shadow: 0 0 0 2px var(--fail) !important; }

.run-detail { padding: 4px 16px 16px 42px; border-top: 1px solid var(--border); background: #FBFBFB; }
.detail-block { margin: 10px 0; }
.detail-block p { margin: 2px 0 0; font-size: 13px; color: var(--text); white-space: pre-wrap; }
.dl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.notes-label { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.notes { font: inherit; font-size: 13px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; resize: vertical; width: 100%; }
.notes:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
/* Screenshots on a run */
.shot-count { font-size: 12px; font-weight: 700; color: var(--primary-dark); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.shot-count[hidden] { display: none; }
.shot-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.shot { position: relative; margin: 0; width: 120px; height: 84px; }
.shot a { display: block; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.shot a:hover { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-remove {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface);
  background: var(--ink); color: #fff; font: inherit; font-size: 14px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  opacity: 0; transition: opacity 0.15s ease;
}
.shot:hover .shot-remove, .shot-remove:focus-visible { opacity: 1; }
.shot-remove:hover { background: var(--fail); }
.shot-drop {
  width: 120px; height: 84px; border-radius: 12px;
  border: 1.5px dashed var(--primary-soft-hover); background: var(--primary-soft);
  display: grid; place-items: center; text-align: center; cursor: pointer;
  font-size: 12px; line-height: 1.3; color: var(--primary-dark);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.shot-drop small { color: var(--muted); font-size: 11px; }
.shot-drop:hover, .shot-drop.is-over { border-color: var(--primary); background: var(--primary-soft-hover); }
.shot-drop:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--lime); }
.shot-drop.is-busy { opacity: 0.6; cursor: progress; }
@media (hover: none) { .shot-remove { opacity: 1; } }

.detail-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.saved-flag { font-size: 12px; color: var(--pass-text); font-weight: 700; }
.bug-action { margin-left: auto; }

/* Test cases + avatars */
.case-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.case { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 4px 16px; }
.case.archived { opacity: .6; }
.case > summary { cursor: pointer; padding: 10px 0; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.case > summary:hover { color: var(--primary-dark); }
.case-sum-title { flex: 1; }
.case-form { max-width: none; padding: 8px 0 14px; }
.avatar-fallback { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; }
.avatar-fallback { background: var(--primary-dark); color: #fff; display: grid; place-items: center; font-weight: 700; }

/* Login: full-bleed sky, big rounded card */
body:has(.auth-wrap) {
  background: linear-gradient(165deg, #00AFF0 0%, #4EC3F0 45%, #F7F7F7 100%) fixed;
}
body:has(.auth-wrap)::before { display: none; }
.auth-wrap {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 24px 0;
}
.login-card {
  background: var(--surface);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(4, 114, 155, 0.25);
  padding: 44px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.login-logo { height: 34px; width: auto; margin-bottom: 22px; }
.login-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; margin: 0 0 10px; color: var(--text); }
.login-card .muted { font-size: 14px; margin: 0 0 24px; }
.connect-card { max-width: 520px; text-align: left; }
.connect-card h1 { text-align: center; }
.connect-card > .muted { text-align: center; }
.connect-card .login-logo { display: block; margin: 0 auto 22px; }
.connect-steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.connect-steps li { display: flex; gap: 12px; align-items: flex-start; }
.connect-steps li > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.connect-steps .small { font-size: 13px; line-height: 1.45; }
.step-mark { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 13px; font-weight: 800; border: 2px solid var(--border); color: var(--muted); }
.connect-steps .is-done .step-mark { background: var(--lime); border-color: var(--lime); color: var(--pass-text); }
.connect-steps .is-current .step-mark { background: var(--primary); border-color: var(--primary); color: #fff; }
.connect-steps li:not(.is-done) { opacity: 0.6; }
.connect-btn { width: 100%; padding: 13px 18px; }
.connect-help { margin-top: 18px; font-size: 13px; color: var(--muted); }
.connect-help summary { cursor: pointer; font-weight: 600; color: var(--text); }
.connect-help ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.connect-logout { margin-top: 16px; text-align: center; }

.alert {
  background: var(--fail-soft); color: var(--fail-text);
  border-radius: 14px; padding: 10px 12px; font-size: 14px; margin: 0 0 18px;
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; border-radius: 24px; width: calc(100% - 24px); }
  .nav { order: 3; width: 100%; flex: 1 0 100%; margin-left: 0; }
  .user-name { display: none; }
  .page-head { flex-direction: column; }
  .page-head h1, .rel-detail-title h1 { font-size: 32px; letter-spacing: -1px; }
  .rel-detail-head { flex-wrap: wrap; }
  .run-main { flex-wrap: wrap; }
  .status-group { order: 3; }
  .summary-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .schedule-hint { border-radius: 16px; }
  .container { padding: 24px 16px 48px; }
  .login-card { padding: 32px 24px; }
}

/* Account page */
.account-card { margin-bottom: 20px; }
.account-card h2 { margin: 0 0 10px; font-size: 20px; font-weight: 800; }
.account-card p { margin: 0 0 10px; }
.account-actions { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.flash { padding: 10px 16px; border-radius: 12px; margin: 0 0 16px; font-weight: 600; }
.flash-ok { background: var(--pass-soft); color: var(--pass-text); }
.flash-error { background: var(--fail-soft); color: var(--fail-text); }
.new-token { background: var(--pass-soft); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.new-token p { margin: 10px 0 4px; }
.new-token code, .new-token pre { display: block; background: var(--surface); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; font-size: 13px; white-space: pre-wrap; word-break: break-all; cursor: pointer; }
.copy.copied { outline: 2px solid var(--pass); }
.token-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.token-table th, .token-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.token-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.token-form { margin: 14px 0 10px; }
.small { font-size: 13px; }
@media (max-width: 640px) { .token-table th:nth-child(3), .token-table td:nth-child(3) { display: none; } }

/* ── Roles, mini progress, release rows ─────────────────────── */
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-role { font-size: 11px; font-weight: 600; color: var(--primary-dark); }
.small-avatar { width: 28px; height: 28px; font-size: 13px; }
.badge.role-admin, .role-select.role-admin { background: var(--dark-blue); color: #fff; }
.badge.role-member { background: var(--primary-soft); color: var(--primary-dark); }
.role-select { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.role-select.role-admin { border-color: var(--dark-blue); }
.case-readonly { padding: 0 0 12px; }

.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2, .section-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }
.section-title { margin-bottom: 10px; }
#no-match { margin-top: 8px; }

/* Live mini progress: bar, x/y, blockers */
.mini { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.mini-bar { flex: 1; min-width: 40px; height: 5px; border-radius: 999px; background: var(--pending); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: #6CC417; border-radius: inherit; transition: width 0.2s ease; }
.mini-count { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.mini-blockers { color: var(--fail-text); font-weight: 700; white-space: nowrap; }
.mini-blockers[hidden] { display: none; }

/* Compact release rows (dashboard lists) */
.rel-rows { display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.rel-row {
  display: grid; grid-template-columns: 64px minmax(0, 1.2fr) auto minmax(80px, 1fr) 48px 84px;
  align-items: center; gap: 14px; padding: 12px 18px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.rel-row:last-child { border-bottom: 0; }
.rel-row:hover { background: var(--primary-soft); }
.rel-row:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: -2px; }
.rel-row .rel-version { font-size: 16px; margin: 0; }
.rel-row .badge { justify-self: start; }
.rel-row-lg { grid-template-columns: 64px minmax(0, 1.4fr) minmax(80px, 1fr) 64px 72px; padding: 14px 18px; }
.rel-row-title { display: flex; flex-direction: column; min-width: 0; }
.rel-row .blockers { margin: 0; }

.timeline { list-style: none; margin: 4px 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; background: var(--border); border-radius: 1px; }
.tl-item { position: relative; padding: 0 0 14px 24px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 2px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); box-sizing: border-box; }
.tl-full .tl-dot { left: 0; top: 3px; width: 14px; height: 14px; background: var(--lime); border-color: var(--pass); }
.tl-has .tl-dot { background: var(--primary); }
.tl-full.tl-has .tl-dot { background: var(--pass); }
.tl-body { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; font-size: 14px; color: var(--text); text-decoration: none; }
a.tl-body { border-radius: 8px; margin: -2px -6px; padding: 2px 6px; }
a.tl-body:hover { background: var(--primary-soft); }
.tl-date { font-weight: 700; }
.tl-name { grid-column: 1; color: var(--muted); }
.tl-full .tl-name { color: var(--pass-text); font-weight: 700; }
.tl-meta { grid-column: 2; grid-row: 1; text-align: right; white-space: nowrap; }

/* Workbench: content + sticky rail (release, dashboard, catalogue, team, account) */
.wb { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.wb.wb-right { grid-template-columns: minmax(0, 1fr) 300px; }
.wb-rail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 2px; }
.rail-card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; }
.rail-progress { box-shadow: var(--shadow-lg); }
.rail-pct { font-size: 40px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; margin-bottom: 10px; }
.rail-pct small { font-size: 12px; letter-spacing: 0; color: var(--muted); margin-left: 6px; font-weight: 700; }
.rail-progress .bar { height: 10px; }
.rail-meta { margin: 10px 0 0; }
.rail-meta a { color: var(--primary-dark); font-weight: 600; }
.rail-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; }
.rail-index { display: flex; flex-direction: column; padding: 6px; }
.index-item {
  display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text);
  background: none; border: 0; border-radius: 12px; padding: 8px 10px; cursor: pointer;
}
.index-item:hover { background: var(--bg); }
.index-item.active { background: var(--primary-soft); }
.index-item.active .index-name { color: var(--primary-dark); }
.index-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.index-name { font-size: 13px; font-weight: 700; }
.index-item .mini { width: 100%; }
.wb-rail .blockers-box { margin: 0; }
.wb-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-lg); padding: 8px 10px 8px 18px; }
.wb-toolbar .ghost { margin-left: auto; }
.mywork { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 -4px; border-radius: 12px; text-decoration: none; color: var(--text); }
.mywork:hover { background: var(--primary-soft); }
.mywork b { font-size: 18px; color: var(--primary-dark); }

/* Workbench pieces for catalogue, team and account */
.list-card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.list-row { display: grid; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row.archived, .list-row.inactive { opacity: 0.55; }
.subj-line { grid-template-columns: minmax(0, 1fr) 80px 150px auto; }
.subj-line:has(.drag-handle) { grid-template-columns: 22px minmax(0, 1fr) 80px 150px auto; }
.drag-handle {
  width: 22px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none;
  color: var(--skipped); font: inherit; font-size: 14px; letter-spacing: -3px; line-height: 1; cursor: grab;
}
.drag-handle:hover { color: var(--primary-dark); background: var(--primary-soft); }
.drag-handle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--lime); color: var(--primary-dark); }
.drag-handle.is-off { cursor: default; }
.list-row.is-dragging, .case.is-dragging { opacity: 0.45; background: var(--primary-soft); }
.case > summary .drag-handle { margin-left: -6px; flex: 0 0 auto; }
.case-list + .case-list { margin-top: 14px; }
.order-hint { margin: 0 0 10px; }
.team-line { grid-template-columns: 36px minmax(0, 1fr) 130px auto; }
.list-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-main p { margin: 0; }
.list-title { font-weight: 800; font-size: 15px; letter-spacing: -0.2px; color: var(--text); text-decoration: none; }
a.list-title:hover { color: var(--primary-dark); }
.list-main .badge { align-self: flex-start; }
.list-stat { font-size: 13px; color: var(--muted); white-space: nowrap; }
.list-stat b { color: var(--text); font-size: 15px; }
.list-owner { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-act { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.warn-text { color: var(--blocked-text); font-weight: 600; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 48px; height: 48px; font-size: 20px; flex: 0 0 auto; }

.stat-list { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.stat-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stat-list dt { color: var(--muted); font-size: 14px; }
.stat-list dd { margin: 0; font-weight: 800; font-size: 18px; text-align: right; }
.stat-list > div:first-child dd { font-size: 32px; letter-spacing: -1px; line-height: 1; }
.stat-list .warn dd { color: var(--blocked-text); }
.rail-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.rail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wb-rail .form { max-width: none; gap: 12px; }
.wb-rail .form p { margin: 0; }
.role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.role-item { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 3px solid var(--primary); }
.role-item-admin { border-left-color: var(--dark-blue); }
.role-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.role-count { min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 700; text-align: center; }
.role-item-admin .role-count { background: var(--dark-blue); color: #fff; }
.role-desc { font-size: 13px; line-height: 1.4; color: var(--muted); }
.role-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.page-head p a { color: #fff; font-weight: 700; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-lg); }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs a:hover { color: var(--primary-dark); background: var(--primary-soft); }
.tabs a.active { background: var(--primary); color: #fff; }
.tabs a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--lime); }
.tab-n { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); }
.tabs a.active .tab-n { background: rgba(255, 255, 255, 0.22); color: #fff; }
.catalogue-tabs { display: inline-flex; margin-bottom: 14px; }
.sync-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; background: var(--primary-soft); color: var(--primary-dark); font-size: 14px; }
.sub-h { margin: 22px 0 6px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 16px; font-weight: 800; }
.detail-actions .copy-prompt { font-size: 13px; padding: 7px 14px; }
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 12px; }
.install-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.install-card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.install-card > p { margin: 0 0 10px; }
.install-steps { margin: 0; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 10px; }
.install-steps pre { margin: 6px 0 0; background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 12px; white-space: pre-wrap; word-break: break-all; cursor: pointer; }
@media (max-width: 1100px) { .install-grid { grid-template-columns: 1fr; } }

.toolbar-title { margin: 0; font-size: 16px; font-weight: 800; }
.wb-toolbar .toolbar-title + .btn { margin-left: auto; }
.wb-toolbar .toolbar-title + .btn + .ghost { margin-left: 0; }
.pill-muted { background: var(--skipped-soft); color: var(--muted); }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.add-case { max-width: none; }

.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-card > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-name { font-size: 16px; }
.profile-card .badge { align-self: flex-start; margin-top: 4px; }
.setup-list { display: flex; flex-direction: column; padding: 6px; }
.setup-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--text); }
.setup-item:hover { background: var(--primary-soft); }
.setup-item > span:last-child { display: flex; flex-direction: column; }
.setup-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.setup-item.is-done .setup-mark { background: var(--lime); border-color: var(--lime); color: var(--pass-text); }
.wb-main .account-card:first-child { box-shadow: var(--shadow-lg); }

/* Workbench responsive */
@media (max-width: 900px) {
  .wb, .wb.wb-right { grid-template-columns: minmax(0, 1fr); }
  .wb > * { min-width: 0; }
  .wb-rail { position: static; max-height: none; overflow: visible; }
  .rail-index { flex-direction: row; overflow-x: auto; }
  .index-item { min-width: 170px; }
}
@media (max-width: 640px) {
  .subj-line { grid-template-columns: minmax(0, 1fr) auto; }
  .subj-line:has(.drag-handle) { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .subj-line:has(.drag-handle) .list-act { grid-column: 2 / -1; }
  .subj-line .list-owner { display: none; }
  .subj-line .list-act { grid-column: 1 / -1; justify-content: flex-start; }
  .team-line { grid-template-columns: 36px minmax(0, 1fr); }
  .team-line .list-stat { display: none; }
  .team-line .list-act { grid-column: 2; justify-content: flex-start; }
  .form-2col { grid-template-columns: 1fr; }
  .rel-row, .rel-row-lg { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .rel-row .rel-row-bar, .rel-row > .muted { display: none; }
  .rel-row > .badge:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mini-bar i { transition: none; } }

/* ── Icons (Tabler webfont) ─────────────────────────────────── */
.ti { font-size: 1.15em; line-height: 1; vertical-align: -0.15em; }
.link .ti { margin-right: 2px; }
.drag-handle { display: inline-grid; place-items: center; letter-spacing: 0; font-size: 16px; }
/* transparent icon button (backoffice .btn-transparent) */
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-md);
  background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 16px; flex: 0 0 auto;
}
.icon-btn:hover { background: var(--btn-secondary); color: var(--btn-secondary-label); }
.icon-btn:active { background: var(--btn-secondary-hover); }
.icon-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Test Subjects: master-detail ───────────────────────────── */
.page-head .tabs { flex: 0 0 auto; align-self: flex-end; }
.md {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 560px;
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.md-list { border-right: 1px solid var(--border); background: #FBFBFB; display: flex; flex-direction: column; min-width: 0; }
.md-list-head { padding: 14px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.md-list-head .btn { justify-self: start; }
.md-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.md-stats b { color: var(--text); margin-right: 3px; }
.md-stats .warn, .md-stats .warn b { color: var(--blocked-text); }
.md-stats .warn .ti { margin-right: 3px; }
.md-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 12px; color: var(--muted); }
.md-search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.md-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 13px; padding: 8px 0; color: var(--text); }
.md-hint { margin: 0; padding: 8px 14px 0; font-size: 12px; }
.md-items { padding: 6px 0; }
.md-item { display: flex; align-items: center; gap: 2px; padding: 0 8px 0 4px; border-left: 3px solid transparent; }
.md-item[hidden] { display: none; }
.md-item:hover { background: var(--surface); }
.md-item.on { background: var(--surface); border-left-color: var(--primary); }
.md-item.archived { opacity: 0.6; padding-left: 12px; }
.md-item.is-dragging { opacity: 0.45; background: var(--primary-soft); }
.md-item .drag-handle { opacity: 0; }
.md-item:hover .drag-handle, .md-item .drag-handle:focus-visible { opacity: 1; }
.md-item-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 6px; text-decoration: none; color: var(--text); }
.md-item-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.md-item-t b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-item-t span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-item.warn .md-item-t span { color: var(--blocked-text); font-weight: 600; }
.md-item-n { font-size: 12px; font-weight: 800; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.md-item.on .md-item-n { background: var(--primary-soft); color: var(--primary-dark); }
.md-item.on .md-item-t b { color: var(--primary-dark); }
.md-archived { margin-top: auto; border-top: 1px solid var(--border); }
.md-archived summary { cursor: pointer; padding: 12px 14px; font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; list-style: none; }
.md-archived summary::-webkit-details-marker { display: none; }
.md-archived summary:hover { color: var(--primary-dark); }
.md-empty { padding: 12px 24px; margin: 0; }

.md-detail { display: flex; flex-direction: column; min-width: 0; }
.md-blank { margin: auto; text-align: center; color: var(--muted); padding: 40px; }
.md-blank .ti { font-size: 40px; color: var(--skipped); }
.md-banner { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--blocked-soft); color: var(--blocked-text); font-weight: 600; font-size: 13px; }
.md-banner form { margin-left: auto; }
.md-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; padding: 20px 24px 18px; border-bottom: 1px solid var(--border); }
.md-head-main { grid-column: 1; }
.md-head-main[hidden] { display: none; }
.md-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; display: flex; align-items: center; gap: 4px; }
.md-head h2 .icon-btn { opacity: 0.5; }
.md-head h2:hover .icon-btn, .md-head h2 .icon-btn:focus-visible { opacity: 1; }
.md-head p { margin: 4px 0 0; white-space: pre-wrap; }
.md-inline-form { max-width: none; gap: 8px; }
.md-inline-form input[name=name] { font-size: 20px; font-weight: 800; }
.md-head-act { grid-column: 2; grid-row: 1; display: flex; gap: 4px; align-items: flex-start; }
.md-props { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.prop {
  position: relative; display: inline-flex; align-items: center; gap: 7px; margin: 0;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px 3px 4px; font-size: 13px; font-weight: 600; background: var(--surface);
}
.prop small { color: var(--muted); font-weight: 600; font-size: 12px; }
.prop .prop-ic { width: 24px; text-align: center; color: var(--primary-dark); }
.prop select { appearance: none; -webkit-appearance: none; border: 0; background: none; font: inherit; color: var(--text); padding: 2px 16px 2px 0; margin-right: -16px; cursor: pointer; }
.prop select:focus { outline: none; }
.prop > .ti-chevron-down { color: var(--muted); pointer-events: none; font-size: 13px; }
.prop:has(select):hover { border-color: var(--primary-soft-hover); background: var(--primary-soft); }
.prop:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.prop.is-busy { opacity: 0.6; }
.prop-static { padding-left: 4px; }

.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto; object-fit: cover;
  background: var(--primary-dark); color: #fff; font-size: 10px; font-weight: 800; }
.av-sm { width: 24px; height: 24px; }
.av-xs { width: 20px; height: 20px; font-size: 8px; }
.av-empty { background: var(--skipped-soft); color: var(--muted); font-size: 13px; }

.md-cases { padding: 6px 0 16px; }
.md-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.md-group .muted { font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 12px; }
.md-case { display: flex; align-items: center; gap: 4px; padding: 0 16px 0 12px; border-radius: 0; transition: background .3s; }
.md-case:hover { background: #FBFBFB; }
.md-case.archived { opacity: 0.6; }
.md-case.is-dragging { opacity: 0.45; background: var(--primary-soft); }
.md-case.is-saved { background: var(--pass-soft); }
.md-case > span:first-child { width: 22px; }
.md-case .drag-handle { opacity: 0; }
.md-case:hover .drag-handle, .md-case .drag-handle:focus-visible { opacity: 1; }
.md-case-no { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.md-case-open {
  flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto 200px 20px; gap: 12px; align-items: center;
  border: 0; background: none; font: inherit; color: inherit; text-align: left; padding: 11px 4px; cursor: pointer; border-radius: 10px;
}
.md-case-open:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--lime); }
.md-case-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-case-open:hover .md-case-title { color: var(--primary-dark); }
.md-case-meta { display: flex; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.tag-warn { background: var(--blocked-soft); color: var(--blocked-text); }
.md-assn { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-assn.own { color: var(--primary-dark); font-weight: 700; }
.md-assn .inh { font-size: 11px; color: var(--skipped); }
.md-case-go { color: var(--skipped); }
.md-case-open:hover .md-case-go { color: var(--primary-dark); }
.md-quickadd { display: flex; align-items: center; gap: 10px; margin: 8px 24px 4px; border: 1px dashed var(--border); border-radius: 12px; padding: 0 14px; color: var(--muted); }
.md-quickadd:focus-within { border-style: solid; border-color: var(--primary); box-shadow: var(--ring); color: var(--primary-dark); }
.md-quickadd input { flex: 1; border: 0; outline: none; background: none; font: inherit; padding: 11px 0; color: var(--text); }

/* Drawer (case) and modal (new subject) */
dialog { border: 0; padding: 0; color: var(--text); }
dialog::backdrop { background: rgba(44, 46, 47, 0.3); backdrop-filter: blur(2px); }
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(460px, 100vw); height: 100vh; max-height: none; max-width: none; box-shadow: -20px 0 40px rgba(0, 0, 0, 0.12); display: none; flex-direction: column; }
.drawer[open] { display: flex; animation: drawer-in .18s ease-out; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 20px 12px; }
.drawer-head h3 { margin: 2px 0 0; font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.drawer-kicker { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px 20px; max-width: none; }
.drawer-foot { position: sticky; bottom: -20px; margin: auto -20px -20px; padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal { border-radius: 20px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2); }
.modal .form { padding: 0 20px 20px; max-width: none; }
.modal .drawer-head { padding: 20px 0 0; }
.modal h3 { margin: 0; }

@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }
@media (max-width: 900px) {
  .page-head { flex-wrap: wrap; }
  .md { grid-template-columns: minmax(0, 1fr); }
  .md-list { border-right: 0; border-bottom: 1px solid var(--border); }
  .md-items { max-height: 260px; overflow-y: auto; }
  .md-case-open { grid-template-columns: minmax(0, 1fr) auto 20px; }
  .md-assn { display: none; }
  .md-head { padding: 16px; }
  .md-group, .md-banner { padding-left: 16px; padding-right: 16px; }
  .md-quickadd { margin-left: 16px; margin-right: 16px; }
}

/* ── Release page: KPI strip + dense test table ─────────────── */
.rt { display: flex; flex-direction: column; gap: 12px; }
.rt-strip {
  position: sticky; top: 8px; z-index: 5;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 12px 16px; display: flex; flex-direction: column; gap: 10px;
}
.rt-kpi { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rt-pct { font-size: 28px; font-weight: 800; letter-spacing: -1px; line-height: 1; white-space: nowrap; }
.rt-pct small { font-size: 12px; letter-spacing: 0; color: var(--muted); margin-left: 6px; font-weight: 700; }
.rt-bar { flex: 1; min-width: 160px; }
.rt-bar .bar { height: 10px; }
.rt-kpi .counts { margin: 0; gap: 6px; }
.rt-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rt-tools .chip-btn { padding: 5px 12px; }
.chip-n { font-size: 11px; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); }
.chip-btn.active .chip-n { background: var(--surface); color: var(--btn-secondary-label); }
.rt-search {
  font: inherit; font-size: 13px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); width: 180px; margin-left: 6px;
}
.rt-search:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.rt-epic { color: var(--primary-dark); font-weight: 600; text-decoration: none; white-space: nowrap; }
.rt-epic:hover { text-decoration: underline; }
.rt-date { white-space: nowrap; margin-left: auto; }
.rt-tools .btn.ghost { margin-left: 0; }
.rt-subjects { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.rt-subjects .index-item {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-width: 128px; max-width: 190px; padding: 6px 10px; border-radius: 10px; text-align: left; font: inherit;
}
.rt-subjects .index-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rt-subjects .mini { width: 100%; font-size: 11px; gap: 6px; }
.rt-subjects .mini.is-done .mini-count { color: var(--pass-text); }
.rt .blockers-box { margin: 0; padding: 10px 16px; }
.rt .blockers-box.is-empty { display: none; }
.rt .blockers-box h2 { font-size: 14px; margin-bottom: 6px; }
.rt .blocker-list li { font-size: 13px; }
.rt .rel-notes, .rt .flash, .rt .sync-banner { margin: 0; }

/* One card, groups as section heads, runs as hairline rows */
.rt-table { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.rt-table .subject-group { margin: 0; }
.rt-table .subject-head {
  margin: 0; padding: 6px 12px 6px 16px; gap: 10px; background: var(--bg);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.rt-table .subject-group:first-child .subject-head { border-top: 0; }
.rt-table .subject-head h3 { font-size: 13px; font-weight: 800; letter-spacing: 0; }
.rt-table .subject-prog { font-size: 12px; font-variant-numeric: tabular-nums; }
.rt-table .subject-bar { max-width: 140px; }
.rt-table .subject-bar .bar { height: 4px; }
.rt-table .subject-assign select { font-size: 12px; padding: 3px 10px; }
.rt-table .run { border-radius: 0; box-shadow: none; margin: 0; border-bottom: 1px solid var(--border); }
.rt-table .subject-group:last-of-type .run:last-child { border-bottom: 0; }
.rt-table .run[data-status] { box-shadow: none; }
.rt-table .run-main { padding: 3px 10px 3px 12px; gap: 8px; min-height: 36px; }
.rt-table .run-main:hover { background: var(--primary-soft); }
.rt-table .run-main:focus-visible { outline: none; box-shadow: inset 3px 0 0 var(--primary); background: var(--primary-soft); }
.rt-table .case-title { font-size: 13px; font-weight: 600; }
.rt-table .run[data-status="pass"] .case-title,
.rt-table .run[data-status="skipped"] .case-title { color: var(--muted); }
.rt-table .shot-count, .rt-table .bug-link { font-size: 11px; padding: 1px 7px; }
.run-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--pending); box-shadow: inset 0 0 0 1.5px var(--skipped); }
.run[data-status="pass"] .run-dot { background: #6CC417; box-shadow: none; }
.run[data-status="fail"] .run-dot { background: var(--fail); box-shadow: none; }
.run[data-status="blocked"] .run-dot { background: var(--blocked); box-shadow: none; }
.run[data-status="skipped"] .run-dot { background: var(--skipped); box-shadow: none; }
.rt-table .run-toggle { width: 14px; font-size: 11px; }

/* Status: only the active one shows at rest; all show on hover / focus */
.rt-table .status-group { padding: 2px; background: transparent; }
.rt-table .st { font-size: 12px; padding: 3px 9px; }
.rt-table .run:not(:hover):not(:focus-within) .st:not(.active) { display: none; }
.rt-table .run:not(:hover):not(:focus-within) .st.st-pending.active { visibility: hidden; }
.rt-table .run:hover .status-group, .rt-table .run:focus-within .status-group { background: var(--surface); }
@media (hover: none) {
  .rt-table .run .st:not(.active) { display: inline-block !important; }
  .rt-table .run .st.st-pending.active { visibility: visible !important; }
}

/* Assignee as initials avatar with the native select layered on top */
.assignee-av {
  position: relative; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-dark); color: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.assignee-av.is-mine { background: var(--primary); }
.assignee-av.is-empty { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--border); border: 0; }
.assignee-av:hover { box-shadow: 0 0 0 2px var(--primary-soft-hover); }
.assignee-av:focus-within { box-shadow: var(--ring); }
.assignee-av .assignee {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  opacity: 0; cursor: pointer; padding: 0; border: 0;
}
.rt-keys { margin: 0; text-align: center; }
kbd { font: inherit; font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); }

@media (max-width: 720px) {
  .rt-strip { position: static; }
  .rt-search { width: 100%; margin-left: 0; }
  .rt-table .run-main { flex-wrap: wrap; }
  .rt-keys { display: none; }
}

/* Release settings (admins) */
.settings-stack { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.settings-stack .form h3 { font-size: 18px; }
.status-pick { display: flex; flex-direction: column; gap: 6px; }
.status-opt { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
.status-opt:hover { background: var(--bg); }
.status-opt input { width: auto; }

/* Release epic templates (admins) */
.tpl-stack { max-width: none; }
.tpl-card { padding: 0; }
.tpl-card > summary { list-style: none; cursor: pointer; padding: 18px 24px; display: flex; flex-direction: column; gap: 4px; }
.tpl-card > summary::-webkit-details-marker { display: none; }
.tpl-card > summary:hover { background: var(--primary-soft); border-radius: var(--radius); }
.tpl-card[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.tpl-head { display: flex; align-items: center; gap: 10px; }
.tpl-card > .form { padding: 18px 24px 8px; max-width: none; }
.tpl-foot { display: flex; gap: 8px; padding: 4px 24px 18px; }
.tpl-foot .tpl-del { margin-left: auto; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.tpl-links { max-width: none; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.link-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--bg, #f5f7fa); }
.link-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-add select { flex: 1 1 140px; }
.ph-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wb-rail .tpl-grid { grid-template-columns: 1fr; }
.epic-plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.epic-plan li { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.epic-plan .ti { color: var(--muted); }
.rel-epics { display: flex; flex-wrap: wrap; gap: 6px 14px; }
@media (max-width: 700px) { .tpl-grid { grid-template-columns: 1fr; } }
.epic-plan-box { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.epic-plan-box .label-text { font-weight: 600; color: var(--text); }
.tpl-ic { color: var(--primary); font-size: 18px; }
.tpl-count { margin-left: 4px; }
.tpl-children { display: flex; flex-direction: column; gap: 6px; }
.tpl-children-root { padding: 6px 24px 22px; border-top: 1px solid var(--border); }
.tpl-sub-title { margin: 10px 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.tpl-child { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tpl-child > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 14px; }
.tpl-child > summary::-webkit-details-marker { display: none; }
.tpl-child > summary:hover { background: var(--primary-soft); border-radius: 12px; }
.tpl-child[open] > summary { border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }
.tpl-child .tpl-children { padding: 0 14px 14px 28px; }
.tpl-child-body > .form { padding: 14px 14px 6px; max-width: none; }
.tpl-child-body > .tpl-foot { padding: 4px 14px 14px; }
.tpl-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.tpl-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tpl-grid-type { grid-template-columns: 180px 1fr; }
.tpl-inline-note { font-weight: 400; padding: 10px 0; }
.tpl-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.tpl-add select { flex: 0 0 150px; }
.tpl-add input[type=text] { flex: 1 1 220px; }
.tpl-add select, .tpl-add input[type=text] { padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.tpl-add select:focus, .tpl-add input[type=text]:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
@media (max-width: 700px) { .tpl-grid-type { grid-template-columns: 1fr; } .tpl-children-root { padding: 6px 14px 18px; } }
