/* giixi DORA — IR module components.
   All styles are scoped under .ir-module so existing pages remain untouched.
   Design tokens are declared globally in ir-tokens.css. */

.ir-module {
  font-family: var(--font-sans);
  color: var(--ink-0);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Reset legacy global `button { width:100%; margin-top:1.5rem; ... }` from style.css */
.ir-module button {
  width: auto;
  margin-top: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  border-radius: 0;
  font-weight: inherit;
  font-family: inherit;
  border: 0;
}
.ir-module button:hover { background: transparent; }
.ir-module input,
.ir-module textarea,
.ir-module select { font-family: inherit; color: inherit; }

/* Breadcrumb */
.ir-module .ir-crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-3);
  margin-bottom: 18px;
}
.ir-module .ir-crumb .sep { opacity: 0.5; }
.ir-module .ir-crumb .here { color: var(--ink-1); font-weight: 600; }

/* Page header */
.ir-module .ir-page-head {
  display: flex; align-items: flex-end; gap: 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.ir-module .ir-page-head h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink-0);
}
.ir-module .ir-page-head .sub {
  color: var(--ink-2);
  font-size: 14px;
  max-width: 640px;
}
.ir-module .ir-page-head .actions { margin-left: auto; display: flex; gap: 10px; }

/* Buttons */
.ir-module .ir-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surf-1);
  color: var(--ink-0);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, transform 120ms ease;
}
.ir-module .ir-btn:hover { background: var(--surf-2); color: var(--ink-0); }
.ir-module .ir-btn:active { transform: translateY(1px); }
.ir-module .ir-btn-primary {
  background: var(--gold);
  color: var(--accent-ink);
  border-color: var(--gold);
}
.ir-module .ir-btn-primary:hover { background: var(--gold-hi); color: var(--accent-ink); }
.ir-module .ir-btn-primary:disabled,
.ir-module .ir-btn-primary[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.ir-module .ir-btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-1);
}
.ir-module .ir-btn-ghost:hover { background: var(--surf-1); color: var(--ink-0); }

/* Tabs */
.ir-module .ir-tabs {
  display: inline-flex; gap: 4px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--surf-1);
  border: 1px solid var(--line);
}
.ir-module .ir-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.ir-module .ir-tab:hover { color: var(--ink-0); }
.ir-module .ir-tab.active {
  background: var(--bg-0);
  color: var(--ink-0);
}
.ir-module .ir-tab .count {
  margin-left: 8px;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surf-2);
  color: var(--ink-2);
  font-weight: 700;
}
.ir-module .ir-tab.active .count { background: var(--gold-soft); color: var(--gold-hi); }

/* Cards */
.ir-module .ir-card {
  background: var(--surf-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.ir-module .ir-card-flat {
  background: var(--surf-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* Phase chips */
.ir-module .ir-phase-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid;
}
.ir-module .phase-initial { color: var(--danger); border-color: rgba(239, 68, 68, 0.35); background: var(--danger-soft); }
.ir-module .phase-intermediate { color: var(--warn); border-color: rgba(245, 158, 11, 0.35); background: var(--warn-soft); }
.ir-module .phase-final { color: var(--info); border-color: rgba(59, 130, 246, 0.35); background: var(--info-soft); }
.ir-module .phase-threat { color: var(--gold-hi); border-color: var(--gold-line); background: var(--gold-soft); }

/* Status chips */
.ir-module .ir-status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surf-2);
  color: var(--ink-1);
  border: 1px solid var(--line);
}
.ir-module .ir-status-chip .pulse {
  width: 6px; height: 6px; border-radius: 50%;
}
.ir-module .status-draft .pulse { background: var(--warn); }
.ir-module .status-validating .pulse { background: var(--info); animation: ir-pulse 1.4s ease-in-out infinite; }
.ir-module .status-passed .pulse { background: var(--ok); }
.ir-module .status-failed .pulse { background: var(--danger); }
.ir-module .status-overdue { color: var(--danger); border-color: rgba(239, 68, 68, 0.4); }
.ir-module .status-overdue .pulse { background: var(--danger); }
.ir-module .ir-status-chip.overdue    { color: var(--danger); border-color: rgba(239,68,68,0.4);   background: rgba(239,68,68,0.08); }
.ir-module .ir-status-chip.cancelled  { color: #6b7280;       border-color: rgba(107,114,128,0.4); background: rgba(107,114,128,0.08); }
.ir-module .ir-status-chip.submitted  { color: var(--ok);     border-color: rgba(34,197,94,0.4);   background: rgba(34,197,94,0.08); }
.ir-module .ir-status-chip.draft      { color: var(--warn);   border-color: rgba(234,179,8,0.4);   background: rgba(234,179,8,0.08); }
.ir-module .ir-status-chip.expired    { color: var(--danger); border-color: rgba(239,68,68,0.4);   background: rgba(239,68,68,0.08); }
.ir-module .ir-overdue-label { color: var(--danger); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.ir-module .ir-expired-label { color: var(--danger); font-size: 12px; font-weight: 600; }
@keyframes ir-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Reports table */
.ir-module .ir-reports-table {
  width: 100%;
  border-collapse: collapse;
}
.ir-module .ir-reports-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}
.ir-module .ir-reports-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-1);
  vertical-align: middle;
}
.ir-module .ir-reports-table tr:last-child td { border-bottom: 0; }
.ir-module .ir-reports-table tbody tr { cursor: pointer; transition: background 100ms; }
.ir-module .ir-reports-table tbody tr:hover { background: var(--surf-2); }

