:root {
  --bg: #0f1115;
  --surface: #161a22;
  --surface-alt: #1d222c;
  --border: #2a313d;
  --text: #e6e8ec;
  --muted: #8b94a3;
  --primary: #6c8cff;
  --primary-hover: #5a7af0;
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  font-size: 14px; line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.hidden { display: none !important; }

/* Shell: fixed sidebar, scrolling content.

   The nav outgrew a single row once Reports, My Work and the admin pages
   landed - twelve destinations on one line read as one undifferentiated list.
   Grouping them down the side says whose data each page shows: Testing is
   ours, Jira mirrors another system read-only, Admin changes how the tool
   behaves. */
.shell { display: flex; min-height: 100vh; align-items: stretch; }
/* min-width:0 keeps a wide table or code block inside the content column
   instead of widening the whole page. */
.shell-main { flex: 1; min-width: 0; max-width: 100%; }

.sidebar {
  width: 232px; flex: 0 0 232px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 0 14px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; padding: 0 18px 18px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 10px; }

.nav-group { margin-bottom: 18px; }
.nav-group-title {
  font-size: 11px; font-weight: 600; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--muted); opacity: 0.7;
  padding: 0 10px 6px;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; margin-bottom: 1px;
  border-radius: 8px;
  color: var(--muted); font-weight: 500; font-size: 14px;
  /* The active item is marked with a rail rather than a fill, so a long list
     does not turn into a stack of blocks. */
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item.active {
  background: var(--surface-alt); color: var(--text);
  border-left-color: var(--primary);
}
.nav-count {
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 1;
  padding: 3px 7px; border-radius: 999px;
}

.sidebar-foot {
  padding: 12px 14px 0; margin: 0 6px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.nav-item-user { flex-direction: column; align-items: flex-start; gap: 1px; }
.nav-user-name { color: var(--text); font-size: 13px; }
.nav-user-role {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}

/* Narrow screens: the sidebar becomes a scrolling strip across the top, and
   the group headings turn into inline separators. */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    /* min-width:0 so the flex child may shrink below its content width -
       without it the strip pushes the whole page wider instead of scrolling
       inside itself, and Sign out ends up off-screen. */
    width: auto; flex: none; height: auto; min-width: 0; max-width: 100%;
    position: static;
    border-right: 0; border-bottom: 1px solid var(--border);
    padding: 12px 0 8px;
  }
  .sidebar-nav {
    display: flex; gap: 4px; padding: 0 12px;
    min-width: 0; overflow-x: auto; scrollbar-width: thin;
  }
  .nav-group { display: flex; align-items: center; gap: 4px; margin: 0; }
  .nav-group-title { padding: 0 8px 0 4px; white-space: nowrap; }
  .nav-item { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .nav-item.active { border-left: 0; border-bottom-color: var(--primary); }
  .sidebar-foot {
    flex-direction: row; align-items: center; justify-content: space-between;
    border-top: 0; padding-top: 8px;
  }
  .nav-item-user { flex-direction: row; gap: 8px; align-items: baseline; }
}

/* The Oryx wordmark. The supplied logo is navy #02327C, which is invisible on
   this dark UI, so the asset is a knockout: the wordmark in white with the
   original cyan #0BC0D2 arc kept. Swap for a navy-on-transparent asset if the
   theme ever goes light. */
.brand-logo {
  height: 24px; width: auto; display: block;
  /* Nudges the wordmark's optical baseline in line with the "TMS" text. */
  margin-top: -1px;
}
.brand-name {
  letter-spacing: 1.4px; font-size: 13px; font-weight: 600;
  color: var(--muted); text-transform: uppercase;
  padding-left: 9px; border-left: 1px solid var(--border);
}

/* Buttons */
.btn {
  appearance: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: 8px;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,0.1); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

/* Auth */
.auth-wrap { max-width: 380px; margin: 60px auto; }
.auth-logo { height: 38px; width: auto; display: block; margin: 0 0 14px; }
.auth-wrap h1 { margin: 0 0 4px; font-size: 22px; }
.auth-wrap p.muted { color: var(--muted); margin: 0 0 24px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 18px; background: var(--surface-alt); padding: 4px; border-radius: 8px; }
.auth-tabs button {
  flex: 1; padding: 8px; border: none; cursor: pointer; border-radius: 6px;
  background: transparent; color: var(--muted); font-weight: 500;
}
.auth-tabs button.active { background: var(--surface); color: var(--text); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.input, .textarea, .select {
  width: 100%; padding: 9px 11px;
  background: var(--surface-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: 14px;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary); }
.textarea { min-height: 80px; resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }

/* Lists */
.list { display: grid; gap: 10px; }
.list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius);
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.list-item:hover { border-color: var(--primary); }
.list-item h3 { margin: 0 0 4px; font-size: 15px; }
.list-item p { margin: 0; color: var(--muted); font-size: 13px; }
.list-item-meta { display: flex; gap: 10px; align-items: center; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
  background: var(--surface-alt); color: var(--muted);
  border: 1px solid var(--border);
}
.badge-pass { color: var(--success); border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.1); }
.badge-fail { color: var(--danger); border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.1); }
.badge-blocked { color: var(--warning); border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.1); }
.badge-pending { color: var(--info); border-color: rgba(96,165,250,0.3); background: rgba(96,165,250,0.1); }
.badge-running { color: var(--info); border-color: rgba(96,165,250,0.3); background: rgba(96,165,250,0.15); animation: pulse 1.6s ease-in-out infinite; }
.badge-not-run { color: var(--muted); border-color: var(--border); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.badge-high { color: var(--danger); border-color: rgba(248,113,113,0.3); }
.badge-medium { color: var(--warning); border-color: rgba(251,191,36,0.3); }
.badge-low { color: var(--muted); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table th { color: var(--muted); font-weight: 500; }

/* Header row */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.page-header h2 { margin: 0; font-size: 20px; }
.breadcrumb { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }

/* Empty state */
.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface); color: var(--text);
  padding: 12px 18px; border-radius: 8px;
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow); z-index: 100;
  animation: slideIn 0.2s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  padding: 14px; border-radius: var(--radius);
}
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 24px; font-weight: 600; margin-top: 4px; }

