:root {
    color-scheme: dark;
    --bg: #06111f;
    --bg-2: #081a2d;
    --card: rgba(12, 29, 49, .82);
    --card-strong: rgba(14, 35, 59, .94);
    --ink: #f4f8ff;
    --muted: #8fa2bb;
    --line: rgba(148, 177, 214, .18);
    --line-strong: rgba(148, 177, 214, .30);
    --ok: #4ade80;
    --warn: #fbbf24;
    --bad: #fb7185;
    --blue: #2f8cff;
    --cyan: #22d3ee;
    --purple: #a855f7;
    --shadow: 0 22px 60px rgba(0, 0, 0, .35);
    --glow: 0 0 38px rgba(47, 140, 255, .20);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { min-height: 100%; overflow-x: hidden; }

body {
    min-height: 100%;
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 18% -10%, rgba(34, 211, 238, .24), transparent 26rem),
        radial-gradient(circle at 90% 4%, rgba(47, 140, 255, .20), transparent 22rem),
        linear-gradient(160deg, #040b15 0%, #071629 42%, #06111f 100%);
    background-attachment: fixed;
}


body, .app-main, main {
    max-width: 100%;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.020) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent 80%);
}

h1, h2, h3, p { margin-top: 0; }

h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: -.045em;
}

h2 {
    margin-bottom: 0;
    font-size: 1rem;
    letter-spacing: .02em;
    text-transform: uppercase;
}

h3 {
    font-size: .82rem;
    margin: 14px 0 8px;
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
}

code { color: #bfdbfe; }

a { color: #93c5fd; }

.app-shell-header,
.hero {
    max-width: 100%;
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px clamp(16px, 4vw, 42px);
    border-bottom: 1px solid rgba(148, 177, 214, .12);
    background: rgba(3, 10, 20, .72);
    backdrop-filter: blur(18px);
}

.hero {
    grid-template-columns: minmax(280px, 1fr) auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: radial-gradient(circle at 32% 30%, #e0f2fe, #38bdf8 34%, #1d4ed8 100%);
    color: #031525;
    font-size: 1.4rem;
    font-weight: 900;
    box-shadow: 0 12px 34px rgba(37, 99, 235, .38);
}

.brand strong {
    display: block;
    font-size: 1.34rem;
    line-height: 1;
    letter-spacing: -.03em;
}

.brand small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.desktop-nav {
    display: inline-flex;
    align-items: center;
    justify-self: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(7, 19, 34, .72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}


.nav-button,
.bottom-nav-item {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 13px;
    padding: 10px 14px;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font: inherit;
    font-weight: 800;
    font-size: .90rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.nav-button:hover,
.bottom-nav-item:hover {
    color: var(--ink);
    background: rgba(96, 165, 250, .10);
    border-color: rgba(96, 165, 250, .16);
}

.nav-button.active,
.nav-toggle.active,
.bottom-nav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, #1556c9, #2388ff);
    border-color: rgba(147, 197, 253, .42);
    box-shadow: 0 12px 26px rgba(37, 99, 235, .30), inset 0 1px 0 rgba(255,255,255,.16);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(7, 19, 34, .72);
    border: 1px solid var(--line);
    padding: 8px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.toolbar label {
    font-size: .82rem;
    color: var(--muted);
    font-weight: 800;
}

.compact-toolbar { justify-self: end; }

select, button, input {
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    padding: 10px 12px;
    font: inherit;
    background: rgba(6, 18, 32, .92);
    color: var(--ink);
    outline: none;
}

select:focus,
button:focus-visible,
input:focus {
    border-color: rgba(96, 165, 250, .7);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .16);
}

button {
    background: linear-gradient(135deg, #1556c9, #2f8cff);
    color: white;
    border-color: rgba(147, 197, 253, .35);
    cursor: pointer;
    font-weight: 900;
}

button:disabled {
    opacity: .65;
    cursor: wait;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.app-main,
main {
    width: min(1480px, calc(100% - clamp(24px, 5vw, 72px)));
    margin: 0 auto;
    padding: 18px 0 calc(44px + var(--safe-area-bottom));
}

.mobile-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
    padding: clamp(18px, 4vw, 28px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(15, 43, 72, .86), rgba(8, 24, 42, .72)),
        radial-gradient(circle at 78% 24%, rgba(34, 211, 238, .16), transparent 18rem);
    box-shadow: var(--shadow), var(--glow);
}

.hero-status-dot {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(74,222,128,.95), rgba(22,163,74,.18) 58%, transparent 60%);
    box-shadow: 0 0 32px rgba(74, 222, 128, .38);
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: .15em;
    font-size: .72rem;
    color: var(--cyan);
    font-weight: 900;
}

.lead {
    color: var(--muted);
    max-width: 760px;
    margin-bottom: 0;
}

.status-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 16px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(12, 29, 49, .72);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    border-left: 6px solid var(--muted);
}

.status-strip.ok { border-left-color: var(--ok); }
.status-strip.warn { border-left-color: var(--warn); }
.status-strip.bad { border-left-color: var(--bad); }

.status-strip.has-warnings {
    cursor: pointer;
}

.status-strip.has-warnings:hover,
.status-strip.has-warnings:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(251, 191, 36, .55);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .34), 0 0 0 1px rgba(251, 191, 36, .12);
    outline: none;
}

.status-strip.has-warnings #statusText::after {
    content: ' · Näytä huomautukset';
    color: var(--accent-2);
    font-weight: 800;
}

.dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--muted);
    box-shadow: 0 0 18px currentColor;
}
.status-strip.ok .dot { background: var(--ok); color: var(--ok); }
.status-strip.warn .dot { background: var(--warn); color: var(--warn); }
.status-strip.bad .dot { background: var(--bad); color: var(--bad); }

.timestamp {
    margin-left: auto;
    color: var(--muted);
    font-size: .88rem;
}

.view-panel { display: none; }
.view-panel.active { display: block; }

.cards {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-1 { grid-template-columns: 1fr; }

.card {
    background:
        linear-gradient(180deg, rgba(15, 39, 65, .86), rgba(8, 24, 42, .78));
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
}

.card:hover {
    border-color: rgba(96, 165, 250, .26);
}

.metric {
    position: relative;
    overflow: hidden;
    min-height: 150px;
}

.metric::after {
    content: '';
    position: absolute;
    inset: auto -20% -45% 28%;
    height: 80px;
    background: radial-gradient(circle, rgba(34, 211, 238, .12), transparent 70%);
}

.metric-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 10px;
    border-radius: 13px;
    background: rgba(34, 211, 238, .10);
    color: var(--cyan);
    font-size: 1.25rem;
    font-weight: 900;
}

.metric .label {
    display: block;
    color: var(--muted);
    font-weight: 900;
    font-size: .78rem;
    margin-bottom: 8px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.metric strong {
    position: relative;
    z-index: 1;
    display: block;
    font-size: clamp(1.28rem, 3vw, 1.85rem);
    line-height: 1.13;
    margin-bottom: 8px;
    letter-spacing: -.02em;
}

.metric small {
    position: relative;
    z-index: 1;
    display: block;
    color: var(--muted);
    line-height: 1.45;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 900;
    font-size: .74rem;
    background: rgba(148, 163, 184, .16);
    color: #dbeafe;
    border: 1px solid var(--line);
    white-space: nowrap;
}

.pill.ok { background: rgba(34, 197, 94, .14); color: #86efac; border-color: rgba(74, 222, 128, .26); }
.pill.warn { background: rgba(245, 158, 11, .13); color: #fde68a; border-color: rgba(251, 191, 36, .26); }
.pill.bad { background: rgba(244, 63, 94, .13); color: #fecdd3; border-color: rgba(251, 113, 133, .28); }
.pill.muted { background: rgba(59, 130, 246, .13); color: #bfdbfe; border-color: rgba(96, 165, 250, .24); }


#warningsSection {
    scroll-margin-top: calc(var(--sticky-header-offset, 104px) + 14px);
}

.warnings {
    display: grid;
    gap: 9px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.warnings li {
    border-radius: 16px;
    padding: 12px 13px;
    background: rgba(3, 10, 20, .44);
    border: 1px solid var(--line);
    border-left: 5px solid var(--muted);
    color: #e5eefb;
}

.warnings li.ok { border-left-color: var(--ok); }
.warnings li.warn { border-left-color: var(--warn); }
.warnings li.bad { border-left-color: var(--bad); }

.note {
    color: var(--muted);
    font-size: .90rem;
    margin: 16px 0 0;
    line-height: 1.55;
}

.note.compact { margin: 6px 0 12px; }

.title-with-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.profile-date-label {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 10px;
    border: 1px solid rgba(125, 192, 255, .34);
    border-radius: 999px;
    background: rgba(20, 58, 98, .54);
    color: #d9edff;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .01em;
    white-space: nowrap;
}


.info-button {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(147, 197, 253, .38);
    background: rgba(96, 165, 250, .14);
    color: #bfdbfe;
    font-size: .82rem;
    line-height: 1;
    font-weight: 1000;
    box-shadow: none;
}

.info-button:hover,
.info-button[aria-expanded="true"] {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(37, 99, 235, .92), rgba(34, 211, 238, .72));
    border-color: rgba(191, 219, 254, .62);
}

.info-panel {
    margin: -2px 0 14px;
    padding: 14px 15px;
    border: 1px solid rgba(147, 197, 253, .24);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(12, 29, 49, .96), rgba(3, 10, 20, .92));
    color: #dbeafe;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255,255,255,.05);
}

.info-panel[hidden] { display: none; }

.info-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.info-panel-header strong {
    color: #f4f8ff;
    font-size: .94rem;
}

.info-panel p {
    margin: 0;
    color: #b9cbe2;
    line-height: 1.55;
    font-size: .90rem;
}

.info-panel p + p { margin-top: 7px; }

.info-close {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, .12);
    border-color: rgba(148, 177, 214, .20);
    color: #dbeafe;
    box-shadow: none;
    font-size: 1.05rem;
    line-height: 1;
}


.raw {
    white-space: pre-wrap;
    overflow-x: auto;
    min-height: 58px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(2, 8, 15, .74);
    color: #dbeafe;
    border: 1px solid rgba(148, 177, 214, .14);
    font-family: "Cascadia Mono", Consolas, monospace;
    line-height: 1.55;
    font-size: .88rem;
}

.chart-card { min-height: 420px; }
.featured-chart { min-height: 460px; }

.chart-card canvas {
    width: 100% !important;
    height: 330px !important;
}

.chart-scroll-wrap {
    width: 100%;
    overflow-x: visible;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.chart-scroll-inner {
    width: 100%;
    min-width: 0;
}

.chart-scroll-inner canvas {
    display: block;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(3, 10, 20, .36);
}

.wind-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: .9rem;
}

.wind-table th,
.wind-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 177, 214, .13);
    text-align: left;
    white-space: nowrap;
}

