:root {
    --page: #f5f7f9;
    --surface: #ffffff;
    --surface-soft: #f6f9fb;
    --nav: #111f2e;
    --ink: #17283a;
    --muted: #738291;
    --line: #dce4ea;
    --line-strong: #cbd6de;
    --accent: #08a8b6;
    --accent-dark: #087f8b;
    --green: #159769;
    --red: #dc5962;
    --amber: #d99a22;
    --blue: #357cc2;
    --radius: 12px;
    --qmk-text: #f4fbfd;
    --qmk-muted: #94aeb8;
    --qmk-accent: #41d9d0;
    --qmk-live: #39e3a4;
    --qmk-stale: #ff7b68;
    --qmk-line: rgba(184, 226, 239, .16);
    --qmk-panel-strong: rgba(7, 17, 25, .98);
    --qmk-header-h: 56px;
    --qmk-shadow: 0 20px 56px rgba(0, 0, 0, .42);
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }

.smp-header {
    position: relative;
    z-index: 1200;
    height: var(--qmk-header-h);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 0 18px;
    background: #07121a;
    border-bottom: 1px solid rgba(181, 229, 241, .14);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .22);
}
.smp-brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 21px;
    font-weight: 820;
    letter-spacing: -.03em;
}
.smp-brand > span:last-child > span { color: var(--qmk-accent); }
.smp-brandmark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(65, 217, 208, .48);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(65, 217, 208, .22), rgba(20, 105, 139, .13));
    box-shadow: inset 0 0 20px rgba(65, 217, 208, .08);
}
.smp-brandmark svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: var(--qmk-accent);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.smp-live {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--qmk-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
}
.smp-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #81949b; box-shadow: 0 0 0 4px rgba(129, 148, 155, .1); }
.smp-live.is-ok { color: #b6ffe2; }
.smp-live.is-ok .smp-live-dot { background: var(--qmk-live); box-shadow: 0 0 0 4px rgba(57, 227, 164, .13), 0 0 15px rgba(57, 227, 164, .65); animation: qmk-pulse 2s infinite; }
.smp-live.is-error { color: #ffc1b8; }
.smp-live.is-error .smp-live-dot { background: var(--qmk-stale); }

.port-shell {
    width: min(1180px, calc(100% - 42px));
    margin: 0 auto;
    padding-bottom: 54px;
}
.port-breadcrumb {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #85919c;
    font-size: 11px;
}
.port-breadcrumb a { text-decoration: none; }
.port-breadcrumb a:hover { color: var(--accent-dark); }
.port-breadcrumb strong { color: #667482; font-weight: 600; }

.port-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .75fr);
    gap: 42px;
    align-items: stretch;
    padding: 3px 0 56px;
}
.port-hero-copy { padding: 24px 0 15px; }
.port-eyebrow,
.port-section-eyebrow {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.port-country {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
}
.port-country img { width: 24px; height: 18px; }
.port-hero h1 {
    margin: 0 0 18px;
    color: var(--ink);
    font-size: clamp(43px, 5vw, 58px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.055em;
}
.port-hero h1 span { color: var(--accent); }
.port-intro {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.85;
}
.port-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}
.port-hero-actions a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 17px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}
.port-hero-actions a.is-primary { background: var(--nav); color: #fff; }
.port-hero-actions a:not(.is-primary):hover { color: var(--accent-dark); }

.port-hero-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 4px 16px rgba(23, 44, 64, .045);
}
.port-hero-facts > div {
    min-width: 0;
    padding: 18px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.port-hero-facts > div:nth-child(odd):not(.port-fact-status) { border-right: 0; }
.port-hero-facts > div:nth-last-child(-n + 2) { border-bottom: 0; }
.port-hero-facts .port-fact-status {
    grid-column: 1 / -1;
    border-right: 0;
}
.port-hero-facts dt {
    margin: 0 0 7px;
    color: #89949e;
    font-size: 9px;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.port-hero-facts dd {
    margin: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 690;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.port-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eaf8f4;
    color: var(--green);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .02em;
}
.port-live-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.port-live-pill.is-error { color: var(--red); background: #fff0f1; }

.port-tabs {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex;
    align-items: stretch;
    gap: 28px;
    min-height: 59px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: rgba(245, 247, 249, .95);
    backdrop-filter: blur(12px);
}
.port-tabs a {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    color: var(--ink);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.port-tabs a:hover,
.port-tabs a.is-active { color: var(--accent-dark); border-bottom-color: var(--accent); }

.port-section {
    padding: 40px 0 4px;
    scroll-margin-top: 60px;
}
.port-section > h2,
.port-section-title h2 {
    margin: 0 0 25px;
    color: var(--ink);
    font-size: 29px;
    line-height: 1.2;
    letter-spacing: -.035em;
}
.port-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 22px;
}
.port-section-title > span { color: var(--muted); font-size: 11px; }
.port-section-intro {
    max-width: 820px;
    margin: -10px 0 24px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}
.port-disclaimer {
    margin: 13px 2px 0;
    color: #7c8995;
    font-size: 10px;
    line-height: 1.65;
}

.dash-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 4px 15px rgba(23, 44, 64, .035);
}
.dash-card-head {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 17px;
    border-bottom: 1px solid var(--line);
}
.dash-card-head h3 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.dash-card-head > a,
.dash-card-head > span {
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
}
.dash-card-head > a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
}
.dash-card > footer {
    padding: 11px 15px;
    border-top: 1px solid var(--line);
    color: #84909b;
    font-size: 9px;
    line-height: 1.55;
}

.port-map-card #portMap { height: 560px; background: #dce8ec; }
.port-map-wrap { position: relative; padding: 14px; }
.port-map-wrap #portMap { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.port-map-layers {
    position: absolute;
    z-index: 500;
    top: 27px;
    right: 27px;
    min-width: 112px;
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    border: 1px solid rgba(203, 214, 222, .95);
    border-radius: 8px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 5px 16px rgba(23, 44, 64, .12);
    color: var(--muted);
    font-size: 10px;
}
.port-map-layers > * { padding: 5px 0; }
.port-map-layers strong { color: var(--accent-dark); }
.port-map-scale {
    position: absolute;
    z-index: 500;
    left: 32px;
    bottom: 30px;
    width: 64px;
    padding-top: 3px;
    border-top: 2px solid #183246;
    color: #183246;
    font-size: 8px;
}
.port-map-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0 14px 14px;
}
.port-map-kpis > div {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}
.port-map-kpis > div > span { color: var(--accent); font-size: 22px; }
.port-map-kpis p { margin: 0; color: var(--muted); font-size: 10px; }
.port-map-kpis strong { display: block; margin-top: 2px; color: var(--ink); font-size: 24px; }