.ir-module .ir-ref-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-0);
  font-weight: 600;
}

/* Countdown */
.ir-module .ir-countdown {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  gap: 2px;
}
.ir-module .ir-countdown .time {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.ir-module .ir-countdown.urgent .time { color: var(--danger); }
.ir-module .ir-countdown.warn .time { color: var(--warn); }
.ir-module .ir-countdown.ok .time { color: var(--ok); }
.ir-module .ir-countdown .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
}

/* Progress meter */
.ir-module .ir-meter {
  width: 100%; height: 4px;
  background: var(--surf-2);
  border-radius: 999px;
  overflow: hidden;
}
.ir-module .ir-meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
  transition: width 300ms ease;
}
.ir-module .ir-meter.urgent > span { background: var(--danger); }
.ir-module .ir-meter.warn > span { background: var(--warn); }
.ir-module .ir-meter.ok > span { background: var(--ok); }

/* Stat strip */
.ir-module .ir-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.ir-module .ir-stat-card {
  background: var(--surf-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.ir-module .ir-stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 700;
}
.ir-module .ir-stat-card .value {
  font-family: var(--font-sans);
  font-size: 28px;
  color: var(--ink-0);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ir-module .ir-stat-card .foot {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 4px;
}
.ir-module .ir-stat-card.critical .value { color: var(--danger); }
.ir-module .ir-stat-card.warn .value { color: var(--warn); }
.ir-module .ir-stat-card.ok .value { color: var(--ok); }

/* Phase picker cards */
.ir-module .ir-phase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.ir-module .ir-phase-card {
  position: relative;
  padding: 32px 24px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surf-1);
  cursor: pointer;
  transition: all 160ms ease;
  overflow: hidden;
  min-height: 240px;
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none;
  color: var(--ink-0);
  text-align: center;
}
.ir-module .ir-phase-card:hover {
  border-color: var(--line-strong);
  background: var(--surf-2);
  transform: translateY(-2px);
}
.ir-module .ir-phase-card .accent-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
}
.ir-module .ir-phase-card.initial .accent-bar { background: var(--danger); }
.ir-module .ir-phase-card.intermediate .accent-bar { background: var(--warn); }
.ir-module .ir-phase-card.final .accent-bar { background: var(--info); }
.ir-module .ir-phase-card h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 22px;
  margin: 14px 0 4px;
  color: var(--ink-0);
}
.ir-module .ir-phase-card .deadline-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ir-module .ir-phase-card .deadline {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  margin-top: 12px;
}
.ir-module .ir-phase-card .desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-top: 14px;
}
.ir-module .ir-phase-card .ir-phase-chip { align-self: center !important; }
.ir-module .ir-phase-card .ir-deadline-badge { justify-content: center; }
.ir-module .ir-phase-card .arrow {
  margin-top: auto;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  width: 100%;
}
.ir-module .ir-phase-card.initial .arrow { color: var(--danger); }
.ir-module .ir-phase-card.intermediate .arrow { color: var(--warn); }
.ir-module .ir-phase-card.final .arrow { color: var(--info); }

