/* ---- Page container ---- */
.page-wrap { max-width: 1500px; margin-inline: auto; padding: 1.25rem; }

/* ---- Auth pages (login/register/verify) ---- */
.auth-page {
  display: flex;
  justify-content: center;
  padding-block: 2.75rem;
}
.auth-shell {
  width: min(100%, 540px);
}
.auth-shell--narrow { width: min(100%, 460px); }
.auth-shell--wide   { width: min(100%, 660px); }
.auth-card {
  margin: 0 auto;
}
.auth-card .card-body {
  padding: 1.5rem;
}

@media (max-width: 680px) {
  .auth-page {
    padding-block: 2rem;
  }
  .auth-card .card-body {
    padding: 1.15rem;
  }
}

@media (max-width: 480px) {
  .auth-card .card-body {
    padding: 1rem;
  }
}

/* ---- Card surface (dark-friendly) ---- */
.card-surface {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  margin-bottom: 16px; /* keep gutter once */
}
.card-surface .card-header {
  padding: .875rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.card-surface .card-body { padding: 1rem; }

/* Profile card: inline Edit next to title */
#profileCard .card-header{ position: static; padding-right: 1rem; }
#profileCard .card-header #btnEdit.view-only{ position: static; }

/* ---- Field list (labels/values) ---- */
.fieldlist {
  display: grid;
  grid-template-columns: 220px 1fr;
  column-gap: 18px;
  row-gap: 12px;
  margin: 0;
}
.fieldlist dt {
  margin: 0;
  color: #aeb4be;
  font-weight: 600;
  align-self: center;
}
.fieldlist dd {
  margin: 0;
  align-self: center;
  overflow-wrap: anywhere;    /* prevent long digit strings */
}
.fieldlist dd .view-only { word-break: break-word; }

/* Typography helpers */
.h5-tight { font-size: 1.05rem; margin: 0; }
.muted { color: #9aa2ad; }

/* ---- Editing visibility ---- */
#profileCard.editing .view-only { display: none !important; }
#profileCard:not(.editing) .edit-only { display: none !important; }
.edit-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: inherit;
}

/* ---- Buttons ---- */
.btn-compact { padding: .35rem .6rem; border-radius: 10px; }
.btn-accent { background: #3a86ff; border-color: #3a86ff; color: #fff; }
.btn-accent:hover { filter: brightness(1.05); color: #fff; }
.btn-icon { padding: .35rem .55rem; border-radius: 10px; }

/* ---- Selects (better dark dropdown) ---- */
.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.12))
    ,#14181f
    ,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%238ab4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3.5 6.5 8 11 12.5 6.5'/%3E%3C/svg%3E") no-repeat right .7rem center/14px;
  color: #e6edf6;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding-right: 2rem;
  color-scheme: dark;
}
.form-select:focus {
  border-color: #3a86ff;
  box-shadow: 0 0 0 .2rem rgba(58,134,255,.18);
}
.form-select option { background: #0f1319; color: #e6edf6; }
.form-select option[disabled] { color: #6b7586; }

/* ---- Appointments ---- */
.appt-card {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(15,18,23,.45);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px rgba(0,0,0,.26);
  padding: 16px 18px;
  display: grid;
  gap: 10px;
  transition: border-color .2s ease, background .2s ease, transform .04s ease;
}
.appt-card:hover {
  border-color: rgba(78,169,255,.45);
  background: rgba(18,22,28,.55);
}
.appt-card + .appt-card { margin-top: 12px; }

.appt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.appt-head .appt-title {
  font-weight: 600;
  font-size: 1.02rem;
}
.appt-head .appt-title a {
  color: inherit;
  text-decoration: none;
}
.appt-head .appt-title a:hover { color: #8ab4ff; }

.appt-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.appt-vehicle,
.appt-address {
  display: flex;
  align-items: center;
  gap: 6px;
}
.appt-address { color: rgba(255,255,255,.7); }

.appt-estimates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.appt-estimates .chip { gap: 6px; }

.appt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.appt-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

.appt-details {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 10px;
}
.appt-details ul { margin: 0; padding-left: 1.1em; }
.appt-details li { margin-bottom: 4px; }

.appt-card[aria-expanded="true"] {
  border-color: rgba(78,169,255,.45);
}

.badge-soft {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #cfd6df;
  padding: .2rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .02em;
}
.badge-success { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.12); color: #52d2a7; }
.badge-info    { border-color: rgba(59,130,246,.35); background: rgba(59,130,246,.12); color: #93c5fd; }
.badge-danger  { border-color: rgba(239,68,68,.35);  background: rgba(239,68,68,.12);  color: #f9a8a8; }

/* Accent helpers */
.text-accent { color: #8ab4ff !important; }

.chip--bad {
  background: rgba(239,68,68,.14);
  border-color: rgba(239,68,68,.35);
  color: #f9a8a8;
}

/* ---- Security / password panel ---- */
.pw-body.collapsed { display: none; }
.pw-form { max-width: 560px; }
.pw-grid { display: grid; gap: 12px; }
.pw-row { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 14px; }
.pw-label { color: #aeb4be; font-weight: 600; }
.pw-hint { font-size: .9rem; }

/* ---- Addresses list ---- */
.address-list .address-item {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.address-list .address-item + .address-item { margin-top: 10px; }
.address-list .address-item:hover {
  border-color: rgba(80,160,255,.28);
  box-shadow: 0 4px 22px rgba(80,160,255,.08), inset 0 1px 0 rgba(255,255,255,.05);
  transform: translateY(-1px);
}

.address-list .addr-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(80,160,255,.16), rgba(80,160,255,.06));
  border: 1px solid rgba(255,255,255,.08);
}
.address-list .addr-main { min-width: 0; }
.address-list .addr-title {
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.address-list .addr-sub {
  font-size: .9rem; color: rgba(255,255,255,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.address-list .addr-pills { display: flex; gap: 8px; margin-top: 6px; }
.pill {
  font-size: .75rem; padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06);
}
.pill-default { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.14); color: #52d2a7; }

.address-list .addr-actions {
  opacity: .65; display: flex; gap: 8px; transition: opacity .15s ease;
}
.address-list .address-item:hover .addr-actions { opacity: 1; }
.address-list .addr-actions .btn-icon.act-use {
  box-shadow: 0 0 0 0 rgba(80,160,255,0);
  transition: box-shadow .15s ease;
}
.address-list .address-item:hover .addr-actions .btn-icon.act-use {
  box-shadow: 0 0 12px rgba(80,160,255,.25);
}

/* Top bar alignment on account pages */
.account-tabs { display:flex; justify-content:center; margin: 10px 0 18px; }

/* ---- Vehicles (single consolidated block; duplicates removed) ---- */
.vehicle-item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:18px 20px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:rgba(15,18,23,.45);
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
  transition: border-color .18s ease, background .18s ease, transform .06s ease;
}
.vehicle-item + .vehicle-item{ margin-top:14px; }
.vehicle-item:hover{
  border-color: rgba(78,169,255,.35);
  background: rgba(18,22,28,.55);
  transform: translateY(-1px);
}
.vehicle-main{ flex:1 1 auto; min-width:0; }
.vehicle-title{ font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.25; }
.vehicle-sub{ font-size:.9rem; color:rgba(255,255,255,.65); overflow-wrap:anywhere; }
.vehicle-actions{ flex:0 0 auto; display:flex; gap:8px; }

.timeline{ margin-top:8px; border-left:2px solid rgba(255,255,255,.08); padding-left:10px; }
.timeline-item{ margin:8px 0; }

/* Clamp long lists and provide a compact More link */
.timeline--clamp .trow:nth-child(n+3){ display:none; }
.link-more{ margin-top:6px; background:transparent; border:0; color:#9cc1ff; padding:0; font-size:.85rem; }
.link-more:hover{ color:#cfe1ff; text-decoration: underline; }

/* Slightly smaller chips inside vehicle cards to reduce crowding */
.vehicle-item .chip{ font-size:.75rem; padding:.16rem .48rem; }

/* Generic chips (used across) */
.chip{ border:1px solid rgba(255,255,255,.18); border-radius:999px; padding:.18rem .55rem; font-size:.78rem; line-height:1; white-space:nowrap; }
.chip--muted{ background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.12); color:rgba(255,255,255,.8); }
.chip--info{ background:rgba(110,168,254,.15); border-color:rgba(110,168,254,.35); color:#9cc1ff; }
.chip--warn{ background:rgba(255,200,0,.12); border-color:rgba(255,200,0,.35); color:#ffd36e; }
.chip--ok{   background:rgba(28,167,119,.14); border-color:rgba(28,167,119,.38); color:#79d3b7; }

.section-head{
  font-size:.8rem; letter-spacing:.02em; color:rgba(255,255,255,.7);
  display:flex; align-items:center; gap:6px; margin:6px 0;
}
.count-pill{ background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.15); border-radius:999px; padding:.1rem .5rem; font-size:.73rem; }

/* Vehicle estimate rows: clearer hierarchy */
.vehicle-item .est-row { align-items: baseline; }
.vehicle-item .est-row .est-head{ display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.vehicle-item .est-row .status-badge{ font-size:.7rem; padding:.08rem .45rem; border-radius:999px; }
.vehicle-item .est-row .est-sub{ margin-top:2px; }

.pill-link{
  display:inline-flex; align-items:center; gap:.35rem;
  padding:.22rem .6rem; border-radius:999px;
  border:1px solid rgba(138,180,255,.35);
  background:rgba(138,180,255,.14);
  color:#cfe1ff; text-decoration:none; font-weight:600; font-size:.82rem; line-height:1;
}
.pill-link:hover{ background:rgba(138,180,255,.22); border-color:rgba(138,180,255,.55); color:#fff; }
.pill-link:focus-visible{ outline:2px solid #8ab4ff; outline-offset:2px; }
.pill-link .mono{ font-variant-numeric: tabular-nums; }

/* Vehicle header visuals (icons) */
.vehicle-head{ display:flex; align-items:center; gap:12px; min-height:72px; width:100%; }
.vehicle-icon .veh-pin{
  width:44px; height:44px; flex:0 0 44px; border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.vehicle-icon .veh-pin img{ width:74%; height:74%; object-fit:contain; opacity:.95; filter: invert(1) brightness(1.25) contrast(1.05); }
.vehicle-icon .veh-pin img.veh-logo-color{ filter:none; }
.vehicle-icon .veh-initials{ font-weight:600; font-size:.9rem; letter-spacing:.3px; color:#e9eef7; opacity:.95; }

/* ==== Unified “glass” list row (used by Address/Vehicle/Estimates) ==== */
.list-card,
.est-card,
.click-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:1rem; padding:.75rem .95rem;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px; background:rgba(15,18,23,.45);
  backdrop-filter: blur(6px);
  box-shadow:0 2px 6px rgba(0,0,0,.35);
  transition:border-color .2s ease, background .2s ease, transform .04s ease;
  text-decoration:none; color:inherit;
}
.list-card:hover, .est-card:hover, .click-row:hover {
  border-color: rgba(78,169,255,.45);
  background: rgba(18,22,28,.55);
}
.list-left  { min-width:0; }
.list-right { white-space:nowrap; text-align:right; font-variant-numeric: tabular-nums; }
.list-title { font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-meta  { font-size:.9rem; opacity:.8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:.15rem; }

/* Alias styles for overview's click-row that uses row-* classnames */
.click-row .row-left  { min-width: 0; }
.click-row .row-right { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.click-row .row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Allow the address (left meta) to wrap on mobile and desktop */
.click-row .row-left .row-meta { white-space: normal; overflow: visible; text-overflow: initial; opacity: .85; }

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 680px) {
  .fieldlist { grid-template-columns: 1fr; }
  .fieldlist dt { padding-top: .2rem; }
  .card-surface .card-body { padding: .75rem; }

  .appt-card { padding: 14px; }
  .appt-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .appt-meta { margin-left: 0; }
  .appt-actions { width: 100%; justify-content: flex-start; }

  /* Addresses & Vehicles mobile polish */
  .address-list .address-item {
    grid-template-columns: 36px 1fr auto;
    padding: 12px;
    gap: 10px;
    border-radius: 12px;
  }
  .address-list .addr-icon { width: 36px; height: 36px; border-radius: 9px; }
  .address-list .addr-actions { gap: 6px; }
  .pill { font-size: .74rem; padding: 3px 8px; }

  .vehicle-item { padding: 12px; border-radius: 12px; }
  .vehicle-head { gap: 10px; min-height: 64px; flex-direction: column; align-items: stretch; }
  .vehicle-main { order: 1; min-width: 0; }
  .vehicle-actions { order: 2; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
  .vehicle-actions .btn { flex: 1 1 46%; min-width: 120px; }
  .vehicle-title { white-space: normal; }

  /* Buttons & inputs: larger hit area, stop iOS zoom */
  button, input, select, textarea { font-size: 16px; }
  .btn-compact { padding: .5rem .8rem; border-radius: 12px; }

  /* Profile header: keep Edit inline next to title on mobile */
  #profileCard .card-header { flex-wrap: nowrap; gap: 8px; }
  #profileCard .card-header .btn-group { width: auto; display: flex; gap: 6px; }
  /* Make the view-mode Edit button icon-only to save space */
  #btnEdit.view-only { padding: .4rem .55rem; }
  #btnEdit.view-only { font-size: 0; }
  #btnEdit.view-only .bi { font-size: 1.1rem; margin: 0 !important; }
  /* When actually editing, allow wrapping so Save/Cancel fit cleanly */
  #profileCard.editing .card-header { flex-wrap: wrap; }
  #profileCard.editing .card-header .btn-group { width: 100%; justify-content: flex-start; gap: 8px; }
}

/* Ultra-small screens (≤360px) */
@media (max-width: 360px){
  .address-list .addr-title { max-width: 75vw; }
  .address-list .addr-actions { gap: 4px; }
}

/* =========================
   ACCOUNT OVERVIEW — MOBILE POLISH (shared tabs + profile)
   ========================= */
@media (max-width: 680px){
  .page-wrap { padding: 14px; }

  .account-tabs,
  .section-tabs,
  .nav-tabs,
  .tabs{
    position: sticky;
    top: calc(var(--header-h, 56px) + 6px);
    z-index: 30;
    display: flex; gap: 8px;
    overflow-x: auto; padding: 8px 12px 10px; margin: 0 -12px 8px;
    background: linear-gradient(180deg, rgba(9,12,16,.85), rgba(9,12,16,.55));
    -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
    backdrop-filter: blur(8px);
  }
  .account-tabs > *{ scroll-snap-align: center; min-width: max-content; }
  .account-tabs::-webkit-scrollbar{ height: 0; }

  .profile-card, .card-profile { position: relative; }
  .profile-card .card-header, .card-profile .card-header{ position: relative; padding-right: 64px; }
  .profile-card .card-header .btn,
  .card-profile  .card-header .btn{
    position: absolute; top: 10px; right: 10px; z-index: 2;
    min-height: 36px; border-radius: 10px; font-size: 16px;
  }
}

/* === Addresses: surgical cleanup === */

/* 1) Force the "Default" pill to behave like a compact badge */
#addrList .pill-default,
#addrList .addr-pills .pill-default,
#addrList .address-item > .pill-default {
  display: inline-flex !important;      /* beat any .d-block */
  align-items: center;
  gap: 6px;
  width: auto !important;               /* beat any .w-100 */
  max-width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(16,185,129,.35);
  background: rgba(16,185,129,.14);
  color: #52d2a7;
  margin-top: 6px;                      /* small breathing room */
}

/* If that pill is injected outside the pills row, keep it on the main column neatly */
#addrList .address-item > .pill-default {
  grid-column: 2;                        /* middle column in your 40px | 1fr | auto grid */
  justify-self: start;
}

/* 2) Action buttons: consistent hit area and spacing */
#addrList .addr-actions { display: flex; align-items: center; gap: 10px; }
#addrList .addr-actions .btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
#addrList .addr-actions .btn-outline-secondary.btn-icon { border-color: rgba(255,255,255,.16); }
#addrList .addr-actions .btn-outline-danger.btn-icon    { border-color: rgba(239,68,68,.45); }

/* Hover glow just on the blue "use" action (if present) */
#addrList .address-item:hover .addr-actions .btn-icon.act-use {
  box-shadow: 0 0 12px rgba(80,160,255,.25);
}

/* 3) Section head rhythm (match Appointments) – scoped to this card only */
.card-surface:has(#addrList) .section-head{
  display:flex; align-items:center; gap:8px;
  font-weight:600; font-size:.95rem; color:rgba(255,255,255,.75);
  margin:8px 2px 10px;
}
.card-surface:has(#addrList) .section-head .count-pill{
  margin-left:auto; background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12); color:rgba(255,255,255,.72);
  font-size:.75rem; padding:2px 8px; border-radius:999px;
}

/* Mobile nudge */
@media (max-width:680px){
  #addrList .addr-actions { gap: 8px; }
  #addrList .addr-actions .btn-icon { width:34px; height:34px; }
  #addrList .pill-default { margin-top: 4px; }
}

/* === Account tabs: non-sticky, wrap on mobile (override) === */
@media (max-width: 680px){
  .account-tabs,
  .section-tabs,
  .nav-tabs,
  .tabs{
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    overflow-x: visible !important;
    background: transparent !important;
    backdrop-filter: none !important;
    margin: 8px 0 12px !important;
    padding: 0 !important;
  }
  .account-tabs .tabs-scroll{
    flex-wrap: wrap !important;
    overflow: visible !important;
    gap: 8px !important;
    justify-content: center !important;
  }
  .account-tabs .btn{ flex: 0 1 auto !important; }
  /* Icon-first buttons: show icons, hide text label on tight screens */
  .account-tabs .btn .ti { font-size: 1.35rem; line-height: 1; }
  .account-tabs .btn .text-label { display: none; }
  .account-tabs .btn.btn-compact {
    padding: .6rem .7rem;
    border-radius: 14px;
    min-width: 44px;          /* larger tap target */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .account-tabs { justify-content: center !important; }
}

/* =========================
   ADDRESSES — visual cleanup (scoped)
   ========================= */

/* Make each item a glassy card, like appointments */
#addrList .address-item{
  background: rgba(15,18,23,.45);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 14px 16px;
  grid-template-columns: 40px 1fr auto;  /* icon | main | actions */
  align-items: center;
  transition: border-color .18s ease, background .18s ease, transform .06s ease;
}
#addrList .address-item + .address-item{ margin-top: 10px; }
#addrList .address-item:hover{
  border-color: rgba(78,169,255,.35);
  background: rgba(18,22,28,.55);
  transform: translateY(-1px);
}

/* Icon tile */
#addrList .addr-icon{
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(80,160,255,.16), rgba(80,160,255,.06));
  border: 1px solid rgba(255,255,255,.08);
}

/* Title row + “Default” badge inline; subline beneath */
#addrList .addr-main{ 
  min-width: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
}
#addrList .addr-title{
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  order: 0;
}
#addrList .addr-sub{
  font-size: .92rem; color: rgba(255,255,255,.62);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-basis: 100%; order: 1;   /* force onto the next line */
}

/* Compact green “Default” pill; sits on the same row as the title */
#addrList .addr-pills{ display: inline-flex; gap: 8px; order: 0; margin: 0; }
#addrList .addr-pills .pill{
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; line-height: 1; padding: 3px 8px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}
#addrList .addr-pills .pill-default,
#addrList .addr-pills .pill.default{
  border-color: rgba(16,185,129,.35);
  background: rgba(16,185,129,.14);
  color: #52d2a7;
}

/* Actions: consistent, not cramped */
#addrList .addr-actions{ display: flex; align-items: center; gap: 10px; opacity: .95; }
#addrList .addr-actions .btn-icon{
  width: 36px; height: 36px; padding: 0; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
#addrList .addr-actions .btn-outline-secondary.btn-icon{ border-color: rgba(255,255,255,.16); }
#addrList .addr-actions .btn-outline-danger.btn-icon{    border-color: rgba(239,68,68,.45); }
#addrList .address-item:hover .addr-actions .btn-icon.act-use{ box-shadow: 0 0 12px rgba(80,160,255,.25); }

/* Section header (Saved Addresses) rhythm + count match Appointments */
.card-surface:has(#addrList) .section-head{
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .95rem; color: rgba(255,255,255,.75);
  margin: 8px 2px 10px;
}
.card-surface:has(#addrList) .section-head .count-pill{
  margin-left: auto; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.72);
  font-size: .75rem; padding: 2px 8px; border-radius: 999px;
}

/* Mobile tweaks */
@media (max-width:680px){
  #addrList .address-item{ padding: 12px; border-radius: 12px; }
  #addrList .addr-actions{ gap: 8px; }
  #addrList .addr-actions .btn-icon{ width: 34px; height: 34px; }
}

/* =========================
   ADDRESSES — spacing and flow polish
   ========================= */

/* Each address card: taller padding and better rhythm */
#addrList .address-item {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(15,18,23,.45);
  transition: border-color .18s ease, background .18s ease, transform .06s ease;
}

#addrList .address-item + .address-item { margin-top: 14px; }

#addrList .address-item:hover {
  border-color: rgba(78,169,255,.35);
  background: rgba(18,22,28,.55);
  transform: translateY(-1px);
}

/* Icon column: larger, centered */
#addrList .addr-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(80,160,255,.16), rgba(80,160,255,.06));
  border: 1px solid rgba(255,255,255,.08);
}

