.portal-body{ background:var(--paper); }
.portal-header{ background:#fff; border-bottom:1px solid var(--line-light); padding:14px 20px; }
.portal-header-inner{ max-width:820px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.portal-header-right{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
/* v1.203 S-11: the 13-link header row measured 981px on a 390px viewport —
   it now wraps to a second row, and the links carry a 36px touch floor. */
.portal-header-right a{ display:inline-flex; align-items:center; padding:8px 0; }

.portal-login-wrap{ min-height:calc(100vh - 60px); display:flex; align-items:center; justify-content:center; padding:24px 16px; }
.portal-login-card{ width:100%; max-width:360px; }

/* ---------- V34 Phase 2: segmented OTP input + login error shake ---------- */
.otp-row{ display:flex; gap:8px; justify-content:center; }
.otp-box{
  width:44px; height:52px; text-align:center; font-size:1.3rem; font-weight:600;
  font-family:'JetBrains Mono',monospace; color:var(--teal);
  border:1px solid var(--line-light); border-radius:8px; background:#fff;
  transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.otp-box:focus{ outline:none; border-color:var(--orange); box-shadow:0 0 0 3px rgba(246,152,16,.15); }
.login-shake{ animation:loginShake .4s ease; }
@keyframes loginShake{
  0%,100%{ transform:translateX(0); }
  20%{ transform:translateX(-7px); } 40%{ transform:translateX(6px); }
  60%{ transform:translateX(-4px); } 80%{ transform:translateX(3px); }
}
@media (max-width:360px){ .otp-box{ width:38px; height:48px; } .otp-row{ gap:6px; } }

.status-box{ margin-top:14px; background:var(--orange-tint); border-radius:8px; padding:12px 16px; }

.link-btn{ background:none; border:none; padding:0; color:var(--teal); text-decoration:underline; font-size:.82rem; cursor:pointer; font-family:inherit; }
.link-btn--danger{ color:#c0392b; font-weight:600; }

.collapsible{ display:none; margin-top:12px; padding-top:12px; border-top:1px solid var(--line-light); }
.collapsible.open{ display:block; }

/* ---------- V34 Phase 4: portal motion polish ----------
   Cards cascade in on load (capped stagger), the timeline collapsible
   fades open, and its rows follow with a slight lag. The blanket
   prefers-reduced-motion rule in style.css zeroes all of it. */
.portal-main .card{ animation:portalCardIn .32s var(--ease-cinematic) both; }
.portal-main .card:nth-of-type(1){ animation-delay:.03s; }
.portal-main .card:nth-of-type(2){ animation-delay:.08s; }
.portal-main .card:nth-of-type(3){ animation-delay:.13s; }
.portal-main .card:nth-of-type(n+4){ animation-delay:.18s; }
@keyframes portalCardIn{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:none; } }
.collapsible.open{ animation:collapsibleIn .28s var(--ease-out); }
@keyframes collapsibleIn{ from{ opacity:0; transform:translateY(-4px); } to{ opacity:1; transform:none; } }
.collapsible.open .timeline-row{ animation:timelineRowIn .3s var(--ease-cinematic) both; }
.collapsible.open .timeline-row:nth-child(2){ animation-delay:.05s; }
.collapsible.open .timeline-row:nth-child(3){ animation-delay:.10s; }
.collapsible.open .timeline-row:nth-child(n+4){ animation-delay:.15s; }
@keyframes timelineRowIn{ from{ opacity:0; transform:translateX(-6px); } to{ opacity:1; transform:none; } }
.btn--sending{ opacity:.65; pointer-events:none; }
.timeline-row{ font-size:.82rem; color:var(--ink-soft); padding:4px 0; }

.emergency-box{ background:#fdecea; border:1px solid #f4c7c1; border-radius:8px; padding:14px; }
.emergency-box textarea{ width:100%; border:1px solid #f4c7c1; border-radius:6px; padding:10px; font:inherit; font-size:.9rem; min-height:70px; resize:vertical; }

/* ---------- Small screens ---------- */
@media (max-width:480px){
  .portal-header{ padding:12px 16px; }
  .card{ padding:16px; }
}

/* ---------- APP-01: PWA install / notification banner ---------- */
.pwa-banner{
  position:fixed; left:16px; right:16px; bottom:16px; z-index:500;
  max-width:420px; margin:0 auto;
  background:var(--teal); color:#fff; border-radius:10px;
  padding:14px 16px; display:flex; align-items:center; gap:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.25);
  animation:pwaBannerIn .25s ease-out;
}
.pwa-banner p{ flex:1; margin:0; font-size:.85rem; line-height:1.3; }
.pwa-banner .pwa-banner-actions{ display:flex; gap:8px; flex-shrink:0; }
.pwa-banner button{ border:none; border-radius:7px; padding:8px 12px; font-size:.82rem; font-weight:700; cursor:pointer; font-family:inherit; }
.pwa-banner .pwa-btn-primary{ background:var(--orange); color:var(--teal-deep); }
.pwa-banner .pwa-btn-dismiss{ background:rgba(255,255,255,.14); color:#fff; }
@keyframes pwaBannerIn{ from{ transform:translateY(12px); opacity:0; } to{ transform:translateY(0); opacity:1; } }
@media (max-width:480px){
  .pwa-banner{ flex-direction:column; align-items:stretch; text-align:center; }
  .pwa-banner .pwa-banner-actions{ justify-content:center; }
}

/* v1.284 CUSTOMER-APP-CODE — cover while in the background, the screenshot notice, printing blocked,
   the App code page. */
#srcCover { display: none; }
html.src-covered #srcCover { display: flex; position: fixed; inset: 0; z-index: 2147483000; background: #003841; color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font: 600 1rem system-ui, sans-serif; }
#srcCover img { width: 150px; height: auto; }
#srcShot { position: fixed; inset: 0; z-index: 2147483001; background: rgba(0, 30, 35, .97); color: #fff; display: grid; place-items: center; padding: 24px; text-align: center; font: 1rem/1.5 system-ui, sans-serif; }
#srcShot strong { display: block; font-size: 1.2rem; margin-bottom: 8px; }
@media print { body.portal-body * { display: none !important; } body.portal-body::after { content: "Printing the Smartrise app is not allowed."; display: block; padding: 40px; font: 16px system-ui, sans-serif; } }
.ac-status { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: #eef2f3; color: #41575c; }
.ac-status--approved { background: #e1f4e8; color: #17663a; } .ac-status--pending { background: #fff1dc; color: #8a5200; } .ac-status--locked, .ac-status--declined { background: #fde4e1; color: #a3271b; }
.ac-devices { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ac-devices li { border: 1px solid var(--line-light, #e3e9ea); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
/* v1.284 app code page */
.ac-this { border: 1px solid var(--line-light, #e3e9ea); border-radius: 12px; padding: 12px 14px; font-size: .9rem; background: #f7fafa; }
.ac-form { display: grid; gap: 10px; }
.ac-form label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; }
.ac-form input { font-size: 1rem; padding: 10px 12px; border: 1px solid var(--line-light, #cfd9db); border-radius: 10px; }
.ac-form input[inputmode="numeric"] { letter-spacing: .4em; font-family: var(--font-mono, monospace); max-width: 220px; }
