/* Customer portal preview — standalone stylesheet.
   Mobile-first. Uses the EnsureLoc brand tokens shared with the rest of the site. */

:root {
  --navy: #243c54;
  --deep: #1a2c40;
  --teal: #18a8a8;
  --teal-soft: #e8f6f6;
  --orange: #fc9018;
  --paper: #f6f8fb;
  --white: #fff;
  --muted: #627386;
  --line: #d9e3ef;
  --radius: 18px;
  --nav-height: 68px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Public Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--paper);
  color: var(--navy);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: 'Archivo', 'Public Sans', sans-serif; margin: 0; }

a { color: var(--teal); }

.portal {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 20px);
}

/* Header */
.portal-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.portal-header img { height: 34px; width: auto; display: block; }

.portal-header .back {
  font-weight: 800;
  text-decoration: none;
  color: var(--navy);
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portal-header h1 { font-size: 1.05rem; }

.portal-main { padding: 20px 18px 8px; max-width: 720px; margin: 0 auto; }

/* Hero */
.portal-hero {
  background: linear-gradient(135deg, var(--deep), var(--navy));
  color: #fff;
  border-radius: 22px;
  padding: 24px 22px;
  box-shadow: 0 14px 34px rgba(36, 60, 84, .16);
}

.portal-hero h2 { font-size: clamp(1.7rem, 7vw, 2.3rem); line-height: 1.1; }

.portal-hero p { color: #cfdae4; margin: 10px 0 20px; font-size: .98rem; }

/* Buttons */
.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 15px 20px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
}

.btn-primary { background: var(--orange); color: #fff; }
.btn-secondary { background: var(--teal); color: #fff; }
.btn-quiet { background: #eef3f7; color: var(--navy); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Summary cards */
.summary-grid { display: grid; gap: 14px; margin-top: 22px; }

.storage-status { margin-top: 16px; }
.storage-status__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.storage-status__head h3 { margin: 0; }
.storage-status__head strong { color: var(--navy); font-size: .9rem; }
.storage-meter { height: 10px; overflow: hidden; margin-top: 12px; background: #e7edf1; border-radius: 999px; }
.storage-meter span { display: block; width: 0; height: 100%; background: var(--teal); border-radius: inherit; transition: width .25s ease; }
.storage-status.is-warning { border-color: #e09a2d; background: #fff9ef; }
.storage-status.is-warning .storage-meter span { background: #dc8518; }
.storage-status.is-full { border-color: #b74343; background: #fff4f4; }
.storage-status.is-full .storage-meter span { background: #b74343; }
.storage-upload-note.is-warning,
.storage-account-note.is-warning { color: #9a5907; font-weight: 700; }
.storage-upload-note.is-full,
.storage-account-note.is-full { color: #a12f2f; font-weight: 800; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(36, 60, 84, .05);
}

.card h3 { font-size: 1rem; }

.summary-card { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; }

.summary-card .count {
  font-family: 'Archivo', sans-serif;
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 800;
  grid-row: span 2;
}

.summary-card p { margin: 0; color: var(--muted); font-size: .9rem; grid-column: 1; }

/* Section headings */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
}

.section-head h3 { font-size: 1.15rem; }

.section-head a { font-weight: 700; font-size: .9rem; }

/* Record list */
.record-list { display: grid; gap: 10px; }

.record-row {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.record-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: .85rem;
}

.record-title { font-weight: 800; overflow-wrap: anywhere; }

.record-meta { color: var(--muted); font-size: .85rem; }

.empty {
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 15px;
  padding: 22px 18px;
  color: var(--muted);
  text-align: center;
}

/* Quick Add flow */
.step { display: none; }
.step.active { display: block; }

.step-count {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.step h2 { font-size: 1.45rem; margin: 6px 0 4px; }

.step > p.lede { color: var(--muted); margin: 0 0 18px; }

.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.type {
  appearance: none;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 15px;
  padding: 16px 14px;
  font: inherit;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
  text-align: left;
  min-height: 76px;
  display: flex;
  align-items: center;
}

.type[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px rgba(24, 168, 168, .16);
}

.file-drop {
  background: var(--white);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
}

.file-drop strong { display: block; font-size: 1.02rem; }

.file-drop p { margin: 8px 0 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }

.file-drop.dragging, .file-drop.has-file { border-color: var(--teal); background: var(--teal-soft); }

.file-drop.has-file p { color: var(--navy); font-weight: 700; }

.field { display: grid; gap: 6px; margin-bottom: 18px; }

.field label { font-weight: 800; font-size: .95rem; }

.field .optional { color: var(--muted); font-weight: 600; }

.input, .textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 14px;
  font: inherit;
  background: var(--white);
  color: var(--navy);
}

.textarea { min-height: 110px; resize: vertical; }

.input:focus, .textarea:focus, .type:focus-visible, .btn:focus-visible, .file-drop:focus-visible {
  outline: 3px solid rgba(24, 168, 168, .45);
  outline-offset: 2px;
}

.step-actions { display: grid; gap: 10px; margin-top: 22px; }

.review-list { display: grid; gap: 10px; margin: 0 0 4px; padding: 0; list-style: none; }

.review-list div { display: flex; justify-content: space-between; gap: 16px; }
#filedUnderRow[hidden] { display: none !important; }


.review-list dt { color: var(--muted); font-size: .9rem; }

.review-list dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

/* Same list, used for the permissions an invitation offers. */
.review-list li { font-weight: 700; }

/* Changing the record type back on the step that chose it. Reads as a link
   rather than a button so it never competes with Save Record. */
.review-change {
  margin-left: 10px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--teal);
  text-decoration: underline;
  cursor: pointer;
}

.review-change:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* Success */
.success { text-align: center; padding: 34px 22px; }

.success-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
}

.success h2 { font-size: 1.7rem; }

.success p { color: var(--muted); margin: 8px 0 24px; }

.form-error {
  margin-top: 14px;
  color: #b93d3d;
  background: #fff0f0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: .92rem;
}

.hint { color: var(--muted); font-size: .85rem; margin: 12px 0 0; }

/* Bottom navigation */
.portal-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}

.portal-nav a {
  min-height: var(--nav-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  padding: 8px 2px;
}

.portal-nav a span { font-size: 1.15rem; line-height: 1; }

.portal-nav a.active { color: var(--teal); }

.portal-nav a[aria-disabled="true"] { opacity: .55; }

.portal-nav a.add span {
  background: var(--orange);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.portal-nav a.add.active { color: var(--orange); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-height) + 18px);
  background: var(--deep);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 40;
  max-width: calc(100% - 36px);
  text-align: center;
}

.toast.show { opacity: 1; }

/* ---------- My Records: open and download ---------- */

.record-icon { grid-row: span 2; align-self: start; }

.record-body { display: grid; gap: 2px; min-width: 0; }

.record-body .record-title, .record-body .record-meta, .record-body .record-notes { display: block; }

.record-notes {
  margin-top: 5px;
  color: var(--navy);
  font-size: .9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.record-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.btn-small { padding: 9px 14px; font-size: .85rem; }

/* Summary cards link through to the full screens. */
.summary-card { color: var(--navy); text-decoration: none; }

.summary-card > span { color: var(--muted); font-size: .9rem; grid-column: 1; }

.greeting { margin: 0 0 16px; font-weight: 700; }

.header-signout { margin-left: auto; }

/* ---------- Sign in ---------- */

.portal-plain { padding-bottom: 24px; }

.signin-main { display: grid; align-content: center; min-height: 100vh; gap: 18px; }

.signin-brand { display: flex; align-items: center; gap: 10px; }

.signin-brand img { height: 34px; }

.signin-card h1 { font-size: 1.35rem; }

.signin-card .lede { color: var(--muted); margin: 8px 0 20px; }

.signin-help { margin: 18px 0 0; }

.signin-footer { color: var(--muted); font-size: .85rem; text-align: center; margin: 0; }

/* ---------- Trusted Connections ---------- */

.connection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.connection-head strong { display: block; overflow-wrap: anywhere; }

.connection-head .record-meta { display: block; overflow-wrap: anywhere; }

.pill {
  background: #eef3f7;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill-on { background: var(--teal-soft); color: var(--teal-dark, #128585); }

.permission-set { border: 0; padding: 0; margin: 0 0 6px; }

.permission-set legend {
  padding: 0;
  font-weight: 800;
  font-family: 'Archivo', sans-serif;
  font-size: 1rem;
}

.permission-set .hint { margin: 6px 0 12px; }

.permission {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  margin-bottom: 8px;
  cursor: pointer;
}

.permission input { margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--teal); }

.permission strong { display: block; color: var(--navy); font-size: .95rem; }

.permission span { font-size: .9rem; color: var(--muted); }

.permission-inline { margin: 0; }

.permission-inline span { color: var(--navy); font-weight: 700; font-size: .9rem; }

.permission-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }

.permission-note { margin: 4px 0 16px; }

.connection { display: grid; gap: 4px; }

.connection-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- Booker: clear of the bottom navigation ---------- */

.booker-portal-launcher {
  bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom));
  z-index: 45;
}

.booker-portal-panel {
  bottom: calc(var(--nav-height) + 78px + env(safe-area-inset-bottom));
  height: min(600px, calc(100vh - var(--nav-height) - 150px));
  z-index: 46;
}

.portal-plain ~ .booker-portal-launcher { bottom: 22px; }

.portal-plain ~ .booker-portal-panel { bottom: 84px; height: min(600px, calc(100vh - 120px)); }

/* Larger screens keep the same single-column, mobile-first layout, centred. */
@media (min-width: 640px) {
  .portal-main { padding: 26px 24px 8px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .step-actions { grid-auto-flow: column; justify-content: start; }
  .step-actions .btn { min-width: 150px; }
  .portal-nav { max-width: 720px; margin: 0 auto; border-radius: 18px 18px 0 0; }
  .signin-main { max-width: 480px; margin: 0 auto; }
}

/* The help control stays labelled on small screens — it is the portal's only
   route to help, so an unlabelled circle is not enough. */
@media (max-width: 820px) {
  .booker-portal-launcher { right: 16px; padding: 10px 16px 10px 10px; }
  .booker-portal-launcher .booker-label { display: block; }
  body.hero-visible .booker-portal-launcher { display: flex; }
}

@media (max-width: 520px) {
  .booker-portal-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}


/* five-item portal nav */
.portal-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ============================================================
   2026-08 production cleanup: typography, alignment, clean icons
   ============================================================ */
body{font-family:'Open Sans',Arial,sans-serif;font-size:16px}
h1,h2,h3,.btn,.type,.step-count,.record-title,.permission-set legend{font-family:'Montserrat',Arial,sans-serif}
.portal-main{max-width:860px;padding-left:24px;padding-right:24px}
.portal-header{min-height:70px;padding:14px 24px}
.portal-header img{height:36px!important;max-width:190px;width:auto;object-fit:contain}

body[data-portal-page="add"] .portal-header,
body[data-portal-page="records"] .portal-header,
body[data-portal-page="connections"] .portal-header,
body[data-portal-page="account"] .portal-header{
  display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center
}
body[data-portal-page="add"] .portal-header .back,
body[data-portal-page="records"] .portal-header .back,
body[data-portal-page="connections"] .portal-header .back,
body[data-portal-page="account"] .portal-header .back{justify-self:start}
body[data-portal-page="add"] .portal-header h1,
body[data-portal-page="records"] .portal-header h1,
body[data-portal-page="connections"] .portal-header h1,
body[data-portal-page="account"] .portal-header h1{justify-self:center;text-align:center;white-space:nowrap}
body[data-portal-page="add"] .portal-header img,
body[data-portal-page="records"] .portal-header img,
body[data-portal-page="connections"] .portal-header img,
body[data-portal-page="account"] .portal-header img{justify-self:end;height:32px!important;width:32px!important}

body[data-portal-page="home"] .portal-header{display:flex;align-items:center}
body[data-portal-page="home"] .portal-header>img{height:38px!important;max-width:190px!important}
body[data-portal-page="home"] .header-signout{margin-left:auto}

.step{max-width:780px;margin:0 auto}
.step-count{font-size:13px;letter-spacing:.08em}
.step h2{margin-top:8px;margin-bottom:6px}
.type-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.type{min-height:78px;padding:14px 16px;gap:12px;justify-content:flex-start;text-align:left;line-height:1.25;font-size:15px}
.type .type-icon{width:34px;height:34px;border-radius:10px;background:#EEF4F7;color:var(--navy);display:grid;place-items:center;flex:none}
.type .type-icon svg{width:20px;height:20px;display:block}
.type[aria-pressed="true"] .type-icon{background:#fff;color:var(--teal)}
.record-icon svg{width:16px;height:16px;display:block}
.step-actions{align-items:center}
.record-row{transform:none!important}
.portal-nav{grid-template-columns:repeat(6,minmax(0,1fr));max-width:860px}

.signin-brand{justify-content:center;margin-bottom:4px}
.signin-brand img{height:46px!important;max-width:230px;width:auto;object-fit:contain}
.signin-card{text-align:left}
.signin-card h1{text-align:center}
.signin-card>.lede{text-align:center}

@media(max-width:700px){
  .portal-main{padding-left:18px;padding-right:18px}
  .portal-header{padding-left:18px;padding-right:18px}
  .type-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  body[data-portal-page="connections"] .portal-header h1{font-size:14px!important}
}
@media(max-width:430px){
  .type-grid{grid-template-columns:1fr}
  .type{min-height:64px}
}

/* EnsureLoc brand header */
.portal-header .portal-brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 112px;
  text-decoration: none;
}
.portal-header .portal-brand img {
  display: block;
  width: 150px;
  max-width: 28vw;
  height: auto;
}
@media (max-width: 520px) {
  .portal-header .portal-brand { min-width: 88px; }
  .portal-header .portal-brand img { width: 124px; max-width: 38vw; }
}


/* ===== 2026-08-20 portal branding, nav icon, and mobile camera update ===== */

.portal-header{padding:16px 18px;border-bottom:1px solid rgba(36,60,84,.08);box-shadow:0 3px 18px rgba(36,60,84,.04)}
.portal-header img{display:block}
body[data-portal-page="home"] .portal-header{min-height:78px}
body[data-portal-page="home"] .portal-header>img{width:188px!important;max-width:min(60vw,188px)!important;height:auto!important}
body[data-portal-page="add"] .portal-header,
body[data-portal-page="records"] .portal-header,
body[data-portal-page="connections"] .portal-header,
body[data-portal-page="account"] .portal-header{grid-template-columns:minmax(78px,1fr) auto minmax(132px,1.25fr)!important;gap:10px}
body[data-portal-page="add"] .portal-header h1,
body[data-portal-page="records"] .portal-header h1,
body[data-portal-page="connections"] .portal-header h1,
body[data-portal-page="account"] .portal-header h1{font-size:1.03rem;letter-spacing:.01em}
.portal-header .portal-brand{min-width:132px;justify-content:flex-end}
.portal-header .portal-brand img{width:156px!important;max-width:min(44vw,156px)!important;height:auto!important}
.signin-brand img{width:198px!important;max-width:min(68vw,198px)!important;height:auto!important}

.portal-nav{box-shadow:0 -8px 24px rgba(36,60,84,.08)}
.portal-nav a{font-size:.72rem;font-weight:800;gap:4px;padding:8px 1px 10px}
.portal-nav a .nav-icon{width:26px;height:26px;display:flex;align-items:center;justify-content:center;color:currentColor}
.portal-nav a .nav-icon svg{width:24px;height:24px;display:block;stroke:currentColor;stroke-width:2.05;stroke-linecap:round;stroke-linejoin:round}
.portal-nav a.add .nav-icon{width:42px;height:42px;border-radius:50%;background:var(--orange);color:#fff;box-shadow:0 8px 20px rgba(252,144,24,.28)}
.portal-nav a.add .nav-icon svg{width:22px;height:22px;stroke-width:2.4}
.portal-nav a.active{color:var(--teal)}
.portal-nav a.add.active{color:var(--orange)}
.portal-nav a.add{transform:translateY(-2px)}
.portal-nav a .nav-icon-connections svg{stroke-width:1.95}

.capture-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.capture-actions .btn{min-height:50px}
.file-drop{padding:26px 18px}
.file-drop strong{font-size:1.04rem}
.file-drop::after{content:"Tap to choose from files or photos";display:block;margin-top:10px;color:var(--muted);font-size:.82rem;font-weight:600}
.file-drop.has-file::after{content:"Ready to continue";color:var(--teal)}

@media(max-width:480px){
  body[data-portal-page="add"] .portal-header,
  body[data-portal-page="records"] .portal-header,
  body[data-portal-page="connections"] .portal-header,
  body[data-portal-page="account"] .portal-header{grid-template-columns:minmax(70px,.9fr) auto minmax(112px,1fr)!important}
  .portal-header .portal-brand img{width:138px!important;max-width:40vw!important}
  body[data-portal-page="home"] .portal-header>img{width:168px!important;max-width:54vw!important}
  .portal-nav a .nav-icon{width:28px;height:28px}
  .portal-nav a .nav-icon svg{width:25px;height:25px}
  .portal-nav a.add .nav-icon{width:44px;height:44px}
}
@media(max-width:390px){
  .portal-header{padding-left:14px;padding-right:14px}
  body[data-portal-page="add"] .portal-header h1,
  body[data-portal-page="records"] .portal-header h1,
  body[data-portal-page="connections"] .portal-header h1,
  body[data-portal-page="account"] .portal-header h1{font-size:.95rem}
  .portal-header .portal-brand img{width:128px!important;max-width:38vw!important}
  .capture-actions{grid-template-columns:1fr}
}

/* 2026-08-21 account deletion */
.account-danger{border-color:#e6b8b8;background:#fffafa}
.account-danger h3{color:#8d2f2f}
.delete-confirm{display:flex;gap:10px;align-items:flex-start;margin:14px 0;color:var(--navy);font-size:.9rem;line-height:1.45}
.delete-confirm input{margin-top:3px;flex:none}
.btn-danger{background:#a93a3a;color:#fff;border:1px solid #a93a3a}
.btn-danger:hover{background:#8f3030}
.btn-danger:disabled{opacity:.45;cursor:not-allowed}

/* ===== 2026-08-21 portal logo prominence refinement =====
   Make EnsureLoc branding the visual anchor of every customer portal screen. */
body[data-portal-page="home"] .portal-header {
  min-height: 96px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 18px;
}
body[data-portal-page="home"] .portal-header > img {
  grid-column: 2;
  justify-self: center;
  width: 224px !important;
  max-width: min(64vw,224px) !important;
  height: auto !important;
}
body[data-portal-page="home"] .portal-header .header-signout {
  grid-column: 3;
  justify-self: end;
  white-space: nowrap;
}

body[data-portal-page="add"] .portal-header,
body[data-portal-page="records"] .portal-header,
body[data-portal-page="connections"] .portal-header,
body[data-portal-page="account"] .portal-header {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 8px;
  padding-top: 14px;
  padding-bottom: 12px;
}
body[data-portal-page="add"] .portal-header .portal-brand,
body[data-portal-page="records"] .portal-header .portal-brand,
body[data-portal-page="connections"] .portal-header .portal-brand,
body[data-portal-page="account"] .portal-header .portal-brand {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  justify-content: center;
  min-width: 0;
}
body[data-portal-page="add"] .portal-header .portal-brand img,
body[data-portal-page="records"] .portal-header .portal-brand img,
body[data-portal-page="connections"] .portal-header .portal-brand img,
body[data-portal-page="account"] .portal-header .portal-brand img {
  width: 216px !important;
  max-width: min(62vw,216px) !important;
  height: auto !important;
}
body[data-portal-page="add"] .portal-header .back,
body[data-portal-page="records"] .portal-header .back,
body[data-portal-page="connections"] .portal-header .back,
body[data-portal-page="account"] .portal-header .back {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}
body[data-portal-page="add"] .portal-header h1,
body[data-portal-page="records"] .portal-header h1,
body[data-portal-page="connections"] .portal-header h1,
body[data-portal-page="account"] .portal-header h1 {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  white-space: nowrap;
  font-size: 1.05rem;
}

/* Sign-in, password recovery and connection acceptance screens. */
.signin-brand {
  justify-content: center;
  margin-bottom: 8px;
}
.signin-brand img {
  width: 224px !important;
  max-width: min(76vw,224px) !important;
  height: auto !important;
}

@media (max-width: 480px) {
  body[data-portal-page="home"] .portal-header {
    min-height: 90px;
    padding-left: 14px;
    padding-right: 14px;
  }
  body[data-portal-page="home"] .portal-header > img {
    width: 196px !important;
    max-width: 58vw !important;
  }
  body[data-portal-page="add"] .portal-header .portal-brand img,
  body[data-portal-page="records"] .portal-header .portal-brand img,
  body[data-portal-page="connections"] .portal-header .portal-brand img,
  body[data-portal-page="account"] .portal-header .portal-brand img {
    width: 190px !important;
    max-width: 58vw !important;
  }
  .signin-brand img {
    width: 210px !important;
    max-width: 74vw !important;
  }
}

@media (max-width: 390px) {
  body[data-portal-page="home"] .portal-header > img {
    width: 184px !important;
    max-width: 56vw !important;
  }
  body[data-portal-page="add"] .portal-header .portal-brand img,
  body[data-portal-page="records"] .portal-header .portal-brand img,
  body[data-portal-page="connections"] .portal-header .portal-brand img,
  body[data-portal-page="account"] .portal-header .portal-brand img {
    width: 180px !important;
    max-width: 56vw !important;
  }
  body[data-portal-page="connections"] .portal-header h1 {
    font-size: .9rem !important;
  }
}

/* ===== 2026-08-21 portal spacing and alignment QA ===== */
.summary-grid,.type-grid{align-items:stretch}
.summary-card,.type{height:100%;box-sizing:border-box}
.card{box-sizing:border-box}

/* Keep the instructional copy centered above each action area; the actual
   record choices and record details remain left-aligned for scanability. */
.step>.step-count,.step>h2,.step>p.lede{
  text-align:center;
  margin-left:auto;
  margin-right:auto;
}
.step>p.lede{max-width:680px}
.step-actions{justify-content:center}

/* Keep summary/content cards visually balanced across the portal. */
.summary-card{min-height:116px}
.connection,.permission,.review-list>li{box-sizing:border-box}


/* After-Loss Business record-readiness experience */
.afterloss-readiness[hidden]{display:none!important}
.afterloss-readiness{margin-top:22px;padding:0;overflow:hidden;border-color:#cfdce8}
.afterloss-readiness__head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 20px 14px}
.afterloss-kicker{margin:0 0 4px;color:var(--teal);font-size:.76rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
.afterloss-readiness__head h3{font-size:1.35rem}
.afterloss-progress{flex:none;background:var(--teal-soft);color:#137f80;border-radius:999px;padding:8px 12px;font-size:.85rem;white-space:nowrap}
.afterloss-intro{margin:0;padding:0 20px 16px;color:var(--muted);font-size:.92rem}
.afterloss-checklist{border-top:1px solid var(--line)}
.readiness-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:12px;align-items:center;min-height:58px;padding:11px 20px;border-bottom:1px solid var(--line);color:var(--navy);text-decoration:none;background:#fff}
.readiness-row:hover{background:#f9fbfd}
.readiness-mark{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-size:1rem;font-weight:1000;line-height:1}
.readiness-name{font-weight:800;min-width:0}
.readiness-state{font-size:.82rem;font-weight:900;white-space:nowrap}
.readiness-row.is-complete .readiness-mark{background:#e6f7f2;color:#16845f}
.readiness-row.is-complete .readiness-state{color:#16845f}
.readiness-row.is-missing .readiness-state{color:#d6333f}
.afterloss-scope{margin:0;padding:14px 20px;color:var(--muted);background:#f8fafc;font-size:.8rem;border-bottom:1px solid var(--line)}
.afterloss-more{padding:16px 20px 20px}
.afterloss-more>strong{display:block;font-size:.9rem;margin-bottom:10px}
.afterloss-extra{display:flex;flex-wrap:wrap;gap:8px}
.afterloss-extra-link{display:inline-flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid var(--line);border-radius:999px;text-decoration:none;color:var(--navy);background:#fff;font-size:.82rem;font-weight:800}
.afterloss-extra-link>span{color:var(--teal);font-weight:1000}
.afterloss-extra-link.has-record{border-color:#bfe5dc;background:#edf9f6}
.afterloss-business .portal-hero{background:linear-gradient(135deg,#1a2c40,#2d5872)}

@media(max-width:560px){
  .afterloss-readiness__head{align-items:flex-start;flex-direction:column;gap:10px}
  .afterloss-progress{white-space:normal}
  .readiness-row{grid-template-columns:32px minmax(0,1fr);gap:10px;padding:12px 16px}
  .readiness-state{grid-column:2;white-space:normal;margin-top:-7px}
  .afterloss-intro,.afterloss-scope,.afterloss-more{padding-left:16px;padding-right:16px}
}

/* AFTER-LOSS READINESS PROGRESS BAR */
.afterloss-meter{
  height:10px;
  margin:0 20px 16px;
  overflow:hidden;
  border-radius:999px;
  background:#e8eef4;
  box-shadow:inset 0 1px 2px rgba(26,44,64,.08);
}

.afterloss-meter__fill{
  width:0;
  height:100%;
  border-radius:999px;
  background:linear-gradient(
    90deg,
    var(--teal) 0%,
    var(--teal) 72%,
    var(--orange) 100%
  );
  transition:width .45s ease;
}

@media(max-width:560px){
  .afterloss-meter{
    margin-left:16px;
    margin-right:16px;
  }
}
/* INSURELOC READINESS BAR V2 */
.afterloss-meter {
  height: 10px;
  margin: 0 20px 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6f0f2;
}

.afterloss-meter__fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--teal, #08a6a6) 0%,
    var(--teal, #08a6a6) 70%,
    var(--orange, #ff9418) 100%
  );
  transition: width .4s ease;
}
/* INSURELOC CONNECTION CAPACITY V2 */

.connection-capacity {
  margin: 18px 0 24px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f1fbfb 100%);
  border: 1px solid #cfe4e7;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(36, 60, 84, .07);
}

.connection-capacity__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.connection-capacity__eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #00a6a6;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .08em;
}

.connection-capacity__usage {
  display: block;
  color: #243c54;
  font-size: 22px;
  line-height: 1.2;
}

.connection-capacity__available {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 8px 13px;
  border-radius: 999px;
  background: #e4f6f6;
  color: #008f8f;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.connection-capacity__track {
  height: 9px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf2;
}

.connection-capacity__fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: #00a6a6;
  transition: width .35s ease;
}

.connection-capacity__note {
  margin: 12px 0 0;
  color: #587087;
  font-size: 14px;
  line-height: 1.5;
}

.connection-error {
  padding: 18px 20px;
  border: 1px solid #f1d2a8;
  border-radius: 16px;
  background: #fffaf3;
}

.connection-error strong {
  display: block;
  margin-bottom: 5px;
  color: #243c54;
  font-size: 16px;
}

.connection-error span {
  display: block;
  color: #587087;
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .connection-capacity__top {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ---------- reminders ---------- */
.reminder-form { margin: 0 0 22px; }
.reminder-form .input { accent-color: var(--teal); }
.reminder-form .input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(24, 168, 168, .22);
  box-shadow: none;
}
.reminder-time-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.reminder-time-fields select { background: #fff; color: var(--navy); cursor: pointer; }
.reminder-form .field-label { font-weight: 800; font-size: .95rem; color: var(--navy); }
.reminder-form .field-optional { color: var(--muted); font-weight: 600; }
.reminder-form .field-error { color: #b3261e; font-size: .88rem; margin: -8px 0 12px; }
.reminder-list { display: grid; gap: 10px; }
.reminder {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}
.reminder.is-done { opacity: .62; }
.reminder-check {
  width: 26px; height: 26px; margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  background: #fff; color: var(--teal);
  font-weight: 900; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.reminder-check[aria-pressed="true"] { background: var(--teal); color: #fff; }
.reminder-body { min-width: 0; display: grid; gap: 3px; }
.reminder-title { font-weight: 800; margin: 0; overflow-wrap: anywhere; color: var(--navy); }
.reminder.is-done .reminder-title { text-decoration: line-through; }
.reminder-meta { margin: 0; display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.reminder-date { color: var(--muted); }
.reminder-overdue {
  color: var(--orange); font-weight: 800;
  background: #fff2e2; border-radius: 999px; padding: 1px 8px; font-size: .75rem;
}
.reminder-note { margin: 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.reminder-remove {
  border: 0; background: transparent; color: var(--muted);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 2px;
}
.reminder-remove:hover { color: #b3261e; }

/* ===== Cumulative portal repairs ===== */
.folder-select {
  width: min(100%, 360px);
  min-width: 0;
  padding: 10px 36px 10px 12px;
  border: 1px solid #ccd8e5;
  border-radius: 10px;
  background: #fff;
  color: #173a5e;
  font: inherit;
  font-weight: 700;
}

.readiness-row.is-missing {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* Six equal navigation destinations on every portal page. */
.portal-nav {
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.portal-nav a { width: 100%; min-width: 0; padding-inline: 0; }

@media (max-width: 560px) {
  :root { --nav-height: 62px; }

  .portal-main {
    width: 100%;
    max-width: 100%;
    padding: 14px 14px 8px;
  }

  body[data-portal-page="home"] .portal-header {
    min-height: 68px;
    display: flex !important;
    justify-content: space-between;
    padding: 10px 14px;
  }

  body[data-portal-page="home"] .portal-header > img {
    width: 154px !important;
    max-width: 54vw !important;
  }

  body[data-portal-page="home"] .portal-header .header-signout {
    min-height: 40px;
    padding: 9px 12px;
    font-size: .82rem;
  }

  body[data-portal-page]:not([data-portal-page="home"]) .portal-header {
    min-height: 62px;
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    grid-template-rows: 1fr !important;
    gap: 8px;
    padding: 10px 14px !important;
  }

  body[data-portal-page]:not([data-portal-page="home"]) .portal-header .back {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start;
    font-size: .84rem;
  }

  body[data-portal-page]:not([data-portal-page="home"]) .portal-header h1 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: center;
    max-width: 50vw;
    overflow: hidden;
    font-size: .92rem !important;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-portal-page]:not([data-portal-page="home"]) .portal-header .portal-brand {
    display: none !important;
  }

  .portal-hero { padding: 20px 16px; border-radius: 16px; }
  .portal-hero h2 { font-size: clamp(1.45rem, 7.5vw, 1.85rem); line-height: 1.12; }
  .portal-hero p { margin: 9px 0 16px; font-size: .9rem; line-height: 1.5; }
  .card { padding: 16px; border-radius: 14px; }
  .summary-grid { gap: 12px; margin-top: 16px; }
  .summary-card { min-height: 0; }
  .section-head { margin-top: 22px; }

  .afterloss-readiness__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 16px 14px 10px;
  }

  .afterloss-readiness__head h3 { font-size: 1.18rem; }
  .afterloss-progress { padding: 7px 9px; font-size: .74rem; white-space: nowrap; }
  .afterloss-intro { padding: 0 14px 14px; font-size: .87rem; }
  .afterloss-meter { margin: 0 14px 14px; }

  .readiness-row,
  .readiness-row.is-missing { min-height: 0; padding: 12px 14px; }
  .readiness-row { grid-template-columns: 28px minmax(0, 1fr); gap: 8px 10px; }
  .readiness-row.is-missing { grid-template-columns: minmax(0, 1fr); }
  .readiness-mark { width: 26px; height: 26px; }
  .readiness-name { font-size: .92rem; line-height: 1.3; }
  .readiness-state { grid-column: 2; margin: -3px 0 0; white-space: normal; }
  .readiness-row.is-missing .readiness-state { grid-column: 1; margin: 0; }
  .afterloss-scope, .afterloss-more { padding-left: 14px; padding-right: 14px; }

  .type-grid { grid-template-columns: 1fr; gap: 10px; }
  .type { min-height: 60px; padding: 12px; }
  .file-drop { padding: 24px 14px; }
  .review-list div { display: grid; grid-template-columns: 1fr; gap: 4px; }
  .review-list dd { text-align: left; }
  .review-change { margin-left: 8px; }
  .folder-select { width: 100%; }
  .capture-actions { grid-template-columns: 1fr; }
  .step-actions { grid-auto-flow: row !important; justify-content: stretch; }
  .step-actions .btn { width: 100%; min-width: 0; }

  .portal-nav { max-width: none; }
  .portal-nav a {
    gap: 2px;
    min-height: var(--nav-height);
    padding: 5px 0 7px;
    font-size: clamp(.55rem, 2.55vw, .66rem);
    letter-spacing: -.02em;
  }
  .portal-nav a .nav-icon { width: 22px; height: 22px; }
  .portal-nav a .nav-icon svg { width: 21px; height: 21px; }
  .portal-nav a.add .nav-icon { width: 36px; height: 36px; }

  .connection-capacity { padding: 16px; border-radius: 14px; }
  .connection-capacity__top { gap: 10px; }
  .connection-capacity__usage { font-size: 19px; }
  .reminder-time-fields { gap: 6px; }
  .reminder-time-fields .input { padding-left: 9px; padding-right: 9px; }
}

/* ===== 2026-09-05 final MVP cleanup: portal mobile containment =====
   Layout-only safeguards for narrow phones. */
html,body{max-width:100%;overflow-x:hidden}
.portal,.portal-main,.card,.record-row,.summary-card,.afterloss-readiness,.connection-capacity{min-width:0;max-width:100%}
input,select,textarea,button{max-width:100%}
@media (max-width:560px){
  body[data-portal-page]:not([data-portal-page="home"]) .portal-header h1{max-width:44vw}
  .portal-main{padding-bottom:10px}
  .portal-nav{padding-left:4px;padding-right:4px}
  .portal-nav a{overflow:hidden;white-space:nowrap;text-overflow:clip}
  .portal-nav a .nav-icon{flex:0 0 auto}
}

