/* =============================================================================
   SurfGuru Wave Conditions v2.0 – Front-end Styles
   Designed to match surfguru.com visual style:
   - Dark navy/teal header bars
   - Horizontal conditions boxes (surf / wind / swell / weather / wind wave)
   - Clean forecast tables with alternating rows
   - Offshore = green, Onshore = muted
   All selectors prefixed .sgw- to avoid theme conflicts
   ============================================================================= */

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
    --sgw-navy:          #1a2b3c;
    --sgw-navy-mid:      #243447;
    --sgw-navy-light:    #2e4057;
    --sgw-teal:          #0e9aa7;
    --sgw-teal-dark:     #0b7a85;
    --sgw-white:         #ffffff;
    --sgw-off-white:     #f4f7fa;
    --sgw-border:        #d1dbe6;
    --sgw-border-dark:   #b0bec5;
    --sgw-text:          #1a2332;
    --sgw-text-mid:      #3d5166;
    --sgw-text-muted:    #607d8b;
    --sgw-row-alt:       #f8fbff;
    --sgw-row-now:       #e8f4fd;
    --sgw-row-now-border:#0e9aa7;

    --sgw-excellent:     #16a34a;
    --sgw-excellent-bg:  #dcfce7;
    --sgw-good:          #2563eb;
    --sgw-good-bg:       #dbeafe;
    --sgw-fair:          #d97706;
    --sgw-fair-bg:       #fef3c7;
    --sgw-poor:          #dc2626;
    --sgw-poor-bg:       #fee2e2;

    --sgw-offshore-color:#16a34a;
    --sgw-onshore-color: #607d8b;

    --sgw-radius:        6px;
    --sgw-radius-sm:     4px;
    --sgw-shadow:        0 2px 8px rgba(0,0,0,0.10);
    --sgw-font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */
.sgw-wrap {
    font-family: var(--sgw-font);
    font-size: 13px;
    color: var(--sgw-text);
    margin: 20px 0 28px;
    border: 1px solid var(--sgw-border);
    border-radius: var(--sgw-radius);
    overflow: hidden;
    box-shadow: var(--sgw-shadow);
}

.sgw-forecast-section {
    margin-top: 28px;
}

.sgw-error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: var(--sgw-radius);
    color: #b91c1c;
    padding: 14px 18px;
    margin: 16px 0;
    font-family: var(--sgw-font);
}

/* --------------------------------------------------------------------------
   Header Bars  — matches surfguru.com's dark navy section headers
   -------------------------------------------------------------------------- */
.sgw-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 6px;
}

.sgw-bar--dark {
    background: var(--sgw-navy);
    color: var(--sgw-white);
}

.sgw-bar--mid {
    background: var(--sgw-navy-mid);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
}

.sgw-bar__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--sgw-white);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.sgw-bar__icon {
    display: inline-block;
    vertical-align: middle;
    /* filter makes white SVG icons visible on dark bg */
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.sgw-bar__meta {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sgw-bar__meta-sm {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* Live pulse dot */
.sgw-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    animation: sgw-pulse 2s infinite;
    flex-shrink: 0;
}
@keyframes sgw-pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:0.4; transform:scale(0.85); }
}


/* --------------------------------------------------------------------------
   Current Conditions Row
   Matches surfguru.com's horizontal boxes: surf | wind | swell | weather | wind wave
   -------------------------------------------------------------------------- */
.sgw-current-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-bottom: 1px solid var(--sgw-border);
}

@media (max-width: 860px) {
    .sgw-current-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 540px) {
    .sgw-current-row { grid-template-columns: repeat(2, 1fr); }
}

.sgw-current-box {
    padding: 14px 14px 12px;
    border-right: 1px solid var(--sgw-border);
    background: var(--sgw-white);
    text-align: center;
    transition: background 0.15s;
}
.sgw-current-box:last-child { border-right: none; }
.sgw-current-box:hover { background: #f5f9ff; }

.sgw-current-box__label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sgw-text-muted);
    margin-bottom: 5px;
}

.sgw-current-box__value {
    font-size: 18px;
    font-weight: 800;
    color: var(--sgw-navy);
    line-height: 1.2;
    margin-bottom: 4px;
}

.sgw-current-box__value--lg {
    font-size: 22px;
    color: var(--sgw-teal-dark);
}