.wind-table th {
    background: rgba(148, 177, 214, .08);
    color: #a8bdd6;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.wind-table tbody tr:last-child td { border-bottom: 0; }
.wind-table tbody tr:nth-child(even) td { background: rgba(148, 177, 214, .035); }


/* Maatuulihistoria kuvastaa mennyttä aikaa neutraalimmalla, harmaalla värimaailmalla. */
.groundwind-history-card {
    background:
        linear-gradient(180deg, rgba(36, 43, 52, .84), rgba(17, 24, 35, .78));
    border-color: rgba(156, 163, 175, .22);
}

.groundwind-history-card:hover {
    border-color: rgba(209, 213, 219, .28);
}

.groundwind-history-card .section-heading h2,
.groundwind-history-card .note {
    color: #c4ccd7;
}

.wind-history-wrap {
    background: rgba(13, 18, 25, .58);
    border-color: rgba(156, 163, 175, .24);
}

.wind-table-history th,
.wind-table-history td {
    border-bottom-color: rgba(156, 163, 175, .16);
}

.wind-table-history th {
    background: rgba(156, 163, 175, .13);
    color: #cbd5e1;
}

.wind-table-history tbody tr:nth-child(even) td {
    background: rgba(156, 163, 175, .055);
}

.wind-table-history .wind-time,
.wind-table-history .wind-direction {
    color: #d1d5db;
}

.wind-table-history .wind-cell-main {
    color: #e5e7eb;
}

.wind-table-history .wind-cell-unit {
    color: #9ca3af;
}

.wind-table-history .wind-cell-kt {
    color: #b6beca;
}


/* Yhteenvedon maatuulitaulukko yhdistää harmaan havaintohistorian, korostetun nykyhetken ja lähiennusteen. */
.overview-groundwind-card {
    overflow: hidden;
}

.overview-groundwind-heading {
    align-items: flex-start;
}

.overview-groundwind-heading > div {
    min-width: 0;
}

.overview-groundwind-heading .note {
    margin-bottom: 0;
}

.overview-groundwind-wrap {
    margin-top: 12px;
}

.wind-table-overview tbody tr.overview-groundwind-history td {
    background: rgba(156, 163, 175, .055);
    border-bottom-color: rgba(156, 163, 175, .16);
    color: #c5ccd6;
}

.wind-table-overview tbody tr.overview-groundwind-history:nth-child(even) td {
    background: rgba(156, 163, 175, .085);
}

.wind-table-overview .overview-groundwind-history .wind-cell-main {
    color: #e5e7eb;
}

.wind-table-overview .overview-groundwind-history .wind-cell-unit,
.wind-table-overview .overview-groundwind-history .wind-cell-kt {
    color: #9ca3af;
}

.wind-table-overview tbody tr.overview-groundwind-now td {
    padding-top: 14px;
    padding-bottom: 14px;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, .28), rgba(34, 211, 238, .13)),
        rgba(7, 24, 43, .94);
    border-top: 1px solid rgba(96, 165, 250, .55);
    border-bottom: 1px solid rgba(34, 211, 238, .45);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}

.wind-table-overview tbody tr.overview-groundwind-now td:first-child {
    border-left: 4px solid var(--cyan);
}

.wind-table-overview tbody tr.overview-groundwind-now .wind-cell-main {
    font-size: 1.12rem;
    color: #ffffff;
}

.overview-groundwind-separator td {
    height: 9px;
    padding: 0 !important;
    border: 0 !important;
    background: rgba(3, 10, 20, .62) !important;
}

.overview-now-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    margin-right: 9px;
    padding: 4px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1556c9, #22d3ee);
    color: #ffffff;
    font-size: .70rem;
    font-weight: 1000;
    letter-spacing: .08em;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .28);
}

.overview-now-time {
    color: #eaf6ff;
    font-weight: 900;
}

.overview-wind-direction {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    white-space: nowrap;
}

.overview-wind-direction > span:last-child {
    white-space: nowrap;
}

.overview-wind-arrow {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 999px;
    background: rgba(96, 165, 250, .12);
    border: 1px solid rgba(96, 165, 250, .20);
    color: #bfdbfe;
    font-size: 1rem;
    font-weight: 1000;
    transform: rotate(var(--wind-rotation, 0deg));
}

.overview-groundwind-history .overview-wind-arrow {
    background: rgba(156, 163, 175, .10);
    border-color: rgba(156, 163, 175, .20);
    color: #cbd5e1;
}

/* Tuuli-sivun havaintohistorian suunnanuolet pidetään muun historiataulukon tavoin harmaana. */
.wind-table-history .overview-wind-arrow {
    background: rgba(156, 163, 175, .10);
    border-color: rgba(156, 163, 175, .20);
    color: #cbd5e1;
}

.overview-groundwind-actions {
    display: flex;
    justify-content: center;
    padding-top: 14px;
}

.overview-groundwind-toggle {
    min-width: 210px;
    padding-inline: 18px;
}

.overview-groundwind-toggle[hidden] {
    display: none;
}

.profile-card { margin-bottom: 16px; overflow: hidden; }
.profile-heading { align-items: flex-start; }

.profile-day-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 14px;
}

.profile-day-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(148, 177, 214, .22);
    background: rgba(148, 177, 214, .08);
    color: var(--muted);
    text-decoration: none;
    font-size: .86rem;
    font-weight: 800;
}

