:root[data-theme="harbour"] {
  --ink: #123b45;
  --sea: #126b65;
  --pale: #e6f4f1;
}

.market-entry { margin: 24px 0 0; }
.market-shell { min-height: 70vh; padding: 34px 0 54px; }
.market-shell h1 { margin: 0 0 18px; font-size: clamp(28px, 5vw, 44px); }
.market-shell h2, .recent-requests h2 { margin: 0 0 12px; }
.market-shell p { overflow-wrap: anywhere; }
.market-page { background: var(--bg-soft); }
.market-grid { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 22px; }
.market-menu, .market-panel, .market-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 15px;
  padding: 18px;
  min-width: 0;
}
.market-menu { display: flex; flex-direction: column; gap: 6px; align-self: start; }
.market-panel { max-width: 850px; }
.market-auth { max-width: 510px; margin: 18px auto; }
.market-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.market-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--sea);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.market-button.secondary { color: var(--ink); background: var(--pale); }
.market-button:disabled { opacity: .65; cursor: wait; }
.market-form { display: grid; gap: 14px; margin: 16px 0; }
.market-form label { display: grid; gap: 4px; font-weight: 650; }
.market-form :is(input, select, textarea) {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--field-line);
  border-radius: 9px;
  font: inherit;
  color: inherit;
  background: var(--surface);
}
.market-form textarea { min-height: 96px; resize: vertical; }
/* Error component (task 2026-11-11-friendly-errors): one alert style for every form, card and
 * page; field-level variant sits under its field. Icon is CSS-only (strict CSP, not read twice). */