/* Address content flow */
#addrList .addr-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* Title and inline badges */
#addrList .addr-title {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

#addrList .addr-sub {
  font-size: .92rem;
  color: rgba(255,255,255,.7);
  line-height: 1.4;
}

/* “Default” badge more balanced */
#addrList .pill-default {
  font-size: .78rem;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(16,185,129,.35);
  background: rgba(16,185,129,.14);
  color: #52d2a7;
}

/* Meta line (distance, fee) */
#addrList .addr-meta {
  font-size: .9rem;
  color: rgba(255,255,255,.6);
  margin-top: 4px;
}

/* Button layout: aligned, with more air */
#addrList .addr-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

#addrList .addr-actions .btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================
   MOBILE
   ========================= */
@media (max-width:680px) {
  #addrList .address-item {
    padding: 14px 16px;
    gap: 12px;
    grid-template-columns: 36px 1fr;
  }
  #addrList .addr-title { font-size: .95rem; }
  #addrList .addr-actions { gap: 10px; }
}

/* Account sub-nav */
.account-tabs { display:flex; justify-content:center; margin:10px 0 18px; }
.account-tabs .tabs-scroll { display:flex; gap:8px; flex-wrap:wrap; }

/* Mobile: make it a sticky, horizontally-scrollable bar */
@media (max-width: 680px){
  .account-tabs{
    position: sticky;
    top: calc(var(--header-h, 56px) + 6px);
    z-index: 30;
    justify-content: flex-start;
    padding: 8px 12px 10px;
    margin: 0 -12px 10px;              /* bleed to edges */
    background: linear-gradient(180deg, rgba(9,12,16,.9), rgba(9,12,16,.6));
    backdrop-filter: blur(8px);
  }
  .account-tabs .tabs-scroll{
    gap: 8px;
    flex-wrap: nowrap;                 /* no wrapping on narrow screens */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .account-tabs .tabs-scroll::-webkit-scrollbar{ height:0; }
  .account-tabs .btn{ flex: 0 0 auto; }  /* keep each button’s width */
}

/* Optional: slightly larger hit area for compact buttons on touch */
@media (pointer:coarse){
  .account-tabs .btn.btn-compact{ padding:.5rem .9rem; border-radius:12px; }
}

/* ===== Addresses — compact 2-row desktop layout ===== */
@media (min-width: 900px){
  /* 3 cols: icon | main | actions */
  #addrList .address-item{
    grid-template-columns: 52px 1fr auto;
    padding: 14px 16px;
  }

  /* Main becomes a 2-row grid:
     row1: Title (left) + Default pill (right)
     row2: Meta (left) + City line (right) — flows full width on small content */
  #addrList .addr-main{
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 14px;
    row-gap: 4px;
    align-items: center;
    min-width: 0; /* enable ellipsis */
  }

  /* Row 1 */
  #addrList .addr-title{
    grid-column: 1; grid-row: 1;
    font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #addrList .addr-pills{
    grid-column: 2; grid-row: 1;
    justify-self: end; margin: 0;
  }
  #addrList .addr-pills .pill-default{
    padding: 3px 8px; font-size: .75rem;
    border:1px solid rgba(16,185,129,.35);
    background: rgba(16,185,129,.14); color:#52d2a7;
  }

  /* Row 2: meta left, city right (wraps to one line if short) */
  #addrList .addr-meta{ grid-column: 1; grid-row: 2; margin-top: 0; opacity:.75; }
  #addrList .addr-sub { grid-column: 2; grid-row: 2; margin-top: 0; text-align: right; opacity:.85; }

  /* Actions: pin to top-right, vertically centered, no extra bottom gap */
  #addrList .addr-actions{
    align-self: start;
    display: flex; gap: 10px; margin-top: 0;
  }
  #addrList .addr-actions .btn-icon{
    width: 36px; height: 36px; padding: 0; border-radius: 12px;
    display:inline-flex; align-items:center; justify-content:center;
  }

  /* Trim excess vertical whitespace between cards */
  #addrList .address-item + .address-item{ margin-top: 12px; }
}

