/* =============================================================================
   CORPORATE IDENTITY & INTELLECTUAL PROPERTY NOTICE:
   iTTD LTD - built and powered by ittd.works .logic division
   Copyright (C) 2026 iTTD LTD. All rights reserved.
   logic.growth
   File: app/static/css/base.css
   @version 0.1.20260814.0001
   CCB factor: 40-18
   >>>>>>>>>> Guarded by Tekkers The Dog <<<<<<<<<<
   ============================================================================= */
:root {
  --c-bg: #f4f8fb;
  --c-card: #ffffff;
  --c-text: #1a1a1a;
  --c-brand: #0099ff;
  --c-logic: #33cc33;
  --c-muted: #6b7280;

  --panel-padding: 1.25rem;
  --panel-radius: 12px;
  --panel-border: 1px solid #e2e8f0;
  --input-height: 2.5rem;
  --input-padding-y: 0.6rem;
  --input-padding-x: 0.75rem;
  --input-radius: 10px;
  --input-font-size: 1rem;
  --pill-sm-padding: 0.25rem 0.6rem;
  --pill-sm-radius: 999px;
  --pill-md-padding: 0.35rem 0.8rem;
  --pill-md-radius: 999px;
  --pill-lg-padding: 0.5rem 0.9rem;
  --pill-lg-min-width: 8rem;
  --pill-lg-radius: 18px;
}

/* --- localtrade member surfaces ---------------------------------------------
   These templates serve two audiences from one stylesheet: operators on
   growth.logic.ittd.works, and trades who arrived from localtrade.exchange.
   Only the second group gets the localtrade brand, so the tokens are scoped to
   a body class rather than rewriting :root -- rebranding the ops console as a
   side effect of branding the sign-in page would be the wrong trade.
   Values come from brand.css, which the site and the PWA also read.
   -------------------------------------------------------------------------- */
body.lt-brand {
  --c-brand: var(--lt-brand);
  font-family: var(--lt-font-body);
}

body.lt-brand :is(h1, h2, h3, h4, h5, h6),
body.lt-brand .brand {
  font-family: var(--lt-font-display);
  letter-spacing: -0.02em;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #eff6ff 0%, var(--c-bg) 30%, #ffffff 100%);
  color: var(--c-text);
}

.topbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #dbe4ee;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  color: var(--c-logic);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.brand-paw {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand-stack {
  display: grid;
  gap: 0.12rem;
}

.brand-meta {
  color: var(--c-muted);
  font-size: 0.74rem;
}

.nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.nav-link {
  text-decoration: none;
  color: var(--c-text);
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
}

