/* ============================================================================
 * BayCast v63 — Profile / Calendar / Tackle / Species / Photos
 * ----------------------------------------------------------------------------
 * Shared panel styles for every v63 feature. Keeps the look consistent with
 * the existing v52 marks menu (dark panel, accent teal) without touching any
 * current styles.
 * ============================================================================ */

/* ------- Sidebar nav buttons (below GPS Marks) ---------------------------- */
.v63-nav-group {
  display: flex; flex-direction: column; gap: 6px;
  margin: 0 0 12px 0;
}

/* v63.9.99-clean9c — PC fix
   Chrome was collapsing the wrapping <details> to height:2px even though the
   children laid out at 273px (35 summary + 238 body). Caused by overflow:hidden
   on .layer-group + nested flex containers. Use a flow-root container so the
   details computes intrinsic height properly, allow overflow visible just for
   this one details, and put the buttons in plain block flow. */
.v63-nav-details {
  display: flow-root !important;
  overflow: visible !important;
  height: auto !important;
}
.v63-nav-details > .lg-body {
  display: block !important;
  padding: 8px 8px 8px 8px;
}
.v63-nav-details .v63-nav-group {
  display: block;
  margin: 0;
  gap: 0;
}
.v63-nav-details .v63-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 4px;
}
.v63-nav-details .v63-nav-btn:last-child { margin-bottom: 0; }
.lg-dot.account { background: #f6c23b; }
.v63-nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  color: #e7eef6; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.v63-nav-btn:hover {
  background: rgba(11,154,168,0.12);
  border-color: rgba(11,154,168,0.35);
}
.v63-nav-btn svg {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.v63-nav-btn .v63-nav-count {
  margin-left: auto;
  font-size: 11px; padding: 2px 7px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px; font-weight: 600;
  color: #9ab0c9;
}

/* ------- Panel overlay (right-slide on desktop, full screen on mobile) ---- */
.v63-overlay {
  position: fixed; inset: 0; z-index: var(--z-auth);
  display: none;
  background: rgba(4,10,18,0.6);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.v63-overlay.open { display: block; }
.v63-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 100vw;
  background: #0e1a27; color: #e7eef6;
  box-shadow: -8px 0 32px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
  animation: v63SlideIn 0.22s cubic-bezier(.22,.61,.36,1);
}
.v63-panel-wide { width: 560px; }
@keyframes v63SlideIn { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.v63-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.v63-hd h2 {
  margin: 0; font-size: 17px; font-weight: 700;
  color: #fff; letter-spacing: 0.01em;
}
.v63-hd .v63-close {
  /* v63.6: raise above the DBG debug tag (z=2147483647) so the close target
     is never occluded when the overlay opens with ?debug=1 active. */
  position: relative; z-index: var(--z-debug);
  background: rgba(255,255,255,0.08); color: #e7eef6;
  border: 0; width: 30px; height: 30px; border-radius: 7px;
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.v63-hd .v63-close:hover { background: rgba(255,255,255,0.14); }

/* v63.6: when debug tag is present, reserve the top-right corner for the
   DBG pill (x=6px right, ~70px wide). The close button shifts left via
   margin-right so it sits clear of the tag with zero pixel overlap. */
body[data-debug="1"] .v63-hd {
  padding-right: 18px;
}
body[data-debug="1"] .v63-hd .v63-close {
  width: 36px; height: 36px;
  margin-right: 84px; /* 70px tag width + 14px breathing room */
}

.v63-bd {
  flex: 1; overflow-y: auto; padding: 16px 18px;
}

.v63-signin-empty {
  padding: 60px 22px; text-align: center; color: #9ab0c9;
}
.v63-signin-empty h3 {
  margin: 0 0 8px 0; font-size: 16px; color: #e7eef6; font-weight: 600;
}
.v63-signin-empty p { margin: 0; font-size: 13px; line-height: 1.5; }

/* ------- Forms ------------------------------------------------------------ */
.v63-field { margin-bottom: 14px; }
.v63-field label {
  display: block; font-size: 11px; font-weight: 600;
  color: #9ab0c9; text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 5px;
}
.v63-field input[type="text"],
.v63-field input[type="number"],
.v63-field input[type="date"],
.v63-field input[type="datetime-local"],
.v63-field textarea,
.v63-field select {
  width: 100%; box-sizing: border-box;
  padding: 9px 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e7eef6;
  border-radius: 7px; font-size: 13.5px;
  font-family: inherit;
}
/* v63.9.13: native <option> elements inherit OS colors and can be dark-on-dark
   on some systems. Force a readable light dropdown list. */
.v63-field select option {
  background: #ffffff;
  color: #0f1724;
}
.v63-field select option:checked,
.v63-field select option:hover {
  background: #e6f0fa;
  color: #0f1724;
}
.v63-field textarea { min-height: 68px; resize: vertical; }
.v63-field input:focus, .v63-field textarea:focus, .v63-field select:focus {
  outline: none; border-color: rgba(11,154,168,0.6);
  background: rgba(255,255,255,0.08);
}
.v63-field-row { display: flex; gap: 10px; }
.v63-field-row .v63-field { flex: 1; }

.v63-check-list { display: flex; flex-wrap: wrap; gap: 6px; }
.v63-check-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #c4d3e3;
  border-radius: 999px; font-size: 12px;
  cursor: pointer; user-select: none;
}
.v63-check-chip.active {
  background: rgba(11,154,168,0.22);
  border-color: rgba(11,154,168,0.5);
  color: #7ff0fb;
}
.v63-check-chip input { display: none; }

.v63-btn {
  padding: 9px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e7eef6;
  border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.v63-btn:hover { background: rgba(255,255,255,0.1); }
.v63-btn-primary {
  background: linear-gradient(135deg, #0a7e8a 0%, #0b9aa8 100%);
  border-color: transparent; color: #fff;
}
.v63-btn-primary:hover { background: linear-gradient(135deg, #0b8f9c 0%, #0db3c2 100%); }
.v63-btn-danger {
  background: rgba(200, 60, 60, 0.12);
  border-color: rgba(200, 60, 60, 0.3);
  color: #f1a0a0;
}
.v63-btn-danger:hover { background: rgba(200, 60, 60, 0.2); }
.v63-btn-sm { padding: 5px 10px; font-size: 12px; }

.v63-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 14px; padding-top: 14px;
}

/* ------- Profile ---------------------------------------------------------- */
.v63-avatar-wrap {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px;
}
.v63-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(135deg, #1a3550, #0a7e8a);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; letter-spacing: 0;
  cursor: pointer; overflow: hidden; position: relative;
  border: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.v63-avatar img { width: 100%; height: 100%; object-fit: cover; }
.v63-avatar:hover::after {
  content: 'Change';
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.v63-avatar-meta {
  flex: 1; min-width: 0;
}
.v63-avatar-meta .v63-email {
  font-size: 13px; color: #9ab0c9; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v63-avatar-meta .v63-since {
  font-size: 12px; color: #6c869f; margin: 4px 0 0 0;
}

.v63-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin: 18px 0;
}
.v63-stat {
  padding: 11px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; text-align: center;
}
.v63-stat .v63-stat-v {
  font-size: 20px; font-weight: 700; color: #fff;
  line-height: 1;
}
.v63-stat .v63-stat-k {
  margin-top: 4px;
  font-size: 10.5px; color: #9ab0c9;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.v63-pb-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 14px;
}
.v63-pb-card {
  padding: 10px;
  background: linear-gradient(135deg, rgba(11,154,168,0.08), rgba(11,154,168,0.02));
  border: 1px solid rgba(11,154,168,0.2);
  border-radius: 8px;
}
.v63-pb-card .v63-pb-sp {
  font-size: 12px; font-weight: 600; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v63-pb-card .v63-pb-l {
  font-size: 18px; font-weight: 700; color: #7ff0fb;
  margin-top: 2px;
}
.v63-pb-card .v63-pb-d {
  font-size: 11px; color: #9ab0c9; margin-top: 1px;
}
.v63-pb-empty {
  padding: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
  text-align: center; color: #9ab0c9; font-size: 13px;
  margin-bottom: 14px;
}
.v63-section-hd {
  font-size: 11px; font-weight: 600;
  color: #9ab0c9; text-transform: uppercase; letter-spacing: 0.05em;
  margin: 18px 0 8px 0;
}

/* ------- Calendar --------------------------------------------------------- */
.v63-cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.v63-cal-nav .v63-cal-title {
  font-size: 16px; font-weight: 700; color: #fff;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
}
.v63-cal-nav .v63-cal-title:hover { background: rgba(255,255,255,0.05); }
.v63-cal-nav button.v63-cal-arrow {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e7eef6; border-radius: 6px; cursor: pointer;
  font-size: 16px; line-height: 1;
}
.v63-cal-nav button.v63-cal-arrow:hover { background: rgba(255,255,255,0.1); }

.v63-cal-filters {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.v63-cal-filters select {
  flex: 1; min-width: 140px;
  padding: 6px 9px; font-size: 12.5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e7eef6; border-radius: 6px;
}

.v63-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px; padding: 6px;
}
.v63-cal-dow {
  text-align: center;
  font-size: 10.5px; font-weight: 600;
  color: #6c869f;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 6px 0;
}
.v63-cal-day {
  aspect-ratio: 1 / 1;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  border-radius: 6px; padding: 4px;
  cursor: pointer;
  display: flex; flex-direction: column;
  position: relative;
  color: #c4d3e3; font-size: 11.5px;
}
.v63-cal-day:hover { background: rgba(255,255,255,0.07); }
.v63-cal-day.v63-other { color: #42566b; background: rgba(255,255,255,0.01); }
.v63-cal-day.v63-today { border-color: rgba(11,154,168,0.5); }
.v63-cal-day.v63-has-catch { background: rgba(11,154,168,0.08); border-color: rgba(11,154,168,0.2); }
.v63-cal-day .v63-cal-dnum { font-weight: 600; }
.v63-cal-day .v63-cal-dots {
  margin-top: auto;
  display: flex; flex-wrap: wrap; gap: 2px;
  align-items: flex-end;
}
.v63-cal-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #0b9aa8;
}
.v63-cal-badge {
  font-size: 10px; font-weight: 700; color: #7ff0fb;
  background: rgba(11,154,168,0.25);
  padding: 1px 5px; border-radius: 9px;
}

.v63-day-drawer {
  margin-top: 14px;
  padding: 12px;
  background: rgba(11,154,168,0.06);
  border: 1px solid rgba(11,154,168,0.2);
  border-radius: 8px;
}
.v63-day-drawer h4 {
  margin: 0 0 8px 0; font-size: 13px; font-weight: 700;
  color: #fff;
}
.v63-day-catch {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 12.5px; color: #c4d3e3;
  display: flex; gap: 8px; align-items: baseline;
}
.v63-day-catch:last-child { border-bottom: 0; }
.v63-day-catch .v63-sp { font-weight: 600; color: #fff; }
.v63-day-catch .v63-m { color: #7ff0fb; }
.v63-day-catch .v63-t { margin-left: auto; color: #6c869f; font-size: 11px; }

.v63-heatmap {
  margin-top: 18px;
}
.v63-heatmap-title {
  font-size: 11px; font-weight: 600;
  color: #9ab0c9; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 8px;
}
.v63-heatmap-grid {
  display: grid; grid-template-columns: minmax(90px, auto) repeat(12, 1fr);
  gap: 2px;
  background: rgba(255,255,255,0.03);
  padding: 4px; border-radius: 6px;
  font-size: 10px;
}
.v63-heatmap-grid .v63-hm-lbl {
  color: #9ab0c9; padding: 3px 6px;
  display: flex; align-items: center;
}
.v63-heatmap-grid .v63-hm-cell {
  aspect-ratio: 1 / 1;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  color: #0e1a27;
  font-weight: 700; font-size: 10px;
}

/* ------- Tackle Box ------------------------------------------------------- */
.v63-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px; margin-bottom: 14px;
  overflow-x: auto; scrollbar-width: none;
}
.v63-tabs::-webkit-scrollbar { display: none; }
.v63-tab {
  padding: 7px 12px; background: transparent;
  border: 0; color: #9ab0c9; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  white-space: nowrap;
}
.v63-tab:hover { background: rgba(255,255,255,0.05); color: #c4d3e3; }
.v63-tab.active { background: rgba(11,154,168,0.25); color: #7ff0fb; }

.v63-tackle-item {
  padding: 11px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; margin-bottom: 8px;
}
.v63-tackle-item.retired { opacity: 0.55; }
.v63-tackle-item .v63-ti-hd {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px;
}
.v63-tackle-item .v63-ti-name { font-weight: 600; color: #fff; font-size: 13.5px; }
.v63-tackle-item .v63-ti-br { font-size: 12px; color: #9ab0c9; }
.v63-tackle-item .v63-ti-specs { font-size: 11.5px; color: #7ff0fb; margin-top: 4px; }
.v63-tackle-item .v63-ti-actions { display: flex; gap: 6px; margin-top: 8px; }
.v63-tackle-empty { padding: 28px 14px; text-align: center; color: #9ab0c9; font-size: 13px; }

/* ------- Species dashboard ----------------------------------------------- */
.v63-species-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.v63-species-card {
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px; cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.v63-species-card:hover {
  background: rgba(11,154,168,0.1);
  border-color: rgba(11,154,168,0.35);
}
.v63-species-card .v63-sc-sp {
  font-size: 14px; font-weight: 700; color: #fff;
}
.v63-species-card .v63-sc-tot {
  font-size: 22px; font-weight: 700; color: #7ff0fb;
  margin-top: 4px; line-height: 1;
}
.v63-species-card .v63-sc-lbl { font-size: 11px; color: #9ab0c9; }
.v63-species-card .v63-sc-pb {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11.5px; color: #c4d3e3;
}

.v63-species-detail-back {
  margin-bottom: 10px;
  font-size: 12px; color: #7ff0fb; cursor: pointer;
  background: none; border: 0; padding: 0;
}
.v63-species-detail-hd {
  font-size: 20px; font-weight: 700; color: #fff;
  margin-bottom: 10px;
}
.v63-species-detail-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin-bottom: 16px;
}
.v63-chart-box {
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  margin-bottom: 12px;
}
.v63-chart-box .v63-chart-hd {
  font-size: 11px; font-weight: 600; color: #9ab0c9;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* ------- Photos gallery --------------------------------------------------- */
.v63-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.v63-photo-grid .v63-photo {
  aspect-ratio: 1/1;
  background: rgba(255,255,255,0.05);
  border-radius: 6px; overflow: hidden;
  cursor: pointer; position: relative;
}
.v63-photo img { width: 100%; height: 100%; object-fit: cover; }
.v63-photo .v63-photo-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 6px 4px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff; font-size: 10px; font-weight: 600;
}

.v63-lightbox {
  position: fixed; inset: 0; z-index: var(--z-auth);
  background: rgba(0,0,0,0.92);
  display: none; align-items: center; justify-content: center;
}
.v63-lightbox.open { display: flex; }
.v63-lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.v63-lightbox .v63-lb-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.15);
  color: #fff; border: 0; width: 36px; height: 36px; border-radius: 8px;
  font-size: 20px; cursor: pointer;
}

/* ------- Trip log extras -------------------------------------------------- */
.v63-trip-month-hd {
  font-size: 11px; font-weight: 600;
  color: #9ab0c9; text-transform: uppercase; letter-spacing: 0.05em;
  margin: 14px 0 6px 0;
}

/* ------- Catch form extensions (photo + rod dropdowns) -------------------- */
.v63-catch-extra {
  border-top: 1px dashed rgba(0,0,0,0.08);
  padding-top: 10px; margin-top: 10px;
}
.v63-catch-extra label {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: #6c869f; margin-bottom: 4px;
}
.v63-catch-extra select, .v63-catch-extra input[type="file"] {
  width: 100%; font-size: 13px; padding: 6px;
  border: 1px solid rgba(0,0,0,0.15); border-radius: 6px;
  background: #fff;
}
.v63-catch-extra .v63-photo-preview-strip {
  display: flex; gap: 4px; margin-top: 6px;
  flex-wrap: wrap;
}
.v63-catch-extra .v63-photo-preview-strip img {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: 4px; border: 1px solid rgba(0,0,0,0.1);
}

/* ------- Mobile tweaks ---------------------------------------------------- */
@media (max-width: 740px) {
  .v63-panel {
    width: 100%; max-width: 100%;
    left: 0; right: 0;
  }
  .v63-species-grid { grid-template-columns: repeat(2, 1fr); }
  .v63-photo-grid { grid-template-columns: repeat(3, 1fr); }
  .v63-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .v63-pb-strip { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile sheet catches don't show v63 nav buttons — they get added to the
   sheet body which is cloned from the sidebar, so they come along for free. */

/* ============================================================================
   v63 — Squid Mode mobile pin (floating top chip)
   Visible only on <=740px. Desktop keeps the inline preset-btn-squid.
   ============================================================================ */
#v63SquidPin { display: none; }

@media (max-width: 740px) {
  #v63SquidPin {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0) + 12px);
    /* Logo is 12+44=56, brand pill sits at left:64px and is ~130px wide on
       small phones. Pin the Squid chip right after the brand pill, with an
       8px gap. Using a right-of-center anchor so it stays clear of the
       wind/tide chip on the right edge. */
    left: 206px;
    height: 44px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 22px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.1);
    font: 700 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0b3a5c;
    cursor: pointer;
    z-index: var(--z-map-controls);
    white-space: nowrap;
  }
  #v63SquidPin .v63-squid-pin-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0b6ea8;
  }
  #v63SquidPin .v63-squid-pin-tx {
    letter-spacing: 0.01em;
  }
  #v63SquidPin:active { transform: scale(0.97); }

  /* Active state: Squid Mode engaged */
  #v63SquidPin.is-active {
    background: linear-gradient(180deg, #0b6ea8, #084e77);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(11, 110, 168, 0.45), 0 1px 3px rgba(0,0,0,.2);
  }
  #v63SquidPin.is-active .v63-squid-pin-ic { color: #ffffff; }

  /* Narrow phones (iPhone SE = 375): brand pill gets cramped. Shrink brand
     subtitle so the Squid chip fits without overlap. */
  body.v27-mobile .v41-brand-pill .v41-brand-by { display: none; }
  body.v27-mobile .v41-brand-pill {
    height: 44px;
    padding: 0 10px;
    justify-content: center;
  }

  /* Hide the chip when any full-screen modal / sheet / overlay is open —
     matches the pattern used for .v27-logo and .v41-brand-pill. */
  body.v27-mobile:has(.leaflet-popup) #v63SquidPin,
  body.v27-mobile:has(.v25-fr-wrap.visible) #v63SquidPin,
  body.v27-mobile:has(#v25_firstRun.visible) #v63SquidPin,
  body.v27-mobile:has(.mm-dlg-wrap) #v63SquidPin,
  body.v27-mobile:has(.mm-panel.open) #v63SquidPin,
  body.v27-mobile:has(.pwa-overlay-card) #v63SquidPin,
  body.v27-mobile:has(.v38-modal-root) #v63SquidPin,
  body.v27-mobile:has(#detail:not(.hidden)) #v63SquidPin,
  body.v27-mobile:has(.v27-sheet.v27-sheet-open) #v63SquidPin {
    display: none;
  }
}

/* Narrow phones: collapse to a circular icon-only chip so everything fits in
   the top row between the brand pill and the conditions pill. iPhone SE 375
   and iPhone 14 Pro 393 both hit this breakpoint. */
@media (max-width: 420px) {
  #v63SquidPin {
    left: auto;
    right: 164px;   /* conditions pill ends near right:12, is ~134 wide → 12+134+8gap+padding → sit just left of it */
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    gap: 0;
    border-radius: 22px;
  }
  #v63SquidPin .v63-squid-pin-tx { display: none; }
  #v63SquidPin .v63-squid-pin-ic svg { width: 22px; height: 22px; }
}
