/* Conte Strong Family — phone overlay. Desktop (>=900px) cards/hero stay as in page CSS. */

.hiee-a2hs {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 120;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: #132a36;
  border-top: 1px solid rgba(224,177,91,.45);
  color: #f4e9d8;
  font: 14px/1.3 "Segoe UI", Tahoma, sans-serif;
}
.hiee-a2hs p { margin: 0; flex: 1; }
.hiee-a2hs button {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: 600 14px/1 "Segoe UI", Tahoma, sans-serif;
  border: 1px solid transparent;
}
.hiee-a2hs .go { background: #e0b15b; color: #07161d; border-color: #c9922a; }
.hiee-a2hs .x { background: transparent; color: #e8dcc4; border-color: rgba(224,177,91,.4); }

@media (max-width: 640px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
  body { min-width: 0; }

  .cards {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 8px 12px 12px !important;
    margin-top: 0 !important;
    justify-content: stretch;
  }
  a.card {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
    flex-basis: auto !important;
    padding: 12px 10px 10px !important;
  }
  .card svg.ico { width: 40px; height: 40px; }
  .card h2 { font-size: 15px; }
  .card p { font-size: 12px; }

  .hero { min-height: 0 !important; }
  .hero-copy {
    padding: 10px 12px 8px !important;
    max-width: none !important;
  }
  .hero-copy h1,
  h1 { font-size: 22px !important; margin: 4px 0 !important; }
  .greet { font-size: 16px !important; letter-spacing: .08em; }
  .sub { font-size: 14px; }

  a.btn,
  button.act,
  a.act,
  a.pwlink,
  button.gold,
  button.ghost,
  button.like,
  button.comment-count,
  .tb button,
  .tb label.up,
  a.dlbtn,
  .tap,
  button.bell {
    min-height: 44px !important;
  }
  a.btn,
  button.act,
  a.act {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 16px !important;
  }
  a.pwlink { padding: 10px 12px !important; }

  .wall-wrap {
    max-width: none !important;
    padding: 6px 12px 24px !important;
  }
  .post-video,
  .post-photo {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
  }

  .lei {
    height: 48px !important;
    z-index: 2 !important;
    background-size: auto 48px !important;
    pointer-events: none !important;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 220px), transparent calc(100% - 64px));
    mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 220px), transparent calc(100% - 64px));
  }
  nav,
  .bar,
  .links,
  .bell-wrap {
    position: relative;
    z-index: 80 !important;
  }
  a.btn.off {
    position: relative;
    z-index: 90 !important;
  }
  nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 8px;
  }
  .bar {
    flex-wrap: wrap;
    height: auto !important;
    min-height: 52px;
    padding: 8px 10px !important;
    gap: 8px;
  }

  input[type=text],
  input[type=password],
  input[type=tel],
  textarea,
  .quick-comment input,
  .invite input {
    min-height: 44px;
    padding: 12px !important;
    font-size: 16px !important;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  label.f { width: 100%; max-width: 100%; }
  .wrap { padding: 12px 14px 24px !important; max-width: 100% !important; }
  button.act.save,
  button.act.add,
  button.act.start { font-size: 16px !important; }

  .tb { flex-wrap: wrap; align-items: stretch; }
  .tb form { flex: 1 1 100%; max-width: 100%; }
  .tb input[type=text],
  .tb input[name=mkdir] {
    width: 100% !important;
    max-width: 100%;
    min-height: 44px;
    font-size: 16px !important;
  }
  .addr {
    max-width: calc(100% - 20px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.list {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .acts input[name=hiee_to] {
    width: 88px !important;
    max-width: 28vw;
  }
  .gallery a.gcard,
  .gitem { width: calc(50% - 8px); max-width: 46vw; }
  .gallery img { width: 100%; height: auto; aspect-ratio: 1; }

  .invite,
  .smsbox,
  .formrow,
  .ownform,
  .addcform { min-width: 0; }
  .invite input { flex: 1 1 100%; min-width: 0 !important; }

  .hiee-a2hs.show { display: flex; }
}

@media (min-width: 900px) {
  /* Desktop tightening already in page CSS — do not enlarge cards or hero. */
}

@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top, 0px); }
}


