/* Cape Coral Canal Map — nautical palette, scoped to .ccmap */
.ccmap {
	--navy: #0b2540;
	--deep: #143d63;
	--sea: #1c6fa8;
	--salt: #2f8fc7;
	--salt-edge: #135f93;
	--fresh: #7cc6b4;
	--fresh-edge: #3f9a86;
	--sand: #f6f1e7;
	--brass: #c8962e;
	--ok: #2e9e6b;
	--tight: #e0a526;
	--no: #d2483f;
	--ink: #10263b;
	--muted: #5b7086;
	--line: #d6e1eb;
	--card: #ffffff;
	--h: var(--ccmap-h, 680px);

	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	color: var(--ink);
	font-size: 15px;
	line-height: 1.45;
	margin: 0 0 24px;
}
.ccmap, .ccmap *, .ccmap *::before, .ccmap *::after { box-sizing: border-box; }
.ccmap--full {
	width: var(--ccmap-vw, 100vw);
	max-width: none;
	margin-left: calc(50% - var(--ccmap-vw, 100vw) / 2);
	margin-right: 0;
	padding-inline: 16px;
}
.ccmap-main { min-width: 0; display: flex; flex-direction: column; }
.ccmap-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Toolbar: one row ---------- */
.ccmap-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: thin;
	padding: 10px 12px;
	background: var(--navy);
	border-radius: 12px 12px 0 0;
	color: #fff;
}
.ccmap-bar > * { flex: 0 0 auto; }
.ccmap-bar button, .ccmap-bar input { font-family: inherit; }

