/* =====================================================================
   EnerBridge — shared stylesheet
   Palette (brand):  #00913d green · #001b0b deep green-black · #ffffff white · #ffde00 gold
   Everything else below is a tint/shade of those four, plus one
   semantic red (--danger) reserved for alerts, errors and destructive actions.
   Styling only: no class names, IDs or markup hooks used by JS/forms changed.
   ===================================================================== */

:root {
  /* brand */
  --green: #00913d;
  --bg: #001b0b;
  --white: #ffffff;
  --gold: #ffde00;

  /* derived surfaces (tints of --bg / --green) */
  --panel: #04260f;
  --panel-2: #073317;
  --panel-3: #0b4220;
  --input: #001409;
  --line: #0f4a27;
  --line-soft: rgba(255, 255, 255, 0.08);
  --grid: rgba(0, 145, 61, 0.07);

  /* derived accents */
  --green-hi: #35d07a;          /* readable green for text on dark */
  --green-lo: rgba(0, 145, 61, 0.2);
  --gold-lo: rgba(255, 222, 0, 0.12);
  --gold-dim: #a89200;
  --muted: #9bb5a4;

  /* semantic (only non-brand hue) */
  --danger: #ff5d5d;
  --danger-text: #ff8a8a;
  --danger-lo: rgba(255, 93, 93, 0.14);
  --danger-line: #c43b3b;

  --mono: ui-monospace, "JetBrains Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  scrollbar-color: #0b5a2b var(--bg);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--white);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body.app { padding: 24px; }
body.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

::selection { background: var(--gold); color: var(--bg); }

a { color: var(--green-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

h1, h2 { font-family: var(--sans); }
h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 700; }

.sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }
.muted { color: var(--muted); font-size: 13px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.note { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); padding: 8px 0; font-size: 14px; }
.hidden { display: none; }
small { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; }

/* ---------- page wrappers & header bar ---------- */
.wrap { margin: 0 auto; }
.page-rooms .wrap, .page-room .wrap { max-width: 1100px; }
.page-approvals .wrap { max-width: 1000px; }
.page-password .box { max-width: 440px; }
.page-approvals .crew-create { margin-bottom: 16px; }
.page-approvals .crew-create .muted { margin: 0 0 12px; }
.page-approvals .crew-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }
.page-approvals .crew-create button { margin-top: 16px; }
.page-profile .wrap { max-width: 760px; }
.page-schedules .wrap { max-width: 1280px; }
.page-schedule-edit .wrap { max-width: 560px; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.page-dashboard .top { align-items: flex-start; margin-bottom: 20px; }

/* title marker: gold bar + brand-green underline accent */
.top h1, .page-schedule-edit h1 {
  position: relative;
  padding-left: 14px;
}
.top h1::before, .page-schedule-edit h1::before {
  content: "";
  position: absolute;
  left: 0; top: 0.18em; bottom: 0.18em;
  width: 4px;
  background: var(--gold);
  border-radius: 2px;
}
.page-dashboard .top .sub { margin: 4px 0 0 14px; }
.page-approvals h1, .page-profile h1, .page-schedule-edit h1 { font-size: 26px; }
.page-schedule-edit h1 { margin-bottom: 6px; }

/* ---------- cards ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel) 0%, #031f0c 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
/* technical "tab marker" on each card's top edge */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 16px;
  width: 28px; height: 2px;
  background: var(--gold);
}
.card h2 { margin: 0 0 12px; }

/* section-title headings (detail pages): small mono caps */
.page-room .card h2,
.page-profile .card h2,
.page-schedules .card h2 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-hi);
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-room .card h2::before,
.page-profile .card h2::before,
.page-schedules .card h2::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 145, 61, 0.25);
}
/* name-style headings (room cards) */
.page-dashboard .card h2 { font-size: 18px; margin-bottom: 10px; }
.page-rooms .card h2 { font-size: 20px; margin-bottom: 4px; }
.card h2 a { color: var(--white); }
.card h2 a:hover { color: var(--gold); text-decoration: none; }

