:root {
    --ink: #f6f2ea;
    --muted: rgba(246, 242, 234, 0.7);
    --faint: rgba(246, 242, 234, 0.46);
    --line: rgba(255, 255, 255, 0.16);
    --alert: #f0b15a;
    --suit: #8ddeaf;
    --marginal: #9ec0ea;
    --poor: #f0a3a3;
}

* { box-sizing: border-box; }

html, body { background: #12181c; }

body {
    margin: 0;
    font-family: "Outfit", "Avenir Next", sans-serif;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.sky { position: fixed; inset: 0; z-index: 0; }

.sky img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 62%;
    opacity: 0;
    transition: opacity 0.7s ease;
}

.wash {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(8, 12, 16, 0.22), transparent 28%, rgba(8, 12, 16, 0.18) 52%, rgba(8, 12, 16, 0.74));
    pointer-events: none;
}

.app, .guide, .sheet { position: relative; z-index: 2; }

.app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 72px 18px 12px;
    color: var(--ink);
}

.topbar {
    position: absolute;
    top: 14px;
    left: 18px;
    right: 18px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand { display: flex; align-items: center; min-width: 0; }

.brand img {
    height: 54px;
    width: auto;
    max-width: 42vw;
    display: block;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}

.stores { position: relative; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.ios { display: flex; align-items: center; gap: 8px; }

.stores img { height: 34px; width: auto; display: block; }

.stores .play img { height: 48px; }

.app-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.play { display: flex; padding: 0; line-height: 0; }

.soon {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    margin: 0;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(10, 14, 18, 0.94);
    color: var(--ink);
    font-size: 13px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    z-index: 6;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.soon[hidden] { display: none; }

.skip {
    position: absolute;
    left: 18px;
    top: -48px;
    z-index: 7;
    background: #12181c;
    color: var(--ink);
    padding: 8px 12px;
    border-radius: 999px;
}

.skip:focus { top: 16px; left: 180px; }

.top {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 0;
}

.place-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.place { font-size: 14px; letter-spacing: 0.04em; color: var(--muted); }

.place button { letter-spacing: 0.04em; text-align: left; }

.place b { color: var(--ink); font-weight: 500; }

.suntrack {
    display: grid;
    grid-template-columns: auto 148px auto;
    align-items: end;
    column-gap: 8px;
    width: max-content;
    margin: 0 0 2px auto;
}

.suntrack span { font-size: 11px; color: var(--faint); padding-bottom: 4px; }

.suntrack svg { width: 148px; height: 48px; display: block; grid-column: 2; grid-row: 1; }

.suntrack #sunRiseLabel { grid-column: 1; grid-row: 1; }

.suntrack #sunSetLabel { grid-column: 3; grid-row: 1; text-align: right; }

.sun-word {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
    padding: 0;
    margin-top: -2px;
    color: var(--muted);
}

.suntrack.down #sunDot { fill: rgba(246, 242, 234, 0.45); }

.headline {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 500;
    font-size: clamp(32px, 4vw, 52px);
    letter-spacing: -0.04em;
    line-height: 0.96;
    max-width: 16ch;
    margin: 4px 0 2px;
}

.say { font-size: 16px; max-width: 68ch; margin: 0; }

.rail {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    min-width: 0;
}

.rail-safe {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.rail-div {
    width: 1px;
    align-self: stretch;
    min-height: 36px;
    background: linear-gradient(180deg, transparent, rgba(246, 242, 234, 0.72), transparent);
    flex: 0 0 1px;
}

.flagpill {
    display: flex;
    align-items: stretch;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(10, 16, 20, 0.45);
    backdrop-filter: blur(12px);
    overflow: hidden;
    cursor: pointer;
}

.flagpill[hidden] { display: none; }

.flag {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 5px 10px 5px 8px;
    font-size: 13px;
    text-align: left;
}

.pill-div {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, rgba(246, 242, 234, 0.55), transparent);
}

.pill-div[hidden] { display: none; }

.flag-marks { display: flex; gap: 2px; }

.flag-marks svg { width: 28px; height: 23px; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }

.flag-copy { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }

.flag-name { display: block; font-weight: 500; line-height: 1.1; white-space: nowrap; }

.flag small { display: block; color: var(--muted); font-size: 11px; }

.rip {
    display: flex;
    align-items: center;
    font-size: 12px;
    letter-spacing: 0.04em;
    padding: 6px 12px 6px 10px;
    white-space: nowrap;
}

.rip[data-rip="low"] { color: var(--suit); }
.rip[data-rip="moderate"] { color: var(--alert); }
.rip[data-rip="high"] { color: var(--poor); }

.flag[hidden] { display: none; }

.swatches { display: flex; gap: 3px; }

.swatch {
    width: 9px;
    height: 14px;
    border-radius: 2px;
    background: #c5cdd6;
}

.activities {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    min-width: 0;
    flex: 1 1 auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
}

.activities::-webkit-scrollbar { display: none; }

@media (min-width: 901px) {
    .activities {
        mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent);
    }
}

.act {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    border-radius: 999px;
    background: rgba(10, 16, 20, 0.4);
    border: 1px solid transparent;
    backdrop-filter: blur(12px);
}

.act.on { border-color: rgba(255, 255, 255, 0.38); background: rgba(10, 16, 20, 0.58); }

.act img {
    width: 28px;
    height: 28px;
    display: block;
    filter: brightness(0) invert(1);
}

.act b { display: block; font-weight: 500; font-size: 13px; }

.act small { display: block; font-size: 11px; color: var(--muted); }

.act[data-fit="green"] small { color: var(--suit); }

.act[data-fit="blue"] small { color: var(--marginal); }

.act[data-fit="red"] small { color: var(--poor); }

.boxes {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.box {
    width: 100%;
    text-align: left;
    padding: 8px 10px 7px;
    border-radius: 16px;
    background: rgba(10, 16, 20, 0.4);
    border: 1px solid transparent;
    backdrop-filter: blur(12px);
    min-width: 0;
    opacity: 0.48;
}

.box.on { opacity: 1; box-shadow: inset 0 -2px 0 var(--bar, rgba(255, 255, 255, 0.45)); }

.box.heads { box-shadow: inset 0 -2px 0 var(--alert); }

.box[data-layer="waves"] { --bar: #7ddea0; }
.box[data-layer="wind"] { --bar: #9ec0ea; }
.box[data-layer="rain"] { --bar: #6aa7ff; }
.box[data-layer="tide"] { --bar: #f0b15a; }
.box[data-layer="sun"] { --bar: #f6d56b; }
.box[data-layer="air"] { --bar: #f0a3a3; }

.box small { display: block; color: var(--faint); font-size: 12px; }

.box b {
    display: block;
    margin: 4px 0 2px;
    font-family: "Fraunces", Georgia, serif;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1;
}

.box em {
    display: block;
    font-style: normal;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.box .state { float: right; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

.picker {
    height: auto;
    background: rgba(10, 14, 18, 0.72);
    border: 1px solid var(--line);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    padding: 10px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.plan {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 2px 4px 0;
}

.plan-k {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
}

.plan-body { min-width: 0; }

.plan-empty { margin: 0; font-size: 14px; color: var(--muted); }

.plan-ruler { min-height: 28px; }

.plan-track {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 32px;
}

.plan-seg {
    position: relative;
    height: 6px;
    min-width: 4px;
    border-radius: 99px;
}

.plan-seg b {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.plan-seg.best { background: #3ddc84; }
.plan-seg.ok { background: #f0b15a; }
.plan-seg.bad { background: #ff5a5a; }

.plan-key {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--muted);
}

.plan-key i {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    display: inline-block;
}

.plan-key i.best { background: #3ddc84; }
.plan-key i.ok { background: #f0b15a; }
.plan-key i.bad { background: #ff5a5a; }
.plan-key span { margin-right: 8px; }

.plan-ruler::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 20px;
    height: 5px;
    border-radius: 99px;
    background: rgba(246, 242, 234, 0.14);
}

.plan-fill {
    position: absolute;
    top: 20px;
    height: 5px;
    border-radius: 99px;
    background: linear-gradient(90deg, #3ddc84, #f0b15a);
}

.plan[data-kind="marginal"] .plan-fill { background: linear-gradient(90deg, #e7c56a, #f0b15a); }

.plan-fill::before,
.plan-fill::after {
    content: "";
    position: absolute;
    top: -5px;
    width: 14px;
    height: 14px;
    border-radius: 99px;
    box-shadow: 0 0 0 3px rgba(10, 14, 18, 0.55);
}

.plan-fill::before { left: -2px; background: #3ddc84; }
.plan-fill::after { right: -2px; background: #f0b15a; }
.plan[data-kind="marginal"] .plan-fill::before { background: #e7c56a; }

.plan-tag {
    position: absolute;
    top: 0;
    font-size: 12px;
    white-space: nowrap;
    color: var(--ink);
}

.plan-tag.leave { transform: translateX(-100%); }

.plan-scale {
    display: flex;
    justify-content: space-between;
    margin-top: -4px;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--faint);
}

.plan-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.switch {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.tab {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.tab.on { background: rgba(255, 255, 255, 0.16); color: var(--ink); }

.picker-note { margin: 0; color: var(--muted); font-size: 13px; }

.day-panel, #dayPanel { display: flex; flex-direction: column; gap: 8px; }

#dayPanel[hidden], #surfPanel[hidden] { display: none; }

.surf { margin: 0; }

.series { flex-wrap: wrap; }

.surf-now { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.surf-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.surf-head h3 { margin: 0; font-size: 15px; font-weight: 500; }

.surf-title { display: flex; align-items: center; gap: 10px; min-width: 0; }

#windDial { width: 58px; height: 58px; flex: 0 0 auto; display: block; }

#windDialNote { margin: 2px 0 0; font-size: 12px; line-height: 1.3; color: var(--muted); }

.legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.lg {
    width: 14px;
    height: 8px;
    border-radius: 99px;
    display: inline-block;
    margin-left: 8px;
}

.lg.clean, .lg.waves { background: #7ddea0; margin-left: 0; }
.lg.fair { background: #9aa0ff; }
.lg.choppy { background: #ff7a7a; }
.lg.wind { background: #9ec0ea; }
.lg.rain { background: #6aa7ff; }
.lg.tide { background: #f0b15a; }
.lg.sun { background: #f6d56b; }
.lg.air { background: #f0a3a3; }
.lg.period {
    width: 16px;
    height: 0;
    border-radius: 0;
    background: none;
    border-top: 1.5px dashed rgba(246, 242, 234, 0.75);
}

#surfChart { width: 100%; height: 220px; display: block; }

.picker-head, .days { display: flex; align-items: center; }

.picker-head { justify-content: space-between; gap: 12px; }

.picker-head h2 { margin: 0; font-size: 16px; font-weight: 500; }

.picker-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.now {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    flex: 0 0 auto;
}

.now[hidden] { display: none; }

.days { gap: 6px; overflow-x: auto; justify-content: center; }

.day {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--muted);
    border: 1px solid transparent;
    text-align: left;
}

.day.on { color: var(--ink); background: rgba(255, 255, 255, 0.12); border-color: var(--line); }

.day small { display: block; font-size: 10px; color: var(--faint); }

.day.on small { color: var(--muted); }

.multi { position: relative; }

.lanes { display: flex; flex-direction: column; gap: 3px; padding: 0 0 16px 52px; min-height: 48px; }

.lane {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 6px;
    align-items: end;
    height: 32px;
    margin-left: -52px;
}

.lane-name { align-self: center; font-size: 11px; font-weight: 500; }

.lane-bars {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    align-items: end;
    height: 32px;
    min-width: 0;
}

.lane-bars i {
    display: block;
    width: 70%;
    max-width: 14px;
    margin: 0 auto;
    height: var(--h, 12%);
    min-height: 4px;
    border-radius: 99px 99px 3px 3px;
    background: rgba(246, 242, 234, 0.84);
}

.lane-bars i.hot { background: var(--alert); }

.lane-bars i.pick { outline: 1px solid #fff; }

.lane-bars i.miss {
    height: 2px;
    min-height: 0;
    background: rgba(246, 242, 234, 0.16);
}

.lane-bars i.miss.pick { outline: 1px solid rgba(255, 255, 255, 0.7); }

.lane-empty { margin: 8px 0; color: var(--muted); font-size: 13px; }

.hours {
    position: absolute;
    left: 52px;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 0;
    height: 100%;
    min-height: 0;
    align-items: stretch;
}

.hour {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    padding: 0;
}

.hour:hover { background: rgba(255, 255, 255, 0.05); }

.hour.now { box-shadow: inset 0 -2px 0 var(--alert); }

.hour.on { background: transparent; }

.hour.on.now { box-shadow: inset 0 -2px 0 var(--alert); }

.hour.heads span { color: var(--alert); }

.hour span {
    font-size: 10px;
    letter-spacing: 0.01em;
    color: var(--faint);
    white-space: nowrap;
    min-height: 13px;
    font-variant-numeric: tabular-nums;
}

.hour.on span, .hour.now span { color: var(--ink); }

.sheet {
    position: fixed;
    z-index: 6;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: min(480px, calc(100vw - 24px));
    max-height: min(72dvh, 560px);
    overflow: auto;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(10, 14, 18, 0.94);
    color: var(--ink);
    backdrop-filter: blur(16px);
}

.sheet.pop {
    left: 12px;
    top: 12px;
    bottom: auto;
    transform: none;
    width: min(380px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    z-index: 8;
    overflow: visible;
}

.sheet.pop .pop-body { overflow: auto; }

.sheet.pop .notch {
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(10, 14, 18, 0.94);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transform: translate(-50%, 5px) rotate(45deg);
    bottom: 0;
}

.sheet.pop .notch.up {
    bottom: auto;
    top: 0;
    border: 0;
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    transform: translate(-50%, -5px) rotate(45deg);
}

.sheet.pop.roll { animation: unroll 0.42s cubic-bezier(.16, 1, .3, 1); }
.sheet.pop.from-below.roll { animation-name: unroll-down; }

@keyframes unroll {
    from { opacity: 0; transform: perspective(700px) rotateX(-64deg) scale(0.84); }
    to { opacity: 1; transform: perspective(700px) rotateX(0) scale(1); }
}

@keyframes unroll-down {
    from { opacity: 0; transform: perspective(700px) rotateX(64deg) scale(0.84); }
    to { opacity: 1; transform: none; }
}

.sheet[hidden] { display: none; }

.sheet h2 { margin: 0 0 6px; font-size: 22px; font-family: "Fraunces", Georgia, serif; font-weight: 500; }

.sheet .kicker { margin: 0 0 10px; color: var(--muted); font-size: 13px; }

.sheet p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; }

.sheet .caveat { color: var(--muted); font-size: 13px; }

.sheet-close {
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
}

.filter {
    width: 100%;
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink);
    font: inherit;
}

.state-name {
    margin: 10px 0 4px;
    color: var(--faint);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.beach-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 4px;
    border-radius: 8px;
    font-size: 16px;
}

.beach-opt[aria-selected="true"] { background: rgba(255, 255, 255, 0.1); }

.checks { list-style: none; margin: 8px 0 0; padding: 0; }

.checks li {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto auto;
    gap: 8px 12px;
    align-items: baseline;
    padding: 7px 0;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.checks li.check-head {
    border-top: 0;
    padding-bottom: 0;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
}

.checks li > :nth-child(3),
.checks li > :nth-child(4) { text-align: right; }

.checks li b { font-weight: 500; }

.checks i {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--poor);
}

.checks li.met i { background: var(--suit); }

.checks small { color: var(--muted); }

.sheet.pop .checks { max-height: min(42dvh, 320px); overflow: auto; }

#actFit[data-fit="green"] { color: var(--suit); }
#actFit[data-fit="blue"] { color: var(--marginal); }
#actFit[data-fit="red"] { color: var(--poor); }

button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 1px solid #fff;
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .app { padding: 62px 14px 18px; gap: 12px; }
    .brand img { height: 40px; }
    .stores img, .app-icon { height: 28px; }
    .stores .play img { height: 40px; }
    .suntrack { margin-left: 0; }
    .suntrack svg { width: 120px; height: 40px; }
    .app-icon { width: 28px; }
    .boxes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .box { padding: 10px; }
    .box b { font-size: 20px; }
    .say { font-size: 15px; }
    .headline { font-size: clamp(30px, 8vw, 42px); }
    .rail { gap: 8px; }
    .activities { flex-wrap: nowrap; }
    .lane, .lane-bars { height: 26px; }
    #windDial { width: 48px; height: 48px; }
    .tab { padding: 6px 8px; font-size: 12px; }
    .plan { grid-template-columns: 1fr; gap: 4px; }
    .surf-head { align-items: flex-start; flex-direction: column; gap: 4px; }
    .days { gap: 2px; }
    .day { padding: 6px 8px; font-size: 13px; }
}

@media (max-width: 420px) {
    .app { padding-top: 56px; }
    .stores { gap: 4px; }
    .stores img, .app-icon { height: 24px; }
    .stores .play img { height: 34px; }
    .app-icon { width: 24px; border-radius: 6px; }
    .brand img { height: 32px; }
    .flag { padding: 5px 8px 5px 6px; }
    .boxes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hour span.minor { visibility: hidden; }
    .legend { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    .sky img { transition: none; }
    .sheet.pop.roll { animation: none; }
}