/* Step list inside forms */
.step-row { display: grid; grid-template-columns: 60px 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: start; }
.step-row .input, .step-row .textarea { min-height: 36px; }

/* ── Releases (Jira) ─────────────────────────────────────────────────────── */

.jira-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.jira-tabs { display: flex; gap: 4px; background: var(--surface-alt); padding: 4px; border-radius: 8px; }
.jira-tab {
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  padding: 6px 12px; border-radius: 6px; font-size: 13px; font-family: inherit;
}
.jira-tab:hover { color: var(--text); }
.jira-tab.active { background: var(--surface); color: var(--text); }
.jira-tab-count {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px;
  background: var(--bg); font-size: 11px; color: var(--muted);
}
.jira-search { max-width: 300px; margin-left: auto; }

.jira-table { table-layout: auto; }
.jira-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.jira-row { cursor: pointer; }
.jira-row:hover > td { background: var(--surface-alt); }

.jira-release-name { font-weight: 600; }
.jira-release-desc {
  color: var(--muted); font-size: 12px; margin-top: 2px;
  max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Status lozenges follow Jira's statusCategory, not the status name. */
.jira-lozenge {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
  border: 1px solid transparent; white-space: nowrap;
}
.jira-lozenge-todo { color: var(--muted); background: rgba(139,148,163,0.15); border-color: rgba(139,148,163,0.3); }
.jira-lozenge-progress { color: var(--info); background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.3); }
.jira-lozenge-done { color: var(--success); background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.3); }
.jira-lozenge-undefined { color: var(--muted); border-color: var(--border); }
.jira-lozenge-overdue { color: var(--danger); background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.3); }

/* The release the team is working toward, lifted out of the list so it is the
   first thing the page answers. */
.jira-next-release {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--primary);
  border-left-width: 3px; border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px; cursor: pointer;
}
.jira-next-release:hover { background: var(--surface-alt); }
.jira-next-label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  color: var(--primary); font-size: 10px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase; white-space: nowrap;
}
.jira-next-body { flex: 1; min-width: 0; }
.jira-next-headline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.jira-next-name { font-size: 20px; font-weight: 600; }
.jira-next-when { color: var(--primary); font-size: 13px; font-weight: 500; }
.jira-next-desc {
  color: var(--muted); font-size: 13px; margin: 0 0 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jira-next-meta {
  display: flex; gap: 14px; font-size: 12px; align-items: center;
  margin-top: 8px; flex-wrap: wrap;
}
.jira-lozenge-next {
  color: var(--primary); background: rgba(108,140,255,0.15);
  border-color: rgba(108,140,255,0.45);
}
@media (max-width: 760px) {
  .jira-next-release { flex-direction: column; align-items: stretch; }
  .jira-next-label { writing-mode: horizontal-tb; transform: none; }
}

.jira-progress {
  display: flex; height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border);
}
.jira-progress-lg { height: 10px; margin-bottom: 4px; }
.jira-progress-done { background: var(--success); }
.jira-progress-prog { background: var(--info); }
.jira-progress-todo { background: var(--border); }

/* Work still in flight cycles through colour and carries a travelling
   highlight; shipped work settles to solid green. The distinction is the
   point — a glance at the bar says whether something is still moving. */
