/* ═══════════════════════════════════════════════════════════════════
   My trip
   ═══════════════════════════════════════════════════════════════════
   The fourth face of the search bar — planning beside searching — and
   the same trips read as cards on the dashboard. Same tokens as
   everything else: this is not a separate product bolted on.
   ═══════════════════════════════════════════════════════════════════ */

/* ── The trip tab ───────────────────────────────────────────────
   A fourth mode of the search bar. Same ground and hairlines as the
   other three, because it is one control with four faces, not a widget
   bolted to the side of one. */

.sb-trip { padding: 1.25rem 1.35rem 1.4rem; }

.sbt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sbt-title {
    margin: 0 0 0.2rem;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sbt-sub, .sbt-lede {
    margin: 0;
    color: var(--hub-ink-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.sbt-lede { max-width: 54ch; margin-bottom: 1.1rem; }

.sbt-rename {
    flex: none;
    min-height: 36px;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--hub-hairline);
    border-radius: 999px;
    background: transparent;
    color: var(--hub-ink-muted);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.sbt-rename:hover { border-color: rgb(var(--hub-accent-rgb) / 0.5); color: var(--hub-ink); }

/* ── Progress ───────────────────────────────────────────────────── */

.sbt-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sbt-bar {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: rgb(var(--hub-ink-rgb) / 0.12);
    overflow: hidden;
}

.sbt-bar span {
    display: block;
    height: 100%;
    background: var(--hub-fill);
    transition: width var(--hub-transition);
}

.sbt-count {
    flex: none;
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--hub-ink-muted);
}

/* ── The six decisions ──────────────────────────────────────────── */

.sbt-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sbt-item {
    display: grid;
    grid-template-columns: 30px minmax(9rem, max-content) 1fr max-content;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--hub-hairline);
}

.sbt-item:last-child { border-bottom: 0; }

.sbt-box {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid var(--hub-hairline);
    border-radius: 50%;
    background: transparent;
    color: var(--hub-on-fill);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background var(--hub-transition), border-color var(--hub-transition);
}

.sbt-box:hover:not(.is-auto) { border-color: rgb(var(--hub-accent-rgb) / 0.7); }

/* Settled by using the other tabs, not by pressing. It must not look
   pressable — a control that invites a click and ignores it is worse
   than no control at all. */
.sbt-box.is-auto { cursor: default; }

.sbt-item.is-done .sbt-box {
    background: var(--hub-fill);
    border-color: transparent;
}

.sbt-label { font-weight: 700; font-size: 0.92rem; }

.sbt-value {
    color: var(--hub-ink-muted);
    font-size: 0.88rem;
    min-width: 0;
}

.sbt-item.is-done .sbt-value { color: var(--hub-ink); }

.sbt-open {
    justify-self: end;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--hub-hairline);
    border-radius: 999px;
    background: transparent;
    color: var(--hub-accent-strong);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.sbt-open:hover { border-color: rgb(var(--hub-accent-rgb) / 0.6); background: rgb(var(--hub-accent-rgb) / 0.08); }

/* ── Foot ───────────────────────────────────────────────────────── */

.sbt-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hub-hairline);
}

.sbt-saved, .sbt-note {
    font-size: 0.82rem;
    color: var(--hub-ink-muted);
}

.sbt-note a, .sbt-gate a:not(.sbt-cta) { color: var(--hub-accent-strong); }

.sbt-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--hub-fill);
    color: var(--hub-on-fill);
    font: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
}

.sbt-cta:hover { background: var(--hub-fill-deep); color: var(--hub-on-fill); }

.sbt-new, .sbt-switch {
    min-height: 40px;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--hub-hairline);
    border-radius: 999px;
    background: transparent;
    color: var(--hub-ink);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.sbt-new:hover, .sbt-switch:hover { border-color: rgb(var(--hub-accent-rgb) / 0.6); }

.sbt-switch { margin-left: auto; }

/* ── Signed out ─────────────────────────────────────────────────
   The gate shows the six decisions rather than describing them, with
   whatever the search tabs have already answered ticked. It is the same
   list as the signed-in checklist, so what the reader is looking at is
   what they get — only the ticking is missing. */

.sbt-gate { padding: 0.5rem 0 0.25rem; }
.sbt-gate .sbt-lede {
    margin-bottom: 0;
    /* Wider than the signed-in sub: the badge takes the right of the row, so
       a 54ch measure left the sentence breaking after "Log". */
    max-width: 64ch;
    text-wrap: pretty;
}
.sbt-gate .sbt-lede strong { color: var(--hub-ink); font-weight: 700; }