/* Mobile unchanged, but give tiny breathing room for the pill under title if it wraps */
@media (max-width: 899.98px){
  #addrList .addr-pills{ margin-top: 4px; }
}

/* ===== Addresses — final polish for desktop ===== */
@media (min-width: 900px) {
  #addrList .address-item {
    grid-template-columns: 56px 1fr auto;
    padding: 18px 22px;
    align-items: center;
  }

  #addrList .addr-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 4px;
    align-items: baseline;
    min-width: 0;
  }

  /* Title on left, meta inline, default pill after meta */
  #addrList .addr-title {
    grid-column: 1 / 3;
    grid-row: 1;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  #addrList .addr-pills {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  #addrList .addr-pills .pill-default {
    padding: 3px 9px;
    font-size: 0.78rem;
    border: 1px solid rgba(16,185,129,.35);
    background: rgba(16,185,129,.14);
    color: #52d2a7;
    border-radius: 999px;
  }

  /* Meta + city on the same visual line, slightly lighter */
  #addrList .addr-meta {
    grid-column: 1 / 2;
    grid-row: 2;
    font-size: .9rem;
    color: rgba(255,255,255,.7);
  }

  #addrList .addr-sub {
    grid-column: 2 / 4;
    grid-row: 2;
    text-align: right;
    font-size: .9rem;
    color: rgba(255,255,255,.7);
  }

  /* Action buttons stay vertically centered */
  #addrList .addr-actions {
    align-self: center;
    display: flex;
    gap: 10px;
  }

  #addrList .addr-actions .btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Give cards more room between each other */
  #addrList .address-item + .address-item {
    margin-top: 16px;
  }
}