.market-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0;
  padding: 11px 14px;
  border: 1px solid var(--error-line);
  border-radius: 12px;
  color: var(--error-ink);
  background: var(--error-bg);
  font-weight: 550;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  animation: market-error-in .18s ease-out;
}
.market-error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  color: var(--surface);
  background: var(--error);
  font-size: .8rem;
  font-weight: 800;
  line-height: 1;
}
.market-error:focus { outline: none; }
.market-error:focus-visible { outline: 2px solid var(--error); outline-offset: 2px; }
.market-error.market-field-error {
  margin: -8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--error);
  font-size: .9rem;
  gap: 6px;
}
.market-error.market-field-error::before { width: 16px; height: 16px; font-size: .7rem; margin-top: 2px; }
.market-form [aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
@keyframes market-error-in { from { opacity: 0; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .market-error { animation: none; } }
.market-stack { display: grid; gap: 10px; margin-top: 16px; }
.market-card h3 { margin: 0 0 4px; overflow-wrap: anywhere; }
.market-card p { margin: 5px 0; color: var(--muted); }
.market-meta { color: var(--muted); font-size: .9rem; }
.market-message { max-width: 85%; background: var(--pale); padding: 8px 13px; border-radius: 12px; }
.market-message.mine { margin-left: auto; }
.market-message p { margin: 0; white-space: pre-wrap; }
.recent-requests { max-width: 1060px; margin: 0 auto; padding-bottom: 56px; }
.recent-requests .market-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.recent-requests .market-card { box-shadow: 0 9px 26px rgb(16 40 63 / 6%); }
@media (max-width: 760px) {
  .market-grid, .recent-requests .market-stack { grid-template-columns: minmax(0, 1fr); }
  .market-menu { flex-direction: row; flex-wrap: wrap; }
}

[hidden] { display: none !important; }
.market-form input[type="checkbox"] { width: auto; justify-self: start; }
/* Privacy-policy consent on the sign-up form (2026-11-26): the box beside its sentence, the link underlined. */
.market-form label.market-consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; line-height: 1.45; }
.market-form label.market-consent input[type="checkbox"] { flex: none; width: 20px; height: 20px; margin: 1px 0 0; }
.market-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Sign-up role cards (owner 2026-12-04, ADR 0097; canvas boards SignupOwner / SignupMate): native radio buttons in cards,
   the chosen card in the request-form blue. */
.market-form fieldset.market-role-cards { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.market-role-cards legend { padding: 0; margin-bottom: 6px; font-weight: 650; }
.market-form label.market-role-card { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); cursor: pointer; font-weight: 500; }
.market-form label.market-role-card:hover { border-color: #2874cc; }
.market-form label.market-role-card:has(input:checked) { background: #e3eefb; border-color: #2874cc; box-shadow: inset 0 0 0 0.5px #2874cc; color: #1c1c1b; }
:root[data-scheme="dark"] .market-form label.market-role-card:has(input:checked) { background: #1b3654; border-color: #4d9be6; box-shadow: inset 0 0 0 0.5px #4d9be6; color: #fff; }
.market-form label.market-role-card input[type="radio"] { flex: none; width: 20px; height: 20px; margin: 2px 0 0; padding: 0; accent-color: #2874cc; }
.market-role-card__text { display: grid; gap: 2px; min-width: 0; }
.market-role-card__name { font-size: 17px; font-weight: 800; }
.market-role-card__line { font-size: 14.5px; line-height: 1.4; }
.market-role-cards .market-role-next, .market-role-cards .market-role-hint { margin: 2px 0 0; }
/* "Keep me signed in" under the password (ADR 0097). */
.market-form label.market-remember { align-items: center; }
/* Sign-up checks (ADR 0087): required marks, the optional location, live name/email notes, the password checklist. */
.market-required { margin-left: 3px; color: var(--error); font-weight: 700; }
.market-required-note { margin: 0; }
.market-form fieldset.market-signup-location { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.market-signup-location legend { grid-column: 1 / -1; padding: 0; margin-bottom: 6px; font-weight: 600; }
@media (max-width: 760px) { .market-form fieldset.market-signup-location { grid-template-columns: minmax(0, 1fr); } }
.market-field-check { margin: -4px 0 0; color: var(--error-ink); font-size: .92rem; line-height: 1.4; }
.market-password-rules { margin-top: -4px; }
.market-password-rules p { margin: 0 0 4px; }
.market-password-rules ul { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: .92rem; color: var(--muted); }
.market-password-rules li { display: inline-flex; align-items: center; gap: 6px; }
.market-password-rules li::before { content: ""; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; opacity: .6; }
.market-password-rules li.is-met { color: var(--ink); font-weight: 600; }
.market-password-rules li.is-met::before { width: 10px; height: 6px; border-width: 0 0 2px 2px; border-color: var(--sea); border-radius: 0; opacity: 1; transform: translateY(-2px) rotate(-45deg); }

.request-gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.request-gallery img { max-width: min(100%, 170px); max-height: 160px; object-fit: contain; border-radius: 9px; }

.market-auth-entry { text-align: center; }
.market-auth-entry .market-auth { text-align: left; box-shadow: 0 12px 40px rgb(16 40 63 / 7%); }
.market-auth-entry h1 { margin: 0 auto 12px; }
.market-auth .market-actions > button { flex: 1; }
@media (max-width: 760px) {
  .signed-in .market-shell { padding-bottom: 90px; }
  .signed-in .market-menu {
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-radius: 0;
    padding: 6px 10px max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgb(16 40 63 / 8%);
  }
  .signed-in .market-menu button { flex: none; }
}

.market-auth-entry .market-auth { max-width: 700px; padding: 0; overflow: hidden; border-radius: 22px; }
.market-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.market-auth-tabs .market-button { min-height: 54px; border-radius: 0; background: var(--surface); }
.market-auth-tabs .market-button[aria-pressed="true"] { background: var(--pale); box-shadow: inset 0 -3px var(--sea); }
.market-auth-body { padding: 24px 28px; }
.market-auth-body .market-error:empty { display: none; }
.market-auth-body .market-form > [type="submit"] { justify-self: end; }
@media (max-width: 540px) {
  .market-auth-body { padding: 18px; }
  .market-auth-body .market-form > [type="submit"] { justify-self: stretch; }
}

.market-profile-photo { max-width: min(100%, 200px); max-height: 160px; object-fit: contain; border-radius: 10px; }

/* Pinned requests on the landing page (ADR 0025): the same thin grey frame and shadow as the other requests,
 * marked by a tinted fill and the "Pinned" badge (2026-11-13). */
.market-pinned { background: var(--brand-pale); }
.market-badge {
  display: inline-block; margin-bottom: 6px; padding: 2px 9px; border-radius: 99px;
  background: var(--brand-text); color: var(--brand-on); font-size: 12px; font-weight: 700; letter-spacing: .2px;
}
.market-pin-option { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; }
.market-pin-option input { width: auto; }
.market-pin-option small { grid-column: 1 / -1; }

/* "Continue with Google" (ADR 0027): Google's light button style. */
.market-google {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; padding: 0 16px;
  border: 1px solid #747775; border-radius: 999px; background: var(--surface); color: #1f1f1f;
  font-weight: 600; text-decoration: none;
}
.market-google:hover { background: var(--surface-2); }
.market-google:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.market-google svg { width: 20px; height: 20px; flex: none; }
.market-or { text-align: center; color: var(--muted); margin: 10px 0; }
.market-notice { padding: 10px 12px; border-radius: 10px; background: var(--pale); }

/* "Show details" on homepage request cards */
.market-details-link { display: inline-block; margin-top: 10px; font-weight: 700; color: var(--sea, #1677d2); text-decoration: none; }
.market-details-link:hover { text-decoration: underline; }

/* Night mode (ADR 0031) */
:root[data-scheme="dark"][data-theme="harbour"] { --ink: #e4ecf5; --sea: #2a9d93; --pale: #12302e; } /* the preset's dark ink made the night page unreadable (found 2026-11-23) */
:root[data-scheme="dark"] .market-details-link { color: var(--link); }
:root[data-scheme="dark"] :is(.market-pinned, .recent-requests .market-card, .market-auth-entry .market-auth) { box-shadow: 0 9px 26px rgb(0 0 0 / 35%); }
:root[data-scheme="dark"] .market-google { border-color: #8e918f; background: #131314; color: #e3e3e3; }
:root[data-scheme="dark"] .market-google:hover { background: #1f1f20; }
:root[data-scheme="dark"] .market-auth-tabs .market-button[aria-pressed="false"] { color: var(--ink); }

.market-verification { display: flex; flex-wrap: wrap; gap: .4rem; margin-block: .5rem; }
.market-verification-badge {
  border-radius: 999px; padding: .15rem .55rem; font-size: .82rem;
  border: 1px solid currentColor; color: var(--muted);
}
.market-verification-badge.is-verified { color: #086642; background: #e5f8ed; }
:root[data-scheme="dark"] .market-verification-badge.is-verified { color: #a2efc8; background: #163929; }
/* Date field with calendar (dateInput in marketplace.js). */
.dp { position: relative; display: grid; gap: 6px; }
.dp-row { display: flex; align-items: end; gap: 8px; }
.dp-row label { flex: 1; min-width: 0; }
.dp-open { min-width: 44px; min-height: 42px; border: 1px solid var(--field-line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.dp-pop { position: absolute; z-index: 20; top: 100%; right: 0; width: min(320px, 100%); margin-top: 4px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 14px 36px rgb(var(--shadow) / 18%); }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dp-head strong { text-transform: capitalize; }
.dp-head button { min-width: 40px; min-height: 40px; border: 0; border-radius: 9px; background: var(--pale); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dp-dow { color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 0; }
.dp-day { min-height: 38px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.dp-day:hover:not(:disabled) { background: var(--pale); }
.dp-day[aria-current="date"] { border-color: var(--sea); font-weight: 800; }
.dp-day[aria-pressed="true"] { background: var(--sea); color: #fff; }
.dp-day:disabled { color: var(--muted); opacity: .45; cursor: default; }

/* Combobox: country list and city typeahead (combobox() in marketplace.js). Colours come from the variables, so it follows night mode. */
.cb { position: relative; display: grid; gap: 4px; }
.cb-text:disabled { opacity: .6; cursor: not-allowed; }
.cb-list { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none; max-height: min(280px, 50vh); overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 14px 36px rgb(var(--shadow) / 18%); }
.cb-option { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-height: 40px; padding: 9px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; cursor: pointer; }
.cb-option.is-active, .cb-option:hover { background: var(--pale); }
.cb-option[aria-selected="true"] { font-weight: 800; }
.cb-hint { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .9em; font-weight: 500; }
.cb-empty { padding: 9px 10px; color: var(--muted); font-weight: 500; }
.cb-credit a { color: inherit; text-decoration: underline; }

/* Errors span the whole row of multi-column forms; in the chat composer they sit above it. */
.market-form > .market-error { grid-column: 1 / -1; }
.cab-chat-page .market-form > .market-error:not(.market-field-error) { order: -1; }

/* Photo picker (2026-11-25): the real file input is kept for keyboard and screen readers but drawn as a button
 * with the chosen file name and a small preview, instead of the browser's plain "Choose File". */
.market-file { display: grid; gap: 6px; }
.market-file-row { position: relative; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; min-width: 0; }
.market-file-input { position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.market-file-button { cursor: pointer; }
.market-file:focus-within .market-file-button { outline: 2px solid var(--sea, #1263b0); outline-offset: 2px; }
.market-file-name { min-width: 0; overflow: hidden; color: var(--muted, #52637a); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.market-file-preview { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; }
.market-hint { display: block; color: var(--muted, #52637a); font-size: .82rem; font-weight: 400; }
.market-notice.is-warning { color: var(--warn-ink, #784700); background: var(--warn-bg, #fff3d8); }

/* Loading (owner 2026-11-27): the BoatMate of the logo spins around his body while a list loads, with "Loading…".
 * It fades in after 150 ms, so a fast answer does not flash it. Over rows already shown (another page) it sits on top
 * of them, dimmed. Reduced motion: no spin, a slow pulse. */
.bm-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 140px;
  padding: 28px 16px; color: var(--cab-muted, var(--muted, #64748b)); font-size: 14px; font-weight: 600;
  opacity: 0; animation: bm-loading-in .2s ease-out .15s forwards; }
.bm-loading.is-compact { flex-direction: row; min-height: 0; padding: 10px 16px; }
.bm-loading-mate { display: block; width: 44px; height: 59px; overflow: visible; transform-box: border-box;
  transform-origin: 49.39% 56.55%; animation: bm-mate-spin 1.1s linear infinite; }
.bm-loading.is-compact .bm-loading-mate { width: 26px; height: 35px; }
.bm-loading-ring { width: 32px; height: 32px; border: 4px solid var(--cab-line, #e2e8f0); border-top-color: #ff3150; border-radius: 50%;
  animation: bm-mate-spin .9s linear infinite; }
.market-stack.is-loading > :not(.bm-loading) { opacity: .45; pointer-events: none; transition: opacity .15s; }
@keyframes bm-loading-in { to { opacity: 1; } }
@keyframes bm-mate-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .bm-loading-mate, .bm-loading-ring { animation: bm-mate-pulse 1.6s ease-in-out infinite alternate; }
  @keyframes bm-mate-pulse { from { opacity: .45; } to { opacity: 1; } }
}
/* A list that could not load: the reason and "Try again" where the rows would be. */
.bm-load-error { display: grid; justify-items: center; gap: 8px; padding: 24px 16px; text-align: center; }
.bm-load-error p { margin: 0; color: var(--cab-muted, var(--muted, #64748b)); }
