/* Plain, in the look of MapLibre's controls: white boxes, 4px corners, a soft 2px outline. */
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #222; }
#map { position: absolute; inset: 0; background: #fbf9f5; }
button, .button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- search */
#search { position: absolute; z-index: 3; top: 10px; left: 10px; width: min(360px, calc(100% - 70px)); margin: 0; }
#search input { box-sizing: border-box; width: 100%; height: 38px; padding: 0 38px 0 12px; border: 0; border-radius: 4px;
  font: inherit; font-size: 15px; background: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .1); outline-offset: -2px; }
#search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
#search .search-clear { position: absolute; top: 0; right: 0; height: 38px; border-radius: 0 4px 4px 0; }
#search input:placeholder-shown + .search-clear { display: none; }
#results { list-style: none; margin: 10px 0 0; padding: 0; background: #fff; border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .1); overflow: hidden; }
#results:empty { display: none; }
#results li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 6px 12px; cursor: pointer; }
#results li[aria-selected="true"], #results li:hover { background: #f0f4fa; }
#results small { grid-column: 2; color: #666; }
#results .icon { width: 1.4em; text-align: center; }

/* ---------- side panel: a column on the left; on phones, the bottom half */
/* the body scrolls, not the panel: the close button stays in the corner, clear of the scrollbar */
#sheet { --r: 4px; position: absolute; z-index: 2; display: flex; flex-direction: column; overflow: hidden; background: #fff;
  border-radius: var(--r); box-shadow: 0 0 0 2px rgba(0, 0, 0, .1); }
#sheet[hidden] { display: none; }
.sheet-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 641px) {
  #sheet { top: 58px; left: 10px; width: 360px; max-height: calc(100% - 78px); }
}
@media (max-width: 640px) {
  #sheet { --r: 12px; left: 0; right: 0; bottom: 0; height: 50%; border-radius: var(--r) var(--r) 0 0; box-shadow: 0 -1px 6px rgba(0, 0, 0, .2); }
}
/* greyed out while the search shows results over it */
#search[aria-expanded="true"] ~ #sheet { filter: grayscale(1); pointer-events: none; }
#search[aria-expanded="true"] ~ #sheet::after { content: ""; position: absolute; inset: 0; z-index: 2; background: #fffa; }
/* close and clear: 38 px squares at the right edge (the search bar and the panel are as wide), a centred X */
.sheet-close, .search-clear { width: 38px; padding: 0; border: 0; background: center / 11px no-repeat
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 2l10 10M12 2L2 12' stroke='%23666' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.sheet-close { position: absolute; top: 0; right: 0; z-index: 1; height: 38px; background-color: #fffd;
  border-radius: 0 var(--r) 0 4px; }   /* its corner is the panel's; the opposite one rounded like the rest */
.sheet-close:hover { background-color: #f2f2f2; }
/* the photo's space is kept while it loads (grey), so the panel doesn't jump */
#sheet .photo { position: relative; height: 200px; background: #eee; }
#sheet .photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
#sheet .photo .credit { position: absolute; right: 0; bottom: 0; max-width: 75%; padding: 1px 6px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; border-top-left-radius: 4px; background: #0008; color: #fff;
  font-size: 10px; line-height: 16px; text-decoration: none; }
@media (max-width: 640px) { #sheet .photo { height: 160px; } }
#sheet .content { padding: 12px 16px 16px; }
#sheet h2 { margin: 0 30px 4px 0; font-size: 20px; line-height: 1.25; }
#sheet h3 { display: flex; align-items: center; gap: 6px; margin: 14px 0 4px; font-size: 15px; }
#sheet .lines { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: #444; }
.muted { color: #777; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 2px;
  box-sizing: border-box; border-radius: 11px;
  font: 15px/1 "D-DIN Bold", system-ui, sans-serif; }   /* the map's font: known metrics, so capitals sit centred */
.badge.rail { min-width: 12px; height: 12px; margin: 0 5px; }
.state { margin: 0 0 6px; font-weight: 600; }
.state::before, .alert::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%;
  background: var(--c); vertical-align: 0; }