.sbt-badge {
    flex: none;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--hub-hairline);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--hub-ink-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Nothing here is pressable, so the rows read a shade quieter than the
   working checklist — visible, legible, plainly not yet yours. */
.sbt-preview .sbt-item.is-open .sbt-box { opacity: 0.55; }

.sbt-gate-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hub-hairline);
}

/* What the account actually buys, in three lines that are all true. */
.sbt-why {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.4rem 1.25rem;
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
}

.sbt-why li {
    position: relative;
    padding-left: 1.15rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--hub-ink-muted);
}

.sbt-why li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgb(var(--hub-accent-rgb) / 0.55);
}

@media (max-width: 640px) {
    .sb-trip { padding: 1rem; }

    /* Four columns will not fit a phone; the decision stacks under its name
       and the action drops to its own line. */
    .sbt-item {
        grid-template-columns: 26px 1fr;
        gap: 0.25rem 0.7rem;
        padding: 0.8rem 0;
    }
    .sbt-label { grid-column: 2; }
    .sbt-value { grid-column: 2; }
    .sbt-open { grid-column: 2; justify-self: start; margin-top: 0.35rem; }
    .sbt-foot,
    .sbt-gate-foot { flex-direction: column; align-items: stretch; }
    .sbt-gate .sbt-head { flex-direction: column; gap: 0.6rem; }
    .sbt-badge { align-self: flex-start; }
    .sbt-switch { margin-left: 0; }
    .sbt-cta { width: 100%; }
}

@media (hover: none) and (pointer: coarse) {
    /* The circle stays small — a 44px disc would dominate the row — but the
       finger needs 44px, so the hit area is grown around it instead. */
    .sbt-box {
        width: 30px;
        height: 30px;
        position: relative;
    }

    .sbt-box[data-key]::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 44px;
        height: 44px;
        transform: translate(-50%, -50%);
    }

    .sbt-open, .sbt-new, .sbt-rename { min-height: 44px; }
}

/* ── Toast ──────────────────────────────────────────────────────── */

.trip-toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    z-index: 1200;
    transform: translate(-50%, 1rem);
    max-width: min(420px, calc(100% - 2rem));
    padding: 0.8rem 1.1rem;
    border: 1px solid var(--hub-hairline);
    border-radius: var(--hub-radius);
    background: var(--hub-elev);
    color: var(--hub-ink);
    box-shadow: var(--hub-shadow);
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--hub-transition), transform var(--hub-transition);
}

.trip-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

.trip-toast.is-error {
    border-color: rgb(var(--hub-error-rgb) / 0.5);
    color: var(--hub-error);
}

/* ── Saved trip cards ───────────────────────────────────────────── */

.trip-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trip-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--hub-hairline);
    border-radius: var(--hub-radius);
    background: var(--hub-elev);
}

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

.trip-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    min-width: 0;
}

.trip-card-when {
    flex: none;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hub-ink-muted);
}

.trip-card-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--hub-ink-muted);
}

.trip-card-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.trip-card-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgb(var(--hub-ink-rgb) / 0.12);
    overflow: hidden;
}

.trip-card-bar span {
    display: block;
    height: 100%;
    background: var(--hub-fill);
}

.trip-card-count {
    flex: none;
    font-size: 0.78rem;
    color: var(--hub-ink-muted);
    font-variant-numeric: tabular-nums;
}

.trip-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.trip-btn {
    flex: 1;
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--hub-hairline);
    border-radius: 999px;
    background: transparent;
    color: var(--hub-ink);
    font: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color var(--hub-transition), background var(--hub-transition);
}

.trip-btn:hover {
    border-color: rgb(var(--hub-accent-rgb) / 0.6);
    background: rgb(var(--hub-accent-rgb) / 0.08);
}

.trip-btn-quiet { flex: 0 0 auto; color: var(--hub-ink-muted); }

.trip-btn-quiet:hover {
    border-color: rgb(var(--hub-error-rgb) / 0.5);
    background: rgb(var(--hub-error-rgb) / 0.08);
    color: var(--hub-error);
}

.trip-empty {
    margin: 0;
    padding: 1.25rem 0;
    color: var(--hub-ink-muted);
}

.trip-empty a { color: var(--hub-accent-strong); }

@media (hover: none) and (pointer: coarse) {
    .trip-btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .sbt-bar span, .sbt-box, .trip-btn, .trip-toast { transition: none; }
}