.nav-link.active {
  background: #e9f8e9;
  color: #0a6e0a;
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.build-tag {
  border: 1px solid #c8d6e5;
  border-radius: 999px;
  padding: 0.25rem 0.52rem;
  font-size: 0.74rem;
  color: #334155;
  background: #f8fbff;
}

.tenant-tag {
  border: 1px solid #d8e6d8;
  border-radius: 999px;
  padding: 0.25rem 0.52rem;
  font-size: 0.74rem;
  color: #166534;
  background: #f0fdf4;
}

.currency-select {
  border: 1px solid #c8d6e5;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.28rem 0.5rem;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.locale-btn,
button,
.logout {
  border: 1px solid #c8d6e5;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.32rem 0.58rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.locale-btn.active {
  background: #e6f4ff;
  border-color: var(--c-brand);
}

.main {
  max-width: 980px;
  width: min(100%, 980px);
  margin: 1.2rem auto;
  padding: 0 1rem;
}

.journey-hero {
  background: linear-gradient(145deg, #ffffff 0%, #f2faff 50%, #ecfaee 100%);
}

.journey-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: #0369a1;
  text-transform: uppercase;
  font-weight: 700;
}

.journey-lead {
  max-width: 72ch;
}

.journey-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.journey-more {
  border: 1px solid #c8d6e5;
  border-radius: 12px;
  padding: 0.65rem;
  background: #fff;
  width: 100%;
  max-width: 640px;
}

.journey-more summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.journey-more summary::-webkit-details-marker {
  display: none;
}

.journey-more summary:after {
  content: '▾';
  float: right;
  font-size: 0.85rem;
}

.journey-more[open] summary:after {
  content: '▴';
}

.journey-actions--nested {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.journey-actions--nested .journey-btn {
  flex: 1 0 45%;
}

.panel {
  background: #fff;
  border: var(--panel-border);
  border-radius: var(--panel-radius);
  padding: var(--panel-padding);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.08);
}
.panel__header,
.panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.panel__header h2 {
  margin: 0;
  font-size: 1.25rem;
}
.panel__body {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.input-field {
  width: 100%;
  height: var(--input-height);
  padding: var(--input-padding-y) var(--input-padding-x);
  border-radius: var(--input-radius);
  border: 1px solid #cbd5f5;
  background: #fff;
  font-size: var(--input-font-size);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-field:focus {
  outline: none;
  border-color: #6ee7b7;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: var(--pill-md-radius);
  padding: var(--pill-md-padding);
  background: #0ea5e9;
  color: #fff;
  font-weight: 600;
}
.pill--success {
  background: #16a34a;
}

.pill--warn {
  background: #f59e0b;
  color: #ffffff;
}

.pill--locked {
  background: #64748b;
  color: #ffffff;
}
.me-profile-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  font-size: 0.95rem;
}
.me-profile-details dt {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}
.me-profile-details dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.me-profile-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.me-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: #e2e8f0;
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.ui-btn.primary {
  background: #0ea5e9;
  color: #fff;
  border-color: #0ea5e9;
}
.ui-btn.ghost {
  background: transparent;
  border-color: #cbd5f5;
}
.ui-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.journey-actions[hidden] {
  display: none !important;
}

.journey-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #c8d6e5;
  border-radius: 9px;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  padding: 0.4rem 0.74rem;
  font-weight: 600;
}

.journey-btn-primary {
  border-color: #0ea5e9;
  background: #0ea5e9;
  color: #ffffff;
}

.journey-steps {
  display: grid;
  gap: 0.45rem;
  padding-left: 1.2rem;
}

.public-join-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.public-join-result {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  border-top: 1px solid #dbe4ee;
  padding-top: 1rem;
}

.public-join-result[hidden],
#publicJoinAccountSection[hidden],
#publicJoinComplete[hidden] {
  display: none !important;
}

.public-join-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.public-join-facts div {
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.72rem;
}

.public-join-facts dt {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.public-join-facts dd {
  margin: 0;
  color: #0f172a;
  font-weight: 700;
}

/* Claim your patch: /join for a trade arriving with the patch they built on the
   map. These blocks are grid-displayed, so `hidden` has to be made to win. */
.public-join-claim {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  border-top: 1px solid #dbe4ee;
  padding-top: 1rem;
}

.public-join-claim[hidden],
.public-join-facts[hidden],
.visual-reach-panel[hidden],
.visual-patch-form[hidden] {
  display: none !important;
}

/* Founder offer panel on the /join patch result */
.public-join-founder {
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px solid #cfe4ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #f2f8ff, #ffffff);
}

.public-join-founder[hidden] { display: none; }

.public-join-founder .journey-kicker {
  color: var(--c-brand);
  margin: 0 0 0.25rem;
}

.public-join-founder__price {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0b1220;
}

.public-join-founder__price strong { font-size: 1.5rem; letter-spacing: -0.02em; }
.public-join-founder__price span { color: var(--c-muted); font-weight: 600; }

.public-join-founder__places {
  margin: 0 0 0.35rem;
  font-weight: 800;
  color: var(--c-brand);
}

.visual-patch-hero h1 {
  max-width: 12ch;
}

.visual-patch-form {
  align-items: end;
}

.visual-patch-stage {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.visual-patch-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 0.35rem;
  max-width: 310px;
  margin: 0 auto;
  padding: 0.65rem;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #f8fbff;
}

.visual-hex {
  display: grid;
  place-items: center;
  aspect-ratio: 1.08;
  min-width: 0;
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
  border: 1px solid transparent;
  color: #0f172a;
  background: #e7eef7;
}

.visual-hex strong {
  padding: 0.25rem;
  font-size: clamp(0.68rem, 2.8vw, 0.9rem);
  line-height: 1;
  text-align: center;
}

.visual-hex--core {
  color: #ffffff;
  background: #0f766e;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.28);
}

.visual-hex--addon {
  background: #d9f7e4;
}

.visual-hex--selected {
  color: #ffffff;
  background: #16a34a;
}

.visual-hex--muted {
  background: #edf2f7;
  opacity: 0.55;
}

.visual-patch-summary {
  min-width: 0;
}

.visual-patch-summary h2 {
  margin: 0 0 0.35rem;
}

.visual-patch-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.visual-patch-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.visual-reach-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.9rem;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #ffffff;
}

.visual-reach-panel h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.visual-reach-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  /* Rural patches can list dozens of villages -- keep the picker bounded. */
  max-height: 340px;
  overflow-y: auto;
  align-content: start;
}