.sgw-current-box__sub {
    font-size: 11px;
    color: var(--sgw-text-muted);
    line-height: 1.4;
}

/* Rating pill inside the surf box */
.sgw-rating-pill {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --------------------------------------------------------------------------
   Wind labels — offshore is good (green), onshore is neutral
   -------------------------------------------------------------------------- */
.sgw-offshore,
.sgw-wind-label.sgw-offshore { color: var(--sgw-offshore-color); font-weight: 600; }
.sgw-onshore,
.sgw-wind-label.sgw-onshore  { color: var(--sgw-onshore-color); }

/* --------------------------------------------------------------------------
   Directional Arrow  (rotated via inline style)
   -------------------------------------------------------------------------- */
.sgw-dir-arrow {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    opacity: 0.65;
    transition: transform 0.3s ease;
}

/* --------------------------------------------------------------------------
   Rating Colors (badges + pills + day cards)
   -------------------------------------------------------------------------- */
.sgw-rating-excellent { background: var(--sgw-excellent-bg); color: var(--sgw-excellent); }
.sgw-rating-good      { background: var(--sgw-good-bg);      color: var(--sgw-good);      }
.sgw-rating-fair      { background: var(--sgw-fair-bg);       color: var(--sgw-fair);      }
.sgw-rating-poor      { background: var(--sgw-poor-bg);       color: var(--sgw-poor);      }

/* Badge (inline in tables) */
.sgw-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Temperature */
.sgw-temp-hi { color: var(--sgw-poor);    font-weight: 700; }
.sgw-temp-lo { color: var(--sgw-navy-mid); font-weight: 500; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.sgw-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Outline for keyboard focus (tabindex="0") */
}
.sgw-table-scroll:focus {
    outline: 2px solid var(--sgw-teal);
    outline-offset: -2px;
}

.sgw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 680px;
}

.sgw-table thead tr {
    background: var(--sgw-navy-light);
}

.sgw-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.sgw-table th:last-child { border-right: none; }

.sgw-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--sgw-border);
    border-right: 1px solid rgba(209,219,230,0.5);
    white-space: nowrap;
    vertical-align: middle;
    color: var(--sgw-text-mid);
}
.sgw-table td:last-child { border-right: none; }
.sgw-table tr:last-child td { border-bottom: none; }

/* Alternating rows */
.sgw-row--alt td { background: var(--sgw-row-alt); }

/* Current / Now row — teal left border like surfguru.com's highlight */
.sgw-row--now td {
    background: var(--sgw-row-now);
    color: var(--sgw-text);
    font-weight: 500;
}
.sgw-row--now td:first-child {
    border-left: 3px solid var(--sgw-row-now-border);
}

/* Hover */
.sgw-table tbody tr:hover td { background: #eef5fd; }
.sgw-row--now:hover td       { background: #dceef9; }

.sgw-td--time { font-weight: 600; min-width: 60px; color: var(--sgw-text); }
.sgw-td--date { font-weight: 700; min-width: 90px; color: var(--sgw-text); }

/* --------------------------------------------------------------------------
   7-Day Day Column Cards  — matches surfguru.com's swell section columns
   -------------------------------------------------------------------------- */
.sgw-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--sgw-border);
    overflow-x: auto;
}

@media (max-width: 900px) {
    .sgw-day-headers { grid-template-columns: repeat(4, minmax(130px,1fr)); }
}
@media (max-width: 560px) {
    .sgw-day-headers { grid-template-columns: repeat(2, 1fr); }
}

.sgw-day-col {
    background: var(--sgw-white);
    border-right: 1px solid var(--sgw-border);
    padding: 12px 10px 10px;
    text-align: center;
    min-width: 110px;
    transition: background 0.15s;
}
.sgw-day-col:last-child { border-right: none; }
.sgw-day-col:hover      { background: #f5f9ff; }

.sgw-day-col--today {
    background: #eef6fb;
    border-top: 3px solid var(--sgw-teal);
}

.sgw-day-col__date {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sgw-text-muted);
    margin-bottom: 6px;
}
.sgw-day-col--today .sgw-day-col__date { color: var(--sgw-teal-dark); }