/* Locked phase card */
.ir-module .ir-phase-card--locked {
  cursor: default;
}
.ir-module .ir-phase-card--locked:hover {
  transform: none;
  border-color: var(--line);
  background: var(--surf-1);
}
.ir-module .ir-phase-card--locked > *:not(.ir-phase-lock-overlay):not(.accent-bar) {
  opacity: 0.999999;
  pointer-events: none;
  user-select: none;
}
.ir-module .ir-phase-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  /* No blur and no full-card scrim: the card underneath should stay readable.
     Legibility comes from a plate behind the lock copy only, densest where the
     text sits and fading out to nothing at the card edges. Themed via
     --surf-1, so it flips with the light theme like everything else. */
  background: radial-gradient(
    ellipse 85% 60% at center,
    color-mix(in srgb, var(--surf-1) 92%, transparent) 0%,
    color-mix(in srgb, var(--surf-1) 80%, transparent) 50%,
    transparent 100%
  );
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
}
.ir-module .ir-phase-lock-overlay i.fa-lock {
  font-size: 28px;
  color: var(--ink-2);
  opacity: 0.85;
}
.ir-module .ir-phase-lock-overlay span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-0);
  line-height: 1.4;
}
.ir-module .ir-phase-lock-overlay small {
  font-size: 12px;
  color: var(--ink-2);
}
.ir-module .ir-phase-lock-overlay small a {
  /* --blue is scoped to the live-roi module, not a global token, so it
     resolved to nothing here and the link read as plain grey body text. */
  color: var(--info);
  font-weight: 600;
  text-decoration: underline;
}

/* ROI banner */
.ir-module .ir-roi-banner {
  background: var(--surf-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap;
}
.ir-module .ir-roi-banner .ico-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gold-soft);
  color: var(--gold);
  display: grid; place-items: center;
  font-size: 16px;
}
.ir-module .ir-roi-banner .ir-roi-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3); font-weight: 700;
}
.ir-module .ir-roi-banner .ir-roi-value {
  font-size: 14px; color: var(--ink-0); font-weight: 600;
}
.ir-module .ir-roi-banner .subtle {
  color: var(--ink-3); font-size: 12px;
}
.ir-module .ir-roi-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* Compact ROI strip on the phase form */
.ir-module .ir-roi-strip {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--surf-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-md);
  flex-wrap: wrap;
}
.ir-module .ir-roi-strip .ico {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--gold-soft); color: var(--gold);
  display: grid; place-items: center;
  font-size: 12px;
}
.ir-module .ir-roi-strip-body {
  display: flex; flex-direction: column; gap: 1px;
  flex: 1; min-width: 220px;
}
.ir-module .ir-roi-strip-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3); font-weight: 700;
}
.ir-module .ir-roi-strip-value {
  font-size: 13px; color: var(--ink-0); font-weight: 600;
}
.ir-module .ir-roi-strip-status {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ir-module .ir-roi-strip-count {
  font-size: 11px; color: var(--ink-2); font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-0); border: 1px solid var(--line);
  white-space: nowrap;
}
.ir-module .ir-roi-strip-action {
  padding: 6px 12px; font-size: 12px;
}
.ir-module .ir-roi-strip-action[aria-expanded="true"] [data-ir-roi-chevron] {
  transform: rotate(180deg);
}
.ir-module .ir-roi-strip-action [data-ir-roi-chevron] {
  transition: transform 160ms ease;
}

/* ROI details panel (expanded from strip) */
.ir-module .ir-roi-details {
  margin: -10px 0 14px;
  padding: 16px 18px 18px;
  background: var(--surf-1);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.ir-module .ir-roi-details[hidden] { display: none; }
.ir-module .ir-roi-details-head {
  display: flex; flex-direction: column; gap: 2px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.ir-module .ir-roi-details-title {
  font-size: 13px; color: var(--ink-0); font-weight: 700;
}
.ir-module .ir-roi-details-sub {
  font-size: 11px; color: var(--ink-3);
}
.ir-module .ir-roi-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.ir-module .ir-roi-details-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--bg-0);
  border: 1px solid var(--line);
}
.ir-module .ir-roi-details-id {
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  font-size: 11px; color: var(--gold); font-weight: 700;
  align-self: start;
  padding-top: 2px;
}
.ir-module .ir-roi-details-name {
  font-size: 11px; color: var(--ink-3); font-weight: 600;
}
.ir-module .ir-roi-details-value {
  font-size: 12px; color: var(--ink-0); font-weight: 600;
  word-break: break-word;
}
.ir-module .ir-roi-details-note {
  margin-top: 12px; padding: 8px 12px;
  background: var(--bg-0); border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  font-size: 11px; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px;
}
.ir-module .ir-roi-details-note i { color: var(--gold); }
.ir-module .ir-roi-details-note a { color: var(--gold); text-decoration: none; font-weight: 600; }
.ir-module .ir-roi-details-note a:hover { text-decoration: underline; }