.visual-reach-options label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #f8fbff;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 700;
}

.visual-reach-options input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.visual-detail {
  max-width: none;
}

.visual-geometry-panel {
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) minmax(0, 1fr);
  gap: 0.85rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid #dbe4ee;
}

.visual-geometry-panel[hidden] {
  display: none !important;
}

.visual-geometry-map {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background:
    linear-gradient(rgba(14, 165, 233, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.11) 1px, transparent 1px),
    #f8fbff;
  background-size: 18px 18px;
}

.visual-geometry-bound {
  position: absolute;
  inset: 24px 30px;
  border: 2px solid #0f766e;
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.08);
}

.visual-geometry-centre {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #0ea5e9;
  box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.18);
  transform: translate(-50%, -50%);
}

.visual-geometry-copy {
  min-width: 0;
}

.visual-geometry-facts {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.visual-geometry-facts div {
  display: grid;
  grid-template-columns: minmax(105px, 0.35fr) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
}

.visual-geometry-facts dt {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.visual-geometry-facts dd {
  margin: 0;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.45;
}

.food-stops-hero h1 {
  max-width: 12ch;
}

.food-stops-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.62fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.food-stops-copy {
  padding: 0.95rem;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #f8fbff;
}

.food-stops-copy h2 {
  margin: 0 0 0.75rem;
}

.food-stops-form {
  align-items: end;
}

.food-stops-result {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
}

.food-stops-result h2 {
  margin: 0 0 0.35rem;
}

.food-stop-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.food-stop-profile-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: end;
  max-width: 620px;
}

.inline-form label {
  grid-column: 1 / -1;
  font-size: 0.86rem;
  color: #334155;
}

.inline-form input {
  font: inherit;
  padding: 0.58rem;
}

.inline-form button {
  font: inherit;
  padding: 0.58rem 0.75rem;
}

.consent-check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-top: 0.5rem;
  font-size: 0.92rem;
}

.consent-check input {
  margin-top: 0.15rem;
}

.journey-progress-shell {
  margin-top: 0.85rem;
}

.journey-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #dbe4ee;
  overflow: hidden;
}

.journey-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9 0%, #22c55e 100%);
  transition: width 0.2s ease;
}

.setup-step {
  border-color: #d5e3ef;
}

.setup-step__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.setup-step__head h2 {
  margin: 0;
  font-size: 1.12rem;
}

.setup-step__head p {
  margin: 0.35rem 0 0;
}

.setup-step__body {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid #e2e8f0;
}

.setup-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.75rem;
}

.setup-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #fbfdff;
  cursor: pointer;
}

.setup-choice input {
  margin-top: 0.25rem;
}

.setup-choice strong,
.setup-choice small {
  display: block;
}

.setup-choice small {
  margin-top: 0.25rem;
  color: var(--c-muted);
}

.setup-branch {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.setup-branch h3,
.setup-branch h4 {
  margin-top: 0;
}

.setup-branch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 1rem;
}

.setup-check-list {
  display: grid;
  gap: 0.55rem;
}

.setup-check-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #ffffff;
}

.setup-social-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0;
}

.setup-social-card {
  padding: 0.9rem;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #ffffff;
}

.setup-social-card h4 {
  margin-bottom: 0.75rem;
}

.setup-social-card label {
  display: block;
  font-size: 0.88rem;
  color: #334155;
  margin-top: 0.6rem;
}

.setup-social-card label:first-of-type {
  margin-top: 0;
}

.setup-social-card input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.3rem;
  font: inherit;
  padding: 0.58rem;
}

.invite-metrics {
  margin-top: 0.8rem;
}

.card {
  background: var(--c-card);
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  max-width: 100%;
}

.step-info {
  cursor: help;
  font-size: 0.85em;
  color: var(--c-brand);
  font-weight: normal;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.6rem 0.9rem;
}

.form-grid-profile {
  grid-template-columns: 1fr;
}

.form-grid-profile input,
.form-grid-profile select {
  min-width: 0;
  width: 100%;
  max-width: 560px;
}