@keyframes jira-progress-hue {
  0%   { background-position:   0% 50%; }
  100% { background-position: 200% 50%; }
}
/* Moves the highlight by background-position rather than transform, so it can
   never travel outside the element it is painted on. */
@keyframes jira-progress-bolt {
  0%   { background-position: -45% 0; opacity: 0; }
  30%  { opacity: 0.8; }
  70%  { opacity: 0.8; }
  100% { background-position: 145% 0; opacity: 0; }
}

.jira-progress-live { position: relative; overflow: hidden; }
.jira-progress-live .jira-progress-done {
  background-image: linear-gradient(90deg,
    #4ade80, #22d3ee, #6c8cff, #a78bfa, #f472b6, #fbbf24, #4ade80);
  background-size: 200% 100%;
  animation: jira-progress-hue 3.4s linear infinite;
}
.jira-progress-live .jira-progress-prog {
  background-image: linear-gradient(90deg, #6c8cff, #22d3ee, #6c8cff);
  background-size: 200% 100%;
  animation: jira-progress-hue 2.2s linear infinite;
}
/* The lightning: a bright band travelling across the FILLED stretch only, so a
   bar at 40% animates over that 40% and stops there. --filled is set per bar;
   at 0% the width collapses and nothing animates. */
.jira-progress-live::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--filled, 0%);
  background-image: linear-gradient(90deg,
    rgba(255,255,255,0) 0%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0) 100%);
  background-size: 45% 100%;
  background-repeat: no-repeat;
  animation: jira-progress-bolt 2.6s ease-in-out infinite;
  pointer-events: none;
}

/* Nothing done yet: --filled is 0, so clamping would leave a dead bar. Run the
   sweep across the whole empty track instead, in plain white — no colour cycle,
   because there is no progress for it to represent. */
.jira-progress-live.jira-progress-empty::after {
  width: 100%;
  background-image: linear-gradient(90deg,
    rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0) 100%);
}

.jira-progress-finished .jira-progress-done { background: var(--success); }

/* Animation is decoration here — the widths already carry the information. */
@media (prefers-reduced-motion: reduce) {
  .jira-progress-live .jira-progress-done,
  .jira-progress-live .jira-progress-prog { animation: none; background-image: none; }
  .jira-progress-live .jira-progress-done { background: var(--success); }
  .jira-progress-live::after { display: none; }
}
.jira-progress-meta { color: var(--muted); font-size: 11px; margin-top: 4px; }

.jira-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--primary); font-size: 12px; }
.jira-key-lg { font-size: 14px; font-weight: 600; }
.jira-count { color: var(--muted); font-weight: 400; font-size: 13px; }