/* ---------- grids ---------- */
.grid { display: grid; gap: 16px; }
.page-dashboard .grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.page-rooms .grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.page-room .grid { margin-bottom: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------- data rows ---------- */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}
.row:last-child { border-bottom: 0; }
.row span:first-child { color: var(--muted); }
.row b {
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.page-dashboard .card small { display: block; margin-top: 8px; }

.desc { color: var(--muted); font-size: 13px; margin-bottom: 10px; min-height: 54px; }

/* ---------- badges / status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #cfe0d5;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge.on, .badge.ok {
  background: var(--green-lo);
  color: var(--green-hi);
  border-color: var(--green);
}
.badge.on::before { box-shadow: 0 0 6px var(--green-hi); }
.badge.off { background: rgba(255, 255, 255, 0.05); color: #a9bfb0; border-color: rgba(255, 255, 255, 0.14); }
.badge.bad, .badge.late {
  background: var(--danger-lo);
  color: var(--danger-text);
  border-color: var(--danger-line);
}
.badge.warn, .badge.wait {
  background: var(--gold-lo);
  color: var(--gold);
  border-color: var(--gold-dim);
}
.page-approvals .badge { font-size: 11px; }
.page-profile .badge { margin-top: 6px; }
.role-administrator { background: var(--gold-lo); color: var(--gold); border-color: var(--gold-dim); }
.role-teacher { background: var(--green-lo); color: var(--green-hi); border-color: var(--green); }
.role-maintenance_crew { background: var(--green-lo); color: #b7f4cf; border-color: var(--green); }

.ok { color: var(--green-hi); font-weight: 700; }
.badge.ok { font-weight: 700; }
.yes { color: var(--green-hi); font-weight: 700; }
.no { color: var(--danger-text); font-weight: 700; }

.approval-pill {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  background: var(--gold);
  color: var(--bg);
  border-radius: 999px;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.approval-pill.overdue { background: var(--danger); }

.dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--muted);
}
.dot.on { background: var(--green-hi); box-shadow: 0 0 8px var(--green-hi); }
.dot.off { background: var(--muted); }

/* ---------- banners & flashes ---------- */
.banner {
  background: var(--danger-lo);
  color: #ffd0d0;
  border: 1px solid var(--danger-line);
  border-left: 4px solid var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-weight: 600;
}
.flash {
  background: var(--green-lo);
  color: #c9f5d9;
  border: 1px solid var(--green);
  border-left: 4px solid var(--green-hi);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.err {
  background: var(--danger-lo);
  color: #ffd0d0;
  border: 1px solid var(--danger-line);
  border-left: 4px solid var(--danger);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}
.err div { margin: 2px 0; }

/* ---------- buttons ---------- */
button, .btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--white);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, filter 0.15s ease;
}
button:hover { background: var(--panel-3); border-color: var(--green); }
button:active, .btn:active { transform: translateY(1px); }

/* primary = gold on deep green (high contrast) */
.btn {
  display: inline-block;
  text-align: center;
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  font-weight: 700;
}
.btn:hover { background: var(--gold); border-color: var(--white); filter: brightness(1.06); text-decoration: none; }
.auth button[type=submit] {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}
.auth button[type=submit]:hover { background: var(--gold); border-color: var(--white); filter: brightness(1.06); }

.linkbtn {
  background: none;
  border: 0;
  color: var(--danger-text);
  font-size: 14px;
  font-weight: 500;
  padding: 0;
}
.linkbtn:hover { background: none; text-decoration: underline; }

/* ---------- forms ---------- */
label { display: block; font-size: 14px; margin: 12px 0 4px; color: #e7f1ea; }
label.l { margin: 14px 0 6px; font-weight: 700; }

input[type=text], input[type=email], input[type=password], input[type=time], select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--white);
  font-family: var(--sans);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: #5f7f6b; }
input:hover, select:hover { border-color: #15703a; }
input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 222, 0, 0.18);
}

/* segmented radios + day chips: inputs hidden visually but still keyboard-focusable */
.seg { display: flex; gap: 8px; margin-top: 4px; }
.seg input, .day input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.seg label {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--muted);
  cursor: pointer;
  margin: 0;
  font-size: 14px;
  transition: all 0.15s ease;
}
.seg label:hover { border-color: var(--green); color: var(--white); }
.seg input:checked + label {
  background: var(--green-lo);
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
  color: var(--white);
  font-weight: 700;
}
.seg input:focus-visible + label, .day input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; }
.check input { width: auto; accent-color: var(--green); }
.check label { margin: 0; }
input[type=checkbox] { accent-color: var(--green); }

