/* Screen: harbor (overlay) — Harbor Projects (C1): her shares on top, how a share works, then the projects
   in cards (one column on phones, 16px gutters, full-width buttons). Also the harbor's parts on other
   screens: the bank's door (.hb-door), a port's line (.hb-port), the statement's card (.hb-pay).
   Calm colours: paper, sea and sand; never red. */

.screen--harbor {
  gap: var(--sp-4);
}

.screen--harbor.is-rerender,
.screen--harbor .mate.is-still {
  animation: none;
}

.screen--harbor .mate {
  max-width: 640px;
}

/* ── Header ────────────────────────────────────────────── */
.hb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.hb-head__sub {
  margin-top: var(--sp-1);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-soft);
}

/* ── Your shares, and how a share works ───────────────── */
.hb-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-4) var(--sp-5);
  align-items: start;
}

.hb-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid rgba(13, 48, 71, 0.06);
  box-shadow: var(--shadow-2);
}

.hb-card__title {
  font-size: var(--fs-lg);
}

.hb-mine__lead {
  font-size: var(--fs-md);
  font-weight: 900;
}

.hb-mine__pay {
  font-weight: 800;
  color: var(--gain);
}

.hb-mine__next {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--sea-50);
  color: var(--sea-800);
  font-weight: 800;
}

.hb-mine__idle {
  font-weight: 800;
  color: var(--ink-soft);
}

.hb-how {
  background: var(--sea-50);
  box-shadow: var(--shadow-1);
}

.hb-steps {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-steps li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
}

.hb-steps__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line);
  font-size: 1.2rem;
}

/* While she owes: a calm note (sand, never red). */
.hb-notice {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  border: 2px solid var(--sand-400);
  background: var(--sand-100);
  font-weight: 800;
}

.hb-notice__icon {
  font-size: 1.8rem;
  line-height: 1;
}

/* ── The projects ──────────────────────────────────────── */
.hb-projects {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.hb-projects__title {
  font-size: var(--fs-lg);
}

.hb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-project {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-1);
}

.hb-project.is-yours {
  border-color: var(--green-300);
  background: var(--green-100);
}

.hb-project__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.hb-project__emoji {
  flex: none;
  font-size: 2rem;
  line-height: 1;
}

.hb-project__names {
  min-width: 0;
}

.hb-project__name {
  font-size: var(--fs-md);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.hb-project__port {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 800;
}

.hb-project__blurb {
  color: var(--ink-soft);
}

.hb-project__price {
  font-size: var(--fs-md);
  font-weight: 900;
}

.hb-project__pay {
  font-weight: 800;
  color: var(--gain);
}

/* A project that builds something: what it does, and where it stands (calm: sea while it builds, green
   once it stands). */
.hb-project__works {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
}

.hb-project__does {
  font-weight: 800;
}

.hb-project__build {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 800;
}

.hb-project__works.is-open .hb-project__build {
  color: var(--green-700);
}

.hb-project__status {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-2);
}

.hb-project__yours {
  font-weight: 900;
  color: var(--green-700);
}

.hb-project__reason {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  color: var(--ink-soft);
  font-weight: 800;
}

.hb-foot {
  display: flex;
  justify-content: center;
}

/* ── The bank's door ──────────────────────────────────── */
.hb-door {
  max-width: 640px;
  background: var(--sand-50);
}

.hb-door__mine {
  font-weight: 800;
  color: var(--gain);
}

.hb-door__go {
  display: flex;
  flex-wrap: wrap;
}

/* ── A port's line (under the port's head, like the 🧰 build hint) ── */
.hb-port {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: flex-start;
  gap: var(--sp-2) var(--sp-3);
  max-width: 640px;
  margin-top: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  border: 2px dashed var(--sand-200);
  border-radius: var(--r-md); /* it may wrap on a phone: a soft box, not a pill */
  background: var(--card);
}

.hb-port__text {
  flex: 1 1 220px;
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 800;
  overflow-wrap: anywhere;
}

/* ── The statement's 🏛️ card ───────────────────────────── */
.hb-pay__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin: var(--sp-2) 0 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
}

.hb-pay__total {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--gain-bg);
  color: var(--gain);
  font-weight: 800;
}

/* ── Tablets in portrait and phones: one column ─────────── */
@media (max-width: 53.75em) {
  /* One column (as the bank's): her shares, the projects, then how a share works, so a buy button is in
     view after one scroll on a phone. */
  .hb-top {
    display: contents;
  }

  .hb-how { order: 1; }
  .hb-foot { order: 2; }
}

@media (max-width: 37.5em) {
  .hb-card,
  .hb-project {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
  }

  .hb-head .hb-back {
    width: 100%;
  }

  .hb-foot .btn {
    width: 100%;
  }
}
