/* Home and its cards' pages (S87, redesigned S88).

   EVERY COLOUR, RADIUS AND SIZE IS A board.css TOKEN, and the shared parts
   (cards, boxes, buttons, the amber and red lines) are join.css's. No new
   token and no hand-set font size: every font-size below is one of the five
   R37 steps, and a test fails on any other. */

/* The business's own name, at the top of Home. */
.home-name {
  overflow-wrap: anywhere;
}

/* "You're in." — once, above the name, on the first visit after joining. */
.home-youre-in {
  margin: 0;
  font-size: var(--fs-support);
  font-weight: var(--fw-name);
  line-height: 1.3;
  color: var(--accent);
}

/* ---- The four cards (S88, S89): ONE shape and ONE height, in every state ----
   An icon tile at the left; a bold title, one grey line and the status under
   it. Each of the three is ONE line and never wraps, so no status can make a
   card taller. The rows also share one height: the tallest sets it for all. */

.home-actions {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 12px;
}

.home-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  box-sizing: border-box;
  /* 2px always, so a card with the green edge is the same size as one
     without: only the colour of the edge changes. */
  padding: 12px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

/* The green edge: this one is waiting for him. On the free screen until it
   is signed. */
.home-action.has-edge {
  border-color: var(--accent);
}

/* COMING SOON: grey fill, dashed edge. A plain box, not a link. */
.home-action.is-soon {
  background: var(--bg);
  border-style: dashed;
  border-color: var(--ink-soft);
  color: var(--ink-soft);
  cursor: default;
}

.home-tile {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg);
  color: var(--accent);
}
.home-action.is-soon .home-tile {
  background: var(--card);
  color: var(--ink-soft);
}
.home-tile-icon {
  width: 24px;
  height: 24px;
}

.home-action-words {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-action-title,
.home-action-line,
.home-action-status {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-action-title {
  font-size: var(--fs-name);
  font-weight: var(--fw-title);
  line-height: 1.3;
  color: var(--ink);
}
.home-action.is-soon .home-action-title {
  color: var(--ink-soft);
}

.home-action-line {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1.35;
  color: var(--ink-soft);
}

/* The status, under the grey line: a fact about him, in the accent. */
.home-action-status {
  align-self: flex-start;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  /* Every status takes the pill's room, pill or not, so all four cards are
     one height. */
  padding: 2px 0;
  border: 1px solid transparent;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  line-height: 1.3;
  color: var(--accent);
}
.home-action.is-soon .home-action-status {
  color: var(--ink-soft);
}

/* The free screen's status is a pill. Solid while there is something for him
   to do (Start, Continue); outlined once it is out of his hands. */
.home-action-status.is-pill {
  padding: 2px 10px;
  border-color: var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
}
.home-action-status.is-pill[data-stage="shop_signed"],
.home-action-status.is-pill[data-stage="completed"],
.home-action-status.is-pill[data-stage="declined"] {
  background: var(--card);
  color: var(--accent);
}

/* ---- The share panel (S88): solid green, his own link to pass on ---- */

.home-share {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
}

.home-share-title {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
  line-height: 1.3;
  color: var(--accent-ink);
}

.home-share-line,
.home-share-note {
  margin: 0;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1.4;
  color: var(--accent-ink);
}

.home-share-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* Two buttons side by side, white on the green. An <a> and a <button>. */
.home-share-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 10px 8px;
  border: 1px solid var(--card);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent);
  font-family: inherit;
  font-size: var(--fs-support);
  font-weight: var(--fw-label);
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Shown only when the phone would not copy: the link, to press and hold. */
.home-share-link {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--card);
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
}

.home-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 8px;
}

/* ---- A card's page: the quiet way back to Home ---- */

