body { margin: 0; }
body.locked .app { display: none; }
.gate { min-height: 100dvh; display: grid; place-items: center; background: radial-gradient(120% 120% at 80% 0%, #0B2340 0%, #07172B 60%); padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); box-sizing: border-box; }
.gate[hidden] { display: none !important; }
.gate-card { width: min(420px, 100%); background: var(--panel); color: var(--ink); border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); }
.gate-head { background: #07172B; color: #fff; padding: 22px 24px 18px; display: flex; gap: 14px; align-items: center; }
.gate-head img { width: 132px; height: auto; aspect-ratio: 3 / 2; object-fit: contain; flex-shrink: 0; border-radius: 6px; }
.gate-head h1 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.5rem; line-height: 1; margin: 0; letter-spacing: .02em; }
.gate-head p { margin: 6px 0 0; font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: #00D5F5; font-weight: 600; }
.gate-stripe { height: 5px; background: var(--wo-gradient-line); }
.gate-body { padding: 22px 24px 24px; display: grid; gap: 14px; }
.gate-body form { display: grid; gap: 12px; }
.gate-body .btn-primary { width: 100%; padding: 11px 14px; font-size: .95rem; }
.gate-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .82rem; }
.gate-msg { font-size: .84rem; border-radius: 6px; padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--line); }
.gate-msg.bad { border-color: var(--bad); color: var(--bad); }
.gate-msg.ok { border-color: var(--ok); color: var(--ok); }
.gate-msg:empty { display: none; }
.gate-foot { font-size: .74rem; color: var(--muted); text-align: center; }
.me { display: grid; gap: 6px; }
.me b { color: var(--on-navy); }
.me .role { font-family: var(--mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: #00D5F5; }
.me-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.me-actions button { appearance: none; border: 0; background: none; color: var(--on-navy-soft); padding: 0; cursor: pointer; font-size: .74rem; text-decoration: underline; }
.me-actions button:hover { color: #fff; }
.import-box { border: 2px dashed var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 8px; justify-items: start; }

/* mechanic logins: the app is theirs alone, no switching person or going to the office view */
.role-mechanic .tk-foot { display: none; }
.role-mechanic .tk-me { pointer-events: none; }
.mech-signout { position: fixed; right: 12px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); z-index: 40; appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .8rem; cursor: pointer; }

/* access picker on Team & logins */
.acc { display: grid; gap: 12px; }
.acc-group { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px 10px; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 6px 12px; }
.acc-group legend { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 4px; }
.acc-opt { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.acc-opt.on { background: color-mix(in srgb, var(--blue) 8%, transparent); font-weight: 600; }
.acc-opt input { width: 18px; height: 18px; }
.gate-keep { display: flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; }
.gate-keep input { width: auto; margin: 0; }

/* customer login (/portal) */
.portal { min-height: 100dvh; background: var(--bg); color: var(--ink); }
.portal[hidden] { display: none; }
.pt-wrap { width: min(880px, 100%); margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.pt-head { background: #07172B; color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.pt-bar { display: flex; align-items: center; gap: 14px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.pt-bar img { width: 72px; height: auto; border-radius: 6px; }
.pt-who { display: grid; gap: 2px; min-width: 0; }
.pt-who span { font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: #00D5F5; font-weight: 600; }
.pt-who b { overflow-wrap: anywhere; }
.pt-links { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.pt-links .link { color: #D9DDE3; font-size: .82rem; text-decoration: underline; }
.pt-links .link:hover { color: #fff; }
.pt-main { display: grid; gap: 18px; padding-top: 20px; padding-bottom: 40px; }
.pt-hi { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.9rem; margin: 0; letter-spacing: .01em; }
.pt-sec { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 12px; }
.pt-sec h2 { margin: 0; font-size: 1.05rem; }
.pt-sec .note { margin: 0; color: var(--muted); font-size: .88rem; }
.pt-cars { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pt-car { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; align-content: start; background: var(--panel-2); }
.pt-rego { font-family: var(--mono); font-weight: 700; font-size: 1.1rem; letter-spacing: .06em; }
.pt-vname { color: var(--muted); font-size: .88rem; margin-top: -4px; }
.pt-car dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: .86rem; }
.pt-car dt { color: var(--muted); }
.pt-car dd { margin: 0; }
.pt-car .btn { justify-self: start; }
.pt-list { display: grid; }
.pt-item { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pt-item:first-child { border-top: 0; padding-top: 0; }
.pt-item > div:first-child { min-width: 0; flex: 1 1 220px; }
.pt-sub { color: var(--muted); font-size: .86rem; margin-top: 2px; overflow-wrap: anywhere; }
.pt-sub .ok, .pt-sub.ok { color: var(--ok); font-weight: 600; }
.pt-sub .bad, .pt-sub.bad { color: var(--bad); }
.pt-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pt-chip { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; border: 1px solid currentColor; white-space: nowrap; }
.pt-chip.ok { color: var(--ok); } .pt-chip.bad { color: var(--bad); } .pt-chip.warn { color: var(--warn); } .pt-chip.blue { color: var(--blue); }
.pt-form { display: grid; gap: 12px; }
.pt-form .btn-primary { justify-self: start; padding: 11px 18px; font-size: .95rem; }
.pt-fs { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; margin: 0; }
.pt-fs legend { font-size: .8rem; font-weight: 600; padding: 0 4px; }
.pt-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; }
.pt-pick { display: flex; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; }
.pt-pick input { width: auto; margin: 0; }
.pt-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .84rem; padding: 4px 2px; }
.pt-foot b { color: var(--ink); }
body.locked .portal ~ .app, body.portal-mode .app { display: none; }

/* customer login screen: styled like the public website */
body.portal-login .gate { background: radial-gradient(90% 120% at 100% 100%, rgba(8, 124, 255, .55) 0%, transparent 60%), linear-gradient(135deg, #07172B 0%, #0B2340 50%, #0643CF 100%); grid-template-columns: minmax(0, 520px) minmax(0, 420px); gap: 64px; align-content: center; justify-content: center; place-items: center stretch; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
body.portal-login .gate > * { max-width: 560px; }
body.portal-login .gate-card { border-radius: 14px; border-top: 5px solid #087CFF; box-shadow: 0 26px 60px rgba(0, 0, 0, 0.32); justify-self: start; }
body.portal-login .gate-head { background: var(--panel); color: var(--ink); padding: 20px 24px 6px; }
body.portal-login .gate-head img { width: 132px; height: auto; background: #07172B; padding: 6px 8px; }
body.portal-login .gate-links button:first-child { display: none; }
body.portal-login .gate-links { justify-content: flex-end; }
body.portal-login .gate-head h1 { font-size: 1.5rem; }
body.portal-login .gate-head p { color: #087CFF; }
body.portal-login .gate-stripe { display: none; }
.pg-intro { color: #fff; display: grid; gap: 14px; justify-self: end; width: 100%; }
.pg-back { color: #D9DDE3; font-size: .85rem; font-weight: 600; text-decoration: none; }
.pg-back:hover { color: #fff; text-decoration: underline; }
.pg-eyebrow { font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #00D5F5; }
.pg-title { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1; margin: 0; letter-spacing: .01em; }
.pg-intro p { margin: 0; color: #E8F4FF; font-size: 1.05rem; max-width: 40ch; }
.pg-feats { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 10px; }
.pg-feats li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; }
.pg-feats li::before { content: "\2713"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--wo-gradient); color: #fff; font-size: 12px; flex: 0 0 22px; }
.pg-intro .pg-help { font-size: .92rem; }
.pg-help a { color: #fff; font-weight: 700; }
body.portal-login .gate[hidden] { display: none !important; }
@media (max-width: 820px) {
  body.portal-login .gate { grid-template-columns: minmax(0, 1fr); gap: 22px; align-content: start; padding-top: max(20px, env(safe-area-inset-top, 0px)); }
  body.portal-login .gate-card, .pg-intro { justify-self: center; width: 100%; max-width: 480px; }
  .pg-feats, .pg-intro .pg-help { display: none; }
  .pg-intro p { font-size: .95rem; }
}
.pt-sub-h { margin: 6px 0 0; font-size: .95rem; }
.pt-addcar { border-top: 1px solid var(--line); padding-top: 12px; }
.pt-sec > div > #pt-addcar { justify-self: start; }

/* "Get the app" tip on iPhone Safari */
.install-tip { position: fixed; z-index: 90; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #07172B; color: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); font-size: .88rem; }
.install-tip img { border-radius: 8px; flex: 0 0 auto; }
.install-tip div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.install-tip .ios-share { display: inline-block; font-size: 1.05em; }
.install-tip button { appearance: none; border: 0; background: none; color: #D9DDE3; font-size: 1.4rem; line-height: 1; padding: 4px 6px; cursor: pointer; }
.mech-alerts { position: fixed; right: 100px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); z-index: 40; appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .8rem; cursor: pointer; }

/* login log */
#lg-table tr.lg-bad td { background: #fff5f5; }
#lg-table td.mono { font-variant-numeric: tabular-nums; color: #5b6472; }

/* Workshop Office style 3: sentence case, rounded, crisp (see app/p1_head.html) */
.gate-head h1, .gate-head p, .me .role, .acc-group legend, .pt-who span, .pt-hi, .pg-eyebrow, .pg-title { text-transform: none !important; letter-spacing: 0 !important; }
.gate-head h1 { font-weight: 900; letter-spacing: -0.02em !important; }
.gate-card { border-radius: 22px; }
.gate-stripe { background: var(--wo-blue, #087CFF) !important; height: 3px !important; }
