:root {
  --navy: #0b1220;
  --ink: #1c2430;
  --muted: #5c6775;
  --line: #d5dbe3;
  --paper: #f4f6f8;
  --card: #ffffff;
  --blue: #3d7ab5;
  --amber: #c9841a;
  --pass: #1f7a52;
  --fail: #9c2f2f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Barlow, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
h1, h2, h3 {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0 0 0.4rem;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.site-header {
  background: var(--navy);
  color: white;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 84px;
}
.brand img { height: 48px; width: auto; display: block; }
.summit-link img { height: 42px; width: auto; display: block; }
nav { display: flex; gap: 1.1rem; margin-left: auto; }
nav a { color: white; text-decoration: none; font-weight: 600; }
nav a:hover { color: #f0c36a; }
.hero { padding: 3rem 0 2rem; }
.hero-grid, .rig-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 0.6rem;
}
.lead { font-size: 1.15rem; color: var(--muted); }
.hero-figure, .card, .wide-photo {
  background: var(--card);
  border: 1px solid var(--line);
}
.hero-figure img, .wide-photo { display: block; width: 100%; }
.hero-figure figcaption, .card p, .note { color: var(--muted); }
.hero-figure figcaption { padding: 0.6rem 0.8rem; font-size: 0.9rem; }
.hero-actions, .command-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.btn, button.btn {
  display: inline-block;
  background: var(--navy);
  color: white;
  text-decoration: none;
  border: 0;
  border-radius: 4px;
  padding: 0.65rem 1rem;
  font: 600 1rem Barlow, sans-serif;
  cursor: pointer;
}
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.btn-danger { background: var(--fail); }
.band { background: white; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  padding: 1.6rem 0;
}
.steps span { color: var(--blue); font-family: "Barlow Condensed", sans-serif; font-size: 1.4rem; }
.section { padding: 2.2rem 0 3rem; }
.section-head, .footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card img { height: 180px; object-fit: contain; background: #eef2f6; width: 100%; }
.card div { padding: 0.9rem 1rem 1.1rem; }
.page-hero { padding: 2.2rem 0 1rem; }
.rig-layout { padding-bottom: 3rem; }
.rig-layout img { border: 1px solid var(--line); background: white; }
.wide-photo { margin-bottom: 1rem; }
.ladder-block { padding-bottom: 2rem; }
.ladder-intro { display: grid; grid-template-columns: 180px 1fr; gap: 1rem; align-items: center; margin: 1rem 0; }
.ladder-intro img { background: white; border: 1px solid var(--line); padding: 0.5rem; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.narrow { width: min(640px, calc(100% - 2rem)); margin: 2rem auto 3rem; }
.stack { display: grid; gap: 0.8rem; }
label { display: grid; gap: 0.3rem; font-weight: 600; }
input, select, textarea {
  font: 1rem Barlow, sans-serif;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
}
.limit { background: #fff7e8; border: 1px solid #efd3a2; padding: 0.7rem 0.8rem; }
.error { color: var(--fail); font-weight: 600; }
.meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin: 1rem 0; }
.meters div { background: white; border: 1px solid var(--line); padding: 0.8rem; }
.meters span, .meters small { display: block; color: var(--muted); }
.meters strong { font-family: "Barlow Condensed", sans-serif; font-size: 2rem; }
.reading-row { display: flex; gap: 0.8rem; align-items: end; margin: 1rem 0; }
.status { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; }
.status-passed { color: var(--pass); }
.status-failed, .status-aborted { color: var(--fail); }
.status-straining, .status-holding { color: var(--amber); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.8rem; margin: 1rem 0 2rem; }
.photo-grid img { width: 100%; height: 140px; object-fit: cover; background: white; border: 1px solid var(--line); }
.site-footer { background: var(--navy); color: #d5dbe3; padding: 1.4rem 0; font-size: 0.92rem; }
.site-footer a { color: white; }
.login-link { color: white; font-weight: 600; text-decoration: none; margin-left: auto; }
.user-pill { position: relative; margin-left: auto; }
.user-pill summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  cursor: pointer;
}
.user-pill summary::-webkit-details-marker { display: none; }
.user-pill summary svg { width: 16px; height: 16px; fill: none; stroke: #6b7280; stroke-width: 2; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #2563eb; color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.user-avatar-sm { width: 26px; height: 26px; font-size: 0.75rem; margin-right: 0.35rem; vertical-align: middle; }
.user-pill-name { font-weight: 600; font-size: 0.92rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  width: 240px; background: white; color: var(--ink);
  border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  padding: 0.35rem;
}
.user-pill-id { padding: 0.55rem 0.7rem 0.45rem; border-bottom: 1px solid #f3f4f6; margin-bottom: 0.25rem; }
.user-pill-id p { margin: 0; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280; font-weight: 700; }
.user-pill-id strong, .user-pill-id span { display: block; }
.user-pill-id span { color: var(--muted); font-size: 0.85rem; }
.user-pill-panel a, .user-pill-panel button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; color: var(--ink);
  font: 600 0.92rem Barlow, sans-serif;
  padding: 0.5rem 0.7rem; border-radius: 8px; text-decoration: none; cursor: pointer;
}
.user-pill-panel a:hover, .user-pill-panel button:hover { background: #f1f5f9; }
.role-pill {
  display: inline-block; border-radius: 999px; padding: 0.15rem 0.55rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.role-admin { background: #dbeafe; color: #1e3a8a; }
.role-operator { background: #ffedd5; color: #9a3412; }
.role-customer { background: #d1fae5; color: #065f46; }
@media (max-width: 860px) {
  .hero-grid, .rig-layout, .cards, .steps, .meters, .ladder-intro { grid-template-columns: 1fr; }
  .header-row { flex-wrap: wrap; padding: 0.8rem 0; }
  nav { order: 3; width: 100%; margin: 0; }
}