/* Segmented control */
.ir-module .ir-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surf-2); border-radius: 999px;
  border: 1px solid var(--line);
}
.ir-module .ir-seg button {
  padding: 6px 14px; font-size: 12px;
  border-radius: 999px; border: 0;
  background: transparent; color: var(--ink-2);
  font-weight: 600; cursor: pointer;
}
.ir-module .ir-seg button.on { background: var(--gold); color: var(--accent-ink); }

/* Guidelines */
.ir-module .ir-guidelines {
  background: var(--surf-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 18px;
}
.ir-module .ir-guidelines h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--ink-0);
}
.ir-module .ir-guidelines ol {
  margin: 0; padding: 0;
  list-style: none;
  counter-reset: gli;
}
.ir-module .ir-guidelines li {
  counter-increment: gli;
  position: relative;
  padding: 10px 0 10px 38px;
  font-size: 13px;
  color: var(--ink-1);
  line-height: 1.55;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.ir-module .ir-guidelines li:last-child { border-bottom: 0; }
.ir-module .ir-guidelines li::before {
  content: counter(gli, decimal-leading-zero);
  position: absolute; left: 0; top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--gold-soft);
}

/* Submission header (form) */
.ir-module .ir-submission-header {
  background: linear-gradient(135deg, var(--surf-1) 0%, var(--surf-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
}
.ir-module .ir-submission-header .left { display: flex; flex-direction: column; gap: 4px; }
.ir-module .ir-submission-header h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 22px;
  margin: 8px 0 0;
  color: var(--ink-0);
  letter-spacing: -0.01em;
}
.ir-module .ir-submission-header .ref-line {
  display: flex; gap: 18px; margin-top: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3);
}
.ir-module .ir-submission-header .ref-line strong { color: var(--ink-0); font-weight: 600; }

.ir-module .ir-deadline-track {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--bg-0);
  border: 1px solid var(--line);
  min-width: 280px;
}
.ir-module .ir-deadline-track .ico { font-size: 18px; }
.ir-module .ir-deadline-track .label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3); font-weight: 700;
}
.ir-module .ir-deadline-track .value {
  font-family: var(--font-mono);
  font-size: 16px; font-weight: 700; color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}

/* Form layout */
.ir-module .ir-form-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 22px;
  align-items: start;
}
@media (max-width: 1200px) {
  .ir-module .ir-form-layout { grid-template-columns: 1fr; }
  .ir-module .ir-form-toc { position: static !important; }
}
@media (max-width: 1100px) {
  .ir-module .ir-stat-strip { grid-template-columns: repeat(2, 1fr); }
  .ir-module .ir-phase-grid { grid-template-columns: 1fr; }
}

.ir-module .ir-form-section {
  background: var(--surf-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.ir-module .ir-form-section-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
  display: flex; align-items: center; gap: 12px;
}
.ir-module .ir-form-section-head h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  color: var(--ink-1);
}
.ir-module .ir-form-section-head .count-chip {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surf-2);
  color: var(--ink-2);
}
.ir-module .ir-form-section-head .count-chip.complete { color: var(--ok); background: var(--ok-soft); }

.ir-module .ir-form-body { padding: 8px 0; }

.ir-module .ir-field-row {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.ir-module .ir-field-row:last-child { border-bottom: 0; }
.ir-module .ir-field-row:hover { background: rgba(255, 255, 255, 0.015); }

/* Unfilled required field — shown once overall completion exceeds 60% */
.ir-module .ir-field-row.ir-field-incomplete {
  border-left: 3px solid var(--danger);
  padding-left: 19px; /* compensate for the 3px border so layout stays stable */
  background: rgba(239, 68, 68, 0.04);
}
.ir-module .ir-field-row.ir-field-incomplete .ir-field-input,
.ir-module .ir-field-row.ir-field-incomplete .ir-ms-trigger,
.ir-module .ir-field-row.ir-field-incomplete [data-fid] {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}
/* Validation error state (on submit) — stronger red, full outline */
.ir-module .ir-field-row.has-error {
  border-left: 3px solid var(--danger);
  padding-left: 19px;
  background: rgba(239, 68, 68, 0.07);
}
.ir-module .ir-field-row.has-error .ir-field-input,
.ir-module .ir-field-row.has-error .ir-ms-trigger,
.ir-module .ir-field-row.has-error [data-fid] {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28);
}