.home-back {
  align-self: flex-start;
  padding: 4px 0;
  font-size: var(--fs-support);
  font-weight: var(--fw-name);
  color: var(--ink-soft);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---- The free screen's start page (S88) ---- */

/* The partner's own logo, above the heading. */
.home-partner-logo {
  display: block;
  width: 132px;
  height: auto;
  border-radius: 8px;
}

/* What the account already holds: shown on step 1, never asked again. */
.home-account {
  gap: 6px;
}

/* ---- My spots: a listed spot, with its photo ---- */

.home-spot-photo {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}

/* ---- My suppliers: the search box's suggestions ---- */

.home-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-suggestion {
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  text-align: left;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  line-height: 1.3;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-suggestion-name {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
}

/* "Joined" / "Not joined yet" — a fact about the supplier, said quietly. */
.home-suggestion-status {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}

/* The last row, always: his supplier may not be on any list. */
.home-suggestion-other {
  color: var(--body-text);
}

/* ===========================================================================
   S90 — spots and suppliers, Part A. No new colour, no new size: every value
   below is a board.css token or one of the five steps.
   =========================================================================== */

/* ---- Home: the top card, and the calm block ---- */

.home-top {
  display: flex;
  flex-direction: column;
}

/* "All up to date": the card's shape, but a quiet box and not a link. */
.home-calm {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  box-sizing: border-box;
  padding: 12px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
}
.home-calm-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0 11px;
  color: var(--accent);
}

/* ---- The menu button: three lines, at the right of the header ---- */

.home-menu-button {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.home-menu-icon {
  width: 24px;
  height: 24px;
}

/* ---- The menu ---- */

.home-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-menu-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 56px;
  box-sizing: border-box;
  justify-content: center;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.home-menu-title {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  line-height: 1.3;
  color: var(--ink);
}
.home-menu-status {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1.35;
  color: var(--accent);
}

/* ---- My spots: a listed spot is a link to its year ---- */

a.home-spot {
  text-decoration: none;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.home-spot-note {
  overflow-wrap: anywhere;
}

/* THE PHOTO, LARGE, while he lists it: the card's width, about 230px. */
.home-spot-big {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}

/* ---- The spot's year ---- */

.home-year-spot {
  display: flex;
  align-items: center;
  gap: 12px;
}
.home-year-photo {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.home-year-named {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* Two columns of tiles. */
.home-periods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* OPEN: white, green edge. */
.home-period {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  min-height: 64px;
  box-sizing: border-box;
  padding: 8px 10px;
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: var(--fs-support);       /* a bare button takes the browser's own */
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
/* CLOSED BY YOU: grey, dashed. */
.home-period[data-state="closed"] {
  background: var(--bg);
  border-style: dashed;
  border-color: var(--ink-soft);
  color: var(--ink-soft);
}
/* PAST: grey, and not a control. */
.home-period[data-state="past"] {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink-soft);
  cursor: default;
}
.home-period-label {
  font-size: var(--fs-name);
  font-weight: var(--fw-title);
  line-height: 1.25;
}
.home-period-dates {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1.3;
}
.home-period-state {
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  line-height: 1.3;
}
.home-period[data-state="open"] .home-period-state {
  color: var(--accent);
}

.home-year-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* ---- My suppliers ---- */

/* "N of M have joined" — a fact about him, in the accent. */
.home-strip {
  margin: 0;
  font-size: var(--fs-support);
  font-weight: var(--fw-name);
  line-height: 1.4;
  color: var(--accent);
}

.home-supplier-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-supplier-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 56px;
  box-sizing: border-box;
  padding: 4px 10px 4px 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* The tick: the whole 44px square is the tap target. */
.home-tick {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.home-tick input {
  font: inherit;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

.home-supplier-words {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.home-supplier-name {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
}
/* His rep's line: a quiet link, still 44px tall to tap. */
.home-rep {
  min-height: 44px;
  padding: 0;
  text-align: left;
}

.home-action-box {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* CONNECTED: plain green words. */
.home-connected {
  flex: 0 0 auto;
  font-size: var(--fs-support);
  font-weight: var(--fw-label);
  color: var(--accent);
}

/* INVITE: a green button. REMIND: an outlined one. */
.home-invite,
.home-remind {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: var(--fs-support);
  font-weight: var(--fw-label);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.home-remind {
  background: var(--card);
  color: var(--accent);
}
/* The gate is closed: shown, and not usable. */
.home-invite:disabled,
.home-remind:disabled {
  border-color: var(--line);
  background: var(--line);
  color: var(--ink-soft);
  cursor: default;
}
.home-soon {
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  color: var(--ink-soft);
}

.home-shop-link {
  margin: 0;
}