.profile-day-link:hover,
.profile-day-link.active {
    color: #eaf5ff;
    border-color: rgba(66, 211, 255, .48);
    background: rgba(66, 211, 255, .14);
}

.profile-canvas-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border-radius: 20px;
    background: #07192d;
    border: 1px solid var(--line);
}

#profileCanvas {
    display: block;
    min-width: 640px;
}

.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: .9rem;
    margin-top: 12px;
}

.legend-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-cloud,
.legend-metar,
.legend-wind {
    display: inline-block;
    width: 22px;
    height: 12px;
    border-radius: 999px;
}

.legend-cloud { background: rgba(148, 163, 184, .55); }
.legend-metar { height: 0; border-radius: 0; border-top: 3px dashed #f97316; }
.legend-wind {
    width: 26px;
    height: 2px;
    border-radius: 0;
    background: #e5e7eb;
    position: relative;
    transform: rotate(-25deg);
}
.legend-wind::after {
    content: '';
    position: absolute;
    right: 2px;
    top: -8px;
    width: 2px;
    height: 12px;
    background: #e5e7eb;
    transform: rotate(25deg);
    transform-origin: bottom center;
}

.cards-map {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: stretch;
}

.map-card { min-height: 680px; }

#weatherMap {
    width: 100%;
    height: min(72vh, 720px);
    min-height: 560px;
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    background: #07192d;
    filter: saturate(.90) brightness(.86) contrast(1.06);
}

.map-list-card {
    display: flex;
    flex-direction: column;
    max-height: calc(min(72vh, 720px) + 96px);
}

.map-search {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 12px;
    font: inherit;
    margin-bottom: 12px;
    background: rgba(3, 10, 20, .52);
    color: var(--ink);
}

.map-location-list {
    display: grid;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.map-location-button {
    display: grid;
    gap: 3px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: rgba(3, 10, 20, .38);
    color: var(--ink);
    text-align: left;
    box-shadow: none;
}

.map-location-button:hover {
    border-color: rgba(96, 165, 250, .38);
    background: rgba(37, 99, 235, .12);
}

.map-location-button strong { font-size: .95rem; }
.map-location-button span { color: var(--muted); font-size: .82rem; font-weight: 700; }

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: rgba(8, 24, 42, .96);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.leaflet-popup-content { margin: 14px; }

.map-popup { min-width: 245px; color: var(--ink); }
.map-popup h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--ink); }
.map-popup-muted,
.map-popup-loading,
.map-popup-error { margin: 5px 0 10px; color: var(--muted); font-size: .86rem; }
.map-popup-error { color: #fecdd3; background: rgba(244, 63, 94, .16); border-radius: 12px; padding: 8px 10px; }
.map-popup dl { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 5px 10px; margin: 10px 0; font-size: .88rem; }
.map-popup dt { color: var(--muted); font-weight: 900; }
.map-popup dd { margin: 0; }
.map-popup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.map-popup-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(37, 99, 235, .16);
    color: #bfdbfe;
    text-decoration: none;
    font-weight: 900;
    font-size: .82rem;
}
.map-popup-actions a:hover { background: rgba(37, 99, 235, .28); }

footer {
    width: min(1480px, calc(100% - clamp(24px, 5vw, 72px)));
    margin: 0 auto;
    padding: 0 0 calc(92px + var(--safe-area-bottom));
    color: var(--muted);
    font-size: .88rem;
}

.bottom-nav {
    display: none;
}

@media (max-width: 1160px) {
    .app-shell-header { grid-template-columns: minmax(160px, auto) auto; }
    .desktop-nav { display: none; }
    .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards-map { grid-template-columns: 1fr; }
    .map-list-card { max-height: none; }
}

@media (max-width: 780px) {
    :root { --sticky-header-offset: 182px; }
    body { background-attachment: scroll; }

    .app-shell-header,
    .hero {
        position: sticky;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px 14px;
    }


    .brand small { display: none; }

    .toolbar,
    .compact-toolbar {
        justify-self: stretch;
        width: 100%;
    }

    .toolbar select { flex: 1 1 auto; min-width: 0; }
    .toolbar button { flex: 0 0 auto; }

    .profile-day-nav { margin-top: 0; }
    .profile-day-link { flex: 1 1 0; padding-left: 8px; padding-right: 8px; }

    .app-main,
    main {
        width: calc(100% - 24px);
        padding-top: 12px;
        padding-bottom: calc(96px + var(--safe-area-bottom));
    }


    .mobile-hero-card {
        border-radius: 24px;
        padding: 18px;
    }

    .mobile-hero-card h1 { font-size: 2.15rem; }
    .hero-status-dot { width: 46px; height: 46px; }

    .status-strip {
        align-items: flex-start;
        flex-wrap: wrap;
        border-radius: 18px;
    }

    .timestamp {
        width: 100%;
        margin-left: 22px;
    }

    .cards-4,
    .cards-2,
    .cards-1 {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric {
        min-height: 142px;
        padding: 15px;
    }

    .metric strong { font-size: 1.28rem; }
    .metric-icon { width: 34px; height: 34px; margin-bottom: 8px; }

    .chart-card { min-height: 360px; }
    .chart-card canvas { height: 280px !important; }
    .featured-chart canvas { height: 300px !important; }

    .wind-chart-scroll {
        overflow-x: auto;
        padding-bottom: 8px;
        margin-inline: -2px;
    }

    .wind-chart-inner {
        min-width: 860px;
        padding-inline: 2px;
    }

    .table-wrap { border-radius: 14px; }
    .wind-table { min-width: 480px; }
    .wind-table-overview { min-width: 520px; }
    .overview-groundwind-heading { gap: 10px; }
    .overview-groundwind-heading .pill { white-space: normal; text-align: right; }

    #weatherMap {
        min-height: 480px;
        height: 62vh;
        border-radius: 18px;
    }

    .map-card { min-height: auto; }

    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: -1px;
        z-index: 80;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        padding: 7px 10px calc(8px + var(--safe-area-bottom));
        border: 1px solid var(--line);
        border-bottom: 0;
        border-radius: 22px 22px 0 0;
        background: rgba(3, 10, 20, .94);
        backdrop-filter: blur(18px);
        box-shadow: 0 -14px 42px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.06);
        transform: none;
        margin: 0;
        overflow: visible;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: -28px;
        height: 28px;
        background: rgba(3, 10, 20, .94);
        pointer-events: none;
    }

    .bottom-nav-item {
        display: grid;
        place-items: center;
        gap: 3px;
        padding: 9px 4px 7px;
        border-radius: 18px;
        font-size: .64rem;
        line-height: 1.1;
        color: var(--muted);
        text-align: center;
    }

    .bottom-nav-item span {
        font-size: 1.02rem;
        line-height: 1;
    }
}