.form-grid label {
  font-size: 0.88rem;
  color: #334155;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  font: inherit;
  padding: 0.58rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.form-grid__full {
  grid-column: 1 / -1;
}

.capacity-recommendation {
  margin: 0.9rem 0 0.75rem;
  border: 1px solid #dbe4ee;
  border-left: 4px solid #0f4c81;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #f8fbff;
}

.capacity-recommendation strong {
  display: block;
  color: #0f172a;
}

.capacity-recommendation__summary {
  margin: 0.35rem 0 0.3rem;
  color: #0f172a;
}

.capacity-recommendation--core {
  border-left-color: #0f4c81;
}

.capacity-recommendation--available {
  border-left-color: #0f766e;
  background: #f2fbf8;
}

.capacity-recommendation--review {
  border-left-color: #b45309;
  background: #fff8ec;
}

.mono-input {
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.panel-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.panel-toggle button.active {
  background: #e6f4ff;
  border-color: var(--c-brand);
}

.territory-panel {
  display: none;
}

.territory-panel.active {
  display: block;
}

.map-shell {
  margin-top: 0.8rem;
}

.map-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.map-canvas {
  width: 100%;
  height: 360px;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #edf6ff 0%, #f8fbff 100%);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 0.6rem;
}

.metric-card {
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  padding: 0.7rem;
  background: #fbfdff;
}

.metric-label {
  color: var(--c-muted);
  font-size: 0.78rem;
}

.metric-value {
  margin-top: 0.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.timeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.timeline-table th,
.timeline-table td {
  border-bottom: 1px solid #dbe4ee;
  padding: 0.45rem;
  text-align: left;
  vertical-align: top;
}

.timeline-table th {
  color: #334155;
  background: #f8fbff;
}

.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.2rem;
  max-width: 100%;
}

.json-box {
  margin-top: 0.7rem;
  background: #f8fbff;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  padding: 0.72rem;
  overflow-x: auto;
  font-size: 0.83rem;
  max-width: 100%;
}

.record-list {
  display: grid;
  gap: 0.65rem;
}

.record-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  padding: 0.72rem;
  background: #fbfdff;
}

.record-row p {
  margin: 0.35rem 0 0;
}

.pill {
  display: inline-block;
  border: 1px solid #c8d6e5;
  background: #f8fbff;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.74rem;
  color: #334155;
}

/* ---- Localtrade auth / login ---- */
.login-page .topbar { display: none; }
.login-page .main { padding: 0; }

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(70% 55% at 50% -5%, rgba(0, 153, 255, 0.12), transparent 62%),
    linear-gradient(rgba(0, 153, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 153, 255, 0.045) 1px, transparent 1px),
    var(--c-bg);
  background-size: auto, 26px 26px, 26px 26px, auto;
}

.login-shell {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem 3.5rem;
}