.field { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.page-profile .field input[type=text] { flex: 1; min-width: 180px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- auth pages ---------- */
.box {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, var(--panel) 0%, #031f0c 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 145, 61, 0.08);
}
.box::before {
  content: "";
  position: absolute;
  top: 0; left: 28px;
  width: 48px; height: 3px;
  background: var(--gold);
}
.page-login .box { max-width: 400px; }
.page-register .box { max-width: 420px; }
.page-pending .box { max-width: 440px; padding: 32px; text-align: center; }
.box h1 { margin: 0 0 4px; font-size: 26px; padding-left: 0; letter-spacing: 0.01em; }
.box h1::before { display: none; }
.box .sub { margin-bottom: 18px; }
.foot { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.page-login .note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.page-pending .icon {
  width: 72px; height: 72px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  border: 1px solid var(--green);
  border-radius: 50%;
  background: var(--green-lo);
  box-shadow: 0 0 24px rgba(0, 145, 61, 0.35);
}
.page-pending h1 { font-size: 24px; margin-bottom: 8px; }
.page-pending p { color: #d3e3d9; line-height: 1.55; margin: 10px 0; }
.time {
  display: inline-block;
  background: var(--gold-lo);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  padding: 4px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  margin-top: 6px;
}
.page-pending a.btn { margin-top: 20px; padding: 11px 26px; font-size: 15px; }

/* ---------- error popup (auth/_popup) ---------- */
.popup-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0, 10, 4, 0.78);
  backdrop-filter: blur(3px);
}
.popup {
  width: 100%; max-width: 360px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--danger-line);
  border-top: 4px solid var(--danger);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.popup h2 { margin: 0 0 10px; color: #ffd0d0; font-size: 20px; }
.popup p { margin: 6px 0; color: #e7f1ea; font-size: 15px; }
.popup button {
  margin-top: 16px;
  padding: 9px 30px;
  width: auto;
  background: var(--danger);
  border-color: var(--danger);
  color: var(--bg);
  font-weight: 700;
}
.popup button:hover { background: #ff7878; border-color: #ff7878; }

/* ---------- dashboard nav ---------- */
.who { color: var(--muted); font-size: 14px; }
.top .who { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.who .account-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who a.profile-link, .who a.admin-link, .details-link, .who button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  background: var(--panel-2);
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.who a.profile-link:hover, .who a.admin-link:hover, .details-link:hover, .who button:hover {
  background: var(--panel-3);
  border-color: var(--green);
  color: var(--gold);
  text-decoration: none;
}
.who button:hover { color: var(--danger-text); border-color: var(--danger-line); }
.details-link { margin-top: 10px; font-size: 13px; font-family: var(--mono); letter-spacing: 0.02em; color: var(--green-hi); }

.chart {
  position: relative;
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(180deg, var(--panel) 0%, #031f0c 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.chart::before { content: ""; position: absolute; top: 0; left: 16px; width: 28px; height: 2px; background: var(--gold); }

/* ---------- rooms ---------- */
.page-rooms .top { margin-bottom: 10px; }
.page-rooms .row { font-size: 15px; }
.page-rooms .card .btn { display: block; margin-top: 14px; padding: 11px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: #dfece4;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.tabs a:hover { text-decoration: none; background: var(--panel-3); border-color: var(--green); color: var(--white); }
.tabs a.active {
  background: var(--green-lo);
  border-color: var(--green);
  box-shadow: inset 0 -2px 0 var(--gold);
  color: var(--white);
  font-weight: 700;
}
.page-schedules .tabs a { padding: 9px 18px; font-size: 15px; font-weight: 600; }
.page-schedules .tabs { margin-bottom: 14px; }

.metric {
  background: linear-gradient(180deg, var(--panel) 0%, #031f0c 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.metric .l {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.metric .v {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--white);
}

.page-room table td.day-hours { text-align: right; color: var(--muted); font-family: var(--mono); }
.page-room table td.day-hours.has-class { color: var(--white); }
.page-room .card .muted { margin-top: 8px; }

ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
ul.list li:last-child { border-bottom: 0; }
ul.list .t { color: var(--muted); min-width: 150px; font-family: var(--mono); font-size: 12.5px; padding-top: 1px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th {
  text-align: left;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
td { padding: 8px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(0, 145, 61, 0.07); }
tr.today td { background: var(--gold-lo); font-weight: 700; box-shadow: inset 0 0 0 0 transparent; }
tr.today td:first-child { box-shadow: inset 3px 0 0 var(--gold); }

/* ---------- approvals ---------- */
.page-approvals .top h1 { font-size: 26px; }
.page-approvals .card { padding: 8px 16px; overflow-x: auto; }
.page-approvals .card::before { left: 16px; }
.page-approvals table { font-size: 14px; }
.page-approvals td { padding: 12px 8px; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-approvals button { padding: 6px 12px; font-size: 13px; }
.approve { background: var(--green-lo); color: var(--green-hi); border-color: var(--green); }
.approve:hover { background: var(--green); color: var(--white); border-color: var(--green); }
.reject { background: var(--danger-lo); color: var(--danger-text); border-color: var(--danger-line); }
.reject:hover { background: var(--danger); color: var(--bg); border-color: var(--danger); }
.page-approvals input[type=text] { padding: 6px 8px; font-size: 13px; width: 150px; }
.page-approvals .empty { padding: 24px; text-align: center; }
.page-approvals .muted { font-size: 12px; }

/* ---------- profile ---------- */
.page-profile .top { margin-bottom: 16px; }
.page-profile .top > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-profile .card { padding: 20px; margin-bottom: 16px; }
.card .who { display: flex; align-items: center; gap: 16px; color: var(--white); }
.avatar {
  width: 64px; height: 64px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--green-lo);
  border: 2px solid var(--green);
  box-shadow: 0 0 0 3px rgba(255, 222, 0, 0.18);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
}
.name { font-size: 20px; font-weight: 700; }
.card .who .muted { font-size: 14px; }
.info { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin-top: 16px; font-size: 15px; }
.info div:nth-child(odd) { color: var(--muted); font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; padding-top: 2px; }
.page-profile ul { list-style: none; margin: 0; padding: 0; }
.page-profile li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.page-profile li:last-child { border-bottom: 0; }
.page-profile p { margin: 8px 0; }
.edit-profile .field { flex-direction: column; align-items: stretch; }
.edit-profile .field .btn { align-self: flex-start; }
.edit-profile summary {
  display: inline-block;
  list-style: none;
  background: var(--gold);
  color: var(--bg);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.edit-profile summary:hover { filter: brightness(1.06); }
.edit-profile summary::-webkit-details-marker { display: none; }

/* ---------- schedules ---------- */
.page-schedules .sub { max-width: 760px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }
.page-schedules .card { margin-bottom: 16px; }
.page-schedules .card.tip { padding: 16px 18px; }

.ttwrap { overflow-x: auto; }
.tt { min-width: 680px; }
.tt-head, .tt-body { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
.dayhead {
  text-align: center;
  padding: 8px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dayhead.today { color: var(--gold); }
.hours .hour {
  height: var(--row);
  padding-right: 8px;
  text-align: right;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  transform: translateY(-7px);
}
.daycol {
  position: relative;
  height: var(--h);
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--row) - 1px), rgba(255, 255, 255, 0.06) calc(var(--row) - 1px), rgba(255, 255, 255, 0.06) var(--row));
}
.daycol.today { background-color: rgba(255, 222, 0, 0.045); }
.now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); box-shadow: 0 0 8px var(--danger); z-index: 3; }
.blk {
  position: absolute; left: 3px; right: 3px; z-index: 2;
  display: block;
  padding: 4px 6px;
  border-radius: 6px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  color: var(--white);
}
.blk b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk span { display: block; font-size: 11px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.blk.mine { background: rgba(0, 145, 61, 0.35); border: 1px solid var(--green); border-left: 4px solid var(--gold); }
.blk.other { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.18); color: #dfece4; }
a.blk:hover { text-decoration: none; filter: brightness(1.2); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 3px; }
.legend .sw-mine { background: var(--green); box-shadow: inset 3px 0 0 var(--gold); }
.legend .sw-other { background: rgba(255, 255, 255, 0.22); }
.legend .sw-now { background: var(--danger); }

.room-badge {
  background: var(--green-lo);
  color: var(--green-hi);
  border: 1px solid var(--green);
  border-radius: 5px;
  padding: 2px 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.page-schedules table { font-size: 14px; }
.page-schedules td { padding: 10px 6px; }
.page-schedules .empty { text-align: center; padding: 22px 10px; line-height: 1.6; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.day { margin: 0; }
.day span {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.day span:hover { border-color: var(--green); color: var(--white); }
.day input:checked + span {
  background: var(--green-lo);
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
  color: var(--white);
  font-weight: 700;
}
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.presets button {
  background: var(--input);
  color: var(--green-hi);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}
.presets button:hover { background: var(--panel-3); border-color: var(--green); }
.page-schedules form .btn { width: 100%; margin-top: 18px; padding: 12px; font-size: 16px; border-radius: 10px; }
.tip { font-size: 13px; color: var(--muted); line-height: 1.55; }
.tip b { color: var(--white); }

/* ---------- schedule edit ---------- */
.page-schedule-edit .sub { margin-bottom: 16px; }
.page-schedule-edit .card { padding: 22px; }
.page-schedule-edit .btn { padding: 12px 22px; font-size: 16px; border-radius: 10px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- responsive & motion ---------- */
@media (max-width: 640px) {
  body.app { padding: 16px; }
  h1 { font-size: 24px; }
  .page-approvals .crew-fields { grid-template-columns: 1fr; }
  .info { grid-template-columns: 1fr; gap: 2px 12px; }
  .info div:nth-child(even) { margin-bottom: 8px; }
  ul.list li { flex-direction: column; gap: 2px; }
  .top .who { justify-content: flex-start; }
}

/* =====================================================================
   BRAND  (logo images live in /public/img)
   The logo's lettering is dark green/black, so it always sits on a light
   plate (the logo's own paper colour) to stay readable on the dark theme.
   ===================================================================== */
/* full 3D logo on login / register / pending: transparent PNG, no plate */
.box .brand {
  position: relative;
  margin: 0 0 8px;
  padding: 0;
  line-height: 0;
  text-align: center;
}
.box .brand img {
  display: inline-block;
  width: 100%; max-width: 300px; height: auto;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 20px rgba(0, 145, 61, 0.35));
}
.page-pending .box .brand { margin-bottom: 18px; }
.page-login .box .sub {
  margin: 6px 0 20px;
  text-align: center;
  color: var(--white);
  font-size: 19px; font-weight: 700; letter-spacing: 0.01em;
}

/* 3D tilt (pointer-driven, see public/js/enerbridge.js) */
[data-tilt] {
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.18s ease-out;
  will-change: transform;
}

/* compact mark in every app page header (links home) */
.title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  height: 48px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(0, 145, 61, 0.3));
  transition: transform 0.2s ease, filter 0.2s ease;
}
.brand-mark img { display: block; height: 100%; width: auto; }
.brand-mark:hover { transform: translateY(-2px) scale(1.07); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 14px rgba(255, 222, 0, 0.55)); text-decoration: none; }
.title h1 { padding-left: 0; }
.title h1::before { display: none; }
.page-dashboard .title .sub { margin: 2px 0 0; }

/* "Live" tag: tells people the numbers refresh by themselves */
.live {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 10px; padding: 1px 8px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--green-lo);
  color: var(--green-hi);
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap; vertical-align: 1px;
}
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-hi); }

/* ambient glow behind everything */
body::before {
  content: "";
  position: fixed; z-index: -1; pointer-events: none;
  top: -24vh; right: -12vw; width: 72vw; height: 72vh;
  background: radial-gradient(closest-side, rgba(0, 145, 61, 0.26), transparent);
}

/* dashboard cards are rebuilt on every refresh: no hover/transition effects there,
   so nothing flickers when the data updates under the pointer */
#rooms .card, #rooms .details-link { transition: none; }

/* dashboard: placeholder while the first reading loads */
#rooms:empty::before {
  content: "Connecting to sensors\2026";
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  min-height: 150px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em;
}

/* =====================================================================
   MOTION
   Short (<= 0.6 s), purposeful, and switched off for anyone who has
   "reduce motion" enabled. Base states are always fully visible, so
   nothing can get stuck hidden if an animation doesn't run.
   ===================================================================== */
@keyframes eb-fade { from { opacity: 0; } }
@keyframes eb-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes eb-logo { from { opacity: 0; transform: scale(0.9); } }
@keyframes eb-breathe { 0%, 100% { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 14px rgba(0, 145, 61, 0.28)); } 50% { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 26px rgba(0, 145, 61, 0.6)); } }
@keyframes eb-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-9vw, 7vh) scale(1.18); } }
@keyframes eb-live { 0% { box-shadow: 0 0 0 0 rgba(53, 208, 122, 0.65); } 70%, 100% { box-shadow: 0 0 0 7px rgba(53, 208, 122, 0); } }
@keyframes eb-glow { 0%, 100% { box-shadow: 0 0 3px var(--green-hi); } 50% { box-shadow: 0 0 9px var(--green-hi); } }
@keyframes eb-alert { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes eb-now { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes eb-pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.12); } 100% { transform: none; } }
@keyframes eb-tick { from { color: var(--gold); text-shadow: 0 0 12px rgba(255, 222, 0, 0.55); } }
@keyframes eb-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes eb-pop-in { from { opacity: 0; transform: translateY(10px) scale(0.94); } }
@keyframes eb-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* smooth fade between pages in browsers that support it (Chrome/Edge) */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }

  body::before { animation: eb-drift 22s ease-in-out infinite alternate; }

  /* page load: header, then content rises in with a light stagger */
  .top { animation: eb-fade 0.4s ease-out backwards; }
  .wrap > :not(.top):not(.banner):not(.grid):not(.layout),
  body:not(.page-dashboard) .grid > *,
  .layout > div,
  .page-dashboard .grid > .enter,
  .page-dashboard .chart,
  .box { animation: eb-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  .wrap > :nth-child(3), .grid > :nth-child(2), .layout > div:nth-child(2) { animation-delay: 0.07s; }
  .wrap > :nth-child(4), .grid > :nth-child(3) { animation-delay: 0.14s; }
  .wrap > :nth-child(5), .grid > :nth-child(4) { animation-delay: 0.2s; }
  .wrap > :nth-child(6), .grid > :nth-child(5) { animation-delay: 0.26s; }
  .wrap > :nth-child(n+7), .grid > :nth-child(n+6) { animation-delay: 0.32s; }
  .page-dashboard .chart { animation-delay: 0.3s; }

  /* logo: pop in, then a slow glow "breathe" */
  .box .brand img {
    animation: eb-logo 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s backwards,
               eb-breathe 4.5s ease-in-out 1s infinite;
  }

  /* live status */
  .live i { animation: eb-live 1.8s ease-out infinite; }
  .badge.on::before, .dot.on { animation: eb-glow 2.6s ease-in-out infinite; }
  .badge.pop { animation: eb-pop 0.4s ease-out; }
  .pulse-update { animation: eb-tick 1.1s ease-out; }
  .banner { animation: eb-alert 2.4s ease-in-out infinite; }
  .now { animation: eb-now 2.2s ease-in-out infinite; }
  #rooms:empty::before {
    background: linear-gradient(90deg, transparent 20%, rgba(0, 145, 61, 0.16) 50%, transparent 80%) 0 0 / 200% 100%;
    animation: eb-shimmer 1.8s linear infinite;
  }

  /* timetable blocks */
  .blk { animation: eb-fade 0.5s ease-out 0.25s backwards; }

  /* hover lift on the (server-rendered) classroom cards only */
  .page-rooms .card { transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
  .page-rooms .card:hover {
    transform: translateY(-3px);
    border-color: var(--green);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 145, 61, 0.45);
  }

  /* messages & dialogs */
  .flash { animation: eb-rise 0.4s ease-out backwards; }
  .err { animation: eb-shake 0.4s ease-out; }
  .popup-backdrop { animation: eb-fade 0.2s ease-out; }
  .popup { animation: eb-pop-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* =====================================================================
   INTRO / WELCOME SPLASH  (resources/views/partials/intro.blade.php)
   ~2 s, once per browser session; click / tap / any key skips it.
   Hidden entirely for people who prefer reduced motion.
   ===================================================================== */
.intro {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 145, 61, 0.30), transparent 62%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg);
}
.intro-done .intro { display: none; }
.intro-body { display: flex; flex-direction: column; align-items: center; }