@media (hover: none) and (pointer: coarse) {
    .bottom-nav-item:hover {
        color: var(--muted);
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }

    .bottom-nav-item.active,
    .bottom-nav-item.active:hover {
        color: #ffffff;
        background: linear-gradient(135deg, #1556c9, #2388ff);
        border-color: rgba(147, 197, 253, .42);
        box-shadow: 0 12px 26px rgba(37, 99, 235, .30), inset 0 1px 0 rgba(255,255,255,.16);
    }
}

@media (max-width: 430px) {
    .metric-grid { grid-template-columns: 1fr; }
    .mobile-hero-card h1 { font-size: 1.9rem; }
    .brand strong { font-size: 1.12rem; }
    .brand-mark { width: 38px; height: 38px; border-radius: 14px; }
    .bottom-nav-item { font-size: .60rem; }
}

.hyppysaa-map-pin {
    width: 24px !important;
    height: 24px !important;
    border-radius: 999px 999px 999px 4px;
    background: linear-gradient(135deg, #22d3ee, #2563eb);
    border: 2px solid #dbeafe;
    box-shadow: 0 10px 26px rgba(37, 99, 235, .48), 0 0 0 7px rgba(37, 99, 235, .18);
    transform: rotate(-45deg);
}

.hyppysaa-map-pin::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 999px;
    background: #06111f;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

.hyppysaa-map-pin.selected {
    background: linear-gradient(135deg, #4ade80, #22d3ee);
    box-shadow: 0 10px 28px rgba(34, 211, 238, .50), 0 0 0 10px rgba(74, 222, 128, .16);
}

/* Legal / privacy pages */
.page-legal .legal-header {
    position: sticky;
    top: 0;
}

.legal-main {
    width: min(1120px, calc(100% - clamp(24px, 5vw, 72px)));
    margin: 0 auto;
    padding: 24px 0 42px;
}

.legal-hero {
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .18), rgba(34, 211, 238, .08)), var(--card);
}

.legal-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 6vw, 4rem);
    letter-spacing: -.06em;
    color: var(--ink);
}

.legal-warning {
    margin-bottom: 18px;
    border-color: rgba(251, 191, 36, .35);
    background: linear-gradient(135deg, rgba(251, 191, 36, .14), rgba(3, 10, 20, .54));
}

.legal-warning h2,
.legal-card h2 {
    margin-top: 0;
}

.legal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.legal-card {
    font-size: .98rem;
    line-height: 1.65;
}

.legal-card.full-width {
    grid-column: 1 / -1;
}

.legal-card ul {
    padding-left: 1.2rem;
    margin: .65rem 0 0;
}

.legal-card li + li {
    margin-top: .35rem;
}

.legal-dl {
    display: grid;
    grid-template-columns: minmax(130px, .7fr) minmax(0, 1.3fr);
    gap: 10px 16px;
    margin: 0;
}

.legal-dl dt {
    color: var(--muted);
    font-weight: 900;
}

.legal-dl dd {
    margin: 0;
    color: var(--ink);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 8px;
}

.footer-links a {
    color: #bfdbfe;
    font-weight: 900;
    text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: #fff;
    text-decoration: underline;
}

