/* Shared building blocks used by both the landing page and the app. */

/* Header */
.bar { display: flex; align-items: center; gap: 18px; padding: 18px 0; }
.bar .spacer { flex: 1; }
.logo-link { text-decoration: none; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 19px; letter-spacing: -0.03em; }
.mark { width: 28px; height: 28px; flex: none; }
.bar nav { display: flex; gap: 4px; margin-left: auto; }
.bar nav a { text-decoration: none; padding: 8px 14px; border-radius: var(--r-pill); color: var(--muted); font-size: 15px; font-weight: 500; transition: background .2s, color .2s; }
.bar nav a:hover, .bar nav a.active { background: var(--glass-strong); color: var(--text); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); color: var(--text); cursor: pointer; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.icon-btn svg { width: 18px; height: 18px; }

/* Surfaces */
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border: 1px solid transparent; border-radius: var(--r-pill); background: var(--pill-bg); color: var(--pill-text); font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer; transition: transform .25s var(--ease), background .2s, opacity .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn-glass { background: var(--glass-strong); color: var(--text); border-color: var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Status tags */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 9px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; white-space: nowrap; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, transparent); }
.tag svg { width: 15px; height: 15px; }
.tag.ok { color: var(--ok); } .tag.attention { color: var(--warn); } .tag.down { color: var(--bad); } .tag.none { color: var(--none); }

/* Fleet board: one block per machine */
.blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; margin: 22px 0 14px; }
.blk { display: block; aspect-ratio: 1; border-radius: 18px; background: var(--none); opacity: .55; transition: transform .25s var(--ease); }
a.blk:hover { transform: translateY(-3px); }
.blk.ok { background: var(--ok); opacity: .85; } .blk.attention { background: var(--warn); opacity: 1; } .blk.down { background: var(--bad-bg); opacity: 1; box-shadow: 0 0 36px rgba(255, 60, 50, .45); }
.blocks.intro .blk { animation: pop .6s var(--ease) backwards; animation-delay: calc(var(--i) * 70ms); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--none); }
.legend .ok i { background: var(--ok); } .legend .attention i { background: var(--warn); } .legend .down i { background: var(--bad-bg); }