/* Always-visible Add to phone — desktop and phone. Nav link is never dismissible. */
a.hiee-addphone,
button.hiee-addphone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  box-sizing: border-box;
  color: #07161d;
  background: #e0b15b;
  border: 1px solid #c9922a;
  border-radius: 8px;
  font: 600 14px/1 "Segoe UI", Tahoma, sans-serif;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  z-index: 90;
  white-space: nowrap;
  max-width: 100%;
}
a.hiee-addphone:hover,
button.hiee-addphone:hover { background: #f4e9d8; }
a.btn.home.hiee-addphone { color: #07161d; }
.hiee-addphone-line {
  text-align: center;
  margin: 10px 12px 16px;
  position: relative;
  z-index: 6;
}
.hiee-addphone-line .hiee-addphone { max-width: calc(100% - 8px); }

.hiee-a2hs-panel {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 220;
  max-width: 420px;
  width: auto;
  margin: 0 auto;
  box-sizing: border-box;
  background: #132a36;
  border: 1px solid rgba(224,177,91,.55);
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  color: #f4e9d8;
  font: 15px/1.4 "Segoe UI", Tahoma, sans-serif;
}
.hiee-a2hs-panel.open { display: block; }
.hiee-a2hs-panel[hidden] { display: none !important; }
.hiee-a2hs-panel h3 {
  margin: 0 0 10px;
  font: 600 16px/1.3 "Segoe UI", Tahoma, sans-serif;
  color: #e0b15b;
}
.hiee-a2hs-panel p { margin: 0 0 10px; color: #e8dcc4; }
.hiee-a2hs-panel-x {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 16px;
  margin-top: 4px;
  background: #e0b15b;
  color: #07161d;
  border: 1px solid #c9922a;
  border-radius: 8px;
  font: 600 14px/1 "Segoe UI", Tahoma, sans-serif;
  cursor: pointer;
}

@media (max-width: 640px) {
  a.hiee-addphone,
  button.hiee-addphone,
  .hiee-a2hs-panel-x {
    min-height: 44px !important;
  }
  nav a.hiee-addphone,
  nav a.btn.home.hiee-addphone {
    position: relative;
    z-index: 90 !important;
  }
  .hiee-a2hs-panel {
    top: max(64px, calc(env(safe-area-inset-top, 0px) + 56px));
    transform: none;
    max-height: calc(100vh - 88px);
    overflow: auto;
  }
  .bar .hiee-addphone {
    flex: none;
    margin-left: 8px;
  }
}

/* Family Wall unread badge on Add to phone + bell. Red count, gold rim so it shows on the gold phone control. */
.wall-unread {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #c44536;
  color: #f4e9d8;
  font: 700 11px/18px "Segoe UI", Tahoma, sans-serif;
  text-align: center;
  border: 1px solid #e0b15b;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  pointer-events: none;
  z-index: 3;
  box-sizing: border-box;
}
.wall-unread[hidden] { display: none !important; }
button.bell > .wall-unread {
  right: auto;
  left: -6px;
}

@media (max-width: 640px) {
  .wall-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font: 700 12px/20px "Segoe UI", Tahoma, sans-serif;
    top: -7px;
    right: -7px;
  }
  button.bell > .wall-unread {
    left: -7px;
    right: auto;
  }
  a.hiee-addphone,
  button.hiee-addphone {
    overflow: visible;
  }
}

.hiee-phone-ico {
  width: 22px;
  height: 22px;
  display: block;
  flex: none;
}
a.hiee-addphone {
  gap: 8px;
  overflow: visible !important;
}
nav {
  overflow: visible;
}

@media (max-width: 640px) {
  .hiee-addphone-label { display: none; }
  nav a.hiee-addphone,
  nav a.btn.home.hiee-addphone {
    width: 48px;
    min-width: 48px;
    padding: 8px;
  }
  .wall-unread {
    min-width: 22px !important;
    height: 22px !important;
    padding: 0 6px !important;
    border-radius: 11px !important;
    font: 800 13px/22px "Segoe UI", Tahoma, sans-serif !important;
    top: -8px !important;
    right: -8px !important;
  }
}

/* Unread count is the OS home-screen icon only (Badging API). Do not paint on-page dots. */
.wall-unread { display: none !important; }

@media (max-width: 640px) {
  /* Fit 5 cards + Family Wall on the first phone screen. */
  .lei {
    height: 36px !important;
    background-size: auto 36px !important;
  }
  .hero-copy {
    padding: 6px 10px 4px !important;
  }
  .hero-copy h1,
  h1 { font-size: 18px !important; margin: 2px 0 0 !important; }
  .greet { font-size: 13px !important; margin: 0 !important; }
  .sub { display: none !important; }
  nav { margin-bottom: 6px !important; gap: 6px !important; }
  .cards {
    gap: 6px !important;
    padding: 4px 10px 6px !important;
  }
  a.card {
    padding: 8px 8px 6px !important;
    gap: 2px !important;
    min-height: 0 !important;
  }
  .card svg.ico { width: 28px !important; height: 28px !important; }
  .card h2 { font-size: 13px !important; margin: 0 !important; }
  .card p { display: none !important; }
  .hiee-addphone-line { margin: 6px 10px 8px !important; }
  .wall-wrap { padding: 4px 12px 24px !important; }
}
/* === v16 phone bottom nav (mobile only; desktop unchanged) === */
.hiee-bnav {
  display: none;
}
@media (max-width: 640px) {
  body.hiee-has-bnav {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.hiee-has-bnav .hiee-a2hs {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .hiee-bnav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 150;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    min-height: 56px;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    background: rgba(19,42,54,.97);
    border-top: 1px solid rgba(224,177,91,.45);
    box-shadow: 0 -8px 24px rgba(0,0,0,.35);
    backdrop-filter: blur(8px);
  }
  .hiee-bnav a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    min-width: 44px;
    padding: 6px 2px;
    text-decoration: none;
    color: #c4b59a;
    font: 600 11px/1.1 "Segoe UI", Tahoma, sans-serif;
    border-radius: 10px;
  }
  .hiee-bnav a svg { width: 22px; height: 22px; display: block; }
  .hiee-bnav a.on, .hiee-bnav a:active {
    color: #e0b15b;
    background: rgba(224,177,91,.12);
  }
  .hiee-bnav a.opt { opacity: .92; }
}
@media (min-width: 641px) {
  .hiee-bnav { display: none !important; }
}

/* Wall albums cards on home */
.albums-wrap {
  width: 100%; max-width: 720px; margin: 0 auto; padding: 4px 16px 12px; position: relative; z-index: 5;
}
.albums-card {
  background: rgba(19,42,54,.9); border: 1px solid rgba(224,177,91,.32);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.28); padding: 14px 16px; margin-bottom: 12px;
}
.albums-card h3 { margin: 0 0 8px; font: 600 16px/1.2 "Segoe UI", Tahoma, sans-serif; color: #e0b15b; }
.album-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-item {
  flex: 1 1 100%; padding: 10px 12px; border-radius: 10px; background: #0b1f2a;
  border: 1px solid rgba(224,177,91,.22); color: #e8dcc4; font-size: 14px;
}
.ev-item .d { color: #e0b15b; font-weight: 600; margin-right: 8px; }
.album-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.album-actions input[type=text] {
  min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(224,177,91,.4);
  background: #0b1f2a; color: #f4e9d8; font: 16px/1 "Segoe UI", Tahoma, sans-serif; flex: 1 1 140px;
}
.album-tile {
  width: calc(50% - 6px); min-width: 120px; text-decoration: none; color: inherit;
  background: #0b1f2a; border: 1px solid rgba(224,177,91,.28); border-radius: 12px; overflow: hidden;
}
.album-tile img { display: block; width: 100%; height: 110px; object-fit: cover; background: #07161d; }
.album-tile .meta { padding: 8px 10px 10px; font: 600 13px/1.25 "Segoe UI", Tahoma, sans-serif; color: #f4e9d8; }
.album-tile .meta span { display: block; color: #c4b59a; font: 12px/1.2 "Segoe UI", Tahoma, sans-serif; margin-top: 2px; }
.health-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 8px; }
.health-card {
  flex: 1 1 220px; min-width: 200px; padding: 14px 16px;
  background: rgba(19,42,54,.92); border: 1px solid rgba(224,177,91,.32); border-radius: 14px;
}
.health-card h3 { margin: 0 0 6px; font: 600 15px/1.2 "Segoe UI", Tahoma, sans-serif; color: #e0b15b; }
.health-card p { margin: 4px 0; color: #e8dcc4; font-size: 14px; }
.health-card .ok { color: #1f6f64; font-weight: 700; }
.health-card .bad { color: #c44536; font-weight: 700; }
@media (max-width: 640px) {
  .albums-wrap { padding: 4px 12px 12px !important; max-width: none !important; }
  .album-tile { width: calc(50% - 6px); }
}