@media (max-width: 780px) {
    .legal-main {
        width: calc(100% - 24px);
        padding-top: 12px;
        padding-bottom: 36px;
    }

    .legal-grid {
        grid-template-columns: 1fr;
    }

    .legal-dl {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .page-legal .desktop-nav {
        display: flex;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 3px;
    }

    .page-legal .nav-button {
        white-space: nowrap;
    }
}

/* Mobile containment pass: cards stay within the viewport; wide content scrolls inside the card. */
.card,
.mobile-hero-card,
.status-strip,
.table-wrap,
.raw,
.chart-scroll-wrap,
.profile-canvas-wrap {
    max-width: 100%;
}

.card > *,
.mobile-hero-card > *,
.section-heading > * {
    min-width: 0;
}

.wind-cell-main {
    font-weight: 900;
    color: #f4f8ff;
}

.wind-cell-unit {
    margin-left: 3px;
    color: var(--muted);
    font-size: .78em;
    font-weight: 800;
}

.wind-cell-kt {
    display: inline-block;
    margin-left: 7px;
    color: #bfdbfe;
    font-size: .82em;
    font-weight: 900;
}

@media (max-width: 780px) {
    .cards {
        gap: 12px;
        margin-bottom: 12px;
    }

    .card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        border-radius: 22px;
        padding: 14px;
    }

    .section-heading {
        align-items: flex-start;
        gap: 8px;
    }

    .section-heading h2 {
        overflow-wrap: anywhere;
    }

    .pill {
        flex: 0 0 auto;
        padding: 5px 8px;
        font-size: .68rem;
    }

    .raw,
    .chart-scroll-wrap,
    .profile-canvas-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap {
        overflow-x: hidden;
        border-radius: 14px;
    }

    .wind-table {
        min-width: 0 !important;
        width: 100%;
        table-layout: fixed;
        font-size: .72rem;
    }

    .wind-table th,
    .wind-table td {
        padding: 7px 5px;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.15;
        vertical-align: top;
    }

    .wind-table th {
        font-size: .58rem;
        letter-spacing: .045em;
    }

    .wind-table th:nth-child(1),
    .wind-table td:nth-child(1) { width: 16%; }

    .wind-table th:nth-child(2),
    .wind-table td:nth-child(2) { width: 22%; }

    .wind-table th:nth-child(3),
    .wind-table td:nth-child(3),
    .wind-table th:nth-child(4),
    .wind-table td:nth-child(4) { width: 31%; }

    .wind-direction .overview-wind-direction {
        max-width: 100%;
        overflow-wrap: normal;
        word-break: normal;
    }

    .wind-time,
    .wind-direction {
        font-weight: 900;
        color: #dbeafe;
    }

    .wind-speed {
        display: table-cell;
    }

    .wind-cell-main {
        display: inline-block;
        min-width: 2.2em;
        font-size: .92rem;
        line-height: 1;
    }

    .wind-cell-unit {
        margin-left: 2px;
        font-size: .63rem;
    }

    .wind-cell-kt {
        display: block;
        margin: 2px 0 0;
        font-size: .64rem;
        color: #93c5fd;
    }

    .note.compact {
        font-size: .78rem;
        line-height: 1.4;
    }
}


@media (hover: none) and (pointer: coarse) {
    .bottom-nav-item:hover {
        color: var(--muted);
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }

    .bottom-nav-item.active,
    .bottom-nav-item.active:hover {
        color: #ffffff;
        background: linear-gradient(135deg, #1556c9, #2388ff);
        border-color: rgba(147, 197, 253, .42);
        box-shadow: 0 12px 26px rgba(37, 99, 235, .30), inset 0 1px 0 rgba(255,255,255,.16);
    }
}

@media (max-width: 430px) {
    .card {
        padding: 12px;
        border-radius: 20px;
    }

    .wind-table {
        font-size: .68rem;
    }

    .wind-table th,
    .wind-table td {
        padding: 6px 4px;
    }

    .wind-cell-main {
        font-size: .84rem;
    }
}

.learning-metric-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.learning-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 177, 214, .14);
    border-radius: 14px;
    background: rgba(7, 19, 34, .42);
}

.learning-metric-row span {
    color: var(--muted);
    font-size: .90rem;
}

.learning-metric-row strong {
    color: var(--ink);
    font-size: .98rem;
    white-space: nowrap;
}

@media (max-width: 780px) {
    .learning-metric-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}


/* Profiilin otsikkorivin mobiilikorjaus: estää pitkän otsikon jakautumisen kirjaimiksi. */
.title-with-info h2 {
    white-space: nowrap;
    flex: 0 0 auto;
}

.profile-date-label,
.title-with-info .info-button {
    flex: 0 0 auto;
}

@media (max-width: 780px) {
    .profile-heading {
        display: block;
    }

    .profile-heading > div {
        min-width: 0;
    }

    .profile-heading > .pill,
    .profile-heading > .section-heading-actions > .pill {
        margin-top: 10px;
        max-width: 100%;
    }

    .title-with-info {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .title-with-info h2 {
        flex-basis: 100%;
        width: 100%;
        margin-bottom: 4px;
        font-size: 1.08rem;
        letter-spacing: .04em;
        line-height: 1.15;
    }
}


/* Näkyvät ja sisältökohtaiset palautelinkit */
.feedback-toolbar-link,
.context-feedback-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(34, 211, 238, .34);
    color: #d9f7ff;
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.feedback-toolbar-link {
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(8, 145, 178, .22), rgba(37, 99, 235, .20));
    font-size: .84rem;
}

.feedback-toolbar-link:hover,
.context-feedback-link:hover {
    color: #ffffff;
    border-color: rgba(103, 232, 249, .66);
    background: linear-gradient(135deg, rgba(8, 145, 178, .34), rgba(37, 99, 235, .30));
    box-shadow: 0 10px 24px rgba(8, 145, 178, .16);
    transform: translateY(-1px);
}

.feedback-toolbar-link:focus-visible,
.context-feedback-link:focus-visible {
    outline: none;
    border-color: rgba(103, 232, 249, .86);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, .14);
}

.feedback-link-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.context-feedback-link {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(8, 145, 178, .10);
    font-size: .74rem;
}

.context-feedback-link .feedback-link-icon {
    width: 16px;
    height: 16px;
}

.section-heading-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

@media (max-width: 780px) {
    .feedback-toolbar-link {
        flex: 0 0 42px;
        width: 42px;
        padding: 9px;
    }

    .feedback-toolbar-link > span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .section-heading-actions {
        justify-content: flex-start;
    }

    .profile-heading > .section-heading-actions {
        margin-top: 10px;
    }

    .context-feedback-link {
        white-space: normal;
        line-height: 1.2;
        text-align: left;
    }
}