.auth-card {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  background: var(--c-card);
  border: 1px solid #e6ebf2;
  border-radius: 20px;
  padding: 1.9rem 1.7rem;
  box-shadow: 0 26px 64px -30px rgba(2, 40, 110, 0.4);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.auth-logo img {
  height: 50px;
  width: auto;
  max-width: 90%;
}

.auth-card h1 {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  margin: 0.9rem 0 0.4rem;
}

.auth-card > p {
  text-align: center;
  color: var(--c-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 auto 1.1rem;
  max-width: 32ch;
}

.auth-next {
  font-size: 0.85rem;
}

.auth-next code {
  background: #eef4fb;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
}

/* legacy non-public brand row */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.auth-brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.auth-brand-title {
  font-weight: 700;
  color: #0f172a;
}

.auth-brand-meta {
  color: var(--c-muted);
  font-size: 0.82rem;
}

.auth-form {
  display: grid;
  gap: 0.7rem;
}

.auth-choice-panel {
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  padding: 1rem 1rem 1.05rem;
  background: #fafcff;
}

.auth-choice-panel + .auth-choice-panel,
.auth-form + .auth-choice-panel,
.auth-choice-panel + .auth-footer {
  margin-top: 0.85rem;
}

.auth-choice-panel--primary {
  border-color: #cfe4ff;
  background: linear-gradient(180deg, #f2f8ff, #ffffff);
}

details.auth-choice-panel > summary {
  cursor: pointer;
  font-weight: 750;
  color: #334155;
  font-size: 0.92rem;
  list-style: none;
}

details.auth-choice-panel > summary::-webkit-details-marker { display: none; }
details.auth-choice-panel > summary::after { content: " ›"; color: var(--c-muted); }
details.auth-choice-panel[open] > summary::after { content: " ⌄"; }
details.auth-choice-panel[open] > summary { margin-bottom: 0.6rem; }

.auth-choice-panel label {
  display: block;
  font-size: 0.76rem;
  font-weight: 750;
  color: #334155;
  margin: 0.4rem 0 0.3rem;
}

.auth-form > label {
  font-size: 0.76rem;
  font-weight: 750;
  color: #334155;
}

.auth-form input {
  font: inherit;
  width: 100%;
  height: var(--input-height);
  padding: 0 var(--input-padding-x);
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #fff;
}

.auth-form input:focus {
  outline: 2px solid var(--c-brand);
  outline-offset: 1px;
  border-color: var(--c-brand);
}

.auth-form .btn,
.auth-form button {
  font: inherit;
  font-weight: 800;
  height: 46px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 0.6rem;
  background: var(--c-brand);
  color: #fff;
}

.auth-form .btn-outline {
  background: #fff;
  color: var(--c-brand);
  border: 1.5px solid var(--c-brand);
}

.auth-form .btn-ghost {
  background: #eef4fb;
  color: #1f2937;
}

.auth-form .btn:active,
.auth-form button:active { transform: translateY(1px); }

.auth-hint {
  color: var(--c-muted);
  font-size: 0.8rem;
  margin: 0.5rem 0 0;
}

.auth-status {
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
  min-height: 1rem;
}

.auth-footer {
  text-align: center;
  color: var(--c-muted);
  font-size: 0.8rem;
  margin-top: 1.1rem;
}

.auth-footer strong { color: var(--c-brand); }

.muted {
  color: var(--c-muted);
  font-size: 0.92rem;
}

.login-powered,
.brand-company {
  color: var(--c-brand);
  font-size: 0.84rem;
}

.login-powered {
  margin-top: 0.9rem;
}

.qr-wrap img {
  max-width: 220px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
}

.flashes {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.flash {
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.flash-success {
  background: #e9f8e9;
}

.flash-error {
  background: #ffeaea;
}

/* Public LAN pages (pilot v1.1) */
.lan-hub-hero .lan-hub-brand,
.lan-member-hero .lan-member-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.lan-hub-hero .brand-paw,
.lan-member-hero .brand-paw {
  width: 48px;
  height: 48px;
}

.lan-hub-title,
.lan-member-title {
  margin: 0 0 0.2rem 0;
  font-size: 1.25rem;
}

.lan-hub-meta,
.lan-member-meta {
  margin: 0;
  color: var(--c-muted);
  font-size: 0.9rem;
}

.lan-members-section h2 {
  margin: 0 0 0.6rem 0;
  font-size: 1rem;
}

.lan-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lan-member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.lan-member-row:last-child {
  border-bottom: none;
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.member-name {
  font-weight: 600;
  color: var(--c-brand);
  text-decoration: none;
}

.member-name:hover {
  text-decoration: underline;
}

.member-trade {
  font-size: 0.85rem;
  color: var(--c-muted);
}

.member-wa {
  font-size: 0.9rem;
  color: #25d366;
  text-decoration: none;
}

.member-wa:hover {
  text-decoration: underline;
}

.btn-whatsapp {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #25d366;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.btn-whatsapp:hover {
  background: #20bd5a;
}

.member-ctas {
  margin-top: 1rem;
}

.short-link-wrap {
  word-break: break-all;
}

.short-link-wrap .btn-copy {
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.qr-hint {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--c-muted);
}

.loading-note,
.empty-note,
.error-note {
  color: var(--c-muted);
  font-style: italic;
}

.error-note {
  color: #dc2626;
}

html[dir="rtl"] .topbar,
html[dir="rtl"] .actions,
html[dir="rtl"] .nav {
  flex-direction: row-reverse;
}

@media (max-width: 880px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand,
  .brand-lockup,
  .brand-stack,
  .nav,
  .actions {
    width: 100%;
  }

  .nav {
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .record-row {
    flex-direction: column;
  }

  .map-canvas {
    height: 280px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .public-join-facts {
    grid-template-columns: 1fr;
  }

  .visual-patch-stage,
  .visual-reach-panel,
  .visual-geometry-panel,
  .visual-patch-facts {
    grid-template-columns: 1fr;
  }

  .visual-reach-options {
    grid-template-columns: 1fr;
  }

  .food-stops-grid,
  .food-stop-profile-grid,
  .food-stop-profile-facts {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .setup-choice-grid,
  .setup-branch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    margin: 0.75rem auto;
    padding: 0 0.75rem;
  }

  .journey-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .journey-btn,
  .journey-actions--nested .journey-btn {
    width: 100%;
  }

  .setup-step__head {
    flex-direction: column;
  }
}

.public-join-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--c-muted);
  line-height: 1.5;
  cursor: pointer;
}

.public-join-consent input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
}

.public-join-founder__standard {
  margin: 0 0 0.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(107, 114, 128, 0.5);
}

.public-join-founder__saving {
  margin: 0 0 0.4rem;
  font-weight: 800;
  color: var(--c-brand);
}
