:root {
  color-scheme: dark;
  --bg: #0a0c0f;
  --panel: #12161b;
  --panel-2: #191e24;
  --line: #2a3139;
  --text: #f4f6f8;
  --muted: #9ba7b3;
  --red: #d72d2d;
  --red-dark: #9d2020;
  --green: #2eaa68;
  --amber: #e1a62c;
  --blue: #4f8fe8;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; min-height: 100dvh; }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
#app { min-height: 100vh; min-height: 100dvh; }
.shell { min-height: 100vh; min-height: 100dvh; background: radial-gradient(circle at top, #171c22 0, var(--bg) 38%); padding-bottom: max(22px, env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: rgba(10,12,15,.92); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.brand-lock { width: 38px; height: 38px; border-radius: 11px; background: var(--red); display: grid; place-items: center; font-size: 21px; box-shadow: 0 8px 24px rgba(215,45,45,.22); }
.brand-copy { min-width: 0; }
.brand-title { font-weight: 850; letter-spacing: .02em; line-height: 1.05; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* v4.00.00 TEST — ISafetyOS master brand / application shell */
.logo-topbar {
  position: relative;
  justify-content: center;
  min-height: 242px;
  padding-left: 76px;
  padding-right: 76px;
  overflow: visible;
  background:
    radial-gradient(circle at 34% 45%, rgba(215,45,45,.10), transparent 30%),
    radial-gradient(circle at 66% 45%, rgba(43,131,232,.12), transparent 30%),
    linear-gradient(180deg, #07090b 0%, #010203 100%);
  backdrop-filter: none;
  border-bottom-color: rgba(157,167,177,.24);
  box-shadow: 0 10px 34px rgba(0,0,0,.28);
}
.logo-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(215,45,45,.9) 18%,
    rgba(178,185,191,.45) 48%,
    rgba(56,139,235,.95) 82%,
    transparent 100%);
  opacity: .78;
}
.brand-logo-button {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.38));
}
.brand-logo-button:focus-visible {
  outline: 2px solid rgba(79,143,232,.9);
  outline-offset: 8px;
  border-radius: 10px;
}
.brand-logo-image {
  display: block;
  width: clamp(430px, 48vw, 650px);
  height: auto;
  max-height: 318px;
  object-fit: contain;
}
.topbar-scan {
  position: static;
  right: auto;
  top: auto;
  transform: none;
  flex: 0 0 auto;
}
.logo-topbar .topbar-scan,
.logo-topbar .admin-mobile-top-settings {
  border-color: #3b444d;
  background: linear-gradient(180deg, #1b2127 0%, #11161b 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 8px 22px rgba(0,0,0,.22);
}
.logo-topbar .topbar-scan:hover,
.logo-topbar .topbar-scan:focus-visible,
.logo-topbar .admin-mobile-top-settings:hover,
.logo-topbar .admin-mobile-top-settings:focus-visible {
  border-color: rgba(121,156,196,.55);
  background: linear-gradient(180deg, #242b32 0%, #171d22 100%);
}
@media (max-width: 1100px) and (min-width: 821px) {
  .brand-logo-image { width: clamp(385px, 46vw, 505px); }
}
@media (max-width: 820px) {
  .logo-topbar {
    min-height: 236px;
    padding-left: 12px;
    padding-right: 12px;
    align-items: flex-end;
    justify-content: center;
  }
  .brand-logo-button { margin-bottom: 4px; }
  .brand-logo-image {
    width: min(350px, 90vw);
    max-height: 186px;
  }
}
@media (max-width: 520px) {
  .logo-topbar { min-height: 222px; }
  .brand-logo-image {
    width: min(330px, 91vw);
    max-height: 172px;
  }
}
.icon-btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
/* v0.1.31 — use the full available app width on desktop */
.main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px clamp(16px, 2.5vw, 40px) 56px;
}
.hero { margin: 8px 0 18px; }
.hero h1 { font-size: clamp(26px, 7vw, 42px); margin: 0; letter-spacing: -.035em; line-height: 1.02; }
.hero p { margin: 10px 0 0; color: var(--muted); line-height: 1.5; max-width: 700px; }
.status-strip { display: flex; align-items: center; gap: 8px; margin: 12px 0 18px; font-size: 13px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(46,170,104,.12); }
.status-dot.off { background: var(--amber); box-shadow: 0 0 0 4px rgba(225,166,44,.12); }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.action-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; min-height: 145px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), var(--panel); color: var(--text); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.action-card.primary { border-color: rgba(215,45,45,.55); background: linear-gradient(145deg, rgba(215,45,45,.16), rgba(255,255,255,.015)), var(--panel); }
.action-card .emoji { font-size: 28px; display: block; margin-bottom: 14px; }
.action-card strong { display: block; font-size: 18px; margin-bottom: 5px; }
.action-card span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 26px 0 10px; }
.section-title h2 { margin: 0; font-size: 18px; }
.section-title span { color: var(--muted); font-size: 12px; }
.home-profile-title { justify-content: center; align-items: center; text-align: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.record-head { display: flex; gap: 12px; align-items: flex-start; }
.record-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(215,45,45,.14); color: #ff8585; font-size: 24px; flex: 0 0 auto; }
.record-title { min-width: 0; flex: 1; }
.record-title h2, .record-title h3 { margin: 0; }
.record-title h2 { font-size: 24px; }
.record-title h3 { font-size: 17px; }
.record-title p { margin: 5px 0 0; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 750; border: 1px solid var(--line); background: var(--panel-2); }
.badge.red { color: #ff9a9a; border-color: rgba(215,45,45,.42); background: rgba(215,45,45,.11); }
.badge.green { color: #78dba6; border-color: rgba(46,170,104,.35); background: rgba(46,170,104,.1); }
.badge.amber { color: #f4c762; border-color: rgba(225,166,44,.34); background: rgba(225,166,44,.1); }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.detail { border: 1px solid var(--line); background: var(--panel-2); border-radius: 13px; padding: 12px; min-width: 0; }
.detail label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.detail div { font-weight: 700; overflow-wrap: anywhere; }
.detail.full { grid-column: 1 / -1; }
.stack { display: grid; gap: 10px; }
.lock-row { border: 1px solid var(--line); background: var(--panel-2); border-radius: 14px; padding: 13px; }
.lock-row-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.lock-row strong { font-size: 15px; }
.lock-row p { color: var(--muted); margin: 5px 0 0; font-size: 13px; line-height: 1.35; }
.btn { border: 0; border-radius: 13px; min-height: 48px; padding: 12px 16px; background: var(--panel-2); color: var(--text); font-weight: 800; cursor: pointer; border: 1px solid var(--line); }
.btn.primary { background: var(--red); border-color: var(--red); }
.btn.primary:active { background: var(--red-dark); }
.btn.danger { background: rgba(215,45,45,.18); border-color: rgba(215,45,45,.72); color: #ffabab; }
.btn.danger:active { background: rgba(215,45,45,.32); }
.btn.green { background: var(--green); border-color: var(--green); color: #06110b; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row > * { flex: 1; }
.back-row { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.back-row button { flex: 0 0 auto; }
.back-row h1 { margin: 0; font-size: 22px; }
.flow-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 18px; }
.step-dot { height: 5px; background: var(--line); border-radius: 999px; }
.step-dot.on { background: var(--red); }
.scan-slot { border: 1px dashed #47515c; border-radius: 16px; padding: 15px; background: rgba(255,255,255,.018); }
.scan-slot.done { border-style: solid; border-color: rgba(46,170,104,.5); background: rgba(46,170,104,.065); }
.scan-slot + .scan-slot { margin-top: 10px; }
.scan-slot h3 { margin: 0 0 6px; font-size: 15px; }
.scan-slot p { color: var(--muted); margin: 0 0 12px; font-size: 13px; }
.form-group { margin-top: 14px; }
.form-group label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #0d1115; color: var(--text); padding: 13px 14px; outline: none; min-height: 48px; }
.input:focus, .textarea:focus, .select:focus { border-color: #566575; box-shadow: 0 0 0 3px rgba(79,143,232,.12); }
.textarea { min-height: 108px; resize: vertical; }
.pin { letter-spacing: .32em; font-size: 22px; font-weight: 800; text-align: center; }
.notice { border: 1px solid rgba(225,166,44,.35); background: rgba(225,166,44,.08); color: #f0d18a; border-radius: 14px; padding: 12px 13px; font-size: 13px; line-height: 1.45; }
.notice.error { border-color: rgba(215,45,45,.4); background: rgba(215,45,45,.09); color: #ffabab; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.78); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal { width: min(620px, 100%); max-height: 94dvh; overflow: auto; background: #0e1216; border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 15px 15px max(18px, env(safe-area-inset-bottom)); box-shadow: 0 -20px 70px rgba(0,0,0,.5); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; flex: 1; font-size: 19px; }
.permanent-delete-modal { max-width: 560px; }
.permanent-delete-modal .modal-head { align-items: flex-start; }
.permanent-delete-modal .modal-head h2 { margin-top: 7px; }
.permanent-delete-summary { display: grid; gap: 8px; margin: 14px 0; }
.permanent-delete-summary > div { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.02); }
.permanent-delete-summary dt { color: var(--muted); font-size: 12px; }
.permanent-delete-summary dd { margin: 0; font-weight: 750; overflow-wrap: anywhere; }
.permanent-delete-modal > .brand-sub { display: block; margin: 0 0 7px; white-space: normal; overflow: visible; }
.permanent-delete-error { margin-top: 10px; }
.permanent-delete-actions { margin-top: 16px; }
.scanner-frame { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 3/4; max-height: 58dvh; }
.scanner-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-target { position: absolute; inset: 50% auto auto 50%; width: 68%; aspect-ratio: 1; transform: translate(-50%,-50%); border: 3px solid rgba(255,255,255,.95); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0,0,0,.23); pointer-events: none; }
.scan-target::before, .scan-target::after { content:""; position:absolute; left:10%; right:10%; height:2px; background: var(--red); top:50%; box-shadow: 0 0 12px var(--red); }
.scanner-help { color: var(--muted); text-align: center; font-size: 13px; margin: 12px 0; }
.file-label { display: block; }
.file-label input { display:none; }
.manual-row { display: flex; gap: 8px; }
.manual-row input { flex: 1; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300; max-width: calc(100% - 30px); background: #20262d; border: 1px solid #39424c; border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 13px; animation: toastIn .18s ease-out; }
.toast.error { border-color: rgba(215,45,45,.55); background: #281516; color: #ffc0c0; }
@keyframes toastIn { from { transform: translate(-50%, 10px); opacity: 0; } }
.loading { min-height: 180px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid #303842; border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 690px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 12px; font-size: 13px; vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: #101419; }
tr:last-child td { border-bottom: 0; }

.history-mobile-list { display: none; }
.history-card { border: 1px solid var(--line); background: #11161b; border-radius: 17px; padding: 15px; }
.history-card + .history-card { margin-top: 10px; }
.history-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.history-card-head strong { display: block; font-size: 17px; }
.history-card-head span:not(.badge) { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.history-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 13px; }
.history-field { min-width: 0; }
.history-field.full { grid-column: 1 / -1; }
.history-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.history-field strong { display: block; overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.history-field small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.admin-tabs { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; overflow: visible; padding-bottom: 0; margin: 12px 0; }
.admin-tabs button { width: 100%; min-width: 0; white-space: normal; }
@media (min-width: 521px) and (max-width: 900px) {
  .admin-tabs { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
.admin-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.admin-form .full { grid-column: 1/-1; }
.mini-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn { border: 1px solid var(--line); background: #171c22; color: var(--text); border-radius: 9px; padding: 7px 9px; font-size: 11px; font-weight: 750; cursor: pointer; }
.qr-label { background: white; color: #111; border-radius: 16px; padding: 22px; text-align: center; }
.qr-label h2 { margin: 0 0 5px; font-size: 23px; }
.qr-label p { margin: 4px 0; }
.qr-box { display: inline-block; margin: 18px auto; padding: 8px; background: white; }
.qr-code-text { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 800; letter-spacing: .06em; }
.success-mark { width: 72px; height: 72px; margin: 8px auto 14px; border-radius: 50%; background: rgba(46,170,104,.14); color: #77e0a9; display: grid; place-items: center; font-size: 38px; }
@media (min-width: 760px) {
  .main { padding-top: 26px; }
  .action-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .action-card { min-height: 165px; }
  .modal-backdrop { align-items: center; padding: 22px; }
  .modal { border-radius: 22px; max-height: 90vh; }
}
@media (max-width: 520px) {
  .main { padding-left: 14px; padding-right: 14px; padding-bottom: 44px; }
  .action-grid { grid-template-columns: 1fr 1fr; }
  .action-card { min-height: 132px; padding: 15px; }
  .action-card strong { font-size: 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail.full { grid-column: auto; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-form .full { grid-column: auto; }
  .admin-tabs { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; gap: 8px; }
  .admin-tabs button { width: 100%; }
  .history-desktop-table { display: none; }
  .history-mobile-list { display: block; }
  .history-title { align-items: flex-end; }
  .history-title span { text-align: right; font-size: 12px; }
  .history-card-grid { grid-template-columns: 1fr 1fr; }
}

/* v0.1.30 — compact home profile login and added lower-page breathing room */
.home-login-panel {
  margin: 28px auto 0;
  max-width: 620px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.025), rgba(255,255,255,.008)), var(--panel);
  box-shadow: var(--shadow);
}
.home-login-panel > label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
}
.home-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
}
.home-login-row .select, .home-login-row .btn { min-height: 50px; }
.home-footer-space { height: 76px; }
@media (max-width: 520px) {
  .home-login-panel { margin-top: 22px; padding: 14px; }
  .home-login-row { grid-template-columns: 1fr; }
  .home-login-row .btn { width: 100%; }
  .home-footer-space { height: 96px; }
}

@media print {
  body * { visibility: hidden !important; }
  #qr-print-area, #qr-print-area * { visibility: visible !important; }
  #qr-print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}

/* v0.1.3 — mobile Admin records use cards instead of wide tables */
.admin-mobile-list { display: none; }
.admin-record-card { border: 1px solid var(--line); background: #11161b; border-radius: 17px; padding: 15px; }
.admin-record-card + .admin-record-card { margin-top: 10px; }
.admin-record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-record-head > div { min-width: 0; }
.admin-record-head strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.admin-record-head span:not(.badge) { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.admin-record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 13px; }
.admin-record-field { min-width: 0; }
.admin-record-field.full { grid-column: 1 / -1; }
.admin-record-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-record-field strong { display: block; overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.admin-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.admin-card-actions.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.admin-card-actions .mini-btn { width: 100%; min-height: 42px; padding: 9px 7px; }

@media (max-width: 520px) {
  .admin-desktop-table { display: none; }
  .admin-mobile-list { display: block; }
  .admin-record-grid { grid-template-columns: 1fr 1fr; }
  .admin-card-actions.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 380px) {
  .admin-card-actions.three { grid-template-columns: 1fr; }
}

/* v0.1.4 — shared read-only Viewer profile */
.viewer-login-card { max-width: 500px; margin: 20px auto; }
.viewer-readonly-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.viewer-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.viewer-toolbar h2 { margin: 0; }
.viewer-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.viewer-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.viewer-tabs .btn { width: 100%; }
.viewer-equipment-card { border: 1px solid var(--line); background: #11161b; border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.viewer-equipment-card + .viewer-equipment-card { margin-top: 12px; }
.viewer-equipment-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.viewer-equipment-head > div { min-width: 0; }
.viewer-equipment-head strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.viewer-equipment-head span:not(.badge) { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.viewer-equipment-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 13px 0; }
.viewer-equipment-meta > div { min-width: 0; border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 11px; }
.viewer-equipment-meta span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.viewer-equipment-meta strong { display: block; overflow-wrap: anywhere; font-size: 13px; line-height: 1.35; }
.viewer-lock-stack { margin-top: 0; }
.viewer-history-list { display: none; }
.viewer-admin-pin-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 14px; }
.viewer-admin-pin-row .form-group { margin-top: 0; }
.viewer-admin-pin-row .btn { min-width: 180px; }
.viewer-permission-list { display: grid; gap: 8px; color: var(--text); font-size: 13px; line-height: 1.4; }
.viewer-permission-list.muted { color: var(--muted); }

@media (max-width: 520px) {
  .viewer-toolbar { align-items: flex-start; }
  .viewer-toolbar .btn { flex: 0 0 auto; }
  .viewer-section-title { align-items: flex-end; }
  .viewer-section-title span { text-align: right; }
  .viewer-equipment-meta { grid-template-columns: 1fr 1fr; }
  .viewer-history-list { display: block; }
  .viewer-history-table { display: none; }
  .viewer-admin-pin-row { grid-template-columns: 1fr; }
  .viewer-admin-pin-row .btn { min-width: 0; width: 100%; }
}

@media (max-width: 380px) {
  .viewer-equipment-meta { grid-template-columns: 1fr; }
}

/* v0.1.5 — Admin batch QR printing */
.print-codes-intro .record-head { margin-bottom: 14px; }
.print-type-tabs { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.print-type-tabs .btn { width: 100%; }
.print-scale-note { margin-top: 12px; }
.print-template-card { margin-top: 12px; }
.print-template-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.print-template-head h3 { margin: 0; }
.print-template-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.size-chip { flex: 0 0 auto; border: 1px solid #34546c; background: #102332; color: #9ed8ff; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.print-spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.print-spec-grid > div { border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 11px; min-width: 0; }
.print-spec-grid span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.print-spec-grid strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.lock-size-control { display: grid; grid-template-columns: minmax(180px, .7fr) 1.3fr; gap: 12px; align-items: end; margin-top: 14px; }
.lock-size-control .form-group { margin: 0; }
.lock-size-control .notice { margin: 0; }
.batch-picker-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 18px 0 9px; }
.batch-picker-toolbar h2 { margin: 0; }
.batch-picker-toolbar > div:first-child span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.batch-code-list { display: grid; gap: 8px; }
.batch-code-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); background: #11161b; border-radius: 14px; padding: 12px 13px; cursor: pointer; }
.batch-code-row:hover { border-color: #4a5660; }
.batch-code-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.batch-code-main, .batch-code-meta { min-width: 0; }
.batch-code-main strong, .batch-code-meta strong { display: block; overflow-wrap: anywhere; }
.batch-code-main small, .batch-code-meta small { display: block; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.batch-code-meta { text-align: right; }
.muted-row { opacity: .62; }
.batch-print-button { margin-top: 12px; }
.batch-print-dialog { max-width: 880px; }
.batch-print-dialog > #batch-print-area { max-height: 58vh; overflow: auto; background: #e7e7e7; padding: 18px; border-radius: 14px; }
.batch-print-instructions { margin-bottom: 12px; }
.equipment-batch-sheet { display: grid; grid-template-columns: repeat(auto-fill, 3in); gap: .15in; align-items: start; justify-content: center; }
.equipment-engrave-tag { box-sizing: border-box; width: 3in; height: 1in; display: flex; align-items: center; gap: .10in; padding: .08in .40in .08in .45in; background: #fff; color: #000; outline: 1px dashed #999; overflow: hidden; }
.equipment-qr-frame { box-sizing: border-box; flex: 0 0 .84in; width: .84in; height: .84in; padding: .06in; background: #fff; display: flex; align-items: center; justify-content: center; }
.equipment-qr-frame .batch-qr, .equipment-qr-frame .batch-qr img, .equipment-qr-frame .batch-qr canvas { width: .72in !important; height: .72in !important; display: block; }
.equipment-tag-copy { min-width: 0; line-height: 1.05; }
.equipment-tag-copy strong { display: block; font-size: 12pt; letter-spacing: .02em; }
.equipment-tag-copy span { display: block; font-size: 8.5pt; font-weight: 700; margin-top: .04in; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.equipment-tag-copy small { display: block; font-size: 6.8pt; margin-top: .04in; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lock-batch-sheet { display: grid; grid-template-columns: repeat(auto-fill, 1in); gap: .18in; align-items: start; justify-content: center; }
.lock-print-item { box-sizing: border-box; width: 1in; height: .75in; padding: .025in; background: #fff; color: #000; text-align: left; outline: 1px dashed #999; overflow: hidden; break-inside: avoid; page-break-inside: avoid; display: flex; flex-direction: row; align-items: center; gap: .025in; }
.lock-qr-frame { box-sizing: border-box; flex: 0 0 .64in; width: .64in; height: .64in; padding: .015in; background: #fff; display: flex; align-items: center; justify-content: center; }
.lock-qr-frame .batch-qr, .lock-qr-frame .batch-qr img, .lock-qr-frame .batch-qr canvas { width: .61in !important; height: .61in !important; display: block; }
.lock-print-caption { width: .285in; margin-top: 0; line-height: 1.00; min-height: 0; overflow: hidden; }
.lock-print-caption strong { display: block; font-size: 5.4pt; }
.lock-print-caption span { display: block; font-size: 4.0pt; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .018in; }
.lock-print-caption small { display: block; font-size: 3.8pt; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .018in; }

@media (max-width: 520px) {
  .print-type-tabs { grid-template-columns: 1fr; }
  .print-template-head { flex-direction: column; }
  .print-spec-grid { grid-template-columns: 1fr 1fr; }
  .lock-size-control { grid-template-columns: 1fr; }
  .batch-code-row { grid-template-columns: auto minmax(0,1fr); }
  .batch-code-meta { grid-column: 2; text-align: left; }
  .batch-print-dialog > #batch-print-area { padding: 10px; }
}

@media print {
  @page { margin: .25in; }
  body.batch-printing * { visibility: hidden !important; }
  body.batch-printing #batch-print-area,
  body.batch-printing #batch-print-area * { visibility: visible !important; }
  body.batch-printing #batch-print-area { position: absolute !important; left: 0 !important; top: 0 !important; width: auto !important; max-height: none !important; overflow: visible !important; padding: 0 !important; margin: 0 !important; background: #fff !important; border-radius: 0 !important; }
  body.batch-printing .equipment-batch-sheet { display: grid !important; grid-template-columns: repeat(2, 3in) !important; gap: .15in !important; justify-content: start !important; }
  body.batch-printing .equipment-engrave-tag { outline: 0.5pt solid #bbb !important; break-inside: avoid; page-break-inside: avoid; }
  body.batch-printing .lock-batch-sheet { display: grid !important; gap: .18in !important; justify-content: start !important; }
}

/* v0.1.20 — printable LOTO history reports */
.history-print-card { margin-bottom: 16px; }
.history-print-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.history-print-head h3 { margin:0; }
.history-print-head p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.history-print-controls { display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:10px; margin-top:14px; }
.history-print-controls label { display:block; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; margin:0 0 5px; }
.history-print-note { margin:10px 0 0; }
@media (max-width: 620px) {
  .history-print-head { flex-direction:column; }
  .history-print-head .btn { width:100%; }
  .history-print-controls { grid-template-columns:1fr 1fr; }
  .history-print-controls > div:first-child { grid-column:1 / -1; }
}

/* Destructive Admin source-record actions */
.mini-btn.danger { border-color: rgba(215,45,45,.58); color: #ff9a9a; background: rgba(215,45,45,.10); }
.mini-btn.danger:active { background: rgba(215,45,45,.22); }


/* v0.1.26 — consolidate Viewer and Admin Profile under Settings */
.settings-page { width:100%; }
.settings-head { margin: 0 0 10px; }
.settings-head h2 { margin:0; font-size:28px; }
.settings-head p { color:var(--muted); margin:5px 0 0; font-size:13px; }
.settings-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,220px)); gap:8px; margin:10px 0 14px; }
.settings-tabs .btn { width: 100%; }
@media (max-width: 640px) {
  .settings-tabs { grid-template-columns: 1fr 1fr; }
}

/* v0.1.26 — Settings lives behind the gear beside Sign Out */
.admin-heading-row { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.admin-heading-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.admin-settings-button { width:48px; min-width:48px; height:48px; min-height:48px; padding:0; display:grid; place-items:center; }
.admin-settings-button svg { width:22px; height:22px; fill:currentColor; }
@media (max-width: 520px) {
  .admin-heading-row { align-items:flex-start; }
  .admin-heading-actions { gap:6px; }
  .admin-heading-actions #admin-logout { padding-left:12px; padding-right:12px; }
}

/* v0.1.32 — move profile login into the top-right header beside Home */
.topbar-actions {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
}
.topbar-nav-btn {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #3b444d;
  border-radius: 12px;
  background: linear-gradient(180deg, #1b2127 0%, #11161b 100%);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 8px 22px rgba(0,0,0,.22);
}
.topbar-nav-btn:hover,
.topbar-nav-btn:focus-visible {
  border-color: rgba(121,156,196,.55);
  background: linear-gradient(180deg, #242b32 0%, #171d22 100%);
}
.topbar-login {
  position: relative;
}
.topbar-login > summary {
  list-style: none;
  user-select: none;
}
.topbar-login > summary::-webkit-details-marker { display: none; }
.topbar-login[open] > summary {
  border-color: rgba(215,45,45,.55);
  background: rgba(215,45,45,.12);
}
.topbar-login-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 160px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #11161b;
  box-shadow: 0 18px 44px rgba(0,0,0,.42);
  display: grid;
  gap: 7px;
}
.topbar-login-popover button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  padding: 0 12px;
}
.topbar-login-popover button:hover,
.topbar-login-popover button:focus-visible {
  border-color: rgba(215,45,45,.5);
  background: rgba(215,45,45,.11);
}
.home-footer-space { height: 132px; }

@media (max-width: 820px) {
  .topbar-actions {
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    height: 82px;
    transform: none;
    display: block;
  }
  .topbar-nav-btn {
    min-height: 38px;
    padding: 0 11px;
    border-radius: 10px;
    font-size: 13px;
  }
  .topbar-actions > .topbar-nav-btn[data-nav="/"] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 68px;
  }
  .topbar-actions > .topbar-login {
    position: absolute;
    top: 44px;
    right: 0;
    width: 68px;
  }
  .topbar-actions > .topbar-login > summary {
    width: 100%;
  }
  .topbar-actions .topbar-scan {
    position: absolute;
    top: 0;
    left: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  .topbar-login-popover { width: 148px; }
  .home-footer-space { height: 118px; }
}


/* v0.1.35 history filtering */
.history-filter-card { margin-bottom: 16px; }
.history-filter-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.history-filter-head h3 { margin:0; }
.history-filter-head p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.history-filter-actions { display:flex; align-items:center; gap:12px; flex:0 0 auto; }
.history-filter-date-grid { display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:10px; margin-top:14px; }
.history-filter-search-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)) auto; gap:10px; margin-top:10px; align-items:end; }
.history-filter-date-grid label,.history-filter-search-grid label { display:block; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; margin:0 0 5px; }
.history-filter-search-grid .btn { min-height:46px; white-space:nowrap; }
.history-filter-note { margin:10px 0 0; }
@media (max-width:1200px) {
  .history-filter-search-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .history-filter-search-grid .btn { width:100%; }
}
@media (max-width:760px) {
  .history-filter-head { flex-direction:column; }
  .history-filter-actions { width:100%; justify-content:space-between; flex-wrap:wrap; }
  .history-filter-actions .btn { width:100%; }
  .history-filter-date-grid { grid-template-columns:1fr 1fr; }
  .history-filter-date-grid > div:first-child { grid-column:1 / -1; }
  .history-filter-search-grid { grid-template-columns:1fr 1fr; }
  .history-filter-search-grid .btn { grid-column:1 / -1; }
}
@media (max-width:480px) {
  .history-filter-date-grid,.history-filter-search-grid { grid-template-columns:1fr; }
  .history-filter-date-grid > div:first-child,.history-filter-search-grid .btn { grid-column:auto; }
}

/* v2.00 TEST — multi-module Home + Harness Inspection */
.platform-hero p { max-width: 820px; }
.module-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.module-card { min-height:190px; border:1px solid var(--line); border-radius:20px; padding:22px; background:linear-gradient(145deg,rgba(255,255,255,.04),rgba(255,255,255,.012)),var(--panel); color:var(--text); display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:16px; align-items:center; text-align:left; cursor:pointer; box-shadow:var(--shadow); }
.module-card.loto { border-color:rgba(215,45,45,.48); }
.module-card.harness { border-color:rgba(79,143,232,.48); }
.module-card:hover,.module-card:focus-visible { transform:translateY(-1px); border-color:rgba(255,255,255,.24); }
.module-icon { width:58px; height:58px; border-radius:17px; background:var(--panel-2); display:grid; place-items:center; font-size:31px; }
.module-copy { min-width:0; }
.module-copy strong { display:block; font-size:22px; margin-bottom:7px; }
.module-copy small { display:block; color:var(--muted); font-size:13px; line-height:1.5; }
.module-arrow { font-size:28px; color:var(--muted); }
.test-only-banner { border-color:rgba(79,143,232,.38); background:rgba(79,143,232,.08); color:#bcd6ff; }
.module-switcher { display:grid; grid-template-columns:repeat(2,minmax(0,220px)); gap:8px; margin:14px 0; }
.module-switcher .btn { width:100%; }
.tab-count { display:inline-flex; min-width:22px; height:22px; padding:0 6px; border-radius:999px; align-items:center; justify-content:center; margin-left:6px; background:#fff; color:#a31515; font-size:11px; }
.harness-icon { background:rgba(79,143,232,.14); color:#a8caff; }
.harness-start-card { width:100%; max-width:none; }
.harness-stop-banner { border:2px solid #e44848; background:rgba(215,45,45,.16); border-radius:18px; padding:18px; margin-bottom:14px; text-align:center; box-shadow:0 14px 34px rgba(215,45,45,.14); }
.harness-stop-banner strong { display:block; color:#ff9696; font-size:24px; letter-spacing:.02em; }
.harness-stop-banner span { display:block; color:#ffd0d0; margin-top:7px; line-height:1.45; }
.harness-inspect-cta { margin-top:14px; min-height:58px; font-size:17px; }
.inspection-identity-grid { display:grid; grid-template-columns:2fr 1fr; gap:12px; }
.inspection-identity-grid .form-group { margin-top:0; }
.harness-employee-id { letter-spacing:.18em; }
.harness-checklist { display:grid; gap:12px; margin-top:12px; }
.harness-question { margin-top:0 !important; }
.harness-question-head { display:flex; gap:12px; align-items:flex-start; }
.question-number { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; flex:0 0 auto; background:var(--panel-2); border:1px solid var(--line); font-weight:900; }
.harness-question-head p { margin:3px 0 0; line-height:1.5; font-weight:700; }
.inspection-choice-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.inspection-choice { min-height:52px; border-radius:13px; border:1px solid var(--line); background:var(--panel-2); color:var(--text); font-weight:900; cursor:pointer; }
.inspection-choice.pass.selected { background:rgba(46,170,104,.18); border-color:rgba(46,170,104,.72); color:#8be2b2; box-shadow:0 0 0 2px rgba(46,170,104,.12); }
.inspection-choice.fail.selected { background:rgba(215,45,45,.19); border-color:rgba(215,45,45,.76); color:#ff9e9e; box-shadow:0 0 0 2px rgba(215,45,45,.12); }
.inspection-choice.auto-result { cursor:default; pointer-events:none; }
.harness-defect { margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.harness-defect label { display:block; color:#ffabab; font-size:12px; font-weight:800; margin-bottom:7px; }
.harness-fail-warning { margin-top:12px; }
.inspection-result { border:1px solid var(--line); border-radius:20px; padding:28px 20px; text-align:center; margin-bottom:14px; }
.inspection-result.passed { background:rgba(46,170,104,.10); border-color:rgba(46,170,104,.5); }
.inspection-result.failed { background:rgba(215,45,45,.13); border-color:rgba(215,45,45,.58); }
.inspection-result-icon { width:64px; height:64px; margin:0 auto 12px; border-radius:50%; display:grid; place-items:center; font-size:34px; font-weight:900; background:var(--panel-2); }
.inspection-result.passed .inspection-result-icon { color:#81dfa9; }
.inspection-result.failed .inspection-result-icon { color:#ff9696; }
.inspection-result h1 { margin:0; font-size:clamp(26px,6vw,40px); }
.inspection-result p { margin:9px auto 0; color:var(--muted); max-width:720px; line-height:1.5; }
.safety-alert-card { border-color:rgba(215,45,45,.48); }
.safety-alert-card + .safety-alert-card { margin-top:14px; }
.safety-alert-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.safety-alert-head h3 { margin:9px 0 0; font-size:24px; }
.safety-alert-head p { margin:5px 0 0; color:var(--muted); }
.safety-alert-time { color:var(--muted); font-size:12px; text-align:right; }
.failed-item-list { display:grid; gap:8px; margin:14px 0; }
.failed-item { border:1px solid rgba(215,45,45,.32); background:rgba(215,45,45,.07); border-radius:12px; padding:11px 12px; }
.failed-item strong,.failed-item span,.failed-item em { display:block; }
.failed-item strong { color:#ff9a9a; }
.failed-item span { margin-top:4px; font-size:12px; line-height:1.4; }
.failed-item em { margin-top:5px; color:#ffd0d0; font-style:normal; font-size:12px; }
.harness-admin-form { grid-template-columns:repeat(3,minmax(0,1fr)); }
.harness-admin-form .full { grid-column:1/-1; }
.harness-status-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.harness-status-card { margin-top:0 !important; }
.harness-history-card small { display:block; margin-top:3px; color:var(--muted); }
.harness-history-search-grid { grid-template-columns:repeat(6,minmax(0,1fr)) auto; }

@media (max-width: 900px) {
  .module-grid,.harness-status-grid { grid-template-columns:1fr; }
  .harness-admin-form { grid-template-columns:1fr 1fr; }
  .harness-history-search-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .module-card { min-height:150px; padding:17px; grid-template-columns:auto minmax(0,1fr); }
  .module-arrow { display:none; }
  .module-icon { width:48px; height:48px; font-size:26px; }
  .module-copy strong { font-size:19px; }
  .module-switcher { grid-template-columns:1fr 1fr; }
  .inspection-identity-grid,.harness-admin-form { grid-template-columns:1fr; }
  .inspection-choice-grid { grid-template-columns:1fr 1fr; }
  .safety-alert-head { flex-direction:column; }
  .safety-alert-time { text-align:left; }
  .harness-history-search-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 430px) {
  .module-switcher,.harness-history-search-grid { grid-template-columns:1fr; }
}
.module-switcher .btn.attention { border-color:rgba(215,45,45,.7); background:rgba(215,45,45,.12); color:#ffb0b0; }
.harness-admin-tabs .btn.attention { border-color:rgba(215,45,45,.72); color:#ffb0b0; }

/* v3.00 TEST — Ladder Inspection */
.module-card.ladder { border-color:rgba(225,166,44,.5); }
.ladder-icon { background:rgba(225,166,44,.14); color:#f3cd77; }
.ladder-start-card { width:100%; max-width:none; }
.ladder-inspection-fields .form-group:first-child { margin-top:0; }
.ladder-admin-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
.ladder-admin-form .full { grid-column:1/-1; }
.ladder-history-search-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.ladder-history-search-grid .btn { width:100%; }
.ladder-qr-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.ladder-qr-card { margin-top:0 !important; }

@media (min-width: 901px) {
  .module-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .module-switcher { grid-template-columns:repeat(3,minmax(0,220px)); }
}

@media (max-width: 900px) {
  .ladder-history-search-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ladder-qr-grid { grid-template-columns:1fr; }
}

@media (max-width: 620px) {
  .module-switcher { grid-template-columns:1fr; }
  .ladder-admin-form { grid-template-columns:1fr; }
  .ladder-admin-form .full { grid-column:auto; }
  .ladder-history-search-grid { grid-template-columns:1fr; }
}

/* Ladder history has more audit columns, so switch to cards earlier rather than forcing sideways scrolling. */
@media (max-width: 1100px) {
  .ladder-history-mobile { display:block; }
  .ladder-history-desktop { display:none; }
}

/* v3.00.01 Ladder structured description fields */
.ladder-description-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 0;
  border-top: 1px solid var(--line, rgba(255,255,255,.10));
  margin-top: 2px;
}
.ladder-description-heading strong { font-size: 16px; }
.ladder-description-heading span { color: var(--muted, #9aa7b5); font-size: 13px; text-align: right; }
.optional-label { font-weight: 500; opacity: .72; }
@media (max-width: 620px) {
  .ladder-description-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .ladder-description-heading span { text-align: left; }
}


/* v3.00.02 TEST — centralized Admin Add Equipment */
.admin-add-equipment-button { min-height:48px; white-space:nowrap; }
.admin-add-type-tabs {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
  margin:14px 0;
}
.admin-add-type-tabs .btn { width:100%; min-width:0; }
.admin-add-card { margin-top:0; }
.admin-add-card-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.admin-add-card-head h3 { margin:7px 0 0; font-size:22px; }
@media (max-width:900px) {
  .admin-add-type-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:620px) {
  .admin-heading-row { flex-direction:column; }
  .admin-heading-actions { width:100%; }
  .admin-add-equipment-button { flex:1 1 auto; }
  .admin-add-type-tabs { grid-template-columns:1fr 1fr; }
  .admin-add-card-head { flex-direction:column; }
}
@media (max-width:430px) {
  .admin-add-type-tabs { grid-template-columns:1fr; }
}


/* v3.00.03 TEST — stronger Admin main navigation + Add Equipment on main tab row */
.admin-main-nav {
  display:flex;
  align-items:stretch;
  gap:10px;
  margin:14px 0 10px;
  width:100%;
}
.admin-main-module-tabs {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,220px));
  gap:8px;
  flex:0 1 676px;
}
.admin-main-nav .btn {
  width:100%;
  min-height:54px;
  border-width:2px;
  border-color:#39434e;
  border-radius:14px;
  background:linear-gradient(180deg,#20262d,#171c22);
  font-size:15px;
  font-weight:850;
  box-shadow:0 8px 20px rgba(0,0,0,.20);
}
.admin-main-nav .btn.primary {
  background:var(--red);
  border-color:#ef4a4a;
  color:#fff;
  box-shadow:0 9px 24px rgba(215,45,45,.20);
}
.admin-main-nav .admin-add-equipment-button {
  width:auto;
  min-width:190px;
  margin-left:auto;
  border-color:#66717d;
  background:linear-gradient(180deg,#2a323b,#1b2128);
}
.admin-main-nav .admin-add-equipment-button:hover {
  border-color:#8d99a6;
  background:linear-gradient(180deg,#323b45,#20272f);
}
.admin-sub-tabs {
  margin:6px 0 12px;
}
.admin-sub-tabs .btn {
  min-height:42px;
  padding:9px 13px;
  border-radius:10px;
  border-color:#252c34;
  background:#11161b;
  color:#c7cdd4;
  font-size:13px;
  font-weight:750;
  box-shadow:none;
}
.admin-sub-tabs .btn.primary {
  background:rgba(215,45,45,.16);
  border-color:rgba(215,45,45,.72);
  color:#fff;
}
.admin-sub-tabs .btn.attention:not(.primary) {
  background:rgba(215,45,45,.09);
}
@media (max-width:900px) {
  .admin-main-nav { align-items:stretch; }
  .admin-main-module-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); flex:1 1 auto; }
  .admin-main-nav .admin-add-equipment-button { min-width:155px; }
}
@media (max-width:700px) {
  .admin-main-nav { display:grid; grid-template-columns:1fr 1fr; }
  .admin-main-module-tabs { grid-column:1 / -1; grid-template-columns:1fr; }
  .admin-main-nav .admin-add-equipment-button { grid-column:1 / -1; width:100%; margin-left:0; }
}

/* v3.00.06 TEST — mobile Admin Scan QR + Settings stacked in top-left header */
.admin-mobile-top-settings { display:none; }

@media (max-width: 820px) {
  /* Keep the signed-in control in the same stacked top-right position previously used by Login. */
  .topbar-actions > .topbar-nav-btn[data-action="session-logout"] {
    position:absolute;
    top:44px;
    right:0;
    min-width:68px;
  }

  /* Admin-only mobile tools: Scan QR at top-left with Settings directly beneath it. */
  .admin-mobile-tools-shell .topbar-scan {
    display:grid;
    position:absolute;
    top:0;
    left:0;
    width:38px;
    min-width:38px;
    height:38px;
    min-height:38px;
    border-radius:10px;
  }
  .admin-mobile-top-settings {
    display:grid;
    position:absolute;
    top:44px;
    left:0;
    width:38px;
    min-width:38px;
    height:38px;
    min-height:38px;
    padding:0;
    place-items:center;
    border-radius:10px;
  }
  .admin-mobile-top-settings svg {
    width:20px;
    height:20px;
    fill:currentColor;
  }

  /* Settings is represented in the top-left tool stack on mobile, not beside the page heading. */
  .admin-mobile-tools-shell .admin-heading-actions {
    display:none;
  }
}


/* v3.00.09 TEST — balanced mobile Back / Add Equipment utility row */
.admin-mobile-action-row .admin-mobile-add-equipment-button { display:none; }

@media (max-width:700px) {
  /* Desktop keeps Add Equipment at the far right of the main module row. */
  .admin-main-nav > .admin-add-equipment-button { display:none; }

  /* Keep both mobile utility actions in the same normal-flow row so they align cleanly. */
  .admin-mobile-action-row {
    display:flex;
    align-items:stretch;
    justify-content:space-between;
    gap:14px;
    margin-bottom:16px;
  }
  .admin-mobile-action-row .admin-mobile-back-button,
  .admin-mobile-action-row .admin-mobile-add-equipment-button {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:48px;
    height:48px;
    margin:0;
    border-radius:12px;
    font-size:13px;
    font-weight:850;
    box-shadow:0 6px 16px rgba(0,0,0,.18);
  }
  .admin-mobile-action-row .admin-mobile-back-button {
    min-width:104px;
    padding:10px 18px;
  }
  .admin-mobile-action-row .admin-mobile-add-equipment-button {
    min-width:148px;
    padding:10px 16px;
    margin-left:auto;
    border-color:#66717d;
    background:linear-gradient(180deg,#2a323b,#1b2128);
  }
  .admin-mobile-action-row .admin-mobile-add-equipment-button:hover {
    border-color:#8d99a6;
    background:linear-gradient(180deg,#323b45,#20272f);
  }
}

/* v3.00.10 - auto-generated Ladder ID display */
.ladder-auto-id[readonly] {
  cursor: default;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--text);
  background: rgba(255,255,255,.035);
}

/* v3.00.18 TEST — Home: move signed-in profile return into the top-right header */
.topbar-session-home-group {
  display: grid;
  gap: 7px;
}
.topbar-session-home-row {
  display: flex;
  gap: 8px;
}
.topbar-profile-return {
  width: 100%;
  min-height: 38px;
  border-color: rgba(215,45,45,.48);
  background: rgba(215,45,45,.12);
}
.topbar-profile-return:hover,
.topbar-profile-return:focus-visible {
  border-color: rgba(215,45,45,.78);
  background: rgba(215,45,45,.2);
}

@media (max-width: 820px) {
  .topbar-actions-with-profile-return .topbar-session-home-group {
    position: absolute;
    top: 0;
    right: 0;
    width: 92px;
    gap: 6px;
  }
  .topbar-actions-with-profile-return .topbar-session-home-row {
    display: grid;
    gap: 6px;
  }
  .topbar-actions-with-profile-return .topbar-session-home-row .topbar-nav-btn,
  .topbar-actions-with-profile-return .topbar-profile-return {
    width: 100%;
    min-width: 92px;
    min-height: 36px;
    height: 36px;
    padding: 0 7px;
    font-size: 12px;
  }
  .topbar-actions-with-profile-return .topbar-profile-return {
    height: auto;
    min-height: 40px;
    line-height: 1.08;
    white-space: normal;
  }
}

/* v3.00.19 TEST — compact History controls with filter popup */
.history-filter-toolbar {
  margin-bottom: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.history-filter-toolbar-summary { display:flex; align-items:baseline; gap:10px; min-width:0; }
.history-filter-toolbar-summary strong { font-size:15px; }
.history-filter-toolbar-summary .brand-sub { white-space:nowrap; }
.history-filter-toolbar-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; flex-wrap:wrap; }
.history-filter-toolbar-actions .btn { min-height:42px; padding:9px 15px; }
.history-filter-open-btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.history-filter-open-btn.has-active-filters { border-color:rgba(230,46,46,.82); box-shadow:inset 0 0 0 1px rgba(230,46,46,.18); }
.history-filter-badge { display:inline-flex; align-items:center; justify-content:center; min-width:22px; height:22px; padding:0 6px; border-radius:999px; background:#e62e2e; color:#fff; font-size:11px; font-weight:900; line-height:1; }
.history-filter-badge[hidden], .history-filter-toolbar-clear[hidden] { display:none !important; }
.history-filter-toolbar-clear { border-color:rgba(230,46,46,.5); }
.history-filter-modal-backdrop[hidden] { display:none !important; }
.history-filter-modal { width:min(900px,100%); }
.history-filter-modal .modal-head { align-items:flex-start; }
.history-filter-modal .modal-head p { margin:5px 0 0; }
.history-filter-modal .history-filter-date-grid { grid-template-columns:1.2fr 1fr 1fr; margin-top:4px; }
.history-filter-modal .history-filter-search-grid,
.history-filter-modal .ladder-history-search-grid,
.history-filter-modal .harness-history-search-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.history-filter-modal-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:16px; padding-top:14px; border-top:1px solid var(--line); }
.history-filter-modal-actions .btn { min-width:140px; }

@media (max-width: 760px) {
  .history-filter-toolbar { align-items:stretch; padding:10px; }
  .history-filter-toolbar-summary { flex-direction:column; justify-content:center; gap:1px; }
  .history-filter-toolbar-actions { gap:6px; }
  .history-filter-toolbar-actions .btn { padding:8px 10px; min-height:40px; font-size:13px; }
  .history-filter-modal .history-filter-date-grid { grid-template-columns:1fr 1fr; }
  .history-filter-modal .history-filter-date-grid > div:first-child { grid-column:1 / -1; }
  .history-filter-modal .history-filter-search-grid,
  .history-filter-modal .ladder-history-search-grid,
  .history-filter-modal .harness-history-search-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 520px) {
  .history-filter-toolbar { flex-direction:column; }
  .history-filter-toolbar-summary { flex-direction:row; justify-content:space-between; align-items:center; }
  .history-filter-toolbar-actions { width:100%; }
  .history-filter-toolbar-actions .btn { flex:1 1 0; min-width:105px; }
  .history-filter-open-btn { flex-grow:1.2 !important; }
  .history-filter-modal .history-filter-date-grid,
  .history-filter-modal .history-filter-search-grid,
  .history-filter-modal .ladder-history-search-grid,
  .history-filter-modal .harness-history-search-grid { grid-template-columns:1fr; }
  .history-filter-modal .history-filter-date-grid > div:first-child { grid-column:auto; }
  .history-filter-modal-actions { display:grid; grid-template-columns:1fr 1fr; }
  .history-filter-modal-actions .btn { width:100%; min-width:0; }
}

/* v3.00.21 Badge Maker profile */
.badge-maker-head { display:flex; align-items:flex-end; justify-content:space-between; gap:14px; margin-bottom:12px; }
.badge-maker-head h2 { margin:0; }
.badge-maker-head p { margin:5px 0 0; color:var(--muted); font-size:13px; max-width:760px; }
.badge-maker-primary-nav { grid-template-columns:repeat(2,minmax(0,1fr)); }
.badge-maker-plate-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); }
.badge-maker-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.badge-maker-summary { appearance:none; color:inherit; text-align:left; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; }
.badge-maker-summary span { color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.badge-maker-summary strong { font-size:24px; line-height:1; }
.badge-maker-summary.active { border-color:rgba(215,45,45,.7); box-shadow:0 0 0 1px rgba(215,45,45,.22) inset; }
.badge-maker-toolbar { display:flex; align-items:end; justify-content:space-between; gap:12px; margin:10px 0; }
.badge-maker-toolbar h3 { margin:0; }
.badge-maker-toolbar span { color:var(--muted); font-size:12px; }
.badge-maker-toolbar .input { width:min(420px,46vw); }
.badge-maker-table { border:1px solid var(--line); border-radius:16px; overflow:hidden; background:var(--panel); }
.badge-maker-table-header, .badge-maker-table-row { display:grid; grid-template-columns:minmax(100px,.72fr) minmax(120px,.9fr) minmax(220px,1.75fr) minmax(115px,.8fr) minmax(145px,1fr) minmax(120px,.9fr) minmax(135px,.95fr); align-items:center; }
.badge-maker-table-header { min-height:42px; background:rgba(255,255,255,.035); border-bottom:1px solid var(--line); color:var(--muted); font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.045em; }
.badge-maker-table-header > div, .badge-maker-cell { min-width:0; padding:10px 12px; }
.badge-maker-table-row { min-height:64px; border-bottom:1px solid var(--line); }
.badge-maker-table-row:last-child { border-bottom:0; }
.badge-maker-table-row:hover { background:rgba(255,255,255,.018); }
.badge-maker-cell { color:var(--text); font-size:12px; overflow-wrap:anywhere; }
.badge-maker-code strong { font-size:14px; }
.badge-maker-details { display:grid; gap:3px; }
.badge-maker-details strong { font-size:13px; }
.badge-maker-details span { color:var(--muted); font-size:11px; }
.badge-maker-table-action .mini-btn {
  width:100%;
  min-height:38px;
  padding:8px 10px;
  border:1px solid #536170;
  background:#242c35;
  color:#fff;
  font-weight:850;
  box-shadow:0 2px 8px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.05);
  transition:background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.badge-maker-table-action .mini-btn:hover {
  background:#303a45;
  border-color:#708092;
  box-shadow:0 4px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.07);
}
.badge-maker-table-action .mini-btn:active { transform:translateY(1px); }
.badge-maker-table-action .badge-maker-artwork-btn {
  border-color:rgba(79,143,232,.72);
  background:rgba(79,143,232,.2);
  color:#e8f1ff;
}
.badge-maker-table-action .badge-maker-artwork-btn:hover {
  border-color:#78aaf0;
  background:rgba(79,143,232,.32);
}
.badge-maker-table-action .badge-maker-reprint-btn {
  border-color:rgba(225,166,44,.75);
  background:rgba(225,166,44,.18);
  color:#ffe3a3;
}
.badge-maker-table-action .badge-maker-reprint-btn:hover {
  border-color:#efbd58;
  background:rgba(225,166,44,.3);
}
.badge-maker-table-action .badge-maker-complete-btn {
  border-color:rgba(46,170,104,.7);
  background:rgba(46,170,104,.18);
  color:#c8f5dc;
}
.badge-maker-table-action .badge-maker-complete-btn:hover {
  border-color:#65cc93;
  background:rgba(46,170,104,.3);
}
.badge-maker-table-empty { padding:28px 18px; text-align:center; color:var(--muted); }

@media (max-width: 760px) {
  .badge-maker-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .badge-maker-toolbar { align-items:stretch; flex-direction:column; }
  .badge-maker-toolbar .input { width:100%; }
  .badge-maker-table { border-radius:14px; }
  .badge-maker-table-header { display:none; }
  .badge-maker-table-row { grid-template-columns:1fr 1fr; gap:0; padding:8px 10px; min-height:0; }
  .badge-maker-cell { padding:8px; display:grid; gap:3px; align-content:start; }
  .badge-maker-cell::before { content:attr(data-label); color:var(--muted); font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.045em; }
  .badge-maker-details { grid-column:1 / -1; }
  .badge-maker-table-action .mini-btn { min-height:40px; }
  .settings-tabs { display:grid; grid-template-columns:1fr; }
}

@media (max-width: 1120px) and (min-width: 761px) {
  .badge-maker-table-header, .badge-maker-table-row { grid-template-columns:minmax(90px,.7fr) minmax(110px,.8fr) minmax(190px,1.6fr) minmax(110px,.8fr) minmax(115px,.9fr) minmax(105px,.8fr) minmax(120px,.9fr); }
  .badge-maker-table-header > div, .badge-maker-cell { padding-left:9px; padding-right:9px; }
}

/* v3.00.26 TEST — Admin Dashboard alignment */
.admin-main-module-tabs {
  grid-template-columns:repeat(4,minmax(0,190px));
  flex:0 1 784px;
}
.admin-dashboard-summary-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:14px 0;
}
.admin-dashboard-metric {
  min-width:0;
  border:1px solid #2a323b;
  border-radius:13px;
  background:#12181e;
  padding:14px 15px;
  display:flex;
  flex-direction:column;
  gap:5px;
}
.admin-dashboard-metric > span {
  color:var(--muted);
  font-size:11px;
  font-weight:850;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.admin-dashboard-metric > strong {
  color:#fff;
  font-size:27px;
  line-height:1.05;
}
.admin-dashboard-metric > small {
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}
.admin-dashboard-metric.attention {
  border-color:rgba(215,45,45,.65);
  background:rgba(215,45,45,.09);
}
.admin-dashboard-metric.good {
  border-color:rgba(37,166,95,.42);
  background:rgba(37,166,95,.06);
}
.admin-dashboard-metric.active {
  border-color:rgba(92,146,208,.48);
  background:rgba(92,146,208,.07);
}
.admin-dashboard-attention { margin-top:12px; }
.admin-dashboard-section-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.admin-dashboard-section-head h3 { margin:7px 0 3px; font-size:21px; }
.admin-dashboard-section-head p { margin:0; color:var(--muted); font-size:13px; }
.admin-dashboard-section-head > strong { font-size:34px; color:#ff9c9c; line-height:1; }
.admin-dashboard-attention-actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:14px; }
.admin-dashboard-clear { margin-top:12px; }
.admin-dashboard-overview-title { margin-top:20px; }
.admin-dashboard-module-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

/* Keep dashboard module cards aligned on the same top edge.
   This overrides the global .card + .card margin used for stacked cards. */
.admin-dashboard-module-grid > .admin-dashboard-module-card {
  margin-top:0;
}
.admin-dashboard-module-card {
  margin:0;
  display:flex;
  flex-direction:column;
  min-width:0;
}
.admin-dashboard-module-head {
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}
.admin-dashboard-module-head .record-icon { flex:0 0 auto; }
.admin-dashboard-module-head h3 { margin:6px 0 0; font-size:20px; }
.admin-dashboard-module-metrics {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  flex:1 1 auto;
}
.admin-dashboard-module-metrics .admin-dashboard-metric { padding:11px 12px; }
.admin-dashboard-module-metrics .admin-dashboard-metric > strong { font-size:22px; }
.admin-dashboard-open {
  width:100%;
  margin-top:14px;
  min-height:46px;
  border-color:#596675;
  background:linear-gradient(180deg,#28313a,#1a2027);
}
.admin-dashboard-open:hover { border-color:#8c99a7; background:linear-gradient(180deg,#323c47,#20272f); }

@media (max-width:1100px) {
  .admin-dashboard-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-dashboard-module-grid { grid-template-columns:1fr; }
}
@media (max-width:900px) {
  .admin-main-module-tabs { grid-template-columns:repeat(4,minmax(0,1fr)); flex:1 1 auto; }
}
@media (max-width:700px) {
  .admin-main-module-tabs { grid-template-columns:1fr; }
  .admin-dashboard-summary-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:520px) {
  .admin-dashboard-summary-grid { grid-template-columns:1fr; }
  .admin-dashboard-module-metrics { grid-template-columns:1fr 1fr; }
  .admin-dashboard-section-head { align-items:center; }
}
.admin-dashboard-clear {
  border-color:rgba(37,166,95,.42);
  background:rgba(37,166,95,.06);
}

/* v4.00.01 TEST — tighten ISafetyOS shell + establish ILockIT / IInspectIT Home hierarchy */
.logo-topbar {
  min-height: 286px;
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: 8px;
}
.brand-logo-image {
  width: clamp(440px, 34vw, 560px);
  max-height: 280px;
}

.isafetyos-home-hero {
  margin-top: 4px;
  margin-bottom: 12px;
}
.platform-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 10px;
  border: 1px solid rgba(137,149,161,.34);
  border-radius: 999px;
  color: #b7c0c9;
  background: rgba(255,255,255,.025);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}
.isafetyos-home-hero h1 {
  margin-top: 10px;
  font-size: clamp(34px, 5.2vw, 54px);
  letter-spacing: -.045em;
}
.platform-tagline {
  margin-top: 7px !important;
  max-width: none !important;
  color: #e3e8ed !important;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 750;
  letter-spacing: -.015em;
}
.platform-intro {
  margin-top: 8px !important;
  max-width: 820px !important;
  font-size: 14px;
}
.platform-status-strip { margin-top: 10px; margin-bottom: 16px; }

.platform-module-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 16px;
}
.platform-module-card {
  position: relative;
  min-width: 0;
  min-height: 258px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.008) 48%),
    #11161b;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.platform-module-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  pointer-events: none;
}
.ilockit-module { border-color: rgba(215,45,45,.45); }
.ilockit-module::before { background: linear-gradient(180deg, #f04a3d, #8e1717); }
.iinspectit-module { border-color: rgba(54,134,225,.48); }
.iinspectit-module::before { background: linear-gradient(180deg, #54a4ff, #1d5ea8); }
.platform-module-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.platform-module-symbol {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  background: #191f25;
  font-size: 26px;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.ilockit-module .platform-module-symbol {
  color: #ffb1a9;
  background: linear-gradient(145deg, rgba(215,45,45,.2), rgba(215,45,45,.055)), #171b20;
  border-color: rgba(215,45,45,.34);
}
.iinspectit-module .platform-module-symbol {
  color: #b8d8ff;
  background: linear-gradient(145deg, rgba(79,143,232,.22), rgba(79,143,232,.055)), #171b20;
  border-color: rgba(79,143,232,.35);
}
.module-wordmark {
  line-height: .98;
  font-size: clamp(29px, 3vw, 39px);
  font-weight: 950;
  letter-spacing: -.045em;
  color: #d8dde2;
  text-shadow: 0 2px 0 #000, 0 8px 18px rgba(0,0,0,.35);
  white-space: nowrap;
}
.module-wordmark .module-i { color: #e33a31; }
.module-wordmark .module-it { color: #f0f2f4; }
.iinspectit-wordmark .module-i { color: #3c92ee; }
.iinspectit-wordmark .module-it { color: #76b7ff; }
.platform-module-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.platform-module-card > p {
  margin: 18px 0 20px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
  max-width: 720px;
}
.platform-module-primary-action {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(239,67,57,.58);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(180deg, #b92525 0%, #811919 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(92,9,9,.24);
}
.platform-module-primary-action:hover,
.platform-module-primary-action:focus-visible {
  border-color: rgba(255,120,112,.82);
  background: linear-gradient(180deg, #cf3030 0%, #951d1d 100%);
}
.inspection-module-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.inspection-module-action {
  min-width: 0;
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid rgba(79,143,232,.34);
  border-radius: 13px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(79,143,232,.13), rgba(79,143,232,.045));
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.inspection-module-action:hover,
.inspection-module-action:focus-visible {
  border-color: rgba(111,173,242,.72);
  background: linear-gradient(180deg, rgba(79,143,232,.2), rgba(79,143,232,.075));
}
.inspection-action-icon { font-size: 24px; }
.inspection-module-action strong,
.inspection-module-action small { display: block; min-width: 0; }
.inspection-module-action strong { font-size: 13px; }
.inspection-module-action small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.inspection-action-arrow { color: #9fc7f6; font-size: 20px; }

@media (max-width: 1100px) and (min-width: 821px) {
  .logo-topbar { min-height: 270px; }
  .brand-logo-image { width: clamp(420px, 41vw, 500px); max-height: 262px; }
  .platform-module-grid { grid-template-columns: 1fr 1fr; }
  .inspection-module-actions { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .logo-topbar {
    min-height: 205px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 7px;
  }
  .brand-logo-button { margin-bottom: 0; }
  .brand-logo-image {
    width: min(320px, 86vw);
    max-height: 180px;
  }
  .main { padding-top: 14px; }
  .platform-module-grid { grid-template-columns: 1fr; gap: 12px; }
  .platform-module-card { min-height: auto; padding: 18px; }
  .inspection-module-actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .logo-topbar { min-height: 198px; }
  .brand-logo-image { width: min(308px, 84vw); max-height: 174px; }
  .isafetyos-home-hero h1 { font-size: 34px; }
  .platform-tagline { font-size: 17px; }
  .platform-module-head { gap: 11px; }
  .platform-module-symbol { width: 48px; height: 48px; flex-basis: 48px; font-size: 23px; }
  .module-wordmark { font-size: 28px; }
  .platform-module-card > p { margin: 15px 0 16px; }
  .inspection-module-actions { grid-template-columns: 1fr; }
  .inspection-module-action { min-height: 67px; }
}

@media (max-width: 390px) {
  .brand-logo-image { width: min(286px, 82vw); }
  .module-wordmark { font-size: 25px; }
  .platform-module-subtitle { font-size: 10px; }
}

/* v4.00.02 TEST — branded module artwork + compact mobile Home */
.platform-module-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 128px;
}
.platform-module-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.34));
}
.ilockit-module-logo {
  width: min(315px, 88%);
  max-height: 168px;
}
.iinspectit-module-logo {
  width: min(430px, 96%);
  max-height: 132px;
}
.iinspectit-module .inspection-module-actions {
  margin-top: auto;
}

@media (max-width: 820px) {
  .platform-module-brand {
    min-height: 112px;
    justify-content: center;
  }
  .ilockit-module-logo { width: min(265px, 88%); max-height: 148px; }
  .iinspectit-module-logo { width: min(360px, 96%); max-height: 112px; }
}

@media (max-width: 560px) {
  /* The ISafetyOS master logo already identifies Home on phones, so the
     duplicated hero copy is removed to keep both primary modules above-fold. */
  .logo-topbar {
    min-height: 190px;
  }
  .brand-logo-image {
    width: min(292px, 82vw);
    max-height: 160px;
  }
  .main {
    padding-top: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .isafetyos-home-hero {
    display: none;
  }
  .platform-status-strip {
    margin: 2px 0 9px;
    min-height: 22px;
    font-size: 11px;
  }
  .platform-module-grid {
    margin-top: 0 !important;
    gap: 9px;
  }
  .platform-module-card {
    padding: 9px 11px 11px;
    border-radius: 16px;
  }
  .platform-module-card > p {
    display: none;
  }
  .platform-module-brand {
    min-height: 0;
    justify-content: center;
  }
  .ilockit-module-logo {
    width: min(205px, 64vw);
    max-height: 118px;
  }
  .iinspectit-module-logo {
    width: min(300px, 82vw);
    max-height: 92px;
  }
  .platform-module-primary-action {
    min-height: 43px;
    margin-top: 4px;
    border-radius: 11px;
    font-size: 14px;
  }
  .inspection-module-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 5px !important;
  }
  .inspection-module-action {
    min-height: 55px;
    padding: 7px 8px;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 6px;
    border-radius: 10px;
  }
  .inspection-action-icon { font-size: 20px; }
  .inspection-module-action strong {
    font-size: 11px;
    line-height: 1.15;
  }
  .inspection-module-action small {
    display: none;
  }
  .inspection-action-arrow { font-size: 16px; }
  .test-only-banner {
    margin-top: 10px !important;
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  .logo-topbar { min-height: 184px; }
  .brand-logo-image { width: min(274px, 80vw); max-height: 154px; }
  .ilockit-module-logo { width: min(190px, 62vw); }
  .iinspectit-module-logo { width: min(270px, 80vw); }
  .inspection-module-action strong { font-size: 10px; }
}

/* v4.00.03 TEST — matching industrial module logos + two-logo launcher */
.platform-description-panel {
  position: relative;
  width: 100%;
  margin: 4px 0 16px;
  padding: 14px clamp(18px, 3vw, 30px);
  overflow: hidden;
  border: 1px solid rgba(137,149,161,.3);
  border-radius: 18px;
  background: #07090a;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.035);
  text-align: center;
}
.platform-description-content {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}
.platform-description-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, #bb2929, rgba(187,41,41,.2) 38%, rgba(55,139,232,.2) 62%, #378be8);
}
.platform-description-panel h1 {
  margin: 0;
  color: #f1f4f7;
  font-size: clamp(21px, 2.4vw, 27px);
  letter-spacing: -.025em;
}
.platform-description-panel p {
  margin: 7px auto 0;
  color: #b7c0c9;
  font-size: 13px;
  line-height: 1.5;
}
.platform-description-panel .platform-description-cta {
  margin-top: 9px;
  color: #e8edf2;
  font-weight: 850;
}
@media (min-width: 821px) {
  .platform-description-panel {
    margin-bottom: 14px;
    padding: 12px clamp(24px, 2vw, 32px);
  }
  .platform-description-content { max-width: 1300px; }
  .platform-description-panel h1 { font-size: 34px; line-height: 1.1; }
  .platform-description-panel p { margin-top: 6px; font-size: 16px; line-height: 1.5; }
  .platform-description-panel .platform-description-cta { margin-top: 6px; font-size: 15px; line-height: 1.4; }
}
.module-launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  margin-top: 6px;
}
.module-launcher {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  min-width: 0;
  min-height: 286px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.035), transparent 56%),
    linear-gradient(145deg, rgba(255,255,255,.025), rgba(255,255,255,.004)),
    #0d1115;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.035);
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.module-launcher::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .7;
}
.module-launcher-ilockit {
  border-color: rgba(220,50,45,.42);
}
.module-launcher-ilockit::after {
  box-shadow: inset 3px 0 0 rgba(229,52,47,.9);
}
.module-launcher-iinspectit {
  border-color: rgba(55,139,232,.48);
}
.module-launcher-iinspectit::after {
  box-shadow: inset 3px 0 0 rgba(50,145,245,.95);
}
.module-launcher:hover,
.module-launcher:focus-visible {
  transform: translateY(-2px);
  outline: none;
}
.module-launcher-ilockit:hover,
.module-launcher-ilockit:focus-visible {
  border-color: rgba(244,76,69,.78);
  background:
    radial-gradient(circle at 50% 42%, rgba(225,55,47,.08), transparent 58%),
    #0d1115;
  box-shadow: 0 18px 38px rgba(0,0,0,.34), 0 0 0 2px rgba(224,55,48,.12);
}
.module-launcher-iinspectit:hover,
.module-launcher-iinspectit:focus-visible {
  border-color: rgba(81,164,255,.82);
  background:
    radial-gradient(circle at 50% 42%, rgba(53,139,235,.09), transparent 58%),
    #0d1115;
  box-shadow: 0 18px 38px rgba(0,0,0,.34), 0 0 0 2px rgba(56,142,236,.13);
}
.module-launcher-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0,0,0,.38));
  pointer-events: none;
}
.module-launcher-logo-ilockit {
  width: min(520px, 94%);
  max-height: 255px;
}
.module-launcher-logo-iinspectit {
  width: min(520px, 94%);
  max-height: 268px;
}
.module-launcher-status {
  margin-top: 12px;
  margin-bottom: 0;
}

/* IInspectIT module dashboard */
.inspectit-dashboard-brand {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
}
.inspectit-dashboard-brand img {
  display: block;
  width: min(520px, 94%);
  max-height: 255px;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0,0,0,.34));
}
.inspectit-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.inspectit-dashboard-card {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  min-height: 132px;
  padding: 20px;
  border: 1px solid rgba(71,145,227,.34);
  border-radius: 18px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(65,139,226,.11), rgba(65,139,226,.025)), #11161b;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 16px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.035);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.inspectit-dashboard-card:hover,
.inspectit-dashboard-card:focus-visible {
  transform: translateY(-2px);
  outline: none;
  border-color: rgba(93,168,251,.72);
  background: linear-gradient(145deg, rgba(65,139,226,.18), rgba(65,139,226,.045)), #11161b;
}
.inspectit-dashboard-icon {
  font-size: 34px;
}
.inspectit-dashboard-copy strong,
.inspectit-dashboard-copy small {
  display: block;
}
.inspectit-dashboard-copy strong {
  font-size: 19px;
}
.inspectit-dashboard-copy small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.inspectit-dashboard-arrow {
  color: #9fc9f8;
  font-size: 24px;
}

@media (max-width: 820px) {
  .platform-description-panel {
    margin-bottom: 12px;
    padding: 13px 16px;
  }
  .module-launcher-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .module-launcher {
    min-height: 150px;
    padding: 8px 12px;
    border-radius: 17px;
  }
  .module-launcher-logo-ilockit {
    width: min(330px, 84vw);
    max-height: 142px;
  }
  .module-launcher-logo-iinspectit {
    width: min(330px, 84vw);
    max-height: 149px;
  }
  .inspectit-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .platform-description-panel {
    margin-top: 0;
    margin-bottom: 7px;
    padding: 8px 14px;
    border-radius: 15px;
  }
  .platform-description-panel h1 { font-size: 20px; }
  .platform-description-panel p { margin-top: 5px; font-size: 12.5px; line-height: 1.42; }
  .platform-description-panel .platform-description-cta { margin-top: 5px; }
  .module-launcher-grid {
    margin-top: 0;
    gap: 8px;
  }
  .module-launcher {
    min-height: 0;
    padding: 6px 9px;
    border-radius: 15px;
  }
  .module-launcher-ilockit {
    height: 136px;
  }
  .module-launcher-iinspectit {
    height: 136px;
  }
  .module-launcher-logo-ilockit {
    width: min(244px, 72vw);
    max-height: 130px;
  }
  .module-launcher-logo-iinspectit {
    width: min(244px, 72vw);
    max-height: 130px;
  }
  .module-launcher-status {
    margin-top: 7px;
    min-height: 22px;
    font-size: 10px;
  }
  .inspectit-dashboard-brand {
    min-height: 96px;
    justify-content: center;
    margin-bottom: 7px;
  }
  .inspectit-dashboard-brand img {
    width: min(320px, 88vw);
    max-height: 96px;
  }
  .inspectit-dashboard-card {
    min-height: 88px;
    padding: 13px 14px;
    border-radius: 14px;
    gap: 11px;
  }
  .inspectit-dashboard-icon { font-size: 27px; }
  .inspectit-dashboard-copy strong { font-size: 15px; }
  .inspectit-dashboard-copy small { font-size: 11px; margin-top: 4px; }
  .inspectit-dashboard-arrow { font-size: 20px; }
}

@media (max-width: 390px) {
  .module-launcher-ilockit { height: 128px; }
  .module-launcher-iinspectit { height: 128px; }
  .module-launcher-logo-ilockit { width: min(226px, 70vw); }
  .module-launcher-logo-iinspectit { width: min(226px, 70vw); }
}

/* v4.00.04 TEST — unified icon control header + tighter mobile launcher */
.logo-topbar {
  min-height: 242px;
  padding-left: 18px;
  padding-right: 18px;
}
.brand-logo-image {
  width: clamp(430px, 34vw, 555px);
  max-height: 252px;
}
.topbar-controls {
  position: absolute;
  z-index: 4;
  right: 18px;
  top: 14px;
  transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-control {
  appearance: none;
  -webkit-appearance: none;
  width: 64px;
  height: 62px;
  padding: 7px 6px 6px;
  border: 1px solid #39434d;
  border-radius: 13px;
  color: #f1f4f7;
  background: linear-gradient(180deg, #1a2026 0%, #10151a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 22px rgba(0,0,0,.25);
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.topbar-control:hover,
.topbar-control:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(125,163,207,.72);
  background: linear-gradient(180deg, #252d35 0%, #171d23 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 24px rgba(0,0,0,.3), 0 0 0 2px rgba(67,142,228,.08);
}
.topbar-control-icon {
  width: 23px;
  height: 23px;
  display: block;
  flex: 0 0 auto;
}
.topbar-control-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: .015em;
}
.topbar-control-scan { color: #dfe9f3; }
.topbar-control-home { color: #f4f6f8; }
.topbar-control-user.signed-in {
  border-color: rgba(68,143,229,.5);
  color: #bcd9fb;
}
.topbar-control-user.signed-in .topbar-control-label {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.05;
  text-align: center;
}
.topbar-control-settings.available {
  border-color: rgba(216,96,74,.45);
}

/* The topbar now owns Settings, so page-heading copies are unnecessary. */
.admin-heading-actions .admin-settings-button { display: none !important; }

.topbar-profile-modal {
  width: min(430px, 100%);
}
.topbar-profile-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.topbar-profile-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79,143,232,.42);
  border-radius: 12px;
  color: #bcd9fb;
  background: rgba(79,143,232,.09);
}
.topbar-profile-avatar .topbar-control-icon { width: 25px; height: 25px; }
.topbar-profile-identity strong,
.topbar-profile-identity small { display: block; }
.topbar-profile-identity small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.topbar-profile-help { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.topbar-profile-menu-actions { display: grid; gap: 9px; }

@media (max-width: 1220px) and (min-width: 821px) {
  .topbar-control { width: 48px; height: 48px; padding: 0; }
  .topbar-control-label { display: none; }
  .brand-logo-image { width: clamp(390px, 39vw, 485px); }
}

@media (max-width: 820px) {
  .logo-topbar {
    min-height: 172px;
    padding: max(6px, env(safe-area-inset-top)) 8px 5px;
    align-items: center;
  }
  .brand-logo-button { margin: 0; }
  .brand-logo-image {
    width: min(270px, 66vw);
    max-height: 148px;
  }
  .topbar-controls {
    inset: 0;
    right: auto;
    top: 0;
    transform: none;
    display: block;
    pointer-events: none;
  }
  .topbar-control {
    position: absolute;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 10px;
    pointer-events: auto;
  }
  .topbar-control:hover,
  .topbar-control:focus-visible { transform: none; }
  .topbar-control-icon { width: 20px; height: 20px; }
  .topbar-control-label { display: none; }
  .topbar-control-scan { left: 10px; top: 12px; }
  .topbar-control-settings { left: 10px; top: 58px; }
  .topbar-control-home { right: 10px; top: 12px; }
  .topbar-control-user { right: 10px; top: 58px; }
  .topbar-controls:not(:has(.topbar-control-scan)) .topbar-control-settings { top: 12px; }
}

@media (max-width: 560px) {
  .logo-topbar { min-height: 164px; }
  .brand-logo-image { width: min(258px, 64vw); max-height: 142px; }
  .module-launcher-ilockit,
  .module-launcher-iinspectit { height: 126px; }
  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    width: min(230px, 70vw);
  }
  .module-launcher-logo-ilockit { max-height: 120px; }
  .module-launcher-logo-iinspectit { max-height: 125px; }
}

@media (max-width: 390px) {
  .logo-topbar { min-height: 158px; }
  .brand-logo-image { width: min(236px, 62vw); max-height: 136px; }
  .topbar-control { width: 38px; min-width: 38px; height: 38px; min-height: 38px; }
  .topbar-control-scan { left: 8px; top: 10px; }
  .topbar-control-settings { left: 8px; top: 53px; }
  .topbar-control-home { right: 8px; top: 10px; }
  .topbar-control-user { right: 8px; top: 53px; }
  .module-launcher-ilockit,
  .module-launcher-iinspectit { height: 120px; }
  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit { width: min(215px, 69vw); }
}

/* v4.00.05 TEST — desktop top-right controls + visually matched module logo sizing */
@media (min-width: 821px) {
  .topbar-controls { top: 14px; right: 18px; transform: none; }
  .module-launcher-grid { align-items: stretch; }
  .module-launcher { min-height: 286px; }
}

/* v4.00.06 TEST — LOTO-style IInspectIT dashboard + desktop back control */
.desktop-topbar-back {
  display: none;
}

.inspectit-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.inspectit-action-card {
  border-color: rgba(55,139,232,.48);
  background: linear-gradient(145deg, rgba(55,139,232,.12), rgba(255,255,255,.015)), var(--panel);
}
.inspectit-action-card:hover,
.inspectit-action-card:focus-visible {
  outline: none;
  border-color: rgba(81,164,255,.78);
  background: linear-gradient(145deg, rgba(55,139,232,.18), rgba(255,255,255,.02)), var(--panel);
}

@media (min-width: 821px) {
  .desktop-topbar-back {
    display: inline-flex;
    position: absolute;
    z-index: 5;
    left: 18px;
    top: 14px;
    min-height: 62px;
    padding: 0 20px;
    align-items: center;
    justify-content: center;
    border-color: #39434d;
    border-radius: 13px;
    background: linear-gradient(180deg, #1a2026 0%, #10151a 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 22px rgba(0,0,0,.25);
  }
  .desktop-topbar-back:hover,
  .desktop-topbar-back:focus-visible {
    outline: none;
    border-color: rgba(125,163,207,.72);
    background: linear-gradient(180deg, #252d35 0%, #171d23 100%);
  }
  .mobile-main-back-row {
    display: none !important;
  }
}

@media (max-width: 820px) {
  .desktop-topbar-back {
    display: none !important;
  }
  .mobile-main-back-row {
    display: flex;
  }
}

@media (max-width: 520px) {
  .inspectit-action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* v4.00.07 TEST — global Settings control is rendered only for authenticated Admin sessions. */

/* v4.00.08 TEST — mobile-only ISafetyOS shell refinement.
   Desktop rules are intentionally left untouched/locked. */
@media (max-width: 820px) {
  .logo-topbar {
    min-height: 154px;
    padding: max(7px, env(safe-area-inset-top)) 8px 5px;
    align-items: flex-end;
    justify-content: center;
  }

  .brand-logo-button {
    width: 100%;
    margin: 0;
    padding-top: 34px;
  }

  .brand-logo-image {
    width: min(246px, 68vw);
    max-height: 118px;
  }

  /* One clean icon row across the top-right on phones/tablets. */
  .topbar-controls {
    inset: auto;
    top: max(7px, env(safe-area-inset-top));
    right: 8px;
    left: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
  }

  .topbar-control,
  .topbar-control-scan,
  .topbar-control-home,
  .topbar-control-user,
  .topbar-control-settings {
    position: static;
    inset: auto;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 10px;
  }

  .topbar-control-icon {
    width: 19px;
    height: 19px;
  }

  /* The mobile Back button remains in page content, but is kept compact. */
  .mobile-main-back-row {
    margin-bottom: 8px;
  }

  .mobile-main-back-row .btn {
    min-height: 42px;
    padding: 9px 14px;
  }

  .main {
    padding-top: 8px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 28px;
  }

  /* Equal, compact launcher panels so both module logos stay visible together. */
  .module-launcher-grid {
    gap: 8px;
    margin-top: 0;
  }

  .module-launcher {
    height: 124px;
    min-height: 124px;
    padding: 5px 8px;
    border-radius: 15px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    width: min(226px, 66vw);
    max-height: 116px;
  }

  .module-launcher-status {
    min-height: 18px;
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 10px;
  }

  /* Match the LOTO/IInspectIT dashboard density on phones. */
  .hero {
    margin-top: 3px;
    margin-bottom: 10px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero p {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
  }

  .status-strip {
    margin: 8px 0 12px;
  }

  .action-grid,
  .inspectit-action-grid {
    gap: 9px;
  }

  .action-card,
  .inspectit-action-card {
    min-height: 112px;
    padding: 14px;
    border-radius: 15px;
  }

  .action-card .emoji {
    margin-bottom: 9px;
    font-size: 24px;
  }

  .action-card strong {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .logo-topbar {
    min-height: 148px;
  }

  .brand-logo-button {
    padding-top: 32px;
  }

  .brand-logo-image {
    width: min(236px, 66vw);
    max-height: 112px;
  }

  .topbar-controls {
    top: max(6px, env(safe-area-inset-top));
    right: 7px;
    gap: 5px;
  }

  .topbar-control,
  .topbar-control-scan,
  .topbar-control-home,
  .topbar-control-user,
  .topbar-control-settings {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 9px;
  }

  .topbar-control-icon {
    width: 18px;
    height: 18px;
  }

  .module-launcher {
    height: 118px;
    min-height: 118px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    width: min(216px, 65vw);
    max-height: 110px;
  }

  .module-launcher-status {
    margin-top: 5px;
  }

  .action-card,
  .inspectit-action-card {
    min-height: 104px;
    padding: 12px;
  }
}

@media (max-width: 390px) {
  .logo-topbar {
    min-height: 142px;
  }

  .brand-logo-image {
    width: min(218px, 64vw);
    max-height: 106px;
  }

  .topbar-controls {
    gap: 4px;
  }

  .topbar-control,
  .topbar-control-scan,
  .topbar-control-home,
  .topbar-control-user,
  .topbar-control-settings {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .module-launcher {
    height: 112px;
    min-height: 112px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    width: min(202px, 64vw);
    max-height: 104px;
  }
}


/* v4.00.09 TEST — mobile-only balance pass.
   Desktop (821px+) remains locked exactly as approved in v4.00.08.
   Phones/tablets: split the global controls left/right, slightly enlarge branding,
   and tighten launcher spacing while keeping both modules visible together. */
@media (max-width: 820px) {
  .logo-topbar {
    min-height: 150px;
    padding: max(6px, env(safe-area-inset-top)) 8px 3px;
  }

  .brand-logo-button {
    padding-top: 28px;
  }

  .brand-logo-image {
    width: min(258px, 70vw);
    max-height: 122px;
  }

  /* Let the nav span the header, then pin each control to its own side. */
  .topbar-controls {
    inset: 0;
    display: block;
    pointer-events: none;
  }

  .topbar-control,
  .topbar-control-scan,
  .topbar-control-home,
  .topbar-control-user,
  .topbar-control-settings {
    position: absolute;
    top: max(7px, env(safe-area-inset-top));
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    pointer-events: auto;
  }

  .topbar-control-scan {
    left: 8px;
    right: auto;
  }

  .topbar-control-settings {
    left: 52px;
    right: auto;
  }

  .topbar-control-home {
    right: 52px;
    left: auto;
  }

  .topbar-control-user {
    right: 8px;
    left: auto;
  }

  .main {
    padding-top: 5px;
  }

  .module-launcher-grid {
    gap: 7px;
  }

  .module-launcher {
    height: 122px;
    min-height: 122px;
    padding: 3px 7px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    width: min(238px, 70vw);
    max-height: 116px;
  }

  .module-launcher-status {
    margin-top: 4px;
  }
}

@media (max-width: 520px) {
  .logo-topbar {
    min-height: 146px;
  }

  .brand-logo-button {
    padding-top: 27px;
  }

  .brand-logo-image {
    width: min(250px, 70vw);
    max-height: 118px;
  }

  .topbar-control,
  .topbar-control-scan,
  .topbar-control-home,
  .topbar-control-user,
  .topbar-control-settings {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .topbar-control-scan { left: 7px; }
  .topbar-control-settings { left: 48px; }
  .topbar-control-home { right: 48px; }
  .topbar-control-user { right: 7px; }

  .module-launcher {
    height: 118px;
    min-height: 118px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    width: min(232px, 71vw);
    max-height: 112px;
  }
}

@media (max-width: 390px) {
  .logo-topbar {
    min-height: 140px;
  }

  .brand-logo-image {
    width: min(232px, 68vw);
    max-height: 111px;
  }

  .topbar-control-scan { left: 6px; }
  .topbar-control-settings { left: 46px; }
  .topbar-control-home { right: 46px; }
  .topbar-control-user { right: 6px; }

  .module-launcher {
    height: 112px;
    min-height: 112px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    width: min(216px, 69vw);
    max-height: 106px;
  }
}


/* v4.00.10 TEST — mobile-only header brand prominence.
   Desktop (821px+) stays locked. Enlarge only the ISafetyOS header logo so the
   platform identity clearly outranks the module logos without changing launcher sizes. */
@media (max-width: 820px) {
  .logo-topbar {
    min-height: 162px;
  }

  .brand-logo-button {
    padding-top: 25px;
  }

  .brand-logo-image {
    width: min(306px, 78vw);
    max-height: 142px;
  }
}

@media (max-width: 520px) {
  .logo-topbar {
    min-height: 158px;
  }

  .brand-logo-button {
    padding-top: 24px;
  }

  .brand-logo-image {
    width: min(286px, 76vw);
    max-height: 136px;
  }
}

@media (max-width: 390px) {
  .logo-topbar {
    min-height: 151px;
  }

  .brand-logo-image {
    width: min(260px, 74vw);
    max-height: 126px;
  }
}

/* v4.00.11 TEST — mobile-only master-brand emphasis.
   Desktop (821px+) remains locked. Increase only the ISafetyOS header logo so
   the platform brand is clearly more prominent than the module launch logos. */
@media (max-width: 820px) {
  .logo-topbar {
    min-height: 188px;
  }

  .brand-logo-button {
    padding-top: 30px;
  }

  .brand-logo-image {
    width: min(358px, 84vw);
    max-height: 168px;
  }
}

@media (max-width: 520px) {
  .logo-topbar {
    min-height: 180px;
  }

  .brand-logo-button {
    padding-top: 29px;
  }

  .brand-logo-image {
    width: min(340px, 82vw);
    max-height: 160px;
  }
}

@media (max-width: 390px) {
  .logo-topbar {
    min-height: 166px;
  }

  .brand-logo-button {
    padding-top: 28px;
  }

  .brand-logo-image {
    width: min(304px, 80vw);
    max-height: 148px;
  }
}


/* v4.00.12 TEST — mobile-only module artwork blend.
   Desktop (821px+) remains locked. Match each mobile launcher panel to the
   baked-in dark background of its logo artwork so the image rectangle disappears. */
@media (max-width: 820px) {
  .module-launcher-ilockit {
    background: #050505;
  }

  .module-launcher-iinspectit {
    background: #07090a;
  }

  .module-launcher-ilockit:hover,
  .module-launcher-ilockit:focus-visible {
    background: #050505;
  }

  .module-launcher-iinspectit:hover,
  .module-launcher-iinspectit:focus-visible {
    background: #07090a;
  }
}


/* v4.00.13 TEST — mobile-only header artwork blend.
   Desktop stays locked on the approved WebP asset. Phones/tablets use a
   transparent-background copy of the same approved ISafetyOS artwork so the
   rectangular image background disappears into the application header. */
@media (max-width: 820px) {
  .brand-logo-image {
    content: url('/isafetyos-logo-mobile.webp');
  }
}


/* v4.00.14 TEST — desktop-only logo background blend.
   Mobile/tablet (820px and below) is locked exactly as approved in v4.00.13.
   Desktop uses transparent-background copies of all three approved logos so
   their artwork blends directly into the ISafetyOS header/module panels. */
@media (min-width: 821px) {
  .brand-logo-image {
    content: url('/isafetyos-logo-mobile.webp');
  }

  .module-launcher-logo-ilockit {
    content: url('/ilockit-module-logo-transparent.webp');
  }

  .module-launcher-logo-iinspectit {
    content: url('/iinspectit-module-logo-transparent.webp');
  }
}

/* v4.00.17 TEST — desktop-only ISafetyOS header brand enlargement.
   Mobile/tablet stays locked. Increase only the master ISafetyOS header artwork;
   module logos, top-right controls, page content, and operational logic are unchanged. */
@media (min-width: 821px) {
  .logo-topbar {
    min-height: 292px;
  }

  .brand-logo-image {
    width: clamp(560px, 43vw, 680px);
    max-height: 276px;
  }
}

/* v4.00.19 TEST — module launcher height correction only.
   Keeps the current approved ILockIT / IInspectIT artwork unchanged.
   Adds vertical room so the full module-logo frames are not clipped. */
@media (min-width: 821px) {
  .module-launcher {
    min-height: 320px;
    height: 320px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    max-height: 300px;
  }
}

@media (max-width: 820px) {
  .module-launcher {
    height: 138px;
    min-height: 138px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    max-height: 132px;
  }
}

@media (max-width: 520px) {
  .module-launcher {
    height: 134px;
    min-height: 134px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    max-height: 128px;
  }
}

@media (max-width: 390px) {
  .module-launcher {
    height: 128px;
    min-height: 128px;
  }

  .module-launcher-logo-ilockit,
  .module-launcher-logo-iinspectit {
    max-height: 122px;
  }
}
