/* Shore Pass — Contribute / Write a review
   Translated from screens-share.jsx › ContributeScreen (TopBar + intel hero +
   recent contributions), WriteReviewScreen (StepBar, step headings, chips,
   star tiles, context pill, "Post review →") and ContributeSuccessScreen.

   Every rule is scoped under .scr-contribute. The classes .exp-step and
   .exp-star are kept as hooks for assets/js/app.js (progress bar + rating);
   their look is fully re-specified here. */

.scr-contribute { padding-bottom: 34px; }

/* ──────────────── TopBar ──────────────── */
.scr-contribute .sc-bar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px 12px;
    background: var(--sp-surface);
    border-bottom: 1px solid var(--sp-line);
}
.scr-contribute .sc-bar__back {
    flex: 0 0 auto; width: 36px; height: 36px;
    display: grid; place-items: center;
    border: 1px solid var(--sp-line); border-radius: var(--sp-r-md);
    background: var(--sp-bg); color: var(--sp-ink);
}
.scr-contribute .sc-bar__back:hover { background: var(--sp-bg-2); }
.scr-contribute .sc-bar__titles { flex: 1; min-width: 0; }
.scr-contribute .sc-bar__eyebrow {
    margin: 0 0 2px; font-family: var(--sp-font-display);
    font-size: 10px; font-weight: 600; letter-spacing: .18em;
    text-transform: uppercase; color: var(--sp-red);
}
.scr-contribute .sc-bar__title {
    font-family: var(--sp-font-display); font-size: 22px; font-weight: 600;
    line-height: 1.1; letter-spacing: .01em; text-transform: uppercase;
    color: var(--sp-ink);
}

/* ──────────────── StepBar ──────────────── */
.scr-contribute .sc-stepbar { padding: 12px 16px 4px; }
.scr-contribute .sc-stepbar__bars { display: flex; gap: 4px; }
.scr-contribute .sc-seg {
    display: block; flex: 1 1 0; height: 3px; padding: 0; gap: 0;
    border-radius: 999px; background: var(--sp-line);
    transition: background .3s ease;
}
.scr-contribute .sc-seg.is-on { background: var(--sp-red); }

/* ──────────────── Crew-intel hero ──────────────── */
.scr-contribute .sc-hero {
    margin: 16px 16px 0; padding: 20px 18px;
    border-radius: 18px; overflow: hidden;
    background: linear-gradient(135deg, #14171F 0%, #1C2230 100%);
    border: 1px solid #232A3A;
}
.scr-contribute .sc-hero__eyebrow {
    margin: 0 0 8px; font-family: var(--sp-font-display);
    font-size: 10px; font-weight: 600; letter-spacing: .18em;
    text-transform: uppercase; color: #F1B3B5;
}
.scr-contribute .sc-hero__head {
    font-family: var(--sp-font-display); font-size: 22px; font-weight: 600;
    line-height: 1.2; color: #fff; margin: 0 0 14px;
}
.scr-contribute .sc-hero__stats { display: flex; gap: 10px; }
.scr-contribute .sc-stat {
    flex: 1; min-width: 0; padding: 10px 8px; border-radius: 10px; text-align: center;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08);
}
.scr-contribute .sc-stat__n {
    display: block; font-family: var(--sp-font-mono); font-variant-numeric: tabular-nums;
    font-size: 18px; font-weight: 700; color: #fff; line-height: 1;
}
.scr-contribute .sc-stat__l {
    display: block; margin-top: 4px; font-size: 9px; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase; line-height: 1.35;
    color: rgba(255, 255, 255, .5);
}