.ir-module .ir-field-label { display: flex; flex-direction: column; gap: 3px; }
.ir-module .ir-field-label .id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.ir-module .ir-field-label .name {
  font-size: 13px;
  color: var(--ink-0);
  font-weight: 500;
  line-height: 1.4;
}
.ir-module .ir-field-label .req {
  color: var(--danger);
  font-weight: 700;
  margin-left: 3px;
}

.ir-module .ir-field-input {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-0);
  outline: none;
  transition: border-color 120ms;
}
.ir-module .ir-field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.ir-module .ir-field-input.prefilled {
  background: var(--gold-soft);
  border-color: var(--gold-line);
  color: var(--gold-hi);
}
.ir-module .ir-textarea-wrap { display: flex; flex-direction: column; gap: 4px; }
.ir-module .ir-char-counter {
  align-self: flex-end;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.ir-module .ir-char-counter-warn { color: var(--danger); font-weight: 600; }
.ir-module .ir-field-input:disabled {
  background: color-mix(in oklab, var(--color-primary) 6%, var(--bg-0));
  border-color: color-mix(in oklab, var(--color-primary) 20%, var(--line));
  color: var(--ink-2);
  cursor: not-allowed;
  opacity: 1;
}
.ir-module textarea.ir-field-input { resize: vertical; min-height: 70px; }

/* Date + time halves of a datetime field are always exactly equal width and
   height. Inline flex styles alone were not enough: `box-sizing` is only
   border-box via Bootstrap, and a native `input[type="time"]` carries an
   intrinsic min-width (its hh:mm spinner) that outgrows the date button
   unless the floor is explicitly removed. `flex: 1 1 0` + `min-width: 0` on
   both children makes the split exact at every container width, and
   `width: auto` stops the `.ir-field-input` `width: 100%` from leaking in. */
.ir-module .ir-dt {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.ir-module .ir-dt > .ir-field-input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  box-sizing: border-box;
}
/* A <button> does not inherit the page font, so the date half rendered in the
   UA's button font next to the time input. */
.ir-module .ir-pick-trigger { font-family: inherit; }
/* One explicit height for both halves. `height:auto` was not enough: a native
   `input[type="time"]` sizes its box from its inner hh:mm editor, a <button>
   from its text line, and Chromium, Firefox and Safari disagree by a few
   pixels, so the time half looked shorter or taller than the date half. A
   fixed height with zero block padding and a centred line makes the two
   boxes identical everywhere; the native-fallback date/datetime inputs share
   it so a datetime row also matches the single-line fields around it. */
.ir-module .ir-dt > .ir-field-input,
.ir-module input.ir-field-input[type="date"],
.ir-module input.ir-field-input[type="datetime-local"] {
  height: 42px;
  min-height: 42px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 20px;
}
.ir-module .ir-dt > input[type="time"].ir-field-input {
  font-family: inherit;
  font-size: 13px;
  align-self: stretch;
}
.ir-module .ir-dt > input[type="time"].ir-field-input::-webkit-datetime-edit,
.ir-module .ir-dt > input[type="time"].ir-field-input::-webkit-datetime-edit-fields-wrapper {
  padding-top: 0;
  padding-bottom: 0;
}

.ir-module .ir-field-meta {
  display: none;
  align-items: center; gap: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  justify-content: flex-end;
}
.ir-module .ir-field-meta.from-roi { color: var(--gold); }
.ir-module .ir-field-meta.from-org { color: var(--color-primary); }
.ir-module .ir-field-meta.required { color: var(--danger); }
.ir-module .ir-field-meta.optional { color: var(--ink-3); }
.ir-module .ir-field-meta.ok { color: var(--ok); }

.ir-module .ir-multi-tags {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.ir-module .ir-multi-tag {
  padding: 4px 10px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-hi);
  border: 1px solid var(--gold-line);
  font-size: 12px; font-weight: 600;
}

/* Form TOC sidebar */
.ir-module .ir-form-toc {
  position: sticky; top: 88px;
  padding: 18px;
  background: var(--surf-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
/* The reclassification panel when the page was opened from the Non Major
   list's action — marks what the trip was for, then settles. */
.ir-module .ir-form-toc.ir-recl-focus {
  border-color: var(--gold-line, #60a5fa);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
  animation: ir-recl-pulse 1.6s ease-out 2;
}

@keyframes ir-recl-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18); }
  50%      { box-shadow: 0 0 0 7px rgba(96, 165, 250, 0.08); }
}

@media (prefers-reduced-motion: reduce) {
  .ir-module .ir-form-toc.ir-recl-focus { animation: none; }
}

.ir-module .ir-form-toc h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-weight: 700;
  margin: 0 0 12px;
}
.ir-module .ir-toc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
}
.ir-module .ir-toc-item:hover { background: var(--surf-2); color: var(--ink-0); }
.ir-module .ir-toc-item.active { background: var(--surf-2); color: var(--ink-0); font-weight: 600; }
.ir-module .ir-toc-item .ok-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ir-module .ir-toc-item.complete .ok-dot {
  border-color: var(--ok);
  background: var(--ok);
  color: #0F1714;
  font-size: 9px;
  font-weight: 900;
}
.ir-module .ir-toc-item .pct {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.ir-module .ir-divider { height: 1px; background: var(--line); margin: 14px 0; }

/* Sticky form footer */
.ir-module .ir-form-sticky-bar {
  position: sticky; bottom: 16px;
  /* Was 18px — close enough that the bar could visually sit right against
     the last question's Yes/No row once the page was scrolled to the
     bottom, so a click meant for the answer could land on Cancel instead
     (see ir-phase-form.js's isDirty/Cancel-confirm guard for the second
     half of this fix). Sticky elements still respect margin-top from
     their normal-flow position, so this reliably holds a gap even once
     the bar has stuck. */
  margin-top: 56px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 12px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 12px 36px -12px rgba(0, 0, 0, 0.7);
  z-index: 4;
}
.ir-module .ir-form-sticky-bar .right { margin-left: auto; display: flex; gap: 10px; }
.ir-module .ir-form-sticky-bar .progress {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 240px;
}
.ir-module .ir-form-sticky-bar .progress-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}

