/* SeaTrack v97.76 polish — apply ui-tokens across screens; map declutter helpers.
   Keeps: clean map, no startup popups (startup.js), bell, 2s flashes, map credit + nav line. */

/* —— Floating basemap source chip removed (source lives in Layers) —— */
#map-chip.map-chip { display: none !important; }

/* Layers: active basemap source line */
#bm-active-src.bm-active-src {
  margin: 0 0 var(--st-s-3);
  padding: var(--st-s-2) var(--st-s-4);
  border-radius: var(--st-r-sm);
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: #99f6e4;
  font: 700 var(--st-fs-sm)/1.3 system-ui, -apple-system, sans-serif;
}
.basemap-opt {
  border-radius: var(--st-card-radius) !important;
  padding: var(--st-s-4) !important;
}
.basemap-opt em { font-size: var(--st-fs-xs) !important; }

/* Mid-zoom ramp shrink helper */
.st-ramp-mid .marker-ramp-img { opacity: 0.92; }

/* —— Shared card / section / button tokens —— */
.drawer .subhead,
.side-menu .subhead,
#side-body .subhead,
.al-sheet .subhead,
.cd-sheet .subhead {
  margin: var(--st-section-gap) 0 var(--st-s-3) !important;
  font: var(--st-subhead-weight) var(--st-subhead-fs)/1.3 system-ui, sans-serif !important;
  letter-spacing: var(--st-subhead-track);
  color: var(--st-subhead-color) !important;
  text-transform: uppercase;
}

.drawer-scroll,
#drawer-wind .drawer-scroll,
#drawer-tides .drawer-scroll,
#drawer-conditions .drawer-scroll {
  padding: var(--st-s-3) var(--st-s-5) calc(var(--st-s-8) + env(safe-area-inset-bottom, 0px)) !important;
  gap: var(--st-card-gap);
}

/* Cards inside tab drawers, diary, alerts, rules, menu groups */
#drawer-wind .w-card,
#drawer-wind .wx-card,
#drawer-tides .tide-card,
#drawer-tides .tc-card,
#drawer-conditions .wx2-card,
#drawer-conditions .cd-card,
#drawer-conditions .wx-panel,
.cd-sheet .cd-card,
.cd-sheet .cd-block,
.al-sheet .al-card,
.al-list .al-item,
#drawer-regs .reg-card,
#drawer-regs .rules-card,
#drawer-regs .sr-card,
.menu-group,
.sm-group,
.basemap-opt,
.dc-more {
  border-radius: var(--st-card-radius) !important;
}

/* Generic inner panels that used mixed radii */
#drawer-wind .drawer-scroll > section,
#drawer-tides .drawer-scroll > section,
#drawer-conditions .drawer-scroll > section,
#drawer-wind .drawer-scroll > .panel,
#drawer-tides .drawer-scroll > .panel,
#drawer-conditions .drawer-scroll > .panel,
.cd-diary .cd-day,
.cd-log .cd-field,
.al-sheet .al-row,
#drawer-regs .drawer-scroll > .card,
#drawer-regs details,
.side-scrim .sm-item,
#side-body .sm-item {
  border-radius: var(--st-card-radius);
}

/* Padding rhythm on common cards */
.al-sheet .al-card,
.cd-sheet .cd-card,
.cd-sheet .cd-block,
#drawer-regs .reg-card,
#drawer-regs .rules-card {
  padding: var(--st-card-pad) !important;
}

/* Primary / ghost buttons across tabs + diary + alerts + rules */
.drawer button.primary,
.drawer .btn-primary,
.cd-sheet .cd-save,
.cd-sheet .cd-primary,
.al-sheet .al-ok,
.al-sheet button.primary,
#drawer-regs .btn-primary,
.ramp-sheet .ramp-dir-btn,
.st-ack-ok {
  border-radius: var(--st-btn-radius) !important;
  font-size: var(--st-btn-fs) !important;
  padding: var(--st-btn-pad-y) var(--st-btn-pad-x) !important;
}

/* Type scale — no clipping at XL on sheet titles / rows */
.drawer-head h2,
.cd-sheet h2,
.al-sheet h2,
#side-body .sm-tx {
  /* v97.78h: match other row titles (was --st-fs-title = larger than peers) */
  font-size: var(--fs-label) !important;
  font-weight: 650 !important;
  line-height: 1.25 !important;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}
.drawer .hint,
.cd-hint,
.al-sheet .hint {
  font-size: var(--st-fs-sm) !important;
  line-height: 1.35 !important;
}

/* Alerts list rows */
.al-list .al-item,
.al-sheet .al-row {
  margin-bottom: var(--st-s-3);
  border: var(--st-card-border);
  background: var(--st-card-bg);
}

/* Menu groups */
.menu-group,
.sm-group {
  margin: 0 0 var(--st-s-4);
  padding: var(--st-s-2) 0;
  border: var(--st-card-border);
  background: rgba(10, 24, 36, 0.55);
  overflow: hidden;
}
#side-body .sm-item {
  padding: var(--st-s-4) var(--st-s-5) !important;
  font-size: var(--fs-label) !important;
  font-weight: 650 !important;
  line-height: 1.3 !important;
}

/* Rules / regs cards */
#drawer-regs .drawer-scroll details,
#drawer-regs .reg-card {
  margin-bottom: var(--st-s-3);
  border: var(--st-card-border);
  background: var(--st-card-bg);
  padding: var(--st-s-3) var(--st-s-4);
}

/* Diary log fields */
.cd-sheet .cd-field,
.cd-log label,
.cd-diary .cd-day {
  font-size: var(--st-fs-md);
}

/* Ensure map credit + Approximate note stay visible (never hide) */
.st-mt-attr:not([hidden]),
#nav-disclaimer.nav-disclaimer {
  visibility: visible !important;
}

/* XL: avoid card content clipping in drawers */
html[data-ts="xl"] .drawer-scroll,
html[data-ts="xl"] .cd-sheet,
html[data-ts="xl"] .al-sheet {
  overflow-wrap: anywhere;
}
html[data-ts="xl"] .drawer-head h2,
html[data-ts="xl"] .tab-label {
  white-space: normal;
}

/* v97.76c: needs-a-spot never on the map */
#cd-fixban.cd-fixban { display: none !important; }

/* Badge on Log Bite/Catch tab when catches need a spot */
#cd-fab .cd-need-badge {
  position: absolute;
  top: -2px;
  right: calc(50% - 34px);
  z-index: 2;
  min-width: calc(18px * var(--ts, 1));
  height: calc(18px * var(--ts, 1));
  padding: 0 5px;
  border-radius: 999px;
  background: #f59e0b;
  color: #422006;
  font: 800 calc(10px * var(--ts, 1))/calc(18px * var(--ts, 1)) system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  pointer-events: none;
}
#cd-fab.has-need .fab-disc { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.55); }
.la-need.cd-fixban-in {
  width: 100%;
  margin: 0 0 10px;
  text-align: left;
  appearance: none;
  font: inherit;
}