/* ──────────────── Four action tiles ──────────────── */
.scr-contribute .sc-share { padding: 24px 16px 0; }
.scr-contribute .sc-share__ttl {
    font-family: var(--sp-font-display); font-size: 18px; font-weight: 600;
    color: var(--sp-ink); margin: 0 0 12px;
}
.scr-contribute .sc-share__grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.scr-contribute .sc-tile {
    display: flex; flex-direction: column; gap: 10px;
    padding: 18px 14px; border-radius: 16px; text-decoration: none;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    box-shadow: var(--sp-shadow-1);
    transition: border-color .15s, transform .15s;
}
.scr-contribute .sc-tile:hover { border-color: var(--sp-red); transform: translateY(-1px); }
.scr-contribute .sc-tile__ico {
    width: 48px; height: 48px; border-radius: 14px;
    display: grid; place-items: center;
}
.scr-contribute .sc-tile__svg { width: 22px; height: 22px; }
.scr-contribute .sc-tile__body { min-width: 0; }
.scr-contribute .sc-tile__t {
    display: block; margin-bottom: 3px;
    font-family: var(--sp-font-display); font-size: 15px; font-weight: 600;
    color: var(--sp-ink);
}
.scr-contribute .sc-tile__s { display: block; font-size: 11px; color: var(--sp-slate); line-height: 1.4; }

/* ──────────────── Form shell ──────────────── */
.scr-contribute .sc-flash {
    margin: 16px 16px 0; padding: 12px 14px; border-radius: var(--sp-r-md);
    background: var(--sp-red-soft); border: 1px solid var(--sp-red);
    color: var(--sp-red); font-size: 13px; font-weight: 700;
}
.scr-contribute .sc-step { padding: 24px 16px 0; }
.scr-contribute .sc-step__num {
    margin: 0 0 4px; font-family: var(--sp-font-display);
    font-size: 10px; font-weight: 600; letter-spacing: .18em;
    text-transform: uppercase; color: var(--sp-red);
}
.scr-contribute .sc-step__ttl {
    font-family: var(--sp-font-display); font-size: 20px; font-weight: 600;
    color: var(--sp-ink); line-height: 1.2; margin: 0 0 6px;
}
.scr-contribute .sc-step__sub { margin: 0 0 16px; font-size: 13px; color: var(--sp-slate); line-height: 1.5; }

.scr-contribute .sc-card {
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    border-radius: var(--sp-r-lg); padding: 16px; box-shadow: var(--sp-shadow-1);
}
.scr-contribute .sc-field { margin-top: 18px; }
.scr-contribute .sc-field__lab {
    margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--sp-slate);
}