@media (max-width: 430px) {
    .context-feedback-link span {
        font-size: .70rem;
    }
}

/* Palautelomake ja salattu ylläpitonäkymä */
.feedback-main,
.feedback-admin-main {
    width: min(1120px, calc(100% - clamp(24px, 5vw, 72px)));
    margin: 0 auto;
    padding: 24px 0 calc(56px + var(--safe-area-bottom));
}

.feedback-hero,
.feedback-admin-hero {
    margin-bottom: 16px;
    padding: clamp(22px, 5vw, 38px);
    background:
        linear-gradient(135deg, rgba(15, 43, 72, .92), rgba(8, 24, 42, .80)),
        radial-gradient(circle at 85% 15%, rgba(34, 211, 238, .18), transparent 20rem);
}

.feedback-hero h1,
.feedback-admin-hero h1,
.admin-login-card h1 {
    margin-bottom: 12px;
}

.feedback-back-link {
    display: inline-flex;
    margin-top: 18px;
    font-weight: 900;
    text-decoration: none;
}

.feedback-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
    gap: 16px;
    align-items: start;
}

.feedback-layout-single {
    grid-template-columns: minmax(0, 1fr);
}

.feedback-form-card,
.feedback-security-card,
.admin-login-card {
    padding: clamp(18px, 4vw, 28px);
}

.feedback-form {
    display: grid;
    gap: 18px;
}

.feedback-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.feedback-field {
    display: grid;
    gap: 7px;
}

.feedback-field label,
.feedback-filter-form label {
    color: #dbeafe;
    font-weight: 900;
    font-size: .84rem;
    letter-spacing: .025em;
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea,
.feedback-filter-form select {
    width: 100%;
    border-color: rgba(148, 177, 214, .28);
    background: rgba(4, 15, 28, .80);
}

.feedback-field textarea {
    min-height: 190px;
    resize: vertical;
    line-height: 1.5;
}

.feedback-field textarea:focus,
.feedback-field select:focus,
.feedback-field input:focus {
    border-color: rgba(96, 165, 250, .76);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .16);
}

.feedback-field small,
.optional-label {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
}

.optional-label {
    margin-left: 5px;
    text-transform: none;
}

.feedback-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7, 19, 34, .48);
    color: #cbd5e1;
    font-size: .85rem;
    line-height: 1.45;
}

.feedback-consent input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    padding: 0;
    accent-color: var(--blue);
}

.feedback-submit {
    min-height: 48px;
    font-size: .98rem;
}

.feedback-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.feedback-alert {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(12, 29, 49, .86);
    line-height: 1.45;
}

.feedback-alert ul {
    flex-basis: 100%;
    margin: 3px 0 0;
}

.feedback-alert-success {
    border-color: rgba(74, 222, 128, .42);
    background: rgba(20, 83, 45, .27);
}

.feedback-alert-error {
    border-color: rgba(251, 113, 133, .45);
    background: rgba(127, 29, 29, .25);
}

.feedback-security-card {
    position: sticky;
    top: 104px;
}

.feedback-security-card ul {
    margin: 16px 0;
    padding-left: 20px;
    color: #cbd5e1;
    line-height: 1.55;
}

.feedback-security-card li + li {
    margin-top: 8px;
}

.feedback-security-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    border-radius: 17px;
    background: rgba(74, 222, 128, .12);
    color: var(--ok);
    font-size: 1.4rem;
    font-weight: 900;
}

.feedback-https-warning {
    padding: 12px;
    border-radius: 12px;
    background: rgba(127, 29, 29, .28);
    color: #fecdd3;
    font-weight: 800;
}

.admin-login-card {
    width: min(560px, 100%);
    margin: 7vh auto 0;
}

.admin-login-form {
    margin-top: 22px;
}

.admin-logout-form {
    justify-self: end;
}

.secondary-button,
.danger-button {
    background: rgba(15, 39, 65, .86);
    border-color: var(--line-strong);
}

.danger-button {
    color: #fecdd3;
    border-color: rgba(251, 113, 133, .32);
    padding: 8px 11px;
    font-size: .78rem;
}

.feedback-admin-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.feedback-filter-form {
    display: grid;
    gap: 7px;
    min-width: min(290px, 100%);
}

.feedback-admin-grid {
    display: grid;
    gap: 14px;
}

.feedback-item-card {
    padding: clamp(17px, 4vw, 24px);
}

.feedback-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.feedback-item-heading h2 {
    margin-top: 10px;
    font-size: 1rem;
}

.feedback-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 14px 0;
    color: var(--muted);
    font-size: .82rem;
}

.feedback-message {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(4, 15, 28, .58);
    color: #e2e8f0;
    line-height: 1.58;
    overflow-wrap: anywhere;
}

.feedback-contact {
    margin: 14px 0 0;
    color: #bfdbfe;
    overflow-wrap: anywhere;
}

.feedback-password-card {
    margin-top: 16px;
}

.feedback-password-card summary {
    cursor: pointer;
    font-weight: 900;
}

.feedback-password-form {
    margin-top: 18px;
}

.feedback-empty-card {
    text-align: center;
    color: var(--muted);
}

.feedback-pill-error {
    color: #fecdd3;
    border-color: rgba(251, 113, 133, .38);
}