/* Carry-over notice */
.ir-module .ir-carry-over {
  padding: 16px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  display: flex; gap: 14px; align-items: center;
  margin-top: 16px;
}
.ir-module .ir-carry-over .ico { color: var(--gold); font-size: 18px; }

/* Detail drawer */
.ir-drawer-bg {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1040;
}
.ir-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 540px;
  max-width: 100vw;
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  z-index: 1041;
  display: flex; flex-direction: column;
  box-shadow: -24px 0 48px -16px rgba(0, 0, 0, 0.6);
  animation: ir-slide-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: var(--font-sans);
  color: var(--ink-0);
}
@keyframes ir-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.ir-drawer-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 14px;
}
.ir-drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.ir-drawer-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px;
  align-items: center;
}
.ir-drawer .close-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surf-1);
  border: 1px solid var(--line);
  color: var(--ink-1);
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ir-drawer .close-btn:hover { background: var(--surf-2); }

.ir-kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 14px;
  font-size: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.ir-kv:last-child { border-bottom: 0; }
.ir-kv .k { color: var(--ink-3); font-weight: 600; }
.ir-kv .v { color: var(--ink-0); }

.ir-valid-icon {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11px; font-weight: 900;
}
.ir-valid-icon.miss { background: var(--surf-2); color: var(--ink-3); }
.ir-valid-icon.err { background: var(--danger-soft); color: var(--danger); }

.ir-classification-tag {
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 999px;
  background: var(--surf-2);
  border: 1px solid var(--line);
  color: var(--ink-1);
}

/* Utilities */
.ir-module .ir-row { display: flex; align-items: center; gap: 10px; }
.ir-module .ir-col { display: flex; flex-direction: column; gap: 4px; }
.ir-module .ir-spacer { flex: 1; }
.ir-module .ir-subtle { color: var(--ink-3); font-size: 12px; }
.ir-module .ir-mono { font-family: var(--font-mono); }

