html,
body {
    overflow-x: clip;
}

.site-header {
    min-height: 3.25rem;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.2;
    white-space: nowrap;
}

.header-status {
    color: rgba(148, 163, 184, 1);
    font-size: 0.625rem;
    font-weight: 700;
}

.header-status.is-good {
    color: rgba(134, 239, 172, 1);
}

.header-status.is-warning {
    color: rgba(253, 230, 138, 1);
}

.header-moon {
    flex: 0 0 auto;
}

.planning-controls {
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.18);
}

.planning-controls-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    background: rgba(2, 6, 23, 0.52);
    border-bottom: 1px solid rgba(51, 65, 85, 0.8);
}

.control-label {
    display: block;
    margin-bottom: 0.35rem;
    color: rgba(148, 163, 184, 1);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.trip-planner-shell {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
}

.trip-planner-shell > div:first-of-type {
    padding: 0.85rem 1rem;
}

.trip-planner-shell > div:last-child {
    padding: 1rem;
}

.conditions-strip {
    min-width: 0;
    padding: 0.8rem 0.9rem 0.65rem;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 0.7rem;
    background: linear-gradient(110deg, rgba(14, 116, 144, 0.18), rgba(2, 6, 23, 0.7));
}

.conditions-grid {
    display: grid;
    grid-template-columns: minmax(8.5rem, 1.35fr) repeat(6, minmax(0, 1fr));
    align-items: stretch;
}

.conditions-cell {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 0.18rem;
    padding: 0.25rem 0.75rem;
    border-left: 1px solid rgba(51, 65, 85, 0.72);
}

.conditions-weather {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-left: 0;
    padding-left: 0.15rem;
}

.conditions-icon {
    flex: 0 0 auto;
    color: rgba(125, 211, 252, 1);
}

.conditions-icon svg {
    display: block;
    width: 2rem;
    height: 2rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.conditions-label {
    color: rgba(148, 163, 184, 1);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.conditions-cell strong {
    min-width: 0;
    color: rgba(241, 245, 249, 1);
    font-size: 0.78rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.conditions-weather strong {
    color: rgba(224, 242, 254, 1);
    font-size: 0.86rem;
}

.conditions-cell small {
    color: rgba(148, 163, 184, 0.9);
    font-size: 0.62rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.conditions-footer {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(51, 65, 85, 0.65);
    color: rgba(100, 116, 139, 1);
    font-size: 0.62rem;
    line-height: 1.3;
}

.trip-planner-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    max-width: 100%;
    min-width: 0;
}

.trip-day-tab {
    min-width: 0;
    min-height: 2.65rem;
    padding: 0.3rem 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    border: 1px solid rgba(71, 85, 105, 0.9);
    border-radius: 0.5rem;
    background: rgba(2, 6, 23, 0.72);
    color: rgba(203, 213, 225, 1);
    font-size: 0.7rem;
    font-weight: 800;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.trip-day-tab-label,
.trip-day-tab-date {
    display: block;
    line-height: 1.1;
    white-space: nowrap;
}

.trip-day-tab-date {
    color: rgba(148, 163, 184, 1);
    font-size: 0.64rem;
    font-weight: 700;
}

.trip-day-tab:hover,
.trip-day-tab:focus-visible {
    border-color: rgba(56, 189, 248, 0.7);
    color: rgba(255, 255, 255, 1);
    outline: none;
}

.trip-day-tab.is-active {
    background: rgba(14, 116, 144, 0.7);
    border-color: rgba(56, 189, 248, 0.9);
    color: rgba(255, 255, 255, 1);
    box-shadow: inset 0 -2px 0 rgba(125, 211, 252, 0.95);
}

.trip-day-tab.is-active .trip-day-tab-date {
    color: rgba(224, 242, 254, 1);
}

.trip-day-tab.is-stale {
    border-style: dashed;
    border-color: rgba(245, 158, 11, 0.45);
    color: rgba(253, 230, 138, 0.9);
}

.trip-day-tab.is-stale .trip-day-tab-date {
    color: rgba(251, 191, 36, 0.8);
}

.trip-day-tab.is-unavailable {
    border-color: rgba(100, 116, 139, 0.65);
    color: rgba(148, 163, 184, 1);
}

.trip-planner-empty,
.trip-empty-card {
    color: rgba(148, 163, 184, 1);
    font-size: 0.875rem;
    line-height: 1.5;
}

.trip-summary-card,
.trip-window-card,
.trip-quality-card,
.trip-hourly-card,
.trip-empty-card {
    min-width: 0;
}

.trip-summary-primary {
    padding: 1.1rem;
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 0.8rem;
}

.trip-summary-main,
.trip-period-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.trip-card-label {
    color: rgba(148, 163, 184, 1);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.trip-score-value {
    margin-top: 0.25rem;
    color: rgba(255, 255, 255, 1);
    font-size: 2.65rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.trip-score-value span {
    margin-left: 0.15rem;
    color: rgba(148, 163, 184, 1);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
}

.trip-score-chip,
.trip-period-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.trip-score-chip.is-excellent,
.trip-period-rating.is-excellent,
.trip-score-chip.is-good,
.trip-period-rating.is-good {
    background: rgba(16, 185, 129, 0.14);
    color: rgba(134, 239, 172, 1);
}

.trip-score-chip.is-fair,
.trip-period-rating.is-fair {
    background: rgba(245, 158, 11, 0.14);
    color: rgba(252, 211, 77, 1);
}

.trip-score-chip.is-poor,
.trip-period-rating.is-poor {
    background: rgba(249, 115, 22, 0.14);
    color: rgba(253, 186, 116, 1);
}

.trip-score-chip.is-unlikely,
.trip-period-rating.is-unlikely {
    background: rgba(71, 85, 105, 0.28);
    color: rgba(203, 213, 225, 1);
}

.trip-summary-window,
.trip-summary-targets {
    display: grid;
    gap: 0.25rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(51, 65, 85, 0.7);
}

.trip-summary-window strong {
    color: rgba(125, 211, 252, 1);
    font-size: 1rem;
}

.trip-summary-targets strong {
    color: rgba(226, 232, 240, 1);
    font-size: 0.9rem;
    line-height: 1.45;
}

.trip-targets {
    min-width: 0;
}

.trip-targets-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.trip-targets-heading h3 {
    margin: 0;
    color: rgba(226, 232, 240, 1);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.trip-targets-heading span {
    color: rgba(100, 116, 139, 1);
    font-size: 0.68rem;
}

.trip-target-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
    margin-top: 0.65rem;
}

.trip-target-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 0.85rem;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(51, 65, 85, 0.78);
    border-radius: 0.7rem;
}

.trip-target-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.55rem;
}

.trip-target-card h4 {
    min-width: 0;
    margin: 0;
    color: rgba(248, 250, 252, 1);
    font-size: 1.05rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.trip-target-rating {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.25rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 800;
    white-space: nowrap;
}

.trip-target-rating.is-excellent,
.trip-target-rating.is-good {
    background: rgba(16, 185, 129, 0.14);
    color: rgba(134, 239, 172, 1);
}

.trip-target-rating.is-fair {
    background: rgba(245, 158, 11, 0.14);
    color: rgba(252, 211, 77, 1);
}

.trip-target-rating.is-poor,
.trip-target-rating.is-unlikely {
    background: rgba(71, 85, 105, 0.28);
    color: rgba(203, 213, 225, 1);
}

.trip-target-best {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-top: 0.7rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
}

.trip-target-best span,
.trip-target-details dt,
.trip-target-tip span {
    color: rgba(148, 163, 184, 1);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.trip-target-best strong {
    color: rgba(125, 211, 252, 1);
    font-size: 0.82rem;
}

.trip-target-details {
    display: grid;
    gap: 0.5rem;
    margin: 0.65rem 0 0;
}

.trip-target-details div {
    min-width: 0;
}

.trip-target-details dt {
    line-height: 1.2;
}

.trip-target-details dd {
    margin: 0.12rem 0 0;
    color: rgba(226, 232, 240, 1);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.trip-target-tip {
    margin: auto 0 0;
    padding-top: 0.65rem;
    color: rgba(203, 213, 225, 1);
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.trip-target-tip span {
    margin-right: 0.35rem;
}

.trip-targets-empty {
    margin: 0.65rem 0 0;
    padding: 0.8rem;
    color: rgba(148, 163, 184, 1);
    font-size: 0.82rem;
    background: rgba(2, 6, 23, 0.35);
    border-radius: 0.6rem;
}

.trip-score-note {
    margin: 0.85rem 0 0;
    color: rgba(203, 213, 225, 1);
    font-size: 0.84rem;
    line-height: 1.5;
}

.trip-secondary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.trip-secondary-item {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}

.trip-secondary-item strong {
    color: rgba(226, 232, 240, 1);
    font-size: 0.82rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.trip-secondary-item strong.is-good {
    color: rgba(134, 239, 172, 1);
}

.trip-secondary-item strong.is-warning {
    color: rgba(253, 230, 138, 1);
}

.trip-quality-card {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.8rem;
    padding: 0.9rem;
    background: rgba(2, 6, 23, 0.42);
    border-radius: 0.7rem;
}

.trip-quality-list {
    display: grid;
    gap: 0.45rem;
}

.trip-quality-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
    min-width: 0;
}

.trip-quality-key,
.trip-quality-value {
    font-size: 0.78rem;
    line-height: 1.4;
}

.trip-quality-key {
    color: rgba(148, 163, 184, 1);
}

.trip-quality-value {
    color: rgba(226, 232, 240, 1);
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

.trip-period-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
}

.trip-hourly-card {
    margin-top: 1rem;
}

.trip-period-card {
    min-width: 0;
    min-height: 12rem;
    padding: 0.9rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(51, 65, 85, 0.82);
    border-radius: 0.7rem;
}

.trip-period-card.is-best {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(14, 116, 144, 0.13);
}

.trip-period-name {
    color: rgba(226, 232, 240, 1);
    font-size: 0.78rem;
    font-weight: 800;
}

.trip-period-time {
    margin-top: 0.25rem;
    color: rgba(125, 211, 252, 1);
    font-size: 0.82rem;
    font-weight: 700;
}

.trip-period-rating {
    margin-top: 0;
}

.trip-period-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.8rem;
    margin-top: 1rem;
}

.trip-period-facts div {
    min-width: 0;
}

.trip-period-facts span,
.trip-period-facts strong {
    display: block;
}

.trip-period-facts span {
    color: rgba(148, 163, 184, 1);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.trip-period-facts strong {
    margin-top: 0.15rem;
    color: rgba(226, 232, 240, 1);
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

@media (min-width: 640px) {
    .trip-planner-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

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

@media (min-width: 900px) {
    .trip-target-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .conditions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .conditions-weather {
        grid-column: 1 / -1;
        padding: 0.15rem 0.1rem 0.7rem;
        border-bottom: 1px solid rgba(51, 65, 85, 0.72);
    }

    .conditions-cell {
        padding: 0.55rem 0.6rem;
        border-left: 0;
        border-bottom: 1px solid rgba(51, 65, 85, 0.55);
    }

    .conditions-cell:nth-child(odd):not(.conditions-weather) {
        border-right: 1px solid rgba(51, 65, 85, 0.72);
    }
}

@media (min-width: 1024px) {
    .trip-planner-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .header-moon {
        max-width: 5.25rem;
    }

    .header-moon span:first-child {
        font-size: 0.68rem;
    }

    .trip-period-header {
        gap: 0.5rem;
    }

    .trip-period-facts {
        gap: 0.6rem;
    }
}