.ok { --c: #2e9d4f; } .warning { --c: #ffb300; } .closed { --c: #e53935; } .info { --c: #9e9e9e; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alert { padding: 6px 0; border-top: 1px solid #eee; }
.alert::before { float: left; margin-top: 5px; }
.alert b { display: block; overflow: hidden; font-weight: 500; }
.alert p { margin: 2px 0 0 18px; color: #555; font-size: 13px; }
.parking { margin: 0 0 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions button, .actions .button { padding: 7px 12px; border: 1px solid #d0d0d0; border-radius: 4px; background: #fff;
  text-decoration: none; }
.actions button:hover, .actions .button:hover { background: #f2f2f2; }

/* the attribution, in the same look */
.maplibregl-ctrl.maplibregl-ctrl-attrib { border-radius: 4px; box-shadow: 0 0 0 2px rgba(0, 0, 0, .1); }
.maplibregl-ctrl-attrib.maplibregl-compact-show { padding: 2px 28px 2px 8px; }

/* ---------- control icons (29 px MapLibre buttons) */
.maplibregl-ctrl-group button[aria-pressed="true"] { background-color: #e6eefa; }
[class^="icon-"] { display: block; width: 100%; height: 100%; background: center / 20px no-repeat; }
/* Ecobici: the sprite's (Maki/Temaki) bicycle and parking_space (∩) glyphs, white on blue or on the 0/1/2/3+ colours */
.icon-bike { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='9.5' fill='%231d6fd8'/%3E%3Cg fill='%23fff' transform='translate%284 4%29 scale%28.8%29'%3E%3Cpath d='%26%23xA%3B%26%23x9%3BM7.5,2c-0.6761-0.01-0.6761,1.0096,0,1H9v1.2656l-2.8027,2.334L5.2226,4H5.5c0.6761,0.01,0.6761-1.0096,0-1h-2%26%23xA%3B%26%23x9%3Bc-0.6761-0.01-0.6761,1.0096,0,1h0.6523L5.043,6.375C4.5752,6.1424,4.0559,6,3.5,6C1.5729,6,0,7.5729,0,9.5S1.5729,13,3.5,13%26%23xA%3B%26%23x9%3BS7,11.4271,7,9.5c0-0.6699-0.2003-1.2911-0.5293-1.8242L9.291,5.3262l0.4629,1.1602C8.7114,7.0937,8,8.2112,8,9.5%26%23xA%3B%26%23x9%3Bc0,1.9271,1.5729,3.5,3.5,3.5S15,11.4271,15,9.5S13.4271,6,11.5,6c-0.2831,0-0.5544,0.0434-0.8184,0.1074L10,4.4023V2.5%26%23xA%3B%26%23x9%3Bc0-0.2761-0.2239-0.5-0.5-0.5H7.5z M3.5,7c0.5923,0,1.1276,0.2119,1.5547,0.5527l-1.875,1.5625%26%23xA%3B%26%23x9%3Bc-0.5109,0.4273,0.1278,1.1945,0.6406,0.7695l1.875-1.5625C5.8835,8.674,6,9.0711,6,9.5C6,10.8866,4.8866,12,3.5,12S1,10.8866,1,9.5%26%23xA%3B%26%23x9%3BS2.1133,7,3.5,7L3.5,7z M11.5,7C12.8866,7,14,8.1134,14,9.5S12.8866,12,11.5,12S9,10.8866,9,9.5c0-0.877,0.4468-1.6421,1.125-2.0879%26%23xA%3B%26%23x9%3Bl0.9102,2.2734c0.246,0.6231,1.1804,0.2501,0.9297-0.3711l-0.9082-2.2695C11.2009,7.0193,11.3481,7,11.5,7L11.5,7z'/%3E%3C/g%3E%3C/svg%3E"); }
.icon-bike-count { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 10V.5A9.5 9.5 0 0 1 18.2 14.8z' fill='%232e9d4f'/%3E%3Cpath d='M10 10l8.2 4.8A9.5 9.5 0 0 1 1.8 14.8z' fill='%23e08a00'/%3E%3Cpath d='M10 10L1.8 14.8A9.5 9.5 0 0 1 10 .5z' fill='%23d62839'/%3E%3Cg fill='%23fff' transform='translate%284 4%29 scale%28.8%29'%3E%3Cpath d='%26%23xA%3B%26%23x9%3BM7.5,2c-0.6761-0.01-0.6761,1.0096,0,1H9v1.2656l-2.8027,2.334L5.2226,4H5.5c0.6761,0.01,0.6761-1.0096,0-1h-2%26%23xA%3B%26%23x9%3Bc-0.6761-0.01-0.6761,1.0096,0,1h0.6523L5.043,6.375C4.5752,6.1424,4.0559,6,3.5,6C1.5729,6,0,7.5729,0,9.5S1.5729,13,3.5,13%26%23xA%3B%26%23x9%3BS7,11.4271,7,9.5c0-0.6699-0.2003-1.2911-0.5293-1.8242L9.291,5.3262l0.4629,1.1602C8.7114,7.0937,8,8.2112,8,9.5%26%23xA%3B%26%23x9%3Bc0,1.9271,1.5729,3.5,3.5,3.5S15,11.4271,15,9.5S13.4271,6,11.5,6c-0.2831,0-0.5544,0.0434-0.8184,0.1074L10,4.4023V2.5%26%23xA%3B%26%23x9%3Bc0-0.2761-0.2239-0.5-0.5-0.5H7.5z M3.5,7c0.5923,0,1.1276,0.2119,1.5547,0.5527l-1.875,1.5625%26%23xA%3B%26%23x9%3Bc-0.5109,0.4273,0.1278,1.1945,0.6406,0.7695l1.875-1.5625C5.8835,8.674,6,9.0711,6,9.5C6,10.8866,4.8866,12,3.5,12S1,10.8866,1,9.5%26%23xA%3B%26%23x9%3BS2.1133,7,3.5,7L3.5,7z M11.5,7C12.8866,7,14,8.1134,14,9.5S12.8866,12,11.5,12S9,10.8866,9,9.5c0-0.877,0.4468-1.6421,1.125-2.0879%26%23xA%3B%26%23x9%3Bl0.9102,2.2734c0.246,0.6231,1.1804,0.2501,0.9297-0.3711l-0.9082-2.2695C11.2009,7.0193,11.3481,7,11.5,7L11.5,7z'/%3E%3C/g%3E%3C/svg%3E"); }
.icon-dock-count { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 10V.5A9.5 9.5 0 0 1 18.2 14.8z' fill='%232e9d4f'/%3E%3Cpath d='M10 10l8.2 4.8A9.5 9.5 0 0 1 1.8 14.8z' fill='%23e08a00'/%3E%3Cpath d='M10 10L1.8 14.8A9.5 9.5 0 0 1 10 .5z' fill='%23d62839'/%3E%3Cg fill='%23fff' transform='translate%284 4%29 scale%28.8%29'%3E%3Cpath d='M11 15L11 2L4 2L4 15L2 15L2 0L13 0L13 15L11 15Z'/%3E%3C/g%3E%3C/svg%3E"); }
.icon-ecobici-app { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='1.5' y='1.5' width='17' height='17' rx='4.5' fill='%231d6fd8'/%3E%3Cg fill='%23fff' transform='translate%284 4%29 scale%28.8%29'%3E%3Cpath d='%26%23xA%3B%26%23x9%3BM7.5,2c-0.6761-0.01-0.6761,1.0096,0,1H9v1.2656l-2.8027,2.334L5.2226,4H5.5c0.6761,0.01,0.6761-1.0096,0-1h-2%26%23xA%3B%26%23x9%3Bc-0.6761-0.01-0.6761,1.0096,0,1h0.6523L5.043,6.375C4.5752,6.1424,4.0559,6,3.5,6C1.5729,6,0,7.5729,0,9.5S1.5729,13,3.5,13%26%23xA%3B%26%23x9%3BS7,11.4271,7,9.5c0-0.6699-0.2003-1.2911-0.5293-1.8242L9.291,5.3262l0.4629,1.1602C8.7114,7.0937,8,8.2112,8,9.5%26%23xA%3B%26%23x9%3Bc0,1.9271,1.5729,3.5,3.5,3.5S15,11.4271,15,9.5S13.4271,6,11.5,6c-0.2831,0-0.5544,0.0434-0.8184,0.1074L10,4.4023V2.5%26%23xA%3B%26%23x9%3Bc0-0.2761-0.2239-0.5-0.5-0.5H7.5z M3.5,7c0.5923,0,1.1276,0.2119,1.5547,0.5527l-1.875,1.5625%26%23xA%3B%26%23x9%3Bc-0.5109,0.4273,0.1278,1.1945,0.6406,0.7695l1.875-1.5625C5.8835,8.674,6,9.0711,6,9.5C6,10.8866,4.8866,12,3.5,12S1,10.8866,1,9.5%26%23xA%3B%26%23x9%3BS2.1133,7,3.5,7L3.5,7z M11.5,7C12.8866,7,14,8.1134,14,9.5S12.8866,12,11.5,12S9,10.8866,9,9.5c0-0.877,0.4468-1.6421,1.125-2.0879%26%23xA%3B%26%23x9%3Bl0.9102,2.2734c0.246,0.6231,1.1804,0.2501,0.9297-0.3711l-0.9082-2.2695C11.2009,7.0193,11.3481,7,11.5,7L11.5,7z'/%3E%3C/g%3E%3C/svg%3E"); }
.icon-alert { background-size: 18px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2L1 18h18z' fill='none' stroke='%23333' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M10 8v4.5' stroke='%23333' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='15.2' r='1.1' fill='%23333'/%3E%3C/svg%3E"); }
.icon-fade-lines { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 15L9 5h8' fill='none' stroke='%23e4572e' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3 18L10.5 8H17' fill='none' stroke='%231d6fd8' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round' opacity='.35'/%3E%3C/svg%3E"); }
.maplibregl-ctrl-group button:disabled .icon-fade-lines { opacity: .3; }
.icon-bikelanes { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none'%3E%3Cpath d='M3.5 17C9 13 7 6 16.5 3' stroke='%231b7837' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M3.5 17C9 13 7 6 16.5 3' stroke='%23fff' stroke-width='1.3' stroke-dasharray='2 2'/%3E%3C/g%3E%3C/svg%3E"); }
.maplibregl-ctrl-group button[aria-pressed="false"] .icon-bikelanes { opacity: .4; }
.has-alerts { position: relative; }
.has-alerts::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: #e53935; box-shadow: 0 0 0 1.5px #fff; }

/* ---------- Ecobici popup */
.maplibregl-popup-content { font: inherit; padding: 8px 12px; }
.bike-popup b { display: block; margin-bottom: 2px; }
.bike-popup ul { list-style: none; margin: 0; padding: 0; }
.bike-popup p { margin: 4px 0 0; font-size: 12px; }
.bike-popup .app { display: block; width: 100%; border: 0; margin-top: 8px; padding: 5px 10px; border-radius: 4px; background: #1d6fd8; color: #fff;
  text-align: center; text-decoration: none; font-weight: 600; }
.bike-popup .closed { color: #c62828; font-weight: 600; }

/* markers and popups fade with the basemap (schematic/viewer.js); hidden, they can't be clicked */
.basemap-hidden .maplibregl-marker, .basemap-hidden .maplibregl-popup { pointer-events: none; }