.sgw-day-col__icon {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
/* Make SVG icons visible — they will render with color if colored SVGs are present */
.sgw-day-col__icon img {
    max-width: 32px;
    max-height: 32px;
}

.sgw-day-col__surf {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 6px 0;
}

.sgw-day-col__range {
    font-size: 15px;
    font-weight: 800;
    color: var(--sgw-teal-dark);
    display: block;
}

/* Definition list inside day column */
.sgw-day-col__dl {
    margin: 6px 0 0;
    padding: 0;
    font-size: 11px;
    text-align: left;
}
.sgw-day-col__dl dt {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sgw-text-muted);
    margin-top: 5px;
    margin-bottom: 1px;
}
.sgw-day-col__dl dd {
    margin: 0;
    color: var(--sgw-text-mid);
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Data attribution footer
   -------------------------------------------------------------------------- */
.sgw-attribution {
    font-size: 11px;
    color: var(--sgw-text-muted);
    background: var(--sgw-off-white);
    padding: 7px 14px;
    border-top: 1px solid var(--sgw-border);
    margin: 0;
    text-align: center;
    line-height: 1.6;
}
.sgw-attribution a {
    color: var(--sgw-teal-dark);
    text-decoration: none;
}
.sgw-attribution a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Forecast table wrap (sub-section inside section 1)
   -------------------------------------------------------------------------- */
.sgw-forecast-table-wrap {
    border-top: 1px solid var(--sgw-border);
}

/* --------------------------------------------------------------------------
   Sidebar Widget
   -------------------------------------------------------------------------- */
.sgw-widget { font-family: var(--sgw-font); font-size: 13px; }

.sgw-widget-rating {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.sgw-widget-dl {
    margin: 0 0 8px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    font-size: 12px;
}
.sgw-widget-dl dt {
    font-weight: 600;
    color: var(--sgw-text-muted);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.4px;
    align-self: center;
}
.sgw-widget-dl dd { margin: 0; color: var(--sgw-text); }

.sgw-widget-updated {
    font-size: 10px;
    color: var(--sgw-text-muted);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Loading / refreshing state
   -------------------------------------------------------------------------- */
.sgw-wrap.sgw-is-loading { opacity: 0.7; pointer-events: none; }

.sgw-wrap.sgw-just-updated {
    animation: sgw-flash 0.6s ease;
}
@keyframes sgw-flash {
    0%   { box-shadow: 0 0 0 2px var(--sgw-teal); }
    100% { box-shadow: var(--sgw-shadow); }
}

/* Toast notification */
.sgw-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--sgw-navy);
    color: var(--sgw-white);
    padding: 10px 18px;
    border-radius: var(--sgw-radius);
    font-family: var(--sgw-font);
    font-size: 13px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    pointer-events: none;
}
.sgw-toast.sgw-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Responsive overrides
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .sgw-bar__title { font-size: 14px; }
    .sgw-current-box__value { font-size: 15px; }
    .sgw-current-box__value--lg { font-size: 18px; }
    .sgw-table { font-size: 12px; }
    .sgw-table th, .sgw-table td { padding: 6px 9px; }
    .sgw-day-col__range { font-size: 13px; }
}

@media (max-width: 480px) {
    .sgw-bar { padding: 9px 12px; }
    .sgw-bar__meta { font-size: 11px; }
    .sgw-current-box { padding: 10px 8px; }
    .sgw-current-box__value { font-size: 14px; }
    .sgw-current-box__value--lg { font-size: 16px; }
}

/* --------------------------------------------------------------------------
   Print styles
   -------------------------------------------------------------------------- */