@media (max-width: 900px) {
    .feedback-layout {
        grid-template-columns: 1fr;
    }

    .feedback-security-card {
        position: static;
    }

    .feedback-admin-hero {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .feedback-main,
    .feedback-admin-main {
        width: min(100% - 22px, 1120px);
        padding-top: 12px;
    }

    .feedback-form-grid {
        grid-template-columns: 1fr;
    }

    .feedback-item-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .feedback-item-heading form,
    .feedback-item-heading button {
        width: 100%;
    }
}

/* Mobiilin yläpalkki: sijaintivalinta joustaa, jotta Päivitä ja palauteikoni pysyvät näkyvissä. */
@media (max-width: 780px) {
    .toolbar select {
        flex: 1 1 0;
        width: 0;
        min-width: 0;
        max-width: 100%;
    }

    .toolbar > button,
    .toolbar > .feedback-toolbar-link {
        flex-shrink: 0;
    }
}

@media (max-width: 420px) {
    .toolbar,
    .compact-toolbar {
        gap: 8px;
        padding: 7px;
    }

    .toolbar > button {
        padding-left: 13px;
        padding-right: 13px;
    }
}

/* Koko sivuston responsiivisuustarkistus 15.7.2026:
   otsikkorivien kapselit saavat siirtyä hallitusti omalle rivilleen,
   eikä niiden sisältöä leikata kortin reunan kohdalta. */
@media (max-width: 780px) {
    .section-heading {
        flex-wrap: wrap;
    }

    .section-heading > .pill,
    .section-heading > .section-heading-actions {
        max-width: 100%;
    }

    .section-heading-actions {
        flex: 0 0 auto;
    }

    .section-heading-actions .pill,
    .section-heading > .pill {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: left;
    }

    .overview-groundwind-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .overview-groundwind-heading .section-heading-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .overview-groundwind-heading .pill {
        flex: 0 1 auto;
        width: fit-content;
        max-width: 100%;
    }
}

/* Erittäin kapeilla puhelimilla NYT-tunnus ja kellonaika pinotaan,
   jotta taulukon muita sarakkeita tai fonttikokoa ei tarvitse pienentää. */
@media (max-width: 430px) {
    .wind-table-overview .overview-groundwind-now .wind-time {
        white-space: normal;
    }

    .overview-groundwind-now .overview-now-badge {
        display: flex;
        width: fit-content;
        min-width: 0;
        margin: 0 0 3px;
        padding: 3px 6px;
    }

    .overview-groundwind-now .overview-now-time {
        display: block;
    }

    .overview-wind-direction {
        gap: 5px;
    }

    .overview-wind-arrow {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }
}

/* 320–340 px leveillä näytöillä pisin alavalikon sana tarvitsee vain
   hieman tiiviimmän kirjainkoon ja sivuvälit. */
@media (max-width: 340px) {
    .bottom-nav {
        gap: 2px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .bottom-nav-item {
        padding-left: 2px;
        padding-right: 2px;
        font-size: .57rem;
    }
}

/* SEO-semanttiset sivuotsikot näyttävät samoilta kuin aiemmat korttiotsikot. */
.seo-section-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.title-with-info .seo-section-title {
    white-space: nowrap;
    flex: 0 0 auto;
}

@media (max-width: 780px) {
    .title-with-info .seo-section-title {
        flex-basis: 100%;
        width: 100%;
        margin-bottom: 4px;
        font-size: 1.08rem;
        letter-spacing: .04em;
        line-height: 1.15;
    }
}

/* Palautteiden valinta kehityskoosteeseen */
.feedback-selection-toolbar {
    position: sticky;
    top: 88px;
    z-index: 18;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 20px;
    align-items: center;
    margin-bottom: 14px;
    padding: 16px 18px;
    border-color: rgba(96, 165, 250, .34);
    background: rgba(6, 20, 36, .94);
    backdrop-filter: blur(16px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
}

.feedback-selection-summary {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.feedback-selection-summary strong {
    color: #f8fafc;
    font-size: 1rem;
}

.feedback-selection-summary span {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.45;
}

.feedback-selection-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.feedback-selection-actions button {
    min-height: 40px;
    padding: 9px 13px;
    font-size: .78rem;
}

.feedback-selection-actions button:disabled {
    cursor: not-allowed;
    opacity: .45;
    transform: none;
}

.feedback-copy-status {
    grid-column: 1 / -1;
    min-height: 1.25em;
    margin: 0;
    color: #86efac;
    font-size: .78rem;
    font-weight: 800;
}

.feedback-production-select {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
    color: #dbeafe;
    font-size: .8rem;
    font-weight: 900;
    cursor: pointer;
}

.feedback-production-select input {
    width: 19px;
    height: 19px;
    margin: 0;
    padding: 0;
    accent-color: var(--blue);
    cursor: pointer;
}

.feedback-item-card {
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.feedback-item-card.is-selected {
    border-color: rgba(74, 222, 128, .62);
    background:
        linear-gradient(135deg, rgba(22, 101, 52, .14), rgba(8, 24, 42, .82)),
        var(--card);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, .13), 0 18px 44px rgba(0, 0, 0, .28);
}

@media (max-width: 900px) {
    .feedback-selection-toolbar {
        top: 76px;
        grid-template-columns: 1fr;
    }

    .feedback-selection-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .feedback-selection-toolbar {
        top: 68px;
        padding: 13px;
    }

    .feedback-selection-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .feedback-selection-actions button {
        width: 100%;
    }

    .feedback-selection-actions #copySelectedFeedback {
        grid-column: 1 / -1;
    }
}