/* Slight breathing room for mobile */
@media (max-width: 899.98px) {
  #addrList .address-item {
    padding: 16px;
  }
  #addrList .addr-title {
    margin-bottom: 2px;
  }
}

/* ===== Address meta vs. actions vertical spacing ===== */
#addrList .addr-actions {
  margin-top: 6px;          /* creates breathing room */
}

@media (min-width: 900px) {
  #addrList .addr-actions {
    margin-top: 10px;       /* slightly more space on desktop */
  }
}

/* ==============================
   Account sub-nav — MOBILE clean
   ============================== */
@media (max-width: 680px){

  /* Strip the heavy bar look */
  .account-tabs{
    position: sticky;
    top: calc(var(--header-h, 56px) + 6px);
    z-index: 30;
    padding: 6px 12px 8px;
    margin: 0 -12px 10px;
    background: transparent;            /* no gradient */
    backdrop-filter: none;
    border: 0;
    justify-content: flex-start;
  }

  /* Make buttons lightweight chips */
  .account-tabs .tabs-scroll{
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .account-tabs .tabs-scroll::-webkit-scrollbar{ height: 0; }

  .account-tabs .btn{
    scroll-snap-align: center;
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    padding: .5rem .9rem;
    border-radius: 999px;               /* chip */
    box-shadow: none;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.92);
  }

  /* Inactive outline is softer, no inner glow */
  .account-tabs .btn.btn-outline-accent{
    border-color: rgba(255,255,255,.16);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.90);
  }

  /* Active = solid pill with subtle glow (no harsh border) */
  .account-tabs .btn.btn-accent{
    border-color: transparent;
    background: #3a86ff;
    color: #fff;
    box-shadow: 0 0 0 0 rgba(58,134,255,.0);
  }
  .account-tabs .btn.btn-accent:focus-visible{
    outline: 2px solid #8ab4ff; outline-offset: 2px;
  }

  /* Tighten vertical space around the tabs */
  .page-wrap h1,
  .h5-tight{
    margin-bottom: 6px;
  }
}

