* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

.connection-context-bar {
  margin: 0;
  padding: 10px 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  border-bottom: 1px solid #d1d5db;
}

.connection-context-bar--localhost {
  background: #ecfdf5;
  color: #065f46;
}

.connection-context-bar--tunnel {
  background: #fef3c7;
  color: #92400e;
}

.connection-context-bar--other {
  background: #eff6ff;
  color: #1e40af;
}

.build-version-bar {
  margin: 0;
  padding: 6px 16px;
  font-size: 0.82rem;
  line-height: 1.35;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #475569;
}

.app-identity-shell {
  padding-bottom: 0;
}

.app-identity {
  margin: 0 0 8px;
  padding-top: 8px;
}

.environment-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1px solid transparent;
  line-height: 1.3;
}

.environment-badge--local {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.environment-badge--staging {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}

.environment-badge--pilot {
  background: #eff6ff;
  color: #1e40af;
  border-color: #93c5fd;
}

.environment-badge--production {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.environment-badge--other {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.app-brand-title {
  margin: 0 0 4px;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.app-brand-subtitle {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #475569;
}

.upload-page-heading {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1f2937;
}

.pilot-release-bar {
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748b;
  border: none;
  background: transparent;
}

.pilot-release-bar p {
  margin: 0;
}

.pilot-release-bar p + p {
  margin-top: 2px;
}

.pilot-release-line,
.pilot-release-built {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}

.pilot-release-sep {
  color: #94a3b8;
}

.pilot-release-label {
  font-weight: 600;
  color: #64748b;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  margin-top: 0;
}

.card {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select {
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

button {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #334155;
  color: #fff;
  cursor: pointer;
}

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

.muted {
  color: #475569;
}

.status {
  margin: 8px 0 0;
  font-weight: 600;
}

.warning {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  border-radius: 6px;
  font-weight: 600;
}

.mono {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 13px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
}

/* Context — extra vertical rhythm so fields aren’t cramped */
.context-section h2 {
  margin-bottom: 0.75rem;
}

.context-section .context-block {
  margin-top: 0;
}

.context-section .context-block + .context-block {
  margin-top: 1.25rem;
}

.context-section .context-block.grid.two {
  gap: 16px 28px;
  align-items: start;
}

.context-section label.field-block {
  gap: 8px;
}

.context-section .context-note {
  padding-top: 0.125rem;
  line-height: 1.45;
}

.context-section .context-id-row input {
  margin-top: 2px;
}

.context-internal-sep {
  margin: 1.25rem 0 0.75rem;
  border: none;
  border-top: 1px solid #e2e8f0;
}

.context-internal-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.step2-trip-date-explainer {
  margin-top: 14px;
  line-height: 1.45;
}

/* Step 4 — prominent upload status */
.upload-step-status {
  margin: 14px 0 4px;
  font-size: 1rem;
}

.upload-step-status-label {
  font-weight: 600;
}

.upload-step-status-value {
  margin-left: 0.35rem;
  font-weight: 600;
}

.upload-step-status-value.upload-step-status-value--needs-review {
  color: #b91c1c;
  font-weight: 700;
}

.step4-actions button,
.step6-actions button {
  margin-top: 0;
}

.label-hint {
  font-weight: 400;
}

.job-brief {
  white-space: pre-line;
  line-height: 1.45;
  padding: 10px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.review-section-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
}

.review-found {
  margin-bottom: 6px;
}

.review-hint-after {
  margin: 12px 0 8px;
  line-height: 1.45;
}

.notice-helper-top {
  line-height: 1.55;
  margin-bottom: 12px;
}

.result-client-block {
  margin-top: 8px;
}

.result-plain {
  margin: 0 0 14px;
  white-space: pre-line;
  line-height: 1.5;
  color: #1f2937;
}

.result-success-status {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: #334155;
}

.result-success-word {
  font-weight: 700;
  color: #2563eb;
}

#resultHeading.result-heading--success {
  font-weight: 700;
  color: #2563eb;
}

.failure-lead {
  margin: 0 0 10px;
  line-height: 1.45;
}

.failure-email-line {
  margin: 0 0 14px;
  font-weight: 600;
}

#resultFailureSafety {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 3px solid #16a34a;
  background: #f0fdf4;
  color: #166534;
  font-weight: 600;
}

.failure-email-line a {
  color: #2563eb;
}

.recent-job-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
}

.recent-job-field {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.recent-job-span {
  margin-top: 4px;
}

.recent-job-label {
  display: block;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin-bottom: 2px;
}

.jobs-active-banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.jobs-section-heading {
  font-size: 14px;
  font-weight: 700;
  margin: 20px 0 10px;
  color: #334155;
}

/* Scaffolded wizard */
.wizard-stage-context-only .wizard-intro {
  opacity: 0.75;
}

/*
 * Author display rules (e.g. .grid { display: grid }) override the UA
 * [hidden] stylesheet. Force hide for any [hidden] element.
 */
[hidden] {
  display: none !important;
}

.wizard-pane[hidden],
.wizard-copy-fallback[hidden] {
  display: none !important;
}

.admin-tools-sep {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 16px 0;
}

.infra-health {
  margin: 0 0 4px;
}

.infra-health-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.infra-health-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.infra-health-helper {
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.infra-health-panel {
  margin-top: 8px;
}

.infra-health-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.infra-health-table th,
.infra-health-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.infra-health-table th {
  width: 34%;
  color: #475569;
  font-weight: 600;
}

.infra-health-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.infra-health-pill--healthy {
  background: #ecfdf5;
  color: #065f46;
}

.infra-health-pill--degraded {
  background: #fff7ed;
  color: #9a3412;
}

.infra-health-pill--unavailable {
  background: #fef2f2;
  color: #991b1b;
}

.infra-health-pill--unknown {
  background: #f1f5f9;
  color: #475569;
}

.infra-health-release {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #64748b;
}

.infra-health-overall {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.support-tools-warning,
.admin-tools-warning {
  margin-top: 0;
}

.admin-testing-warning {
  margin-top: 0;
}

.support-tools-actions,
.admin-tools-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.support-tools-actions button,
.admin-tools-actions button {
  margin-top: 0;
}

.admin-tools-helper {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.support-active-jobs table,
.admin-active-jobs table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.support-active-jobs th,
.support-active-jobs td,
.admin-active-jobs th,
.admin-active-jobs td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.support-active-jobs th,
.admin-active-jobs th {
  background: #f8fafc;
}

.support-active-jobs .support-select-col,
.admin-active-jobs .support-select-col {
  width: 2.5rem;
  text-align: center;
}

.team-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.team-toolbar button {
  margin-top: 0;
}

.team-filter {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-weight: 500;
}

.team-filter input {
  margin: 0;
  width: auto;
}

.team-list tr.team-user-disabled td {
  color: #64748b;
}

.team-panel {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.team-panel h3,
.team-list-heading {
  margin: 0 0 10px;
  font-size: 1rem;
}

.team-form {
  display: grid;
  gap: 10px;
  max-width: 28rem;
}

.team-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.team-form-actions button {
  margin-top: 0;
}

.team-secondary-btn {
  background: #fff;
  color: #334155;
  border-color: #94a3b8;
}

.team-username-readonly {
  margin: 0 0 10px;
}

.team-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: #1f2937;
}

.team-list th,
.team-list td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.team-list th {
  background: #f8fafc;
}

.team-list .team-manage-btn {
  margin-top: 0;
}

.wizard-secondary summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

.wizard-secondary[open] summary {
  margin-bottom: 12px;
}

.wizard-job-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.wizard-job-controls button {
  margin-top: 0;
}

.wizard-job-card + .wizard-job-card {
  margin-top: 10px;
}

.review-summary {
  margin: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fafafa;
}

.review-summary dt {
  margin: 0;
  padding-top: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #64748b;
}

.review-summary dt:first-child {
  padding-top: 0;
}

.review-summary dd {
  margin: 2px 0 0;
  padding: 0;
  font-weight: 600;
  color: #1f2937;
}

.review-block {
  margin-top: 14px;
}

.review-subheading {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.compact-mono {
  font-size: 12px;
  padding: 8px;
  min-height: 2rem;
}

.result-summary-line {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 1.05rem;
}

.result-summary-line--ok {
  color: #15803d;
}

.result-summary-line--review {
  color: #b91c1c;
  font-weight: 700;
}

.result-block {
  margin-bottom: 12px;
}

.wizard-copy-fallback {
  display: block;
  width: 100%;
  min-height: 140px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
}

.copy-fallback-actions {
  margin-top: 8px;
}

.copy-fallback-actions button {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #94a3b8;
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
}

.session-identity-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.session-identity-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-line;
}

.identity-labeled {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
  line-height: 1.5;
}

.identity-labeled li {
  margin: 0;
}

.identity-labeled .identity-label {
  font-weight: 600;
  margin-right: 0.35rem;
}

.session-identity-switch {
  font-size: 0.85rem;
}

.session-identity-summary {
  margin: 0;
  white-space: pre-line;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
}