.intro-stage {
  position: relative;
  width: clamp(170px, 28vw, 250px);
  margin-bottom: 20px;
}
.intro-mark {
  position: relative; display: block;
  width: 100%; height: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 28px rgba(0, 145, 61, 0.55));
}
.intro-rings i {
  position: absolute; left: 50%; top: 50%;
  width: 118%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid rgba(53, 208, 122, 0.5);
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
}

.intro-hello {
  font-family: var(--mono);
  font-size: clamp(12px, 1.6vw, 15px); font-weight: 600;
  letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--muted);
}
.intro-title {
  display: flex; justify-content: center;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: clamp(40px, 9vw, 84px); font-weight: 800; line-height: 1.08; letter-spacing: -0.01em;
  perspective: 600px;
}
.intro-title span { display: inline-block; transform-origin: 50% 100%; }
/* extruded 3D lettering */
.intro-title .g { color: #35d07a; --e1: #0a7a3a; --e2: #056028; --e3: #033d1b; }
.intro-title .w { color: #ffffff; --e1: #a8cdb8; --e2: #6f9f84; --e3: #43705a; }
.intro-title span {
  text-shadow:
    1px 1px 0 var(--e1), 2px 2px 0 var(--e1),
    3px 3px 0 var(--e2), 4px 4px 0 var(--e2),
    5px 5px 0 var(--e3), 6px 6px 0 var(--e3),
    8px 14px 22px rgba(0, 0, 0, 0.6);
}
.intro-tag {
  margin-top: 16px;
  font-size: clamp(12px, 1.7vw, 16px); font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: #cfe0d5;
}
.intro-bar { width: min(260px, 60vw); height: 3px; margin-top: 26px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.intro-bar i { display: block; width: 100%; height: 100%; background: var(--gold); transform-origin: left; }
.intro-skip {
  position: absolute; right: 20px; bottom: 18px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--line); border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
}
.intro-skip:hover { color: var(--gold); border-color: var(--gold-dim); background: transparent; }

@keyframes eb-intro-out { to { opacity: 0; visibility: hidden; transform: scale(1.04); } }
@keyframes eb-mark-in { from { opacity: 0; transform: perspective(700px) rotateY(-100deg) scale(0.5); } }
@keyframes eb-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes eb-ring { 0% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.5); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); } }
@keyframes eb-letter { from { opacity: 0; transform: translateY(36px) rotateX(-75deg) scale(0.8); } }
@keyframes eb-bar { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: no-preference) {
  /* leaves on its own after ~2 s even if scripts are blocked; script can end it sooner */
  .intro { animation: eb-intro-out 0.45s ease-in 2s forwards; }
  .intro.leaving { animation: eb-intro-out 0.3s ease-in forwards; }
  .intro-mark { animation: eb-mark-in 0.8s cubic-bezier(0.2, 0.9, 0.25, 1) 0.1s backwards, eb-float 3s ease-in-out 0.9s infinite; }
  .intro-rings i { animation: eb-ring 1.8s ease-out infinite; }
  .intro-rings i:nth-child(2) { animation-delay: 0.5s; }
  .intro-rings i:nth-child(3) { animation-delay: 1s; }
  .intro-hello { animation: eb-fade 0.5s ease-out 0.35s backwards; }
  .intro-title span { animation: eb-letter 0.6s cubic-bezier(0.2, 0.9, 0.25, 1.15) calc(0.55s + var(--i) * 0.05s) backwards; }
  .intro-tag { animation: eb-rise 0.6s ease-out 1.15s backwards; }
  .intro-bar i { animation: eb-bar 2s linear backwards; }
  .intro-skip { animation: eb-fade 0.4s ease-out 0.6s backwards; }
}
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
}