/* Make sticky form bar work inside Bootstrap container */
.ir-module .ir-content { padding-bottom: 140px; }

/* =========================================================================
   ponytail: LIGHT THEME OVERRIDE BLOCK.
   The dark rules above stay byte-identical and remain the default. Chrome
   tokens flip automatically via ir-tokens.css's own light block; this block
   only patches the ~hardcoded literals in this file that bypass tokens and
   assume a dark canvas (black-tint overlays, white hairlines, dark-tuned
   status/phase washes). Near-black button-text literals (#1a1206 / #0F1714)
   are intentionally left — they sit on bright gold/green fills.
   ========================================================================= */

/* (a) Black-tint header/section overlays → on white these read as gray
   smudges, so swap to a faint light surface tint. */
[data-bs-theme="light"] .ir-module .ir-reports-table th {
  background: rgba(0, 0, 0, 0.03);
}
[data-bs-theme="light"] .ir-module .ir-form-section-head {
  background: rgba(0, 0, 0, 0.025);
}
/* Sticky bar drop-shadow tuned for dark → lighter on white. */
[data-bs-theme="light"] .ir-module .ir-form-sticky-bar {
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.18);
}

/* (b) White hairlines (dark-idiom) → black alpha so separators/hover read
   on a white surface. */
[data-bs-theme="light"] .ir-module .ir-guidelines li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-bs-theme="light"] .ir-module .ir-field-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-bs-theme="light"] .ir-module .ir-field-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* (c) Phase chip borders + status/phase washes — fixed dark-tuned alphas;
   bump for legibility on white. */
[data-bs-theme="light"] .ir-module .phase-initial { border-color: rgba(239, 68, 68, 0.45); }
[data-bs-theme="light"] .ir-module .phase-intermediate { border-color: rgba(245, 158, 11, 0.5); }
[data-bs-theme="light"] .ir-module .phase-final { border-color: rgba(59, 130, 246, 0.45); }

[data-bs-theme="light"] .ir-module .status-overdue { border-color: rgba(239, 68, 68, 0.5); }
[data-bs-theme="light"] .ir-module .ir-status-chip.overdue {
  border-color: rgba(239, 68, 68, 0.5);  background: rgba(239, 68, 68, 0.12);
}
[data-bs-theme="light"] .ir-module .ir-status-chip.cancelled {
  border-color: rgba(107, 114, 128, 0.5); background: rgba(107, 114, 128, 0.12);
}
[data-bs-theme="light"] .ir-module .ir-status-chip.submitted {
  border-color: rgba(22, 163, 74, 0.5);   background: rgba(22, 163, 74, 0.12);
}
[data-bs-theme="light"] .ir-module .ir-status-chip.draft {
  border-color: rgba(217, 119, 6, 0.5);    background: rgba(217, 119, 6, 0.12);
}
[data-bs-theme="light"] .ir-module .ir-status-chip.expired {
  border-color: rgba(239, 68, 68, 0.5);    background: rgba(239, 68, 68, 0.12);
}

/* Incomplete / error field washes — calibrated for dark, bump alpha on white. */
[data-bs-theme="light"] .ir-module .ir-field-row.ir-field-incomplete {
  background: rgba(239, 68, 68, 0.06);
}
[data-bs-theme="light"] .ir-module .ir-field-row.ir-field-incomplete .ir-field-input,
[data-bs-theme="light"] .ir-module .ir-field-row.ir-field-incomplete .ir-ms-trigger,
[data-bs-theme="light"] .ir-module .ir-field-row.ir-field-incomplete [data-fid] {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}
[data-bs-theme="light"] .ir-module .ir-field-row.has-error {
  background: rgba(239, 68, 68, 0.1);
}
[data-bs-theme="light"] .ir-module .ir-field-row.has-error .ir-field-input,
[data-bs-theme="light"] .ir-module .ir-field-row.has-error .ir-ms-trigger,
[data-bs-theme="light"] .ir-module .ir-field-row.has-error [data-fid] {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35);
}

/* Drawer + scrim live OUTSIDE the .ir-module scope (lines ~915-989), so these
   light overrides are NOT nested under .ir-module. */
[data-bs-theme="light"] .ir-drawer-bg {
  background: rgba(0, 0, 0, 0.32);
}
[data-bs-theme="light"] .ir-drawer {
  box-shadow: -24px 0 48px -16px rgba(0, 0, 0, 0.22);
}
