/* ============================================================
   Tokens
   ============================================================ */
:root {
  --navy:      #0d1f3c;
  --navy-2:    #142545;
  --teal:      #2bbfca;
  --teal-dim:  #1fa8b3;
  --teal-bg:   rgba(43,191,202,.12);
  --surface:   #ffffff;
  --surface-2: #f0f4f8;
  --surface-3: #dde6ef;
  --text:      #0d1f3c;
  --text-2:    #3d5a7a;
  --text-3:    #7a9ab8;
  --danger:    #c2410c;
  --danger-bg: #fff1ec;

  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --sh: 0 2px 8px rgba(13,31,60,.08);
  --sh-md: 0 4px 16px rgba(13,31,60,.10);

  --nav-w: 220px;   /* sidenav width desktop */
  --bnav-h: 62px;   /* bottom nav height mobile */
}

/* ============================================================
   Reset — no body scroll
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--navy); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }
[hidden] { display: none !important; }

/* ============================================================
   Spinner
   ============================================================ */
.spinner { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--teal); border-radius: 50%; animation: spin .9s linear infinite; }
.spinner--sm { width: 28px; height: 28px; border-width: 2.5px; border-top-color: var(--teal-dim); border-color: var(--surface-3); border-top-color: var(--teal-dim); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ============================================================
   Views — fixed full-screen
   ============================================================ */
.view { position: fixed; inset: 0; display: flex; }

.view--center { align-items: center; justify-content: center; background: linear-gradient(150deg, var(--navy) 0%, #0d3a5c 100%); }

/* ============================================================
   Landing
   ============================================================ */
.landing { text-align: center; padding: 2rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; max-width: 380px; width: 100%; }
.landing__logo { width: min(52vw, 180px); filter: brightness(0) invert(1) drop-shadow(0 2px 16px rgba(43,191,202,.4)); margin-bottom: .5rem; }
.landing__tagline { font-size: clamp(2rem, 8vw, 2.75rem); font-weight: 700; color: #fff; letter-spacing: -.02em; }
.landing__sub { font-size: .9rem; color: rgba(255,255,255,.55); margin-bottom: .75rem; }

/* ============================================================
   App shell
   ============================================================ */
.view--app { flex-direction: column; background: var(--surface-2); }

/* ── Sidenav (desktop) ── */
.sidenav {
  display: none;
  width: var(--nav-w);
  flex-shrink: 0;
  flex-direction: column;
  background: var(--navy);
  padding: 1.5rem 0 1rem;
  overflow-y: auto;
  gap: 0;
}
.sidenav__logo-wrap {
  margin: 0 .875rem 1.75rem;
  display: flex; align-items: center;
}
.sidenav__logo {
  height: 32px; width: auto;
  object-fit: contain;
  object-position: left;
  filter: brightness(0) invert(1);
}
.sidenav__links { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidenav__bottom { padding-bottom: .5rem; }
.sidenav__item {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.25rem;
  margin: 0 .5rem;
  border-radius: var(--r);
  font-size: .875rem; font-weight: 500;
  color: rgba(255,255,255,.5);
  text-align: left;
  transition: color .15s, background .15s;
}
.sidenav__item:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidenav__item--active { color: var(--teal); background: rgba(43,191,202,.1); }
.sidenav__item:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.sidenav__icon { width: 20px; height: 20px; flex-shrink: 0; }
.sidenav__avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.2); flex-shrink: 0; }

/* ── Content area ── */
.app-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Panels ── */
.panel { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; padding-bottom: var(--bnav-h); }

/* ── Panel header ── */
.panel-header { padding: 1rem 1.5rem; border-bottom: 1px solid rgba(43,191,202,.15); background: linear-gradient(90deg, #0a1e38 0%, #0c2d47 100%); display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 5; }
.panel-header__title { font-size: 1.05rem; font-weight: 700; color: #fff; }
.panel-header__count { font-size: .8rem; color: rgba(255,255,255,.45); margin-left: auto; }

/* ── Bottom nav (mobile) ── */
.bottom-nav {
  flex-shrink: 0;
  height: var(--bnav-h);
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--surface-3);
  box-shadow: 0 -2px 10px rgba(13,31,60,.06);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-3); font-size: .65rem; font-weight: 500;
  transition: color .15s;
}
.bottom-nav__item svg { width: 22px; height: 22px; }
.bottom-nav__item--active { color: var(--teal-dim); }
.bottom-nav__avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface-3); }
.bottom-nav__item--active .bottom-nav__avatar { border-color: var(--teal-dim); }
.bottom-nav__item:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }

/* ============================================================
   Home hero (inside scrollable body)
   ============================================================ */
.home-hero {
  background: linear-gradient(120deg, var(--navy) 0%, #0e3d5e 50%, #166878 100%);
  padding: 1rem 1.25rem 1.25rem;
  border-radius: var(--r);
  margin-bottom: .25rem;
}
.home-hero__sub { font-size: .8rem; color: rgba(255,255,255,.6); margin-bottom: .1rem; }
.home-hero__name { font-size: clamp(1.25rem, 4vw, 1.6rem); font-weight: 700; color: #fff; letter-spacing: -.01em; margin-bottom: .85rem; }

.home-stats { display: flex; gap: .6rem; }
.home-stat {
  flex: 1;
  background: rgba(255,255,255,.1);
  border-radius: var(--r);
  padding: .55rem .5rem;
  display: flex; flex-direction: column; align-items: center;
  backdrop-filter: blur(4px);
}
.home-stat__val { font-size: 1.25rem; font-weight: 700; color: #fff; line-height: 1; margin-bottom: .15rem; }
.home-stat__unit { font-size: .85rem; }
.home-stat__lbl { font-size: .6rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.5); }

/* ============================================================
   Home body
   ============================================================ */
.home-body { background: var(--surface-2); flex: 1; padding: .9rem 1.25rem .5rem; display: flex; flex-direction: column; gap: .75rem; }

/* ============================================================
   Cert finder
   ============================================================ */
.cert-body { flex: 1; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; background: var(--surface-2); overflow-y: auto; }
.cert-intro { font-size: .875rem; color: var(--text-2); }
.cert-form { flex-shrink: 0; }
.cert-search-row { display: flex; gap: .5rem; }
.cert-search-input { flex: 1; }
.cert-search-btn { flex-shrink: 0; }
.cert-searching { display: flex; align-items: center; gap: .6rem; color: var(--text-2); font-size: .9rem; padding: .5rem 0; }
.cert-results { }
.cert-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (min-width: 860px) {
  .cert-results-grid { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); }
}

/* ─── Diver Card — wide landscape ───────────── */
.diver-card {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,.45), 0 3px 10px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
  color: #fff;
  background: linear-gradient(160deg, #041e42 0%, #0a3d7a 28%, #0b6575 58%, #054035 85%, #022018 100%);
}

/* Agency underwater tints */
.diver-card--padi   { background: linear-gradient(155deg, #041e42 0%, #073e9e 30%, #0b6e8a 62%, #034e5e 100%); }
.diver-card--ssi    { background: linear-gradient(155deg, #2a0808 0%, #8b1a1a 30%, #0b5068 65%, #034040 100%); }
.diver-card--sdi    { background: linear-gradient(155deg, #060f2a 0%, #0f2d6e 30%, #0b5870 62%, #034040 100%); }
.diver-card--tdi    { background: linear-gradient(155deg, #060f2a 0%, #0f2d6e 30%, #0b5870 62%, #034040 100%); }
.diver-card--sditdi { background: linear-gradient(155deg, #060f2a 0%, #0f2d6e 30%, #0b5870 62%, #034040 100%); }
.diver-card--cmas   { background: linear-gradient(155deg, #001030 0%, #003087 30%, #0b5e70 62%, #033040 100%); }

/* Underwater caustics + depth haze */
.diver-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% -30%, rgba(80,190,255,.22) 0%, transparent 52%),
    radial-gradient(ellipse at 75% -15%, rgba(120,220,255,.14) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 120%, rgba(0,60,30,.35) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* Inline SVG ocean decorations */
.dc-ocean-deco {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

/* All content above bg */
.dc-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 0;
}

/* Top row: [photo]  [cert title]  [agency logo] */
.dc-top-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.dc-photo-wrap { flex-shrink: 0; }
.dc-photo {
  width: 62px; height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.7);
  box-shadow: 0 3px 14px rgba(0,0,0,.45);
}
.dc-photo--placeholder {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 3px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
}
.dc-photo--placeholder svg { width: 34px; height: 34px; opacity: .7; }

.dc-cert-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.dc-cert-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 4px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.dc-name {
  font-size: .95rem;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Agency logo — top right, on frosted-white pill */
.dc-logo-wrap {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.88);
  border-radius: 12px;
  padding: 7px 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.dc-logo {
  max-height: 40px;
  max-width: 96px;
  object-fit: contain;
}
.diver-card--padi .dc-logo {
  max-height: 46px;
  max-width: 108px;
}
.dc-logo-text {
  font-size: 1.7rem;
  font-weight: 900;
  color: rgba(255,255,255,.9);
  letter-spacing: -.02em;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
}

/* Meta row — cert date / number / dob */
.dc-meta-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.18);
  padding: 12px 0;
}
.dc-meta-col { }
.dc-label {
  font-size: .62rem;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 .2rem;
}
.dc-meta-val {
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,.35);
}

.dc-verify {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  color: rgba(150,230,255,.9);
  text-decoration: none;
  padding: 4px 0 8px;
}
.dc-verify:hover { text-decoration: underline; color: #fff; }
.dc-warning { font-size: .78rem; color: #fbbf24; margin: 4px 0 6px; }

/* Remove button (absolute, top-right) */
.dc-remove {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 10;
  background: rgba(0,0,0,.4);
  border: none;
  color: #fff;
  font-size: .8rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.dc-remove:hover { background: rgba(0,0,0,.65); }

/* Edit button — to the left of remove */
.dc-edit {
  position: absolute;
  top: 12px; right: 48px;
  z-index: 10;
  background: rgba(0,0,0,.4);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.dc-edit:hover { background: rgba(0,0,0,.65); }
.dc-edit svg { width: 14px; height: 14px; }

/* Form section titles inside modals */
.form-section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 1.5rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.form-section-title:first-child { margin-top: 0; }

/* Locked (read-only) field state */
.form-input--locked {
  opacity: .55;
  cursor: not-allowed;
  background: rgba(255,255,255,.04) !important;
}

/* Lock notice banner */
.ce-lock-notice {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .82rem;
  color: var(--text-2);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: .65rem .9rem;
  margin-bottom: .75rem;
}
.ce-lock-notice svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; }
.ce-lock-notice strong { color: var(--text); font-weight: 600; }

/* Facility autocomplete dropdown */
.facility-ac-wrap { position: relative; }
.facility-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 200;
  background: var(--navy-2, #142545);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  list-style: none;
  margin: 0; padding: 4px 0;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.facility-dropdown[hidden] { display: none; }
.facility-dropdown li {
  padding: 9px 14px;
  cursor: pointer;
  font-size: .88rem;
  line-height: 1.3;
  color: var(--text, #e2e8f0);
  border-radius: 6px;
  margin: 0 4px;
}
.facility-dropdown li:hover,
.facility-dropdown li[aria-selected="true"] {
  background: rgba(43,191,202,.18);
  color: #fff;
}
.facility-dropdown__name { font-weight: 600; }
.facility-dropdown__loc  { font-size: .78rem; color: rgba(255,255,255,.5); }
.facility-dropdown__empty { padding: 10px 14px; font-size: .85rem; color: rgba(255,255,255,.4); font-style: italic; }
.facility-dropdown__loading { padding: 10px 14px; font-size: .85rem; color: rgba(255,255,255,.4); }

/* 4divers brand footer — white logo centered */
.dc-brand-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 22px 18px;
  margin-top: auto;
}
.dc-brand-logo {
  height: 28px;
  width: auto;
  max-width: 140px;
  filter: brightness(0) invert(1);
  opacity: .75;
}

/* Save/action footer */
.dc-footer { padding: 0 22px 20px; }
.dc-save-btn {
  width: 100%;
  font-weight: 700;
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
}
.dc-save-btn:hover { background: rgba(255,255,255,.28); }
.dc-save-btn--saved { background: rgba(255,255,255,.07); color: rgba(255,255,255,.45); cursor: default; border-color: rgba(255,255,255,.15); }

/* Saved certs shelf uses same grid */
.saved-certs { margin-bottom: 1.5rem; }
.saved-certs__title { font-size: .9rem; font-weight: 700; color: var(--text-2); margin-bottom: .75rem; }
.saved-certs__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 860px) {
  .saved-certs__list { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); }
}
.saved-certs__divider { border: none; border-top: 1px solid var(--surface-3); margin: 1.5rem 0 1rem; }

/* Confidence badges */
.cert-confidence { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cert-confidence--high   { background: rgba(34,197,94,.25); color: #86efac; }
.cert-confidence--medium { background: rgba(234,179,8,.2); color: #fde047; }
.cert-confidence--low    { background: rgba(239,68,68,.2); color: #fca5a5; }
.cert-extra { padding: .6rem 1.1rem .85rem; display: flex; flex-direction: column; gap: .35rem; border-top: 1px solid var(--surface-2); }
.cert-detail-row { display: flex; gap: .5rem; font-size: .8rem; }
.cert-detail-key { color: var(--text-3); font-weight: 600; text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; min-width: 72px; flex-shrink: 0; padding-top: .15rem; }
.cert-detail-val { color: var(--text); word-break: break-word; }

.btn-log-dive {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.5rem;
  background: linear-gradient(135deg, var(--teal) 0%, #17a3b8 100%);
  color: #fff; border: none;
  border-radius: var(--r-lg); font-size: .95rem; font-weight: 700;
  letter-spacing: .01em;
  box-shadow: 0 4px 12px rgba(43,191,202,.35);
  transition: opacity .15s, transform .12s, box-shadow .15s;
}
.btn-log-dive:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(43,191,202,.45); }
.btn-log-dive:active { transform: scale(.98); box-shadow: none; }
.btn-log-dive:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
@media (min-width: 768px) { #btn-log-home { width: auto; min-width: 220px; align-self: center; } }
#home-empty { flex: 1; justify-content: center; }

/* Free bar */
.free-bar { background: var(--surface); border-radius: var(--r); padding: .85rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.free-bar__text { font-size: .875rem; color: var(--text-2); flex: 1; }
.free-bar__upgrade { font-size: .875rem; font-weight: 600; color: var(--teal-dim); text-decoration: none; }
.free-bar__upgrade:hover { text-decoration: underline; }

.section-title { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }

/* ============================================================
   Dive list & cards
   ============================================================ */
.dive-list { display: flex; flex-direction: column; gap: .65rem; }

.dive-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1rem 1.1rem 1rem 1rem;
  display: flex; align-items: center; gap: .85rem;
  box-shadow: var(--sh);
  transition: box-shadow .15s;
}
.dive-card:hover { box-shadow: var(--sh-md); }

/* Number badge */
.dive-num {
  flex-shrink: 0;
  width: 50px;
  background: var(--teal-bg);
  border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center;
  padding: .5rem .25rem .4rem;
  text-align: center;
}
.dive-num__label { font-size: .55rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--teal-dim); line-height: 1; }
.dive-num__n { font-size: 1.4rem; font-weight: 800; color: var(--teal-dim); line-height: 1; }

.dive-card__body { flex: 1; min-width: 0; text-align: left; background: none; border: none; font: inherit; cursor: pointer; padding: 0; }
.dive-card__body:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: var(--r); }
.dive-card__site { font-size: .95rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dive-card__meta { font-size: .78rem; color: var(--text-3); margin: .15rem 0 .5rem; }

.dive-card__badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .71rem; font-weight: 600;
  padding: .18rem .5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--surface-3);
}
.badge--depth { color: var(--teal-dim); background: var(--teal-bg); border-color: transparent; }
.badge--time  { color: #4a7aa5; background: #e8f0f8; border-color: transparent; }
.badge--check { color: #1a7a3c; background: #e8f9ef; border-color: transparent; }
.badge--buddy { color: var(--text-2); }

.dive-card__stars { margin-top: .4rem; color: #f5a623; font-size: .8rem; letter-spacing: .1em; }

.dive-card__sub { font-size: .8rem; color: var(--text-2); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dive-card__actions { display: flex; gap: .15rem; flex-shrink: 0; }
.dive-card__edit, .dive-card__del { flex-shrink: 0; padding: .4rem; color: var(--text-3); border-radius: var(--r); transition: color .15s, background .15s; }
.dive-card__edit:hover { color: var(--teal-dim); background: var(--teal-bg); }
.dive-card__del:hover { color: var(--danger); background: var(--danger-bg); }
.dive-card__edit:focus-visible, .dive-card__del:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.dive-card__edit svg, .dive-card__del svg { width: 15px; height: 15px; display: block; }

/* Dive detail (read-only) modal */
.dive-detail__header-actions { display: flex; align-items: center; gap: .25rem; }
.modal__icon-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--text-3); border-radius: var(--r); transition: color .15s, background .15s; }
.modal__icon-btn:hover { color: var(--teal-dim); background: var(--teal-bg); }
.modal__icon-btn svg { width: 18px; height: 18px; }
.dive-detail__body { display: flex; flex-direction: column; gap: 1.25rem; }
.dive-detail__group-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: .5rem; }
.dive-detail__row { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--surface-2); }
.dive-detail__row:last-child { border-bottom: none; }
.dive-detail__label { font-size: .85rem; color: var(--text-2); flex-shrink: 0; }
.dive-detail__val { font-size: .85rem; font-weight: 600; color: var(--text); text-align: right; word-break: break-word; }
.dive-detail__empty { font-size: .85rem; color: var(--text-3); text-align: center; padding: 1rem; }

/* ============================================================
   State box
   ============================================================ */
.state-box { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3rem 2rem; gap: .65rem; }
.state-box__emoji { font-size: 2.75rem; line-height: 1; }
.state-box__title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.state-box__text  { font-size: .875rem; color: var(--text-2); line-height: 1.7; max-width: 280px; }

/* ============================================================
   Profile
   ============================================================ */
.profile-body { display: flex; flex-direction: column; padding: 2rem 1.5rem; gap: 2rem; max-width: 560px; }
.profile-identity { display: flex; align-items: center; gap: 1.25rem; }
.profile-identity__text { display: flex; flex-direction: column; gap: .25rem; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--teal); flex-shrink: 0; }
.profile-name  { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.profile-email { font-size: .875rem; color: var(--text-2); }

.settings-section { display: flex; flex-direction: column; gap: 1rem; }
.settings-section__title { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin: 0; }
.settings-section__desc  { font-size: .875rem; color: var(--text-2); margin: -.5rem 0 0; }
.settings-section--account { border-top: 1px solid var(--border, rgba(255,255,255,.08)); padding-top: 2rem; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.5rem; border-radius: var(--r);
  font-size: .9rem; font-weight: 600; cursor: pointer; border: none;
  transition: opacity .15s, background .15s;
}
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn--primary { background: var(--teal-dim); color: #fff; }
.btn--primary:hover { background: var(--teal); }
.btn--ghost { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--surface-3); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--danger { background: var(--danger-bg); color: var(--danger); min-width: 160px; }
.btn--danger:hover { opacity: .85; }

/* ============================================================
   Status
   ============================================================ */
.status { font-size: .85rem; color: var(--text-3); text-align: center; min-height: 1.2em; }
.status.error { color: var(--danger); }

/* ============================================================
   Modal
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-end; }
@media (min-width: 600px) { .modal { align-items: center; justify-content: center; } }

.modal__backdrop { position: absolute; inset: 0; background: rgba(13,31,60,.55); backdrop-filter: blur(2px); animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal__sheet {
  position: relative; width: 100%; max-width: 540px; max-height: 92svh;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: slide-up .28s cubic-bezier(.22,1,.36,1);
  padding: 1.25rem 1.25rem 2rem;
}
@media (min-width: 600px) { .modal__sheet { border-radius: var(--r-xl); animation: scale-in .2s ease; } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scale-in { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal__title  { font-size: 1.1rem; font-weight: 700; }
.modal__close  { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--text-3); border-radius: var(--r); transition: color .15s, background .15s; }
.modal__close svg { width: 18px; height: 18px; }
.modal__close:hover { color: var(--text); background: var(--surface-2); }
.modal__close:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ============================================================
   Form
   ============================================================ */
.dive-form  { display: flex; flex-direction: column; gap: .8rem; }
.form-row   { display: grid; gap: .65rem; }
.form-row--2 { grid-template-columns: 1fr 1fr; }
.form-row--name { grid-template-columns: 1fr .42fr 1fr; }
.form-row--4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 480px) { .form-row--4 { grid-template-columns: repeat(4, 1fr); } }
.form-field { display: flex; flex-direction: column; gap: .3rem; }
.form-label { font-size: .78rem; font-weight: 600; color: var(--text-2); }
.form-field--req .form-label::after { content: ' *'; color: var(--danger); }
.form-input {
  padding: .6rem .75rem; border: 1.5px solid var(--surface-3); border-radius: var(--r);
  font: inherit; font-size: .875rem; color: var(--text); background: var(--surface); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(43,191,202,.15); }
.form-input::placeholder { color: var(--text-3); }
.form-input[type="date"] { color-scheme: light; }
.form-textarea { resize: vertical; min-height: 68px; }

.star-rating { display: flex; gap: .2rem; margin-top: .1rem; }
.star { font-size: 1.6rem; color: var(--surface-3); transition: color .1s; padding: 0 .05rem; line-height: 1; }
.star--active { color: #f5a623; }
.star:hover { transform: scale(1.15); }
.star:focus-visible { outline: 2px solid var(--teal); border-radius: 3px; }

.form-status  { font-size: .85rem; text-align: center; }
.form-actions { display: flex; gap: .65rem; justify-content: flex-end; margin-top: .25rem; }
.form-actions .btn { min-width: 100px; }

/* ============================================================
   Log-a-dive wizard
   ============================================================ */
.dive-wizard { gap: 0; }
.dwz-track { display: flex; flex-direction: column; }
.dive-slide { display: flex; flex-direction: column; gap: .8rem; }
.dive-slide[hidden] { display: none; }
.dive-slide__title { font-size: 1rem; font-weight: 700; color: var(--text); margin: .1rem 0 .2rem; }
.dive-slide__fields { display: flex; flex-direction: column; gap: .8rem; }

/* number + unit suffix */
.dwz-num { position: relative; display: flex; align-items: center; }
.dwz-num .form-input { padding-right: 2.6rem; }
.dwz-suffix { position: absolute; right: .75rem; font-size: .8rem; color: var(--text-3); pointer-events: none; }

/* choice chips (enum + multi) */
.chip-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .42rem .7rem; border: 1.5px solid var(--surface-3); border-radius: 999px;
  font: inherit; font-size: .82rem; color: var(--text-2); background: var(--surface);
  cursor: pointer; transition: border-color .12s, background .12s, color .12s;
}
.chip:hover { border-color: var(--teal-dim); }
.chip--on { border-color: var(--teal-dim); background: var(--teal-bg); color: var(--teal-dim); font-weight: 600; }
.chip:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* per-field star (pin to main slides) */
.form-label { display: flex; align-items: center; gap: .4rem; }
.field-star {
  font-size: 1.05rem; line-height: 1; color: var(--text-3);
  padding: 0 .1rem; cursor: pointer; transition: color .12s, transform .12s;
}
.field-star:hover { transform: scale(1.15); }
.field-star--on { color: #f5a623; }
.field-star:focus-visible { outline: 2px solid var(--teal); border-radius: 3px; }

.dwz-pinned-label, .dwz-hint { font-size: .76rem; color: var(--text-3); margin: .3rem 0 0; }
.dwz-pinned-label { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }

/* accordion groups on the "More details" slide */
.dwz-acc { border: 1px solid var(--surface-3); border-radius: var(--r); overflow: hidden; }
.dwz-acc + .dwz-acc { margin-top: .6rem; }
.dwz-acc__head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: .7rem .85rem; font: inherit; font-size: .9rem; font-weight: 600; color: var(--text);
  background: var(--surface-2); cursor: pointer;
}
.dwz-acc__head:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.dwz-acc__chev { transition: transform .18s; color: var(--text-3); }
.dwz-acc__head[aria-expanded="true"] .dwz-acc__chev { transform: rotate(180deg); }
.dwz-acc__body { display: flex; flex-direction: column; gap: .8rem; padding: .85rem; }
.dwz-acc__body[hidden] { display: none; }

/* footer: back | dots | actions */
.dwz-footer {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem;
  margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--surface-2);
}
.dwz-footer__left  { justify-self: start; }
.dwz-footer__right { justify-self: end; display: flex; gap: .5rem; }
.dwz-footer .btn { min-width: 84px; }
.dwz-nav[hidden] { display: none; }
.dwz-dots { display: flex; gap: .4rem; justify-self: center; }
.dwz-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); transition: background .15s, transform .15s; }
.dwz-dot--on { background: var(--teal-dim); transform: scale(1.25); }
.dwz-dot--more { width: 6px; height: 6px; opacity: .6; }

@media (max-width: 420px) {
  .dwz-footer { grid-template-columns: 1fr auto; row-gap: .7rem; }
  .dwz-dots { grid-column: 1 / -1; order: -1; }   /* dots span full width on top */
  .dwz-footer__right { flex-wrap: wrap; justify-content: flex-end; }
}

/* ============================================================
   Desktop layout
   ============================================================ */
@media (min-width: 768px) {
  .view--app { flex-direction: row; }
  .sidenav { display: flex; }
  .app-content { flex-direction: row; flex: 1; overflow: hidden; }
  .panel { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .home-body { padding: 1.5rem; max-width: 860px; }
  .dive-list { max-width: 820px; }
  .home-hero { padding: 1.25rem 2rem 1.5rem; }
  .home-stats { gap: .75rem; max-width: 480px; }

  .panel-header { padding: 1.25rem 2rem 1rem; }
}

/* ============================================================
   Bubbles
   ============================================================ */
.bubble {
  position: fixed;
  bottom: -60px;
  border-radius: 50%;
  /* glassy sphere: dark base, bright rim, specular highlight */
  background:
    radial-gradient(circle at 30% 28%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(circle at 68% 72%, rgba(43,191,202,0.18) 0%, rgba(43,191,202,0) 60%),
    radial-gradient(circle at 50% 50%, rgba(43,191,202,0.07) 0%, rgba(13,31,60,0.04) 100%);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow:
    inset -2px -2px 4px rgba(43,191,202,0.25),
    inset  1px  1px 3px rgba(255,255,255,0.35);
  pointer-events: none;
  animation: bubble-rise var(--dur, 9s) ease-in forwards;
  z-index: 0;
}
@keyframes bubble-rise {
  0%   { transform: translateY(0)       translateX(0);                    opacity: 0; }
  8%   { opacity: 0.85; }
  25%  { transform: translateY(-25vh)   translateX(calc(var(--drift)*0.3)); }
  50%  { transform: translateY(-52vh)   translateX(calc(var(--drift)*0.7)); }
  75%  { transform: translateY(-78vh)   translateX(var(--drift)); }
  92%  { opacity: 0.5; }
  100% { transform: translateY(-112vh)  translateX(calc(var(--drift)*1.1)); opacity: 0; }
}


/* Tall modal variant for search (scrollable content) */
.modal__sheet--tall { max-height: 90vh; overflow-y: auto; }
@media (min-width: 600px) { .modal__sheet--tall { max-height: 80vh; } }
.modal__sheet--narrow { max-width: 360px; margin: auto; border-radius: var(--r-xl) !important; text-align: center; }

/* Remove cert confirmation modal */
.remove-cert-icon-wrap { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.remove-cert-icon { width: 56px; height: 56px; }
.remove-cert-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 0 0 .5rem; }
.remove-cert-name  { font-size: .95rem; font-weight: 600; color: var(--teal); margin: 0 0 .75rem; }
.remove-cert-desc  { font-size: .85rem; color: var(--text-2); margin: 0 0 1.75rem; line-height: 1.5; }
.remove-cert-actions { display: flex; gap: .75rem; justify-content: center; }
.complete-profile__desc { font-size: .9rem; color: var(--text-2); margin: 0 0 1.25rem; line-height: 1.5; }
.remove-cert-actions .btn { min-width: 110px; }

/* No-results strip inside modal */
.cert-no-results { text-align: center; padding: 1.5rem 1rem; }
.cert-no-results__text { color: var(--text-2); margin-bottom: 1rem; font-size: .9rem; }
.btn--secondary { background: var(--surface-2); color: var(--text-1); border: 1px solid var(--surface-3); padding: .6rem 1.4rem; border-radius: var(--r); font-weight: 600; font-size: .9rem; cursor: pointer; }
.btn--secondary:hover { background: var(--surface-3); }

/* Cert-results grid inside modal */
#modal-cert-search .cert-results-grid { margin-top: 1rem; }
#modal-cert-search .diver-card { max-width: 100%; }

/* Cert panel action row */
.cert-actions { padding: 1rem 1.25rem .25rem; }
.cert-actions .btn-log-dive { max-width: 100%; }
@media (min-width: 768px) {
  .cert-actions { padding: 1.5rem 2rem .5rem; }
  .cert-actions .btn-log-dive { width: auto; min-width: 220px; }
}

/* Search form footer — always-visible manual add link */
.cert-form-footer { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--surface-3); }
.cert-form-footer__text { font-size: .82rem; color: var(--text-3); }
.cert-form-footer__link { font-size: .82rem; font-weight: 600; color: var(--teal-dim); background: none; border: none; cursor: pointer; padding: 0; }
.cert-form-footer__link:hover { text-decoration: underline; }
/* Site autocomplete */
.site-ac__list {
  position: fixed;
  z-index: 9999;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: var(--r);
  box-shadow: var(--sh-md);
  max-height: 260px;
  overflow-y: auto;
}
.site-ac__list[hidden] { display: none; }
.site-ac__item {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .6rem 1rem;
  cursor: pointer;
  outline: none;
}
.site-ac__item:hover,
.site-ac__item:focus { background: var(--teal-bg); }
.site-ac__name { font-size: .92rem; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-ac__country { font-size: .78rem; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }

/* Date + time inline row */
.dwz-row { display: flex; gap: .5rem; }
.dwz-row .form-field { flex: 1; }
.dwz-row .dwz-field[data-field="dive_time"] { flex: 0 0 auto; }

/* Time HH:MM split */
.dwz-time-split { display: flex; align-items: center; gap: .35rem; }
.dwz-time-split .form-input { width: 72px; text-align: center; padding-left: .5rem; padding-right: .5rem; }
.dwz-time-sep { font-size: 1.1rem; font-weight: 700; color: var(--text-2); line-height: 1; }

/* Site autocomplete meta (country + distance) */
.site-ac__meta { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.site-ac__dist { font-size: .75rem; color: var(--teal-dim); white-space: nowrap; font-weight: 600; }

/* Invite accept modal */
.invite-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--teal); margin: 0 auto 1rem; display: block;
}
.invite-from { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.invite-tagline { font-size: .95rem; color: var(--text-2); margin-bottom: 1rem; }
.invite-dive {
  background: var(--surface-2); border-radius: var(--r); padding: .75rem 1rem;
  text-align: left; margin: .75rem 0;
}
.invite-dive__label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: .2rem; }
.invite-dive__site  { font-size: .95rem; font-weight: 700; color: var(--text); }
.invite-dive__meta  { font-size: .8rem; color: var(--text-3); margin-top: .1rem; }

/* Missing required field highlight */
.form-field--missing .form-input,
.form-field--missing .chip-group,
.form-field--missing .site-ac .form-input,
.form-field--missing .dwz-time-split .form-input {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(194,65,12,.12);
}
.form-field--missing .form-label { color: var(--danger); }

/* Starred-field highlight animation (fires after promote to experience slide) */
@keyframes field-highlight {
  0%   { background: rgba(43,191,202,.18); border-radius: var(--r); }
  60%  { background: rgba(43,191,202,.10); }
  100% { background: transparent; }
}
.dwz-field--highlight { animation: field-highlight 1.4s ease forwards; }

/* Field label row with help button */
.form-label-row { display: flex; align-items: center; gap: .3rem; margin-bottom: .15rem; }
.form-label-row .form-label { margin: 0; }
.field-help-btn {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--surface-3); font-size: .7rem; font-weight: 700; line-height: 1;
  color: var(--text-3); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .12s, color .12s, background .12s;
}
.field-help-btn:hover { border-color: var(--teal-dim); color: var(--teal-dim); background: var(--teal-bg); }
.field-help-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.field-help-pop {
  font-size: .78rem; color: var(--text-2); line-height: 1.55;
  background: var(--surface-2); border: 1px solid var(--surface-3);
  border-radius: var(--r); padding: .55rem .75rem;
  margin-bottom: .25rem;
}
.field-help-pop[hidden] { display: none; }

/* Entry type chips with icons */
.chip-group--entry { gap: .5rem; }
.chip--icon { display: inline-flex; align-items: center; gap: .35rem; padding: .55rem .85rem; }
.chip__icon { flex-shrink: 0; display: flex; align-items: center; }
.chip__img { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; opacity: .75; }
.chip--on .chip__img { opacity: 1; }
.chip--icon.chip--on .chip__icon svg { stroke: var(--teal-dim); }

/* Location field readonly state */
.form-field--auto .form-input {
  background: var(--surface-2); color: var(--text-2);
  border-style: dashed; cursor: default;
}
.form-field--auto .form-label::after { content: ' (auto-filled)'; font-weight: 400; color: var(--text-3); font-size: .7rem; }

/* Accordion optional label */
.dwz-acc__opt { font-weight: 400; font-size: .8em; color: var(--text-3); }

/* Buddy autocomplete */
.buddy-ac { position: relative; }
.buddy-ac__list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 200; margin: 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--surface-3);
  border-radius: var(--r); box-shadow: var(--sh-md);
  max-height: 220px; overflow-y: auto;
}
.buddy-ac__list[hidden] { display: none; }
.buddy-ac__item, .buddy-ac__create {
  padding: .6rem 1rem; cursor: pointer; outline: none;
  font-size: .9rem; color: var(--text);
  display: flex; align-items: center; gap: .45rem;
}
.buddy-ac__item:hover, .buddy-ac__item:focus { background: var(--teal-bg); }
.buddy-ac__create { color: var(--teal-dim); font-weight: 600; border-top: 1px solid var(--surface-2); }
.buddy-ac__create:hover, .buddy-ac__create:focus { background: var(--teal-bg); }

/* Create new buddy inline form */
.buddy-create {
  margin-top: .6rem; padding: .85rem; background: var(--surface-2);
  border-radius: var(--r); border: 1px solid var(--surface-3);
}
.buddy-create[hidden] { display: none; }
.buddy-create__title { font-size: .82rem; font-weight: 700; color: var(--text-2); margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .04em; }
.buddy-create__row { display: flex; gap: .5rem; }
.buddy-create__row .form-input { flex: 1; }

/* Invite link panel */
.buddy-invite {
  margin-top: .6rem; padding: .85rem; background: linear-gradient(135deg, rgba(43,191,202,.07), rgba(43,191,202,.03));
  border-radius: var(--r); border: 1px solid rgba(43,191,202,.25);
}
.buddy-invite[hidden] { display: none; }
.buddy-invite__label { font-size: .85rem; color: var(--text-2); margin-bottom: .5rem; }
.buddy-invite__label strong { color: var(--teal-dim); }
.buddy-invite__url-row { display: flex; gap: .4rem; margin-bottom: .6rem; }
.buddy-invite__url { flex: 1; font-size: .78rem; background: var(--surface); }
.buddy-invite__share-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn--share {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem; border-radius: var(--r); font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--surface-3); color: var(--text-2); background: var(--surface);
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn--share:hover { background: var(--surface-2); border-color: var(--teal-dim); color: var(--teal-dim); }
.buddy-invite__wa { color: #25d366; }
.buddy-invite__wa:hover { border-color: #25d366; color: #25d366; background: rgba(37,211,102,.07); }

/* Pending dive shares (awaiting approval) */
.pending-shares { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.pending-shares[hidden] { display: none; }
.pending-shares__title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: .25rem 0 .1rem; }
.pending-share {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(43,191,202,.08), rgba(43,191,202,.03));
  border: 1px solid rgba(43,191,202,.28); border-radius: var(--r); padding: .75rem .9rem;
}
.pending-share__info { flex: 1; min-width: 0; }
.pending-share__site { font-size: .95rem; font-weight: 700; color: var(--text); }
.pending-share__meta { font-size: .78rem; color: var(--text-3); margin-top: .15rem; }
.pending-share__actions { display: flex; gap: .4rem; flex-shrink: 0; }
.pending-share__actions .btn { padding: .4rem .8rem; font-size: .82rem; }

/* Buddies page */
/* Buddies panel */
.buddies-body { padding: 1rem 1rem .5rem; display: flex; flex-direction: column; gap: 1rem; }

.buddies-search-wrap { position: relative; }
.buddies-search__icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.buddies-search { width: 100%; padding: .65rem .9rem .65rem 2.4rem; background: var(--surface); border: 1px solid var(--surface-3); border-radius: var(--r); font: inherit; font-size: .9rem; color: var(--text); }
.buddies-search:focus { outline: none; border-color: var(--teal-dim); box-shadow: 0 0 0 3px var(--teal-bg); }

.buddies-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 520px) { .buddies-list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .buddies-list { grid-template-columns: repeat(4, 1fr); } }

.buddy-card {
  background: var(--surface); border: 1px solid var(--surface-3);
  border-radius: var(--r-lg); padding: 1.25rem 1rem 1rem;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  box-shadow: var(--sh); text-align: center;
}
.buddy-card__avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-bg) 0%, var(--surface-3) 100%);
  color: var(--teal-dim); font-weight: 700; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--surface-3);
}
.buddy-card__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.buddy-card__name { font-size: .9rem; font-weight: 700; color: var(--text); line-height: 1.2; word-break: break-word; }
.buddy-card__status {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .2rem .6rem; border-radius: 99px;
}
.buddy-card__status--on { background: var(--teal-bg); color: var(--teal-dim); }
.buddy-card__status--pending { background: var(--surface-2); color: var(--text-3); }
.buddy-card__share {
  margin-top: .35rem; width: 100%; padding: .45rem .5rem;
  background: var(--surface-2); border: 1px solid var(--surface-3);
  border-radius: var(--r); font-size: .78rem; font-weight: 600; color: var(--text-2);
  transition: background .15s, color .15s;
}
.buddy-card__share:hover { background: var(--teal-bg); color: var(--teal-dim); border-color: var(--teal-dim); }

/* Invite buddy modal */
.invite-buddy__desc { font-size: .88rem; color: var(--text-2); margin: 0 0 1rem; line-height: 1.5; }
.invite-buddy__link-wrap { display: flex; gap: .5rem; margin-bottom: 1rem; }
.invite-buddy__link-input { flex: 1; padding: .6rem .85rem; background: var(--surface-2); border: 1px solid var(--surface-3); border-radius: var(--r); font-size: .8rem; color: var(--text-2); min-width: 0; }
.invite-buddy__copy { flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--surface-3); color: var(--text-2); display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.invite-buddy__copy svg { width: 18px; height: 18px; }
.invite-buddy__copy:hover, .invite-buddy__copy.copied { background: var(--teal-bg); color: var(--teal-dim); border-color: var(--teal-dim); }
.invite-buddy__share-row { display: flex; gap: .6rem; }
.invite-buddy__share-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: .75rem .5rem; border-radius: var(--r); font-size: .75rem; font-weight: 600;
  border: 1px solid var(--surface-3); background: var(--surface-2); color: var(--text-2);
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.invite-buddy__share-btn svg { width: 22px; height: 22px; }
.invite-buddy__share-btn:hover { background: var(--surface-3); color: var(--text); }
.invite-buddy__share-btn--whatsapp { color: #25d366; border-color: rgba(37,211,102,.3); background: rgba(37,211,102,.06); }
.invite-buddy__share-btn--whatsapp:hover { background: rgba(37,211,102,.14); }
.invite-buddy__share-btn--whatsapp svg { width: 22px; height: 22px; }
.invite-buddy__share-btn--sms { color: #3b82f6; border-color: rgba(59,130,246,.3); background: rgba(59,130,246,.06); }
.invite-buddy__share-btn--sms:hover { background: rgba(59,130,246,.14); }
