/* wasserstand.fun -- App-Shell-CSS Teil 1: Tokens, Layout, Sidebar, Tidenkurve/-tabelle. Reihenfolge: app.css -> mobile.css -> app-redesign.css. Ausgelagert aus main.py (11.10.2026), Einbindung ueber _app_shell_css(). */
@import url('/static/fonts/inter.css');

:root {
    --blue: #123f63;
    --light-row: #f3f7fb;
    --border: #d8e1e8;
    --text: #1f2d3d;
    --muted: #6b7280;
    --red: #b02a37;

    /* Redesign-Tokens (Etappe 1+2) */
    --font-heading: "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --neutral-100: #f3f5fe;
    --neutral-200: #e4e7f5;
    --neutral-300: #cfd3e5;
    --neutral-500: #9397ab;
    --neutral-600: #75798c;
    --neutral-700: #595d6c;
    --neutral-800: #3f424d;
    --neutral-900: #292b31;
    --accent-200: #e7e5fe;
    --accent-300: #d2cefd;
    --accent-600: #796cbf;
    --accent-700: #5d5294;
    --accent-800: #423a6a;
    --accent-900: #2b2741;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--neutral-100);
    margin: 0;
    padding: 28px;
    color: var(--neutral-900);
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: -0.015em;
}

a { color: var(--accent-600); }

.page {
    max-width: 1120px;
    margin: 0 auto;
    background: white;
    padding: 34px;
    border-radius: 8px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.08);
}
.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 24px;
}

.station-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}

.sidebar-label {
    font-family: var(--font-heading);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--neutral-600);
    padding: 0 0 2px 10px;
}

.station-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.station-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: none;
    border-left: 2px solid transparent;
    background: transparent;
    color: var(--neutral-700);
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}

.station-button:hover:not(.active) {
    background: color-mix(in srgb, var(--neutral-300) 50%, transparent);
}

.station-button.active {
    background: var(--accent-200);
    color: var(--accent-800);
    border-left: 2px solid var(--accent-600);
}

.station-button.pg-more {
    color: var(--accent-600) !important;
}

button {
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 14px;
    color: var(--accent-700);
    background: transparent;
    border: 1px solid var(--accent-600);
    padding: 8px 12px;
    border-radius: var(--radius-md);
}

button:hover {
    background: color-mix(in srgb, var(--accent-600) 10%, transparent);
}

button:focus-visible,
a:focus-visible,
.station-button:focus-visible {
    outline: 2px solid var(--accent-600);
    outline-offset: 2px;
}

header {
    display: grid;
    grid-template-columns: 70px 1fr 260px;
    gap: 18px;
    align-items: start;
    margin-bottom: 34px;
}

.brand {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
}

h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.title-block p,
.source {
    color: var(--muted);
    font-size: 13px;
    margin-top: 8px;
}

.source {
    text-align: right;
    line-height: 1.6;
}


.logo {
    max-width: 150px;
    height: auto;
    display: block;
    margin-top: 8px;
}

.data-note {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 22px 0 0;
    max-width: 760px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--neutral-600);
}

.overview {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.news-card,
.info-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}

.news-card {
    border-left: 8px solid var(--blue);
}

.news-card h2,
.info-card h3 {
    margin: 0 0 8px 0;
}

.news-card p,
.info-card p {
    margin: 0;
    font-size: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid var(--blue);
    table-layout: fixed;
}

thead th {
    background: var(--blue);
    color: white;
    text-align: left;
    padding: 14px 16px;
    font-size: 16px;
}

tbody td {
    border: 1px solid var(--border);
    padding: 18px 16px;
    min-height: 76px;
    vertical-align: top;
    font-size: 16px;
}

tbody tr:nth-child(even) td {
    background: var(--light-row);
}

.date-cell {
    font-weight: 700;
}
.deviation {
    margin-top: 6px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
}


.main-tide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
}

.tide-main-text {
    min-width: 0;
}
.forecast-line {
    margin-top: 6px;
    color: #157347;
    font-size: 15px;
    font-weight: 700;
}