/* ---------- public intro page ---------- */
.page-intro { min-height: 100vh; padding: 0 6vw; }
.intro-header {
  max-width: 1240px; min-height: 88px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-bottom: 1px solid var(--line);
}
.intro-brand { display: flex; align-items: center; gap: 12px; color: var(--white); font-size: 19px; font-weight: 750; letter-spacing: -0.03em; }
.intro-brand:hover { text-decoration: none; }
.intro-brand img { width: 54px; height: auto; }
.intro-nav { display: flex; align-items: center; gap: 24px; font-weight: 600; }
.intro-nav > a:not(.intro-nav-cta) { color: var(--white); }
.intro-nav-cta { border: 1px solid var(--line); border-radius: 7px; padding: 9px 14px; }
.intro-hero {
  max-width: 1240px; min-height: 570px; margin: 0 auto; padding: 68px 0 76px;
  display: grid; grid-template-columns: 1fr 0.9fr; align-items: center; gap: 7vw;
}
.intro-copy { max-width: 600px; }
.intro-eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0 0 20px;
  color: var(--green-hi); font: 700 11px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
}
.intro-eyebrow span { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px rgba(255, 222, 0, 0.5); }
.intro-copy h1 { max-width: 650px; font-size: clamp(42px, 5.4vw, 72px); line-height: 1.05; letter-spacing: -0.055em; }
.intro-copy h1 span { color: var(--green-hi); }
.intro-description { max-width: 540px; margin: 22px 0 0; color: #c0d0c6; font-size: 17px; line-height: 1.75; }
.intro-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.intro-primary, .intro-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 18px; border-radius: 7px; font-weight: 700; }
.intro-primary { color: var(--bg); background: var(--gold); }
.intro-primary:hover { color: var(--bg); background: #ffe94a; text-decoration: none; }
.intro-secondary { border: 1px solid var(--line); color: var(--white); }
.intro-secondary:hover { border-color: var(--green-hi); text-decoration: none; }
.intro-caption { margin: 18px 0 0; color: var(--muted); font: 11px/1.5 var(--mono); letter-spacing: 0.04em; }
.intro-visual { position: relative; display: grid; place-items: center; min-height: 380px; }
.intro-orbit { position: absolute; width: min(35vw, 430px); aspect-ratio: 1; border: 1px solid rgba(53, 208, 122, 0.13); border-radius: 50%; }
.intro-orbit-one { transform: scale(0.78); }
.intro-orbit-two { transform: scale(1.08); border-style: dashed; }
.intro-device {
  z-index: 1; width: min(100%, 430px); padding: 22px;
  background: linear-gradient(145deg, rgba(7, 51, 23, 0.97), rgba(3, 31, 12, 0.98));
  border: 1px solid rgba(53, 208, 122, 0.28); border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), 0 0 55px rgba(0, 145, 61, 0.14);
  transform: rotate(-2deg);
}
.intro-device-head, .intro-device-brand, .intro-device-foot { display: flex; align-items: center; }
.intro-device-head { justify-content: space-between; color: var(--muted); font: 10px var(--mono); letter-spacing: 0.1em; }
.intro-live { display: inline-flex; align-items: center; gap: 8px; }
.intro-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-hi); box-shadow: 0 0 10px var(--green-hi); }
.intro-device-dots { color: var(--green-hi); font-size: 17px; letter-spacing: 0.12em; }
.intro-device-brand { gap: 14px; margin: 28px 0 24px; }
.intro-device-brand img { width: 62px; height: auto; }
.intro-device-brand strong, .intro-device-brand small { display: block; }
.intro-device-brand strong { font-size: 19px; }
.intro-device-brand small { margin-top: 4px; font-size: 9px; letter-spacing: 0.09em; }
.intro-device-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.intro-device-metrics > div { padding: 14px 12px; background: rgba(0, 20, 9, 0.7); border: 1px solid var(--line); border-radius: 8px; }
.intro-device-metrics span, .intro-device-metrics strong, .intro-device-metrics small { display: block; }
.intro-device-metrics span { color: var(--muted); font: 9px var(--mono); letter-spacing: 0.08em; }
.intro-device-metrics strong { margin-top: 12px; color: var(--white); font-size: 23px; }
.intro-device-metrics strong.intro-status { color: var(--green-hi); }
.intro-device-metrics small { margin-top: 3px; font-family: var(--sans); font-size: 10px; }
.intro-device-foot { gap: 9px; margin-top: 18px; color: #c0d0c6; font-size: 11px; }
.intro-device-foot span { width: 20px; height: 3px; border-radius: 2px; background: var(--gold); }
.intro-float-card {
  position: absolute; right: -10px; bottom: 30px; z-index: 2;
  display: grid; grid-template-columns: 1fr auto; column-gap: 18px; align-items: center;
  padding: 12px 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35); transform: rotate(2deg);
}
.intro-float-card span { color: var(--muted); font: 9px var(--mono); letter-spacing: 0.1em; }
.intro-float-card strong { grid-column: 1; margin-top: 3px; font-size: 14px; }
.intro-float-card i { grid-column: 2; grid-row: 1 / span 2; color: var(--gold); font-size: 20px; font-style: normal; }
.intro-features { max-width: 1240px; margin: 0 auto; padding: 0 0 68px; }
.intro-section-heading { margin-bottom: 22px; }
.intro-section-heading .intro-eyebrow { margin-bottom: 8px; }
.intro-section-heading h2 { margin: 0; font-size: clamp(22px, 3vw, 32px); letter-spacing: -0.035em; }
.intro-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.intro-feature {
  min-height: 175px; padding: 22px; background: linear-gradient(180deg, var(--panel), #031f0c);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.intro-feature-icon { color: var(--gold); font: 11px var(--mono); letter-spacing: 0.1em; }
.intro-feature h3 { margin: 18px 0 8px; font-size: 17px; }
.intro-feature p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.intro-footer {
  max-width: 1240px; min-height: 66px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); color: var(--muted); font: 10px var(--mono); letter-spacing: 0.06em;
}
.intro-footer span:first-child { color: var(--green-hi); }

@keyframes intro-rise-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes intro-device-in {
  from { opacity: 0; transform: translateY(24px) rotate(-5deg) scale(0.97); }
  to { opacity: 1; transform: translateY(0) rotate(-2deg) scale(1); }
}
@keyframes intro-orbit-spin { to { rotate: 360deg; } }
@keyframes intro-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}
@keyframes intro-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(53, 208, 122, 0.55); }
  60% { box-shadow: 0 0 0 7px rgba(53, 208, 122, 0); }
}
@media (prefers-reduced-motion: no-preference) {
  .intro-header { animation: intro-rise-in 0.55s ease-out both; }
  .intro-copy > * { animation: intro-rise-in 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .intro-copy > :nth-child(1) { animation-delay: 0.08s; }
  .intro-copy > :nth-child(2) { animation-delay: 0.16s; }
  .intro-copy > :nth-child(3) { animation-delay: 0.24s; }
  .intro-copy > :nth-child(4) { animation-delay: 0.32s; }
  .intro-copy > :nth-child(5) { animation-delay: 0.4s; }
  .intro-device { animation: intro-device-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both, intro-float 5s ease-in-out 1s infinite; }
  .intro-orbit-one { animation: intro-orbit-spin 36s linear infinite; }
  .intro-orbit-two { animation: intro-orbit-spin 52s linear infinite reverse; }
  .intro-live i { animation: intro-pulse 2s ease-out infinite; }
  .intro-float-card { animation: intro-rise-in 0.6s ease-out 0.65s both, intro-float 4s ease-in-out 1.3s infinite; }
  .intro-section-heading { animation: intro-rise-in 0.6s ease-out both; }
  .intro-feature { transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
  .intro-feature:hover { transform: translateY(-5px); border-color: var(--green); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(0, 145, 61, 0.24); }
  .intro-nav-cta, .intro-primary, .intro-secondary { transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease; }
  .intro-nav-cta:hover, .intro-primary:hover, .intro-secondary:hover { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .intro-header, .intro-copy > *, .intro-device, .intro-orbit, .intro-live i, .intro-float-card, .intro-section-heading {
    animation: none !important;
  }
  .intro-feature, .intro-nav-cta, .intro-primary, .intro-secondary { transition: none !important; }
}

@media (max-width: 850px) {
  .page-intro { padding: 0 5vw; }
  .intro-hero { min-height: unset; padding: 58px 0; grid-template-columns: 1fr; gap: 36px; }
  .intro-copy { max-width: 700px; }
  .intro-visual { min-height: 340px; }
  .intro-orbit { width: min(70vw, 390px); }
  .intro-device { width: min(100%, 460px); }
  .intro-feature-grid { grid-template-columns: 1fr; }
  .intro-feature { min-height: unset; }
}
@media (max-width: 520px) {
  .intro-header { min-height: 72px; }
  .intro-brand { gap: 7px; font-size: 16px; }
  .intro-brand img { width: 42px; }
  .intro-nav { gap: 12px; font-size: 13px; }
  .intro-nav-cta { padding: 8px 10px; }
  .intro-hero { padding: 48px 0; }
  .intro-copy h1 { font-size: clamp(38px, 11vw, 52px); }
  .intro-description { font-size: 15px; }
  .intro-visual { min-height: 290px; }
  .intro-device { padding: 16px; }
  .intro-device-metrics { gap: 6px; }
  .intro-device-metrics > div { padding: 11px 8px; }
  .intro-device-metrics strong { font-size: 19px; }
  .intro-float-card { right: -4px; bottom: 6px; }
  .intro-footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 14px 0; }
}

/* ---------- centered intro splash ---------- */
.page-intro { min-height: 100vh; min-height: 100svh; padding: 0; overflow: hidden; }
.intro-splash {
  position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center;
  overflow: hidden; padding: 24px; isolation: isolate; text-align: center;
  background: radial-gradient(ellipse at center, rgba(0, 145, 61, 0.18), transparent 52%), var(--bg);
}
.intro-splash::before {
  position: absolute; z-index: -1; inset: 0; content: "";
  background:
    linear-gradient(rgba(0, 145, 61, 0.11) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(0, 145, 61, 0.11) 1px, transparent 1px) 0 0 / 32px 32px;
  opacity: 0.35;
}
.intro-branding { display: flex; flex-direction: column; align-items: center; }
.intro-logo { display: block; width: clamp(150px, 26vw, 260px); height: auto; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 24px rgba(0, 145, 61, 0.36)); }
.intro-branding h1 { margin-top: 14px; font-size: clamp(32px, 6vw, 52px); letter-spacing: -0.04em; }
.intro-branding p { margin: 10px 0 0; color: #c0d0c6; font-size: clamp(12px, 2vw, 16px); letter-spacing: 0.13em; text-transform: uppercase; }
@keyframes intro-grid-pulse {
  from { opacity: 0.2; }
  to { opacity: 0.75; }
}
@keyframes intro-brand-sequence {
  0% { opacity: 0; transform: scale(0.68); }
  12%, 70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}
@keyframes intro-brand-fade {
  0%, 100% { opacity: 0; }
  15%, 75% { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .intro-splash::before { animation: intro-grid-pulse 1.8s ease-in-out infinite alternate; }
  .intro-branding { animation: intro-brand-sequence 1s cubic-bezier(0.2, 0.75, 0.25, 1) both; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-branding { animation: intro-brand-fade 1s ease-in-out both; }
  .intro-splash::before { animation: none; opacity: 0.45; }
}