@media print {
    .sgw-refresh, .sgw-live-dot { display: none; }
    .sgw-wrap { box-shadow: none; border: 1px solid #ccc; }
    .sgw-bar--dark, .sgw-bar--mid { background: #1a2b3c !important; -webkit-print-color-adjust: exact; }
    .sgw-table thead tr { background: #2e4057 !important; -webkit-print-color-adjust: exact; }
}

/* =============================================================================
   COMPASS ROSE + CONDITIONS LAYOUT
   ============================================================================= */

/* Three-column layout: compass | primary data | secondary data */
.sgw-cond-layout {
    display: grid;
    grid-template-columns: 220px 1fr 200px;
    gap: 0;
    background: var(--sgw-white);
    border-bottom: 1px solid var(--sgw-border);
}

@media (max-width: 860px) {
    .sgw-cond-layout {
        grid-template-columns: 180px 1fr;
        grid-template-rows: auto auto;
    }
    .sgw-cond-secondary-col {
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        border-top: 1px solid var(--sgw-border);
    }
}

@media (max-width: 560px) {
    .sgw-cond-layout {
        grid-template-columns: 1fr;
    }
    .sgw-compass-wrap { display: none; }
    .sgw-cond-secondary-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Compass ---- */
.sgw-compass-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-right: 1px solid var(--sgw-border);
    background: #e8f2f8;
    overflow: hidden; /* clip tile to the wrap bounds */
}

.sgw-compass {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, rgba(200,223,240,0.55) 0%, rgba(168,200,224,0.55) 50%, rgba(136,176,208,0.55) 100%);
    border: 2px solid rgba(111,168,200,0.7);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.08);

}

/* Subtle map-like texture */
.sgw-compass__map {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    z-index: 0;
}

/* Crosshair lines */
.sgw-compass__cross {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        linear-gradient(to right, transparent calc(50% - 0.5px), rgba(255,255,255,0.3) calc(50% - 0.5px), rgba(255,255,255,0.3) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(255,255,255,0.3) calc(50% - 0.5px), rgba(255,255,255,0.3) calc(50% + 0.5px), transparent calc(50% + 0.5px));
    /* Diagonal X lines */
}
.sgw-compass__cross::before,
.sgw-compass__cross::after {
    content: '';
    position: absolute;
    inset: 15%;
    border-radius: 50%;
    border: 0.5px dashed rgba(255,255,255,0.25);
}

/* Cardinal labels */
.sgw-compass__n,
.sgw-compass__s,
.sgw-compass__e,
.sgw-compass__w {
    position: absolute;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    font-family: var(--sgw-font);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    line-height: 1;
}
.sgw-compass__n { top: 6px;   left: 50%; transform: translateX(-50%); }
.sgw-compass__s { bottom: 6px;left: 50%; transform: translateX(-50%); }
.sgw-compass__e { right: 8px; top: 50%;  transform: translateY(-50%); }
.sgw-compass__w { left: 8px;  top: 50%;  transform: translateY(-50%); }

/* Center dot */
.sgw-compass::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.15);
}

/* Arrow containers — centered, rotated */
.sgw-compass__arrow-wrap,
.sgw-compass__wind-wrap {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    overflow: visible;
    z-index: 2;
}

/* Swell arrow: inner — tip near center, tail toward the edge.
   The arrow SVG points UP. margin-bottom shifts it so the tip
   is close to center and the body fills the inner half of the rose. */
.sgw-compass__arrow {
    margin-bottom: 70px;   /* shifted further from center to clear wind arrow */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Wind arrow: outer ring — tip near the inner circle edge,
   body reaching toward the compass rim.
   Sits behind the swell arrow (lower z-index). */
.sgw-compass__wind-wrap {
    z-index: 1;
}

.sgw-compass__wind-arrow {
    margin-bottom: 10px;   /* tip near center, body fills outer half */
    opacity: 0.7;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* ---- Primary conditions column ---- */
.sgw-cond-primary {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: 1px solid var(--sgw-border);
}

.sgw-cond-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.sgw-cond-item:last-child { border-bottom: none; padding-bottom: 0; }

.sgw-cond-item--sm {
    padding-bottom: 8px;
    gap: 1px;
}

.sgw-cond-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.3px;
    color: var(--sgw-text-muted);
}

.sgw-cond-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--sgw-navy);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.sgw-cond-value--surf {
    font-size: 26px;
    font-weight: 800;
    color: var(--sgw-navy);
    letter-spacing: -0.5px;
}

.sgw-cond-muted {
    font-size: 13px;
    font-weight: 500;
    color: var(--sgw-text-muted);
}

.sgw-cond-secondary {
    font-size: 12px;
    color: var(--sgw-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

/* Inline directional arrow images */
.sgw-inline-arrow {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.sgw-inline-arrow--swell { filter: none; }
.sgw-inline-arrow--wind  { filter: none; }
.sgw-inline-arrow--sm    { width: 11px; height: 11px; opacity: 0.7; }

/* Weather icon in conditions */
.sgw-weather-icon {
    display: inline-block;
    vertical-align: middle;
}

/* ---- Secondary conditions column (right) ---- */
.sgw-cond-secondary-col {
    padding: 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fbff;
}

/* Tide rows inside the compact tides widget */
.sgw-tide-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--sgw-text-mid);
    font-weight: 500;
}
.sgw-tide-mini .sgw-cond-value {
    flex-direction: column;
    align-items: flex-start;
    font-size: 12px;
    gap: 3px;
}

/* =============================================================================
   7-DAY BAR CHART
   ============================================================================= */

.sgw-chart-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--sgw-white);
}
.sgw-chart-scroll:focus {
    outline: 2px solid var(--sgw-teal);
    outline-offset: -2px;
}