.prediction-line {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

footer {
    margin-top: 42px;
    color: var(--muted);
    font-size: 12px;
}

.error-box {
    border: 2px solid var(--red);
    padding: 24px;
    border-radius: 12px;
    color: var(--red);
}

@media (max-width: 900px) {
    body {
        padding: 12px;
    }

    .page {
        padding: 18px;
        overflow-x: auto;
    }
.toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    header {
        grid-template-columns: 1fr;
        margin-bottom: 24px;
    }

    .source {
        text-align: left;
    }

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

    table {
        min-width: 920px;
    }

    select {
        min-width: 100%;
    }
}

@media print {
    body {
        background: white;
        padding: 0;
    }

    .no-print,
    header,
    .overview,
    footer {
        display: none !important;
    }

    .page {
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }

    table {
        width: 100%;
        margin: 0;
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    th {
        background: var(--neutral-200) !important;
        color: var(--neutral-900) !important;
        border-bottom: 2px solid var(--accent-600) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    td,
    th {
        font-size: 11px;
        padding: 8px;
    }

    .tide-cell.compact {
        min-height: auto;
    }
}


/* print-logo-start */
.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block !important;
    }

    .print-logo {
        display: block !important;
        margin: 0 0 10px 0 !important;
        padding: 0 !important;
    }

    .print-logo-img {
        width: 160px !important;
        max-width: 160px !important;
        height: auto !important;
        display: block !important;
    }
}
/* print-logo-end */


/* one-page-print-start */
@page {
    size: A4 landscape;
    margin: 6mm;
}

@media print {
    html,
    body {
        width: 297mm !important;
        min-height: 0 !important;
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body {
        font-size: 10.5px !important;
        line-height: 1.2 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .print-logo {
        margin: 0 0 6px 0 !important;
        padding: 0 !important;
    }

    .print-logo-img {
        width: 145px !important;
        max-width: 145px !important;
        height: auto !important;
    }

    .data-note {
        margin: 0 0 7px 0 !important;
        padding: 5px 7px !important;
        font-size: 9px !important;
        line-height: 1.2 !important;
    }

    table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        font-size: 10px !important;
        page-break-inside: avoid !important;
    }

    th,
    td {
        padding: 6px 6px !important;
        line-height: 1.2 !important;
        vertical-align: top !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    th {
        font-size: 9.5px !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }

    tbody tr {
        height: 18mm !important;
    }

    td:first-child,
    th:first-child {
        width: 11% !important;
    }

    td:nth-child(2),
    th:nth-child(2) {
        width: 7% !important;
    }

    td:nth-child(3),
    td:nth-child(4),
    td:nth-child(5),
    td:nth-child(6),
    th:nth-child(3),
    th:nth-child(4),
    th:nth-child(5),
    th:nth-child(6) {
        width: 20.5% !important;
    }

    .tide-cell,
    .tide-time,
    .tide-value,
    .forecast-line,
    .prediction-line {
        font-size: 9.5px !important;
        line-height: 1.18 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .tide-time strong,
    .tide-value strong {
        font-size: 10.5px !important;
    }

    footer {
        display: none !important;
    }

    tr {
        page-break-inside: avoid !important;
    }
}
/* one-page-print-end */

.wave-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #1d70b8;
    flex-shrink: 0;
    min-width: 26px;
    margin-left: 8px;
}

.wave-stack.single {
    gap: 0;
}

.wave-svg {
    display: block;
    width: 22px;
    height: 8px;
    line-height: 0;
}

.wave-svg svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* waterlevel-chart-start */
.chart-section {
    margin-top: 26px;
    padding-top: 8px;
}

.chart-section h2 {
    margin: 0 0 10px 0;
    color: var(--blue);
    font-size: 22px;
}

.chart-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.legend-line {
    display: inline-block;
    width: 28px;
    height: 0;
    border-top: 3px solid;
    vertical-align: middle;
    margin-right: 6px;
}

.legend-measurement {
    border-color: #0f6fae;
}

.legend-prediction {
    border-color: #18a558;
    border-top-style: dotted;
}

.legend-mean {
    border-color: #cc3b3b;
    border-top-style: dashed;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0f6fae;
    vertical-align: middle;
    margin-right: 6px;
}

.waterlevel-chart {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
}

.chart-bg {
    fill: #ffffff;
}

.chart-axis {
    stroke: #9aa8b2;
    stroke-width: 1;
}

.chart-day-line {
    stroke: #d9e2ea;
    stroke-width: 1;
}

.chart-day-label {
    fill: #334155;
    font-size: 15px;
    font-weight: 700;
    text-anchor: middle;
}

.chart-date-label {
    fill: #64748b;
    font-size: 12px;
    text-anchor: middle;
}

.chart-mean-line {
    stroke: #cc3b3b;
    stroke-width: 1.5;
    stroke-dasharray: 6 5;
}

.chart-prediction {
    fill: none;
    stroke: #18a558;
    stroke-width: 2;
    stroke-dasharray: 4 4;
}

.chart-measurement {
    fill: none;
    stroke: #0f6fae;
    stroke-width: 2.4;
}

.chart-event-dot {
    fill: #0f6fae;
    stroke: white;
    stroke-width: 1.5;
}

.chart-event-label {
    fill: #0f172a;
    font-size: 12px;
    font-weight: 700;
    text-anchor: middle;
    paint-order: stroke;
    stroke: white;
    stroke-width: 4px;
    stroke-linejoin: round;
}

.chart-event-label.nw {
    fill: #334155;
}

.chart-label,
.chart-y-title {
    fill: #334155;
    font-size: 13px;
    font-weight: 600;
}
/* waterlevel-chart-end */


/* mobile-layout-start */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chart-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media screen and (max-width: 760px) {
    body {
        background: #ffffff;
    }

    .page {
        margin: 0;
        padding: 14px;
        border-radius: 0;
        box-shadow: none;
        max-width: none;
        width: 100%;
    }

    .top-logo {
        margin-bottom: 10px;
    }

    .logo-top {
        width: 135px !important;
        max-width: 135px !important;
    }

    .toolbar {
        margin-bottom: 16px;
    }

    .station-buttons {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .station-button {
        display: block;
        width: 100%;
        text-align: center;
        font-size: 15px;
        padding: 12px 10px;
        border-radius: 9px;
    }

    h1 {
        font-size: 22px;
        line-height: 1.2;
        margin: 10px 0 14px 0;
    }

    .source {
        position: static !important;
        display: block;
        text-align: left;
        margin-bottom: 12px;
        font-size: 12px;
    }

    .overview {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .info-card {
        padding: 12px;
    }

    .info-card h3 {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .info-card p {
        font-size: 16px;
        margin: 0;
    }

    .data-note {
        font-size: 12px;
        line-height: 1.35;
        padding: 10px;
        margin-bottom: 12px;
    }

    .table-scroll {
        border: 1px solid var(--border);
        border-radius: 10px;
        background: white;
    }

    table {
        min-width: 820px;
        margin: 0;
    }

    th,
    td {
        font-size: 13px;
        padding: 10px 8px;
    }

    .date-cell {
        white-space: nowrap;
    }

    .main-tide {
        font-size: 15px;
    }

    .forecast-line,
    .prediction-line {
        font-size: 12px;
        white-space: nowrap;
    }

    .chart-section {
        margin-top: 18px;
    }

    .chart-section h2 {
        font-size: 20px;
    }

    .chart-legend {
        gap: 10px;
        font-size: 12px;
    }

    .waterlevel-chart {
        min-width: 900px;
        border-radius: 10px;
    }

    footer {
        font-size: 11px;
        line-height: 1.35;
    }
}
/* mobile-layout-end */

/* hero-report-layout-start */
.old-top-logo {
    display: none !important;
}

.hero-report {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 34px;
    align-items: start;
    margin: 24px 0 26px 0;
}

.hero-report-left h1 {
    margin: 0;
    color: var(--blue);
    font-size: 30px;
    line-height: 1.15;
    white-space: nowrap;
}

.hero-report-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

.hero-report-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.hero-report-logo {
    width: 170px;
    max-width: 170px;
    height: auto;
    display: block;
}

.hero-report-cards {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.hero-report-cards .info-card {
    min-height: 104px;
    padding: 18px;
}

.hero-report-cards .info-card h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    line-height: 1.15;
}

.hero-report-cards .info-card p {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
}

@media screen and (max-width: 980px) {
    .hero-report {
        grid-template-columns: 1fr;
        gap: 18px;
        margin: 16px 0 20px 0;
    }

    .hero-report-left h1 {
        white-space: normal;
        font-size: 24px;
    }

    .hero-report-right {
        align-items: flex-start;
    }

    .hero-report-logo {
        width: 140px;
        max-width: 140px;
    }

    .hero-report-cards {
        grid-template-columns: 1fr;
    }
}
/* hero-report-layout-end */


/* final-logo-layout-start */
.page {
    position: relative;
}

/* Das alte Logo oben links ausblenden.
   Die Pegel-Auswahl bleibt sichtbar. */
.top-logo,
.logo-top {
    display: none !important;
}

/* Das neue Logo rechts oben über den Druckbutton setzen. */
.hero-report-logo {
    display: block !important;
    position: absolute;
    top: 38px;
    right: 72px;
    width: 170px;
    max-width: 170px;
    height: auto;
    z-index: 2;
}

/* Tidebericht und die beiden HW/NW-Boxen optisch auf eine Höhe bringen. */
.hero-report {
    align-items: center;
    margin-top: 28px;
}

.hero-report-right {
    padding-top: 64px;
}

.hero-report-left h1 {
    font-size: 30px;
    line-height: 1.12;
    white-space: nowrap;
}

.hero-report-meta {
    margin-top: 12px;
}

@media screen and (max-width: 980px) {
    .hero-report-logo {
        position: static;
        width: 140px;
        max-width: 140px;
        margin-bottom: 8px;
    }

    .hero-report {
        align-items: stretch;
        margin-top: 16px;
    }

    .hero-report-right {
        padding-top: 0;
    }

    .hero-report-left h1 {
        white-space: normal;
        font-size: 24px;
    }
}
/* final-logo-layout-end */

/* print-hide-next-tide-cards-start */
@media print {
    .hero-report-cards {
        display: none !important;
    }

    .hero-report {
        grid-template-columns: 1fr auto !important;
        align-items: start !important;
        margin-bottom: 8px !important;
    }

    .hero-report-right {
        padding-top: 0 !important;
    }
}
/* print-hide-next-tide-cards-end */


/* print-hide-left-logo-start */
@media print {
    .top-logo,
    .logo-top,
    .old-top-logo {
        display: none !important;
    }
}
/* print-hide-left-logo-end */


/* print-logo-cleanup-start */
@media print {
    .top-logo,
    .logo-top,
    .old-top-logo,
    .print-logo,
    .print-only.print-logo,
    img.logo-top {
        display: none !important;
    }

    .hero-report-logo {
        display: block !important;
    }
}
/* print-logo-cleanup-end */

/* rechtenfleth-harbor-row-start */
.rechtenfleth-harbor-row td {
    background: #f3f9fd;
    border-top: 1px solid #b8d7ee;
    border-bottom: 1px solid #b8d7ee;
    color: var(--text);
}

.rechtenfleth-harbor-row strong {
    color: var(--blue);
}

.rechtenfleth-harbor-note {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

@media print {
    .rechtenfleth-harbor-row td {
        background: #f7f7f7 !important;
        border-top: 1px solid #999 !important;
        border-bottom: 1px solid #999 !important;
    }

    .rechtenfleth-harbor-note {
        font-size: 9px;
    }
}
/* rechtenfleth-harbor-row-end */

/* astro-paket-start (Sonnenzeiten/Mondphase/Springtide-Badge,
   siehe astro.py + _astro_footer_html() in main.py) */
.astro-row td {
    border-top: none;
    padding-top: 0;
    padding-bottom: 6px;
}
.astro-cell, .astro-line {
    font-size: 11.5px;
    color: var(--neutral-600, #75798c);
    font-weight: 400;
}
.dtile .astro-line, .mobile-day-card .astro-line {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--neutral-300, #dde3ea);
}
.astro-springtide {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .01em;
}
.astro-springtide.sp {
    background: #eef2ff;
    color: #4338ca;
}
.astro-springtide.np {
    background: #f1f5f9;
    color: #475569;
}
@media print {
    .astro-row, .astro-line { display: none !important; }
}
/* astro-paket-end */

/* tidenkalender-cta-start (Stufe 1, siehe AUFGABE: Link von der
   Pegelseite auf /pegel/{slug}/tidenkalender, nur bei den 4
   Pegeln mit astronomischer Vorausberechnung, siehe
   _render_home()) */
.tidenkal-cta {
    display: inline-block;
    margin: 10px 0 4px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--accent-600);
    color: #fff;
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none;
}
.tidenkal-cta:hover { background: var(--accent-700); }
@media print {
    .tidenkal-cta { display: none !important; }
}
/* tidenkalender-cta-end */