.ccmap-search { display: flex; flex: 1 0 240px; min-width: 220px; margin: 0; }
.ccmap-search input[type="search"] {
	flex: 1; min-width: 0; height: 38px; margin: 0;
	padding: 0 12px; border: 0; border-radius: 8px 0 0 8px;
	background: #fff; color: var(--ink); font-size: 14px;
}
.ccmap-search button {
	height: 38px; margin: 0; padding: 0 16px; border: 0; border-radius: 0 8px 8px 0;
	background: var(--brass); color: var(--navy); font-weight: 700; cursor: pointer;
}
.ccmap-search button:hover { background: #d9a73e; }

.ccmap-draft { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ccmap-draft label { color: #c9d8e6; white-space: nowrap; }
.ccmap-draft input[type="range"] { width: 96px; accent-color: var(--brass); margin: 0; }
.ccmap-draft output {
	min-width: 52px; padding: 3px 8px; border-radius: 6px;
	background: var(--deep); font-weight: 700; font-variant-numeric: tabular-nums; text-align: center;
}

.ccmap-toggles, .ccmap-base { display: flex; gap: 6px; }
.ccmap-chip, .ccmap-seg {
	display: inline-flex; align-items: center; gap: 6px;
	height: 32px; margin: 0; padding: 0 11px;
	border: 1px solid #2c5479; border-radius: 999px;
	background: transparent; color: #c9d8e6; font-size: 13px; white-space: nowrap; cursor: pointer;
	line-height: 1;
}
.ccmap-chip.is-on { background: var(--deep); border-color: #4f7ba3; color: #fff; }
.ccmap-chip:not(.is-on) .sw { opacity: .35; }
.ccmap-base {
	position: absolute; top: 12px; left: 12px; z-index: 760;
	padding: 3px; border-radius: 999px; background: var(--navy); box-shadow: 0 2px 10px rgba(11,37,64,.25);
}
.ccmap-seg { border: 0; height: 28px; }
.ccmap-seg.is-on { background: #fff; color: var(--navy); font-weight: 700; }
.ccmap-base :focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.ccmap-bar :focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* Swatches */
.ccmap .sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; flex: none; }
.ccmap .sw-salt { background: var(--salt); box-shadow: inset 0 0 0 1.5px var(--salt-edge); }
.ccmap .sw-fresh { background: var(--fresh); box-shadow: inset 0 0 0 1.5px var(--fresh-edge); }
.ccmap .sw-bridge { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px #fff inset; border: 1px solid var(--ok); }
.ccmap .sw-spot { width: 12px; height: 12px; border-radius: 3px; background: var(--brass); transform: rotate(45deg) scale(.85); }
.ccmap .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.ccmap .dot-ok { background: var(--ok); }
.ccmap .dot-tight { background: var(--tight); }
.ccmap .dot-no { background: var(--no); }

/* ---------- Map stage ---------- */
.ccmap-stage {
	position: relative;
	height: var(--h);
	border: 1px solid var(--line);
	border-top: 0;
	border-radius: 0 0 12px 12px;
	overflow: hidden;
	background: #dce8f1;
}
.ccmap-map { position: absolute; inset: 0; background: #dce8f1; }
.ccmap .leaflet-container { font: inherit; font-size: 13px; }

.ccmap-status {
	position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 800;
	padding: 6px 14px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 13px;
	box-shadow: 0 4px 14px rgba(11,37,64,.25); pointer-events: none;
}
.ccmap-status:empty { display: none; }
.ccmap-status.is-error { background: var(--no); }

.ccmap-legend {
	position: absolute; left: 12px; bottom: 12px; z-index: 700;
	display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: calc(100% - 24px);
	padding: 8px 12px; border-radius: 10px;
	background: rgba(255,255,255,.94); box-shadow: 0 2px 10px rgba(11,37,64,.15);
	font-size: 12px; color: var(--ink);
}
.ccmap-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Info card */
.ccmap-info {
	position: absolute; top: 12px; right: 12px; z-index: 750;
	width: 320px; max-width: calc(100% - 24px); max-height: calc(100% - 90px); overflow: auto;
	padding: 14px 16px 16px; border-radius: 12px;
	background: var(--card); box-shadow: 0 8px 28px rgba(11,37,64,.22);
	border-top: 4px solid var(--sea);
}
.ccmap-info.is-fresh { border-top-color: var(--fresh-edge); }
.ccmap-info.is-salt { border-top-color: var(--salt-edge); }
.ccmap-info-close {
	position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; margin: 0; padding: 0;
	border: 0; border-radius: 50%; background: var(--sand); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
}
.ccmap-info .ccmap-eyebrow { margin: 0 0 2px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ccmap-info h4 { margin: 0 34px 8px 0; font-size: 18px; line-height: 1.25; color: var(--navy); }
.ccmap-info p { margin: 0 0 10px; }
.ccmap-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.ccmap-pill.salt { background: #e3f0f9; color: var(--salt-edge); }
.ccmap-pill.fresh { background: #e4f4ef; color: #2d7a69; }
.ccmap-pill.ok { background: #e3f4ec; color: #1f7a50; }
.ccmap-pill.tight { background: #fbf0d6; color: #8a6210; }
.ccmap-pill.no { background: #fbe4e2; color: #a3302a; }
.ccmap-pill.unk { background: #edf1f5; color: var(--muted); }
.ccmap-verdict { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: var(--sand); font-size: 14px; }
.ccmap-blist { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--line); }
.ccmap-blist li {
	display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
	padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer;
}
.ccmap-blist li:hover { color: var(--sea); }
.ccmap-blist b { font-variant-numeric: tabular-nums; }
.ccmap-small { font-size: 12px; color: var(--muted); }

/* Leaflet popups & labels */
.ccmap .leaflet-popup-content-wrapper { border-radius: 10px; }
.ccmap .leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.4; }
.ccmap .leaflet-popup-content h5 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
.ccmap .leaflet-popup-content p { margin: 0 0 6px; }
.ccmap .ccmap-clr {
	background: var(--navy); color: #fff; border: 0; border-radius: 4px; padding: 1px 5px;
	font-size: 11px; font-weight: 700; box-shadow: none; font-variant-numeric: tabular-nums;
}
.ccmap .ccmap-clr::before { display: none; }
.ccmap.ccmap-zlow .ccmap-clr { display: none; }
.ccmap-spot-icon {
	display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50% 50% 50% 4px;
	transform: rotate(-45deg); background: var(--brass); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.ccmap-spot-icon span { transform: rotate(45deg); color: var(--navy); font-size: 11px; font-weight: 800; line-height: 1; }
.ccmap-spot-icon.fuel { background: #e9744a; }
.ccmap-spot-icon.dine { background: #f2c14e; }
.ccmap-spot-icon.marina, .ccmap-spot-icon.kayak { background: #9ad1e6; }
.ccmap-home-icon {
	width: 22px; height: 22px; border-radius: 50%; background: var(--no); border: 3px solid #fff;
	box-shadow: 0 0 0 3px rgba(210,72,63,.35), 0 3px 8px rgba(0,0,0,.35);
}

.ccmap-note { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
	.ccmap-stage { height: min(var(--h), 78vh); }
	.ccmap-legend { font-size: 11px; gap: 4px 10px; padding: 6px 8px; }
	.ccmap-info { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-width: none; max-height: 55%; border-radius: 12px 12px 0 0; }
	.ccmap-search { flex-basis: 200px; min-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
	.ccmap .leaflet-zoom-anim .leaflet-zoom-animated { transition: none !important; }
}

/* ---------- Tide button and panel on the map ---------- */
.ccmap-tidebtn {
	position: absolute; top: 52px; left: 12px; z-index: 760;
	display: inline-flex; align-items: center; gap: 6px; height: 30px; margin: 0; padding: 0 12px;
	border: 0; border-radius: 999px; background: var(--navy); color: #c9d8e6;
	font: inherit; font-size: 12px; cursor: pointer; box-shadow: 0 2px 10px rgba(11,37,64,.25);
}
.ccmap-tidebtn b { color: #fff; font-variant-numeric: tabular-nums; }
.ccmap-tidebtn[aria-expanded="true"] { background: var(--brass); color: var(--navy); }
.ccmap-tidebtn[aria-expanded="true"] b { color: var(--navy); }
.ccmap-tidebtn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.ccmap-tidepanel {
	position: absolute; top: 90px; left: 12px; z-index: 755;
	width: 380px; max-width: calc(100% - 24px); max-height: calc(100% - 150px); overflow: auto;
	padding: 14px 16px; border-radius: 12px; background: #fff; box-shadow: 0 8px 28px rgba(11,37,64,.22);
}
@media (max-width: 640px) {
	.ccmap-tidepanel { width: auto; right: 12px; }
}
.ccmap-tidebtn[hidden] { display: none; }