.sgw-chart {
    min-width: 700px;
    padding: 0 0 4px;
    position: relative;
}

/* ---- Day header row ---- */
.sgw-chart__headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 2px solid var(--sgw-border);
    background: var(--sgw-white);
}

.sgw-chart__day-hdr {
    padding: 10px 6px 6px;
    text-align: center;
    border-right: 1px solid var(--sgw-border);
    font-family: var(--sgw-font);
}
.sgw-chart__day-hdr:last-child { border-right: none; }

.sgw-chart__day-hdr strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--sgw-navy);
}

.sgw-chart__day-hdr span {
    display: block;
    font-size: 11px;
    color: var(--sgw-text-muted);
    margin-bottom: 4px;
}

.sgw-chart__surf-range {
    font-size: 13px;
    font-weight: 800;
    color: var(--sgw-teal-dark);
    margin-top: 2px;
}

/* ---- Bar graph area ---- */
.sgw-chart__bars {
    display: grid;
    grid-template-columns: repeat(42, 1fr); /* 6 bars × 7 days */
    height: 120px;
    align-items: flex-end;
    background: linear-gradient(to bottom, #f0f7fc 0%, #e8f2f8 100%);
    padding: 8px 0 0;
    position: relative;
    border-bottom: 2px solid var(--sgw-border-dark);
}

.sgw-chart__bar-wrap {
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 0 1px;
}

.sgw-chart__bar {
    width: 100%;
    background: #1d6fa4;
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

/* Vertical day dividers overlaid on the bars */
.sgw-chart__dividers {
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    pointer-events: none;
}
.sgw-chart__divider {
    border-right: 1px solid rgba(255,255,255,0.5);
}
.sgw-chart__divider:last-child { border-right: none; }

/* ---- Arrow + data rows below bars ---- */
.sgw-chart__arrows {
    display: grid;
    grid-template-columns: repeat(42, 1fr);
    padding: 4px 0 2px;
    background: var(--sgw-white);
    border-bottom: 1px solid #f0f4f8;
}

.sgw-chart__arrow-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgw-chart__swell-arrow {
    display: block;
}

.sgw-chart__wind-arrow {
    display: block;
    opacity: 0.75;
}

/* Period and wind speed number rows */
.sgw-chart__row {
    display: grid;
    grid-template-columns: repeat(42, 1fr);
    background: var(--sgw-white);
    border-bottom: 1px solid #f0f4f8;
}

.sgw-chart__row--period {
    font-size: 10px;
    color: #1d6fa4;
    font-weight: 600;
}

.sgw-chart__row--wind {
    font-size: 10px;
    color: var(--sgw-text-muted);
}

.sgw-chart__cell {
    text-align: center;
    padding: 2px 0;
    font-family: var(--sgw-font);
}

/* Label row between swell and wind sections */
.sgw-chart__label-row {
    background: #f8fbff;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--sgw-text-muted);
    border-top: 1px solid var(--sgw-border);
    border-bottom: 1px solid var(--sgw-border);
}

.sgw-chart__label-unit {
    font-weight: 400;
    font-size: 10px;
}

/* Today column highlight in chart */
.sgw-chart__bars .sgw-chart__bar-wrap:nth-child(-n+6) .sgw-chart__bar {
    background: #1a5a8f;
}

/* =============================================================================
   Y-AXIS SCALE & GRIDLINES
   ============================================================================= */

/* Outer wrapper that holds the y-axis + chart side by side */
.sgw-chart-outer {
    display: flex;
    align-items: stretch;
}

.sgw-chart-outer .sgw-chart {
    flex: 1;
    min-width: 0;
}

/* Y-axis column */
.sgw-chart__yaxis {
    width: 32px;
    flex-shrink: 0;
    position: relative;
    /* Aligns with the bar area only — offset for header row */
    margin-top: 58px; /* matches sgw-chart__headers height */
    height: 120px;    /* matches sgw-chart__bars height */
    border-right: 1px solid var(--sgw-border-dark);
    background: var(--sgw-off-white);
}

.sgw-chart__ytick {
    position: absolute;
    right: 5px;
    font-size: 9px;
    font-family: var(--sgw-font);
    font-weight: 600;
    color: var(--sgw-text-muted);
    transform: translateY(50%);
    white-space: nowrap;
    line-height: 1;
}

/* Horizontal gridlines inside the bar area */
.sgw-chart__bars {
    position: relative; /* ensure gridlines position relative to bars */
}

.sgw-chart__gridline {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    z-index: 1;
}

/* Source tag below UV */
.sgw-cond-source {
    font-size: 9px;
    color: var(--sgw-text-muted);
    font-style: italic;
    margin-top: 1px;
}

/* N/A period cell */
.sgw-chart__cell--na {
    color: var(--sgw-border-dark);
    font-size: 9px;
}

/* =============================================================================
   AI SURF REPORT  [sgw_surf_report]
   Matches surfguru.com report style: small grey label, plain readable text
   ============================================================================= */

.sgw-report {
    font-family: var(--sgw-font);
    color: var(--sgw-text);
    margin: 20px 0;
    line-height: 1.7;
}

.sgw-report__header,
.sgw-report__footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.sgw-report__footer {
    margin-top: 10px;
    margin-bottom: 0;
    border-top: 1px solid var(--sgw-border);
    padding-top: 8px;
}

.sgw-report__label {
    font-size: 12px;
    color: var(--sgw-text-muted);
    font-weight: 400;
    letter-spacing: 0.2px;
}

.sgw-report__updated {
    font-size: 11px;
    color: var(--sgw-text-muted);
}

.sgw-report__body {
    padding: 2px 0;
}

.sgw-report__body p {
    margin: 0 0 16px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--sgw-text);
}

.sgw-report__body p:last-child {
    margin-bottom: 0;
}

.sgw-report__refresh {
    background: none;
    border: none;
    color: var(--sgw-text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    font-family: var(--sgw-font);
    transition: color 0.2s;
}
.sgw-report__refresh:hover  { color: var(--sgw-teal-dark); }
.sgw-report__refresh:active { opacity: 0.6; }

.sgw-report__refresh.sgw-report__refresh--loading {
    opacity: 0.5;
    pointer-events: none;
}

.sgw-report-notice {
    font-family: var(--sgw-font);
    font-size: 13px;
    color: var(--sgw-text-muted);
    background: var(--sgw-off-white);
    border: 1px solid var(--sgw-border);
    border-radius: var(--sgw-radius);
    padding: 12px 16px;
    margin: 16px 0;
}

/* Average Wave Height label inside bar chart */
.sgw-chart__bars-label {
    position: absolute;
    top: 8px;
    right: 10px;
    font-family: var(--sgw-font);
    font-size: 13px;
    font-weight: 500;
    color: var(--sgw-teal);
    opacity: 0.75;
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
}

/* =============================================================================
   OSM MAP TILE BACKDROP ON COMPASS
   ============================================================================= */



.sgw-compass__maptile {
    position: absolute;
    /* Fill the entire compass-wrap square, centered on the location */
    width: 105%;
    height: 105%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    image-rendering: auto;
    object-fit: cover;
}

.sgw-compass__maptile--loaded {
    opacity: 0.55; /* semi-transparent so compass overlays read clearly */
}

/* =============================================================================
   TIDE CURVE CHART
   ============================================================================= */

.sgw-tide-chart-wrap {
    margin: 12px 0 4px;
    padding: 10px 12px 6px;
    background: var(--sgw-off-white);
    border: 1px solid var(--sgw-border);
    border-radius: var(--sgw-radius);
}

.sgw-tide-chart {
    width: 100%;
}

/* Crossshore wind label */
.sgw-crossshore {
    color: var(--sgw-teal);
    font-weight: 500;
}

/* Incoming/outgoing tide flow indicator */
.sgw-tide-flow {
    font-size: 10px;
    font-weight: 500;
    font-style: italic;
}
.sgw-tide-flow--incoming { color: var(--sgw-teal); }
.sgw-tide-flow--outgoing { color: var(--sgw-text-muted); }