/* Roster */
.roster { list-style: none; margin: 0; padding: 6px 0; overflow: hidden; }
.rrow { display: grid; grid-template-columns: minmax(0, 2.2fr) 160px minmax(0, 1.2fr) 80px 110px; gap: 14px; align-items: center; padding: 14px 22px; text-decoration: none; color: inherit; border-top: 1px solid var(--line); }
.roster > li:first-child .rrow, .roster > li:first-child.rrow { border-top: 0; }
a.rrow:hover { background: var(--glass); }
.rrow.head { font-size: 13px; color: var(--muted); padding-block: 12px; border-top: 0; }
.rrow.m4 { grid-template-columns: 2fr 1.5fr 1fr 1fr; }
.rrow.down .nm { color: var(--bad); }
.nm { font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.late { color: var(--bad); font-weight: 600; }
.hot { color: var(--bad); }
@media (max-width: 720px) {
  .rrow { grid-template-columns: 1fr auto; row-gap: 4px; padding: 14px 16px; }
  .rrow.head { display: none; }
  .c-last, .c-hrs, .c-pm { display: none; }
  .rrow.m4 > :nth-child(n+3) { display: none; }
  .rrow.m4 { grid-template-columns: 1fr auto; }
}

/* History feed */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feed > li { padding: 18px 20px; border-radius: var(--r-card); background: var(--glass); border: 1px solid var(--line); }
.feed > li.down { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.feed .top { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 4px; }
.feed .who { font-weight: 600; } .feed .who a { text-decoration: none; }
.feed p { margin-top: 8px; }
.fails { margin: 10px 0 0; padding-left: 18px; color: var(--bad); }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photos img { width: 88px; height: 88px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }

/* "Do not operate" tag: the one loud element. */
.loto { position: relative; width: 230px; padding: 38px 20px 20px; border-radius: 14px; background: var(--bad-bg); color: #fff; text-align: center; transform-origin: 50% 0; animation: swing 2.4s var(--ease) 1; box-shadow: 0 20px 50px rgba(229, 35, 26, .35); }
.loto::before { content: ""; position: absolute; top: 12px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.loto b { display: block; font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; text-transform: uppercase; }
.loto span { display: block; margin-top: 12px; font-size: 14px; line-height: 1.35; opacity: .95; }
@keyframes swing { 0% { transform: rotate(-9deg); } 20% { transform: rotate(7deg); } 40% { transform: rotate(-4deg); } 60% { transform: rotate(2.5deg); } 80% { transform: rotate(-1deg); } 100% { transform: rotate(0); } }

/* Unit tile (stands in for a machine photo) */
.tile { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--line); font: 800 22px/1 var(--font); letter-spacing: -0.02em; color: var(--accent); }

/* Sticker: fixed light colors so it prints and scans the same in either theme. Sized in em: set --st-w. */
.sticker { --st-w: 220px; width: var(--st-w); font-size: calc(var(--st-w) / 13.75); border-radius: .9em; overflow: hidden; background: #fff; color: #0a0a0c; border: .19em solid #0a0a0c; text-align: center; break-inside: avoid; }
.st-head { display: flex; align-items: center; justify-content: center; gap: .5em; padding: .5em; background: #ffc400; font-weight: 800; font-size: 1.06em; letter-spacing: -0.02em; }
.st-head .mark { width: 1.4em; height: 1.4em; }
.st-body { padding: .8em .75em .4em; }
.qr { display: grid; place-items: center; min-height: 8em; }
.qr img, .qr canvas { max-width: 100%; height: auto; }
.st-who { display: flex; align-items: center; gap: .6em; margin-top: .55em; text-align: left; justify-content: center; }
.st-who .tile { width: 2.4em; height: 2.4em; flex: none; border-radius: .5em; border: .06em solid #ccc; color: #555; }
.st-name { font-weight: 700; font-size: .98em; line-height: 1.2; }
.st-id { font-size: .85em; color: #555; }
.st-cta { padding: .5em; background: #0a0a0c; color: #ffc400; font-weight: 700; font-size: .88em; }

/* Notices */
.banner { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 20px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--glass); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--accent); }
.empty { padding: 36px 24px; text-align: center; color: var(--muted); }
.empty a { color: var(--text); }

/* Icons: stroke-based, inherit text color */
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pf-btn .ic { stroke-width: 2.2; }

/* ---- v0.3.1: glass depth, floating nav, two-tone type, dialogs, chips ---- */
.dim { color: var(--muted); }
.glass { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 0.5px rgba(255, 255, 255, 0.04), 0 24px 60px -36px rgba(0, 0, 0, 0.7); }
:root[data-theme="light"] .glass { box-shadow: inset 0 1px 0 #fff, 0 20px 50px -34px rgba(10, 10, 12, 0.25); }
.btn { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), background .2s, opacity .2s; }

/* Floating glass nav capsule that stays put while scrolling */
#topbar, body.landing > header.bar { position: sticky; top: 10px; z-index: 30; }
.wrap.bar, body.landing > header.bar { margin-top: 10px; padding: 8px 10px 8px 20px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 16px 40px -24px rgba(0,0,0,.6); }
body.landing > header.bar { width: min(100% - 32px, var(--maxw)); }
.bar nav { margin-left: auto; }

/* Confirm dialog */
dialog.sheet-dialog { width: min(92vw, 420px); padding: 26px; margin: auto; color: var(--text); background: color-mix(in srgb, var(--bg) 82%, #fff 6%); border-radius: var(--r-tile); animation: dlg .35s cubic-bezier(.34, 1.56, .64, 1); }
dialog.sheet-dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); }
dialog.sheet-dialog h2 { font-size: 24px; letter-spacing: -0.03em; }
dialog.sheet-dialog p { margin-top: 8px; }
dialog.sheet-dialog .actions { margin-top: 22px; }
@keyframes dlg { from { transform: scale(.92); opacity: 0; } }
.btn-danger-solid { background: var(--bad-bg); color: #fff; }

/* Hold to confirm: fills as you press, releasing early cancels */
.btn.hold { position: relative; overflow: hidden; user-select: none; touch-action: none; }
.btn.hold::before { content: ""; position: absolute; inset: 0; background: var(--bad-bg); transform-origin: left; transform: scaleX(var(--hold, 0)); }
.btn.hold span { position: relative; }
.btn.hold.holding { color: #fff; }

/* Filter chips */
.listhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin-top: 36px; }
.listhead .section-title { margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; font: 600 14px var(--font); color: var(--muted); background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-pill); cursor: pointer; transition: all .25s cubic-bezier(.34, 1.56, .64, 1); }
.chip b { font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); background: var(--glass-strong); font-size: 12px; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--pill-bg); color: var(--pill-text); border-color: transparent; }
.chip.on b { background: rgba(128,128,128,.25); }
.empty-list { padding: 28px; text-align: center; color: var(--muted); }

/* Inspection checklist rows (used by the app and the landing page demo) */
.checklist { overflow: hidden; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .t { font-weight: 600; font-size: 17px; line-height: 1.3; }
.crit { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13px; color: var(--accent); font-weight: 600; }
.crit svg { width: 14px; height: 14px; }
.pf { display: flex; gap: 8px; }
.pf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 88px; min-height: 56px; padding: 0 14px; font: 700 16px var(--font); color: var(--text); background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: transform .2s var(--ease), background .2s; }
.pf-btn svg { width: 18px; height: 18px; }
.pf-btn:active { transform: scale(.96); }
.pf-btn.pass.on { background: var(--ok); color: #05150b; border-color: transparent; }
.pf-btn.fail.on { background: var(--bad-bg); color: #fff; border-color: transparent; }
.failnote { padding: 0 18px 16px; }
.failnote[hidden], [hidden] { display: none !important; }
@media (max-width: 520px) { .item { grid-template-columns: 1fr; } .pf-btn { flex: 1; } }


/* ---- v0.4 professional pass: calmer shapes, smaller controls, color only where it means something ---- */
.btn { min-height: 42px; padding: 0 20px; font-size: 15px; font-weight: 550; letter-spacing: -0.01em; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.icon-btn { width: 36px; height: 36px; }
.chip { min-height: 32px; font-size: 13px; }

/* Fleet strip: one thin tick per machine instead of big colored squares */
.blocks { display: flex; gap: 4px; margin: 20px 0 12px; }
.blk { flex: 1; min-width: 6px; max-width: 64px; aspect-ratio: auto; height: 10px; border-radius: 3px; opacity: .5; transition: transform .25s var(--ease), opacity .25s; }
.blk.ok { opacity: .9; } .blk.attention, .blk.down { opacity: 1; }
.blk.down { box-shadow: 0 0 18px rgba(255, 60, 50, .55); }
a.blk:hover { transform: scaleY(1.9); }
.blocks.intro .blk { animation: tick .6s var(--ease) backwards; animation-delay: calc(var(--i) * 70ms); }
@keyframes tick { from { transform: scaleX(0); transform-origin: left; opacity: 0; } }
.mini .blocks { display: flex; grid-template-columns: none; }

/* Unit tile: quiet monogram instead of a loud badge */
.tile { width: 44px; height: 44px; border-radius: 10px; font: 600 14px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; color: var(--muted); background: var(--glass); }

/* Pass / Fail: compact segmented control, tinted rather than solid */
.pf { gap: 6px; }
.pf-btn { min-width: 76px; min-height: 44px; padding: 0 14px; font: 600 15px var(--font); border-radius: 8px; background: var(--glass); color: var(--muted); }
.pf-btn.pass.on { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: var(--ok); }
.pf-btn.fail.on { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); border-color: var(--bad); }
.item { padding: 14px 18px; } .item .t { font-size: 16px; font-weight: 550; }
.checklist .item .pf-btn.on svg { stroke-width: 2.4; }

.tag { font-size: 13px; padding: 3px 10px 3px 8px; }
.display { font-weight: 450; }

/* Photo tiles */
.tile.photo { background-repeat: no-repeat; color: transparent; border-color: rgba(255,255,255,.14); }
.tile.lg { width: 76px; height: 76px; border-radius: 14px; font-size: 20px; }
.tile.sm { width: 36px; height: 36px; border-radius: 8px; }

/* Repair tracking */
.repair { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.rtag { padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; border: 1px solid currentColor; color: var(--warn); }
.repair.scheduled .rtag { color: var(--accent); } .repair.repaired .rtag { color: var(--ok); }
.dlg-fields { display: grid; gap: 4px; margin-top: 14px; }
.dlg-fields label { margin-top: 8px; }

/* Phones: the owner menu drops to its own row under the logo instead of running off the screen */
@media (max-width: 720px) {
  .wrap.bar { flex-wrap: wrap; gap: 6px 10px; padding: 8px 10px 8px 16px; border-radius: 26px; }
  .wrap.bar .logo-link { margin-right: auto; }
  .wrap.bar nav { order: 3; flex: 1 0 100%; margin-left: 0; gap: 2px; }
  .wrap.bar nav a { flex: 1; text-align: center; padding: 8px 4px; font-size: 14px; }
}