/* ===== Profile card — mobile fix ===== */
@media (max-width: 680px){
  /* Card chrome */
  #profileCard.card-surface{
    border-radius: 12px;
  }
  #profileCard .card-header{
    position: relative;
    padding: .75rem .85rem;
    padding-right: 64px;                 /* room for Edit */
  }
  #profileCard .card-header .btn{
    position: absolute;
    top: 8px; right: 8px;
    min-height: 36px;
    border-radius: 10px;
    font-size: 16px;                     /* avoid iOS zoom */
  }
  #profileCard .card-body{
    padding: .85rem .9rem;
  }

  /* Field list → compact 2-column grid */
  #profileCard .fieldlist{
    display: grid;
    grid-template-columns: 42% 1fr;      /* label | value */
    column-gap: 10px;
    row-gap: 8px;
    margin: 0;
  }
  #profileCard .fieldlist dt{
    color: rgba(255,255,255,.72);
    font-weight: 600;
    font-size: .92rem;
    line-height: 1.25;
    margin: 0;
    align-self: center;
  }
  #profileCard .fieldlist dd{
    font-size: .98rem;
    line-height: 1.25;
    margin: 0;
    align-self: center;
    color: rgba(255,255,255,.95);
  }

  /* Long values won’t blow the layout */
  #profileCard .fieldlist dd,
  #profileCard .fieldlist dd a{
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Slightly denser overall rhythm */
  #profileCard .pw-grid,
  #profileCard .pw-row{ gap: 10px; }
}