/* Inputs */
.scr-contribute .sc-lab {
    display: block; margin: 0 0 6px;
    font-size: 12px; font-weight: 700; color: var(--sp-ink);
}
.scr-contribute .sc-lab em { color: var(--sp-red); font-style: normal; }
.scr-contribute .sc-in {
    width: 100%; display: block;
    padding: 13px 14px; border-radius: 12px;
    border: 1.5px solid var(--sp-line); background: var(--sp-surface);
    font-family: var(--sp-font-body); font-size: 14px; color: var(--sp-ink);
    line-height: 1.5; outline: none; -webkit-appearance: none; appearance: none;
}
.scr-contribute select.sc-in {
    background-image: linear-gradient(45deg, transparent 50%, var(--sp-slate) 50%),
                      linear-gradient(135deg, var(--sp-slate) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
    padding-right: 34px;
}
.scr-contribute .sc-in::placeholder { color: var(--sp-slate-2); }
.scr-contribute .sc-in:focus { border-color: var(--sp-red); }
.scr-contribute .sc-in--code { text-transform: uppercase; }
.scr-contribute .sc-ta { resize: vertical; min-height: 76px; }
.scr-contribute .sc-in + .sc-in,
.scr-contribute .sc-ta + .sc-ta,
.scr-contribute .sc-count + .sc-in,
.scr-contribute .sc-count + .sc-ta { margin-top: 10px; }

/* Character counter — prototype's "0/400" under the review body. */
.scr-contribute .sc-count {
    display: block; margin-top: 4px; text-align: right;
    font-size: 11px; color: var(--sp-slate-2); font-variant-numeric: tabular-nums;
}
.scr-contribute .sc-count.is-full { color: var(--sp-red); font-weight: 700; }
.scr-contribute .sc-row2 {
    display: grid; grid-template-columns: 1fr 96px; gap: 10px; margin-top: 12px;
}
.scr-contribute .sc-err { margin: 6px 0 0; font-size: 12px; font-weight: 700; color: var(--sp-red); }

/* Chips (shore-leave) */
.scr-contribute .sc-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.scr-contribute .sc-chip { position: relative; display: inline-flex; cursor: pointer; }
.scr-contribute .sc-chip input { position: absolute; opacity: 0; pointer-events: none; }
.scr-contribute .sc-chip__b {
    padding: 10px 18px; border-radius: 999px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    font-size: 13px; font-weight: 600; color: var(--sp-ink);
    transition: background .15s, color .15s, border-color .15s;
}
.scr-contribute .sc-chip input:checked + .sc-chip__b {
    background: var(--sp-red); border-color: var(--sp-red); color: #fff;
}
.scr-contribute .sc-chip input:focus-visible + .sc-chip__b { outline: 2px solid var(--sp-red); outline-offset: 2px; }

/* Star tiles */
.scr-contribute .sc-rate { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.scr-contribute .sc-rate__row { display: flex; gap: 10px; }
.scr-contribute .sc-rate__btn {
    width: 44px; height: 44px; padding: 0; border: none; border-radius: 12px;
    display: grid; place-items: center; cursor: pointer; opacity: 1;
    background: var(--sp-bg-2); color: var(--sp-slate-2);
    transition: background .15s, color .15s;
}
.scr-contribute .sc-rate__btn.is-on { background: var(--sp-amber-soft); color: var(--sp-amber); opacity: 1; }
.scr-contribute .sc-rate__ico { width: 22px; height: 22px; }
.scr-contribute .sc-rate__word { font-size: 13px; font-weight: 700; color: var(--sp-slate-2); min-height: 18px; }
.scr-contribute .sc-rate__word::after { content: 'Tap to rate'; }
.scr-contribute[data-rating="1"] .sc-rate__word,
.scr-contribute[data-rating="2"] .sc-rate__word,
.scr-contribute[data-rating="3"] .sc-rate__word,
.scr-contribute[data-rating="4"] .sc-rate__word,
.scr-contribute[data-rating="5"] .sc-rate__word { color: var(--sp-amber); }
.scr-contribute[data-rating="1"] .sc-rate__word::after { content: 'Poor'; }
.scr-contribute[data-rating="2"] .sc-rate__word::after { content: 'Below average'; }
.scr-contribute[data-rating="3"] .sc-rate__word::after { content: 'Average'; }
.scr-contribute[data-rating="4"] .sc-rate__word::after { content: 'Good'; }
.scr-contribute[data-rating="5"] .sc-rate__word::after { content: 'Excellent'; }

/* Context pill (prototype step 2) */
.scr-contribute .sc-context {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 8px 12px; border-radius: var(--sp-r-md);
    background: var(--sp-amber-soft); border: 1px solid var(--sp-amber-soft);
    margin-bottom: 14px;
}
.scr-contribute .sc-context__stars { display: flex; gap: 2px; color: var(--sp-line); }
.scr-contribute .sc-context__star { width: 13px; height: 13px; }
.scr-contribute .sc-context__t { font-size: 12px; font-weight: 700; color: var(--sp-amber); margin-left: 4px; }
.scr-contribute .sc-context__m { font-size: 12px; color: var(--sp-slate); }
.scr-contribute[data-rating="1"] .sc-context__star:nth-child(-n+1),
.scr-contribute[data-rating="2"] .sc-context__star:nth-child(-n+2),
.scr-contribute[data-rating="3"] .sc-context__star:nth-child(-n+3),
.scr-contribute[data-rating="4"] .sc-context__star:nth-child(-n+4),
.scr-contribute[data-rating="5"] .sc-context__star:nth-child(-n+5) { color: var(--sp-amber); }

/* ──────────────── Section cards ──────────────── */
/* The TopBar is sticky, so anchored jumps from the tiles must clear it. */
.scr-contribute .sc-sec[id],
.scr-contribute .sc-step[id] { scroll-margin-top: 78px; }
.scr-contribute .sc-sec {
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    border-radius: var(--sp-r-lg); padding: 14px 16px 16px;
    box-shadow: var(--sp-shadow-1); margin-bottom: 12px;
}
.scr-contribute .sc-sec__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.scr-contribute .sc-sec__tile {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px;
    display: grid; place-items: center;
}
.scr-contribute .sc-sec__ico { width: 22px; height: 22px; }
.scr-contribute .sc-sec__titles { min-width: 0; }
.scr-contribute .sc-sec__ttl {
    display: block; font-family: var(--sp-font-display); font-size: 15px;
    font-weight: 600; color: var(--sp-ink); margin-bottom: 3px;
}
.scr-contribute .sc-sec__ttl small {
    font-family: var(--sp-font-body); font-size: 10px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--sp-slate-2);
    margin-left: 6px;
}
.scr-contribute .sc-sec__sub { display: block; font-size: 11px; color: var(--sp-slate); line-height: 1.4; }

.scr-contribute .sc-tint--blue   { background: var(--sp-blue-soft);  color: var(--sp-blue); }
.scr-contribute .sc-tint--green  { background: var(--sp-green-soft); color: var(--sp-green); }
.scr-contribute .sc-tint--red    { background: var(--sp-red-soft);   color: var(--sp-red); }
.scr-contribute .sc-tint--amber  { background: var(--sp-amber-soft); color: var(--sp-amber); }
.scr-contribute .sc-tint--navy   { background: var(--sp-blue-soft);  color: var(--sp-navy); }
.scr-contribute .sc-tint--purple { background: #EFE7FB; color: #7C3AED; }
.scr-contribute .sc-tint--pink   { background: #FDE7F1; color: #DB2777; }
[data-theme="dark"] .scr-contribute .sc-tint--purple { background: #1B1430; color: #A98BF5; }
[data-theme="dark"] .scr-contribute .sc-tint--pink   { background: #2A0F1D; color: #F472B6; }
[data-theme="dark"] .scr-contribute .sc-tint--navy   { color: #7FB2FF; }

/* ──────────────── Photo dropzone ──────────────── */
.scr-contribute .sc-drop {
    display: grid; place-content: center; justify-items: center; gap: 2px;
    width: 100%; aspect-ratio: 4 / 3; max-height: 260px;
    border-radius: var(--sp-r-lg); cursor: pointer; text-align: center;
    background: var(--sp-bg-2); border: 2px dashed var(--sp-line);
    color: var(--sp-slate-2); transition: background .15s, border-color .15s;
}
.scr-contribute .sc-drop:hover,
.scr-contribute .sc-drop.is-drag { background: var(--sp-red-soft); border-color: var(--sp-red); }
.scr-contribute .sc-drop__ico { width: 36px; height: 36px; margin-bottom: 6px; }
.scr-contribute .sc-drop__t { font-size: 13px; font-weight: 600; color: var(--sp-slate); }
.scr-contribute .sc-drop__s { font-size: 11px; color: var(--sp-slate-2); }
.scr-contribute .sc-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.scr-contribute .sc-photos[hidden] { display: none; }
.scr-contribute .sc-photos figure {
    margin: 0; width: 92px; height: 92px; border-radius: 12px;
    overflow: hidden; background: var(--sp-line-2);
}
.scr-contribute .sc-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ──────────────── Anonymous switch ──────────────── */
.scr-contribute .sc-anon {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; margin-bottom: 16px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    border-radius: var(--sp-r-lg); box-shadow: var(--sp-shadow-1);
}
.scr-contribute .sc-anon__ico {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--sp-line-2); color: var(--sp-slate);
}
.scr-contribute .sc-anon__svg { width: 18px; height: 18px; }
.scr-contribute .sc-anon__txt {
    flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--sp-ink);
}
.scr-contribute .sc-anon__txt small {
    display: block; margin-top: 2px;
    font-size: 11px; font-weight: 500; color: var(--sp-slate);
}
.scr-contribute .sc-switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; }
.scr-contribute .sc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scr-contribute .sc-switch__track {
    position: absolute; inset: 0; border-radius: 999px;
    background: var(--sp-line); transition: background .15s;
}
.scr-contribute .sc-switch__track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 22px; height: 22px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.scr-contribute .sc-switch input:checked + .sc-switch__track { background: var(--sp-red); }
.scr-contribute .sc-switch input:checked + .sc-switch__track::after { transform: translateX(20px); }

/* ──────────────── Buttons ──────────────── */
.scr-contribute .sc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 18px; border-radius: 14px; border: none; cursor: pointer;
    font-family: var(--sp-font-body); font-size: 15px; font-weight: 700;
    text-decoration: none; line-height: 1.2;
}
.scr-contribute .sc-btn--solid { background: var(--sp-red); color: #fff; }
.scr-contribute .sc-btn--solid:hover { background: var(--sp-red-deep); }
.scr-contribute .sc-btn--ghost {
    background: transparent; border: 1.5px solid var(--sp-red); color: var(--sp-red);
}
.scr-contribute .sc-btn--ghost:hover { background: var(--sp-red-tint); }
.scr-contribute .sc-btn--block { display: flex; width: 100%; padding: 16px; }

/* ──────────────── Recent contributions ──────────────── */
.scr-contribute .sc-recent { padding: 26px 16px 0; }
.scr-contribute .sc-recent__ttl {
    font-family: var(--sp-font-display); font-size: 18px; font-weight: 600;
    color: var(--sp-ink); margin: 0 0 10px;
}
.scr-contribute .sc-recent__list {
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    border-radius: var(--sp-r-lg); overflow: hidden; box-shadow: var(--sp-shadow-1);
}
.scr-contribute .sc-act { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.scr-contribute .sc-act + .sc-act { border-top: 1px solid var(--sp-line-2); }
.scr-contribute .sc-act__ico {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--sp-red-soft); color: var(--sp-red);
}
.scr-contribute .sc-act__svg { width: 16px; height: 16px; }
.scr-contribute .sc-act__body { flex: 1; min-width: 0; }
.scr-contribute .sc-act__who { display: block; font-size: 12px; font-weight: 700; color: var(--sp-ink); }
.scr-contribute .sc-act__what { display: block; margin-top: 1px; font-size: 11px; color: var(--sp-slate); }
.scr-contribute .sc-act__what a { color: var(--sp-ink-2); font-weight: 600; text-decoration: none; }
.scr-contribute .sc-act__what a:hover { color: var(--sp-red); }
.scr-contribute .sc-act__time { flex: 0 0 auto; font-size: 10px; font-weight: 600; color: var(--sp-slate-2); white-space: nowrap; }
.scr-contribute .dh-empty { margin: 0; }

/* ──────────────── Success state ──────────────── */
.scr-contribute .sc-done {
    display: flex; flex-direction: column; align-items: center; gap: 20px;
    padding: 60px 24px 32px; text-align: center;
}
.scr-contribute .sc-done__mark {
    width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center;
    background: var(--sp-green-soft); border: 3px solid var(--sp-green); color: var(--sp-green);
}
.scr-contribute .sc-done__ico { width: 38px; height: 38px; }
.scr-contribute .sc-done__head {
    font-family: var(--sp-font-display); font-size: 26px; font-weight: 600;
    color: var(--sp-ink); margin: 0 0 8px;
}
.scr-contribute .sc-done__sub { margin: 0; font-size: 14px; color: var(--sp-slate); line-height: 1.6; }
.scr-contribute .sc-impact {
    width: 100%; padding: 18px 20px; border-radius: var(--sp-r-lg); text-align: left;
    background: linear-gradient(135deg, #14171F 0%, #1C2230 100%); border: 1px solid #232A3A;
}
.scr-contribute .sc-impact__n { font-family: var(--sp-font-mono); font-size: 28px; font-weight: 700; color: #fff; }
.scr-contribute .sc-impact__l { margin: 4px 0 0; font-size: 12px; color: rgba(255, 255, 255, .6); }
.scr-contribute .sc-impact__l a { color: #fff; font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .35); }
.scr-contribute .sc-impact__l a:hover { border-bottom-color: #fff; }
.scr-contribute .sc-done__btns { display: flex; gap: 10px; width: 100%; margin-top: 8px; }
.scr-contribute .sc-done__btns .sc-btn { flex: 1; }

/* ──────────────── Wide screens ──────────────── */
@media (min-width: 900px) {
    .scr-contribute .sc-bar { position: static; background: transparent; border-bottom: none; padding: 22px 16px 6px; }
    .scr-contribute .sc-hero__head { font-size: 26px; }
    .scr-contribute .sc-row2 { grid-template-columns: 1fr 140px; }
}