.port-vessel-columns,
.port-vessel {
    display: grid;
    grid-template-columns: minmax(190px, 1.65fr) 1fr .8fr 1fr .9fr;
    align-items: center;
    gap: 14px;
}
.port-vessel-columns {
    min-height: 43px;
    padding: 0 17px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    color: #84909b;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.port-vessel-list {
    max-height: 610px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.port-vessel {
    min-height: 61px;
    padding: 8px 17px;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
    font-size: 11px;
}
.port-vessel:last-child { border-bottom: 0; }
.port-vessel:hover { background: #f8fbfc; }
.port-vessel-name {
    min-width: 0;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}
.port-vessel-name > i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.port-vessel-name > i.is-live { background: var(--green); box-shadow: 0 0 0 3px #dff4eb; }
.port-vessel-name strong,
.port-vessel-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-vessel-name strong { color: var(--ink); font-size: 12px; }
.port-vessel-name small { margin-top: 3px; color: #8a96a0; font-size: 9px; font-weight: 400; }
.port-vessel-cell { color: #657584; line-height: 1.45; }
.port-vessel-cell strong { display: block; color: var(--ink); font-size: 11px; }
.port-vessel-cell small { display: block; color: #8c98a2; font-size: 9px; }
.port-vessel-arrow { color: var(--accent); }
.port-loading,
.port-empty,
.port-error { margin: 0; padding: 40px 18px; color: var(--muted); font-size: 12px; text-align: center; }
.port-error { color: var(--red); }

.port-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.weather-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weather-block { min-width: 0; padding: 18px; }
.weather-block + .weather-block { border-left: 1px solid var(--line); }
.weather-block > p { margin: 0 0 15px; color: var(--accent-dark); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.weather-main { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.weather-main > span { color: #e6b128; font-size: 36px; }
.weather-main > strong { color: var(--ink); font-size: 25px; }
.weather-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.weather-block dl,
.port-data-columns dl { margin: 0; }
.weather-block dl > div,
.port-data-columns dl > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #edf1f4;
}
.weather-block dl > div:last-child,
.port-data-columns dl > div:last-child { border-bottom: 0; }
.weather-block dt,
.port-data-columns dt { color: var(--muted); font-size: 10px; }
.weather-block dd,
.port-data-columns dd { margin: 0; color: var(--ink); font-size: 11px; font-weight: 650; text-align: right; }

.tide-empty { padding: 16px 18px 8px; text-align: center; }
.tide-empty svg { display: block; width: 100%; height: 135px; }
.tide-grid { fill: none; stroke: #e2e9ee; stroke-width: 1; }
.tide-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 5; }
.tide-chart .tide-line { stroke-width: 2.5; stroke-dasharray: none; }
.tide-area { fill: rgba(10, 170, 162, .12); stroke: none; }
.tide-empty strong { display: block; color: var(--ink); font-size: 11px; }
.tide-empty > span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.tide-times { display: grid; grid-template-columns: repeat(4, 1fr); padding: 10px 14px 16px; }
.tide-times > div { text-align: center; }
.tide-times strong { display: block; color: var(--ink); font-size: 11px; }
.tide-times span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }

.port-data-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 18px 18px; }
.port-data-columns dl:first-child { padding-right: 18px; }
.port-data-columns dl + dl { padding-left: 18px; border-left: 1px solid var(--line); }
.port-data-columns .is-yes { color: var(--green); }
.port-data-columns .is-no { color: var(--red); }
.port-data-columns .is-pending { color: var(--amber); }

.traffic-periods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 18px; }
.traffic-periods > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.traffic-periods span { display: block; color: var(--muted); font-size: 9px; }
.traffic-periods strong { display: block; margin: 5px 0; color: var(--ink); font-size: 22px; }
.traffic-periods i { height: 28px; display: flex; float: right; align-items: end; gap: 3px; margin-top: -32px; }
.traffic-periods b { width: 4px; background: var(--green); }
.traffic-periods b:nth-child(1) { height: 8px; }
.traffic-periods b:nth-child(2) { height: 14px; }
.traffic-periods b:nth-child(3) { height: 22px; }
.traffic-periods b:nth-child(4) { height: 17px; }
.traffic-periods b:nth-child(5) { height: 27px; }
.traffic-periods > div:nth-child(2) b { background: var(--blue); }
.traffic-periods > div:nth-child(3) b { background: #8162c6; }
.traffic-periods small { color: var(--green); font-size: 8px; }
.traffic-lists { padding: 0 18px 18px; }
.traffic-lists > div { padding: 13px 4px; border-top: 1px solid var(--line); }
.traffic-lists strong,
.traffic-lists span { display: block; }
.traffic-lists strong { font-size: 11px; }
.traffic-lists span { margin-top: 5px; color: var(--muted); font-size: 9px; }
.traffic-arrivals { margin-top: 9px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.traffic-arrivals a { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(90px, .7fr) minmax(0, 1fr) 12px; gap: 12px; align-items: center; padding: 10px 12px; color: var(--ink); text-decoration: none; }
.traffic-arrivals a + a { border-top: 1px solid var(--line); }
.traffic-arrivals a:hover { background: var(--surface-soft); }
.traffic-arrivals a > span { min-width: 0; margin: 0; color: var(--ink); }
.traffic-arrivals b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.traffic-arrivals small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-style: normal; }
.traffic-arrivals time { color: var(--ink); font-size: 9px; font-weight: 700; }
.traffic-arrivals .traffic-origin { font-size: 9px; }
.traffic-arrivals a > i { color: var(--blue); font-size: 18px; font-style: normal; }
.traffic-arrivals-empty { padding: 12px; }

.nearby-card { max-width: 780px; }
.nearby-list { padding: 7px 18px; }
.nearby-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
}
.nearby-list > div:last-child { border-bottom: 0; }
.nearby-list span { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.nearby-list img { width: 20px; height: 14px; }
.nearby-list strong { color: var(--muted); font-size: 10px; }

.port-footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); }
.port-footer > div {
    width: min(1180px, calc(100% - 42px));
    min-height: 78px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 11px;
}
.port-footer a { text-decoration: none; }
.port-footer a:hover { color: var(--accent-dark); }
.port-footer span { margin-left: auto; }

.smp-port-marker,
.smp-vessel-marker { background: transparent; border: 0; }
.smp-vessel-canvas { position: absolute; left: 0; top: 0; }
.smp-port-marker span {
    display: block;
    width: 18px;
    height: 18px;
    transform: rotate(45deg);
    border: 2px solid #fff;
    border-radius: 4px 50% 50% 50%;
    background: var(--accent-dark);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}
.smp-vessel-marker span {
    display: block;
    width: 10px;
    height: 17px;
    transform-origin: 50% 50%;
    clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
    background: #13b968;
    filter: drop-shadow(0 1px 2px #000);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip { color: var(--ink); background: #fff; }
.leaflet-popup-content { margin: 10px 12px; font: 10px/1.5 Inter, sans-serif; }
.leaflet-popup-content strong { display: block; font-size: 11px; }
.smp-port-popup { min-width: 180px; }
.smp-port-popup > span { display: block; color: var(--muted); }
.smp-port-popup > a { display: inline-flex; margin-top: 8px; padding: 6px 10px; border-radius: 5px; color: #fff; background: var(--accent-dark); font-weight: 800; text-decoration: none; }
.smp-port-popup > a:hover { background: var(--nav); }
.leaflet-control-attribution { font-size: 7px; }

@media (max-width: 920px) {
    .port-hero { grid-template-columns: minmax(0, 1fr) 370px; gap: 28px; }
    .port-intro { font-size: 14px; }
}

@media (max-width: 760px) {
    .port-shell,
    .port-footer > div { width: min(100% - 28px, 1180px); }
    .port-breadcrumb { min-height: 60px; overflow: hidden; white-space: nowrap; }
    .port-hero { grid-template-columns: 1fr; gap: 20px; padding-bottom: 38px; }
    .port-hero-copy { padding: 10px 0 0; }
    .port-hero h1 { font-size: 43px; }
    .port-tabs { gap: 22px; }
    .port-map-card #portMap { height: 440px; }
    .port-dashboard-grid { grid-template-columns: 1fr; }
    .port-section { padding-top: 34px; }
    .port-vessel-columns,
    .port-vessel { grid-template-columns: minmax(170px, 1.5fr) .8fr .75fr; }
    .port-vessel-columns span:nth-child(2),
    .port-vessel-columns span:nth-child(5),
    .port-vessel .port-vessel-cell:nth-of-type(1),
    .port-vessel .port-vessel-cell:nth-of-type(4) { display: none; }
}

@media (max-width: 520px) {
    .port-hero h1 { font-size: 38px; }
    .port-intro { font-size: 13px; line-height: 1.7; }
    .port-hero-facts { grid-template-columns: 1fr; }
    .port-hero-facts > div,
    .port-hero-facts > div:nth-child(odd):not(.port-fact-status),
    .port-hero-facts > div:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
    .port-hero-facts > div:last-child { border-bottom: 0; }
    .port-tabs { margin: 0 -14px; padding: 0 14px; }
    .port-section > h2,
    .port-section-title h2 { font-size: 24px; }
    .port-section-title { align-items: flex-start; flex-direction: column; gap: 0; }
    .port-section-title > span { margin: -15px 0 19px; }
    .dash-card-head { min-height: 59px; padding: 0 13px; }
    .dash-card-head h3 { font-size: 13px; }
    .dash-card-head > a { min-height: 35px; padding: 0 9px; font-size: 9px; }
    .port-map-wrap { padding: 10px; }
    .port-map-card #portMap { height: 350px; }
    .port-map-layers { top: 20px; right: 20px; }
    .port-map-scale { left: 24px; bottom: 24px; }
    .port-map-kpis { grid-template-columns: 1fr; padding: 0 10px 10px; }
    .port-vessel-columns { display: none; }
    .port-vessel { grid-template-columns: minmax(0, 1.7fr) .85fr; gap: 9px; padding: 10px 13px; }
    .port-vessel .port-vessel-cell:nth-of-type(1),
    .port-vessel .port-vessel-cell:nth-of-type(2),
    .port-vessel .port-vessel-cell:nth-of-type(4) { display: none; }
    .weather-grid { grid-template-columns: 1fr; }
    .weather-block + .weather-block { border-left: 0; border-top: 1px solid var(--line); }
    .port-data-columns { grid-template-columns: 1fr; }
    .port-data-columns dl:first-child { padding-right: 0; }
    .port-data-columns dl + dl { padding-left: 0; border-left: 0; }
    .traffic-periods { grid-template-columns: 1fr; }
    .port-footer > div { min-height: 96px; flex-wrap: wrap; gap: 12px 18px; padding: 20px 0; }
    .port-footer span { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* Gemeinsamer Header fuer Karte und Hafenseiten. */
.smp-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.smp-gsearch { position: relative; justify-self: center; width: min(460px, 40vw); }
.smp-gsearch-open, .smp-gsearch-close { display: none; }
.smp-gsearch-open svg, .smp-gsearch-close svg, .smp-gsearch-field svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.smp-gsearch-box { position: relative; display: flex; align-items: center; gap: 8px; }
.smp-gsearch-field { flex: 1; min-width: 0; height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid rgba(181, 229, 241, .18); border-radius: 12px; color: #8fb2bc; background: rgba(255, 255, 255, .05); transition: border-color .15s, background .15s; }
.smp-gsearch-field:focus-within { border-color: rgba(65, 217, 208, .6); background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 3px rgba(65, 217, 208, .12); }
.smp-gsearch-field svg { width: 17px; height: 17px; flex: 0 0 auto; }
.smp-gsearch-field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; color: var(--qmk-text); background: transparent; font-size: 13px; }
.smp-gsearch-field input::placeholder { color: #7f9aa3; }
.smp-gsearch-results { position: absolute; z-index: 1600; top: calc(100% + 8px); left: 0; right: 0; max-height: min(70vh, 480px); overflow: auto; padding: 6px; border: 1px solid var(--qmk-line); border-radius: 14px; background: var(--qmk-panel-strong); box-shadow: var(--qmk-shadow); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.smp-gsearch-group { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px 5px; color: var(--qmk-accent); font-size: 9px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.smp-gsearch-group span { color: #7f9aa3; font-weight: 700; letter-spacing: .04em; text-transform: none; }
.smp-gsearch-item { width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 10px; color: var(--qmk-text); background: transparent; text-align: left; cursor: pointer; }
.smp-gsearch-item:hover, .smp-gsearch-item[aria-selected="true"] { background: rgba(65, 217, 208, .1); }
.smp-gsearch-icon { display: grid; place-items: center; color: var(--qmk-accent); font-size: 14px; }
.smp-gsearch-ship { width: 9px; height: 9px; border-radius: 50%; background: var(--qmk-accent); }
.smp-gsearch-main { min-width: 0; }
.smp-gsearch-main strong { display: block; overflow: hidden; color: #edf7f8; font-size: 12px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.smp-gsearch-main small { display: flex; align-items: center; gap: 5px; margin-top: 3px; overflow: hidden; color: var(--qmk-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.smp-gsearch-side { max-width: 140px; overflow: hidden; color: #b7cdd3; font-size: 10px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.smp-gsearch-side small { display: block; margin-top: 3px; color: #79959e; font-size: 9px; }
.smp-gsearch-msg { padding: 12px 10px; color: var(--qmk-muted); font-size: 11px; }
.smp-gsearch-backdrop { position: fixed; z-index: 1650; inset: 0; background: rgba(0, 0, 0, .55); }
.smp-header-end { justify-self: end; display: flex; align-items: center; gap: 12px; }
.smp-lang { position: relative; }
.smp-lang summary { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid rgba(181, 229, 241, .2); border-radius: 10px; color: #cfe3e8; background: rgba(255, 255, 255, .05); font-size: 11px; font-weight: 800; letter-spacing: .08em; cursor: pointer; list-style: none; user-select: none; }
.smp-lang summary::-webkit-details-marker { display: none; }
.smp-lang summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.smp-lang summary:hover, .smp-lang[open] summary { border-color: rgba(65, 217, 208, .6); background: rgba(255, 255, 255, .08); }
.smp-lang-menu { position: absolute; z-index: 1600; top: calc(100% + 8px); right: 0; min-width: 170px; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--qmk-line); border-radius: 12px; background: var(--qmk-panel-strong); box-shadow: var(--qmk-shadow); }
.smp-lang-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--qmk-text); font-size: 13px; text-decoration: none; }
.smp-lang-menu a b { width: 22px; color: var(--qmk-accent); font-size: 10px; letter-spacing: .08em; }
.smp-lang-menu a:hover, .smp-lang-menu a:focus-visible { background: rgba(65, 217, 208, .1); outline: none; }
.smp-lang-menu a[aria-current="page"] { color: #fff; font-weight: 700; background: rgba(65, 217, 208, .14); }

@media (max-width: 720px) {
    .smp-header { grid-template-columns: 1fr auto auto; gap: 10px; padding: 0 12px; }
    .smp-gsearch { width: auto; justify-self: end; }
    .smp-gsearch-open { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(181, 229, 241, .2); border-radius: 12px; color: #cfe3e8; background: rgba(255, 255, 255, .05); cursor: pointer; }
    .smp-gsearch-open svg { width: 19px; height: 19px; }
    .smp-gsearch-box { display: none; }
    .smp-gsearch.is-open .smp-gsearch-box { position: fixed; z-index: 1700; top: 0; left: 0; right: 0; height: calc(var(--qmk-header-h) + env(safe-area-inset-top, 0px)); display: flex; padding: env(safe-area-inset-top, 0px) 10px 0; background: #07121a; border-bottom: 1px solid rgba(181, 229, 241, .14); }
    .smp-gsearch.is-open .smp-gsearch-close { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px solid rgba(181, 229, 241, .2); border-radius: 12px; color: #cfe3e8; background: rgba(255, 255, 255, .05); cursor: pointer; }
    .smp-gsearch.is-open .smp-gsearch-close svg { width: 18px; height: 18px; }
    .smp-gsearch-field input { font-size: 16px; }
    .smp-gsearch-results { position: fixed; top: calc(var(--qmk-header-h) + env(safe-area-inset-top, 0px) + 8px); left: 8px; right: 8px; max-height: calc(100svh - var(--qmk-header-h) - 24px); }
    .smp-header-end { gap: 8px; }
    .smp-lang summary { height: 38px; padding: 0 10px; border-radius: 12px; }
    .smp-lang summary svg { display: none; }
}
@media (max-width: 400px) {
    #smpLiveText { display: none; }
}
@keyframes qmk-pulse { 50% { box-shadow: 0 0 0 7px rgba(57, 227, 164, 0), 0 0 18px rgba(57, 227, 164, .72); } }