.jira-type { font-size: 12px; }
.jira-type-bug { color: var(--danger); }
.jira-type-story { color: var(--success); }
.jira-type-epic { color: #a78bfa; }
.jira-type-task { color: var(--info); }
.jira-type-sub { color: var(--muted); }

/* Initials avatars: Jira's own avatar URLs need credentials we keep server-side. */
.jira-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  font-size: 10px; font-weight: 600; color: #0f1115; letter-spacing: 0.3px;
}
.jira-avatar-lg { width: 32px; height: 32px; font-size: 12px; }
.jira-avatar-none { background: var(--border); color: var(--muted); }
.jira-avatar-c0 { background: #6c8cff; }
.jira-avatar-c1 { background: #4ade80; }
.jira-avatar-c2 { background: #fbbf24; }
.jira-avatar-c3 { background: #f87171; }
.jira-avatar-c4 { background: #a78bfa; }
.jira-avatar-c5 { background: #22d3ee; }
.jira-avatar-c6 { background: #fb923c; }
.jira-avatar-c7 { background: #f472b6; }

.jira-user { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.jira-user-empty { color: var(--muted); }

.jira-issue-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .jira-issue-grid { grid-template-columns: 1fr; } }

/* minmax(0, 1fr), not 1fr: a grid column defaults to min-width:auto, so a long
   nowrap value like "READY FOR PRODUCTION DEPLOYMENT" pushes the column wider
   than the card and spills outside it. */
.jira-field {
  display: grid; grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border);
}
.jira-field:last-child { border-bottom: 0; }
.jira-field-label { color: var(--muted); font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.jira-field-value { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }

/* Lozenges stay on one line in tables, but must be allowed to wrap in the
   narrow Details column. */
.jira-field-value .jira-lozenge,
.jira-field-value .badge {
  white-space: normal; max-width: 100%; display: inline-block; vertical-align: top;
}
.jira-field-value .jira-user { max-width: 100%; }
.jira-field-value .jira-user span { overflow-wrap: anywhere; }

.jira-linked-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px;
}
.jira-linked-row:last-child { border-bottom: 0; }
.jira-linked-row:hover { color: var(--text); }

.jira-comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.jira-comment:last-child { border-bottom: 0; padding-bottom: 0; }
.jira-comment-body { flex: 1; min-width: 0; }
.jira-comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.jira-comment-head strong { color: var(--text); font-size: 13px; }
.jira-edited { font-style: italic; }

/* ── Rendered Atlassian Document Format ──────────────────────────────────── */

.adf { font-size: 14px; line-height: 1.65; word-wrap: break-word; }
.adf > *:first-child { margin-top: 0; }
.adf > *:last-child { margin-bottom: 0; }
.adf p { margin: 0 0 10px; }
.adf h3, .adf h4, .adf h5, .adf h6 { margin: 18px 0 8px; }
.adf ul, .adf ol { margin: 0 0 10px; padding-left: 22px; }
.adf li { margin-bottom: 4px; }
.adf a { color: var(--primary); }
.adf code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
}
.adf-code {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; overflow-x: auto; font-size: 12px; margin: 0 0 12px;
}
.adf-code code { background: transparent; border: 0; padding: 0; }
.adf-quote { border-left: 3px solid var(--border); margin: 0 0 12px; padding: 2px 0 2px 14px; color: var(--muted); }
.adf-rule { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.adf-panel { border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; border-left: 3px solid var(--info); background: var(--surface-alt); }
.adf-panel-warning { border-left-color: var(--warning); }
.adf-panel-error { border-left-color: var(--danger); }
.adf-panel-success { border-left-color: var(--success); }
.adf-panel-note { border-left-color: #a78bfa; }
.adf-table-wrap { overflow-x: auto; margin: 0 0 12px; }
.adf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adf-table th, .adf-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
.adf-table th { background: var(--surface-alt); color: var(--muted); font-weight: 600; }
.adf-tasklist { list-style: none; padding-left: 0; }
.adf-task { display: flex; gap: 8px; align-items: flex-start; }
.adf-task-done { color: var(--muted); text-decoration: line-through; }
.adf-checkbox { flex: 0 0 auto; }
.adf-mention { color: var(--primary); background: rgba(108,140,255,0.12); border-radius: 3px; padding: 0 4px; }
.adf-media { color: var(--muted); font-size: 12px; }
a.adf-media { color: var(--primary); cursor: pointer; text-decoration: underline; }
.adf-issue-key {
  color: var(--primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95em; text-decoration: none; border-bottom: 1px dotted currentColor;
}

/* Embedded images start blank and fade in once the bytes arrive. */
.adf-image {
  max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border);
  display: block; margin: 10px 0; min-height: 40px;
  background: var(--surface-alt); opacity: 0; transition: opacity 0.2s ease;
}
.adf-image-loaded { opacity: 1; }

.jira-att-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.jira-att-thumb { margin: 0; }
.jira-att-thumb img {
  width: 100%; height: 130px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-alt);
  opacity: 0; transition: opacity 0.2s ease; cursor: zoom-in;
}
.jira-att-thumb img.adf-image-loaded { opacity: 1; }
.jira-att-thumb figcaption {
  color: var(--muted); font-size: 11px; margin-top: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.adf-media-group { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.adf-expand { margin: 0 0 12px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.adf-expand summary { cursor: pointer; color: var(--muted); }
.adf-inline-status { font-size: 11px; font-weight: 600; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; background: var(--surface-alt); border: 1px solid var(--border); }
.adf-inline-status-green { color: var(--success); }
.adf-inline-status-red { color: var(--danger); }
.adf-inline-status-yellow { color: var(--warning); }
.adf-inline-status-blue { color: var(--info); }
.adf-date { color: var(--muted); }

/* Sprints */
.jira-sprint { margin-bottom: 14px; }
.jira-sprint-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.jira-sprint-issues { margin-top: 12px; max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.jira-sprint-issues .table th {
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}

/* Sits above the page content, outside #app, so no view has to render it. */
.nav-back-wrap { padding-top: 16px; padding-bottom: 0; }
.nav-back-wrap .btn { padding: 4px 12px; }

/* --- Modal ---------------------------------------------------------------
   Used by the "New Suite" and "New Test Case" forms, which used to open as a
   panel below the list — off-screen once a collection had a dozen suites.
   Aligned to the top and scrolled by the overlay so a tall form (the case form
   carries steps and automation fields) still reaches its buttons. */
body.modal-open { overflow: hidden; }

.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
}
.modal-dialog {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal-dialog--wide { max-width: 880px; }

.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 22px; line-height: 1;
  padding: 0 4px; border-radius: 4px;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 18px 20px; }
.modal-body > .form-group:last-child { margin-bottom: 0; }

/* Sticky so Create stays reachable while a long form is scrolled. */
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
}
