/* ═══════════════════════════════════════════════════════════════════════
   THE HONEY COMPANY — product stylesheet
   honey.css · v1.0 · October 2026

   Single source of truth for the Resident Portal UI. The reference document
   (docs/portal-visual-system.html) is generated FROM this file, so what you
   see there is what these classes produce. Do not fork these styles into
   component files; extend them here.

   Rules this file enforces (see docs/HONEY_BRAND.md and PORTAL_SPEC.md):
   · Six colours. No pure black/white as designed surfaces.
   · Text is one colour at three tones (100 / 65 / 50). Warm Gray is never
     text. Amber is never text below 18px on a light surface.
   · Every text colour below passes WCAG AA on the surface it sits on.
   · Type floor in the product: 12px for labels/buttons/badges, 13px for
     secondary text, 15px for body.
   · Touch targets ≥ 44px. Radius 2px. No shadows, gradients, or motion
     beyond the loading rule.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Colour ── */
  --honey-amber:      #D29B3A;
  --honey-midnight:   #0E223D;
  --honey-warm-black: #2C2C2A;
  --honey-cream:      #F8F5EF;
  --honey-stone:      #E8E2D5;
  --honey-warm-gray:  #8A8F98;   /* dividers, dots, non-text only */
  --honey-white:      #FFFFFF;   /* card surface on Cream; never a page background */

  /* ── Tone scale (one colour, three tones) ── */
  --tone-full: 1;
  --tone-secondary: .65;         /* passes AA on Cream, White and Midnight */
  --tone-the: .5;                /* the wordmark's "The" only — decorative */

  /* Derived text colours (same hue, different tone) */
  --text:            var(--honey-warm-black);
  --text-strong:     var(--honey-midnight);
  --text-secondary:  rgba(14, 34, 61, var(--tone-secondary));     /* 5.1:1 on white · 4.9:1 on cream */
  --text-on-dark:    var(--honey-cream);
  --text-on-dark-2:  rgba(248, 245, 239, var(--tone-secondary));  /* 6.9:1 on midnight */

  /* ── Type ── */
  --font-brand: "Optima", "Optima nova", "Candara", "Gill Sans", "Trebuchet MS", sans-serif;
  --font-legal: "Georgia", "Times New Roman", serif;   /* legal-instrument bodies only */

  --fs-display: 30px;   /* card value — the one number */
  --fs-h1: 26px;
  --fs-h1-mobile: 22px;
  --fs-title: 16px;     /* card title */
  --fs-body: 15px;
  --fs-secondary: 13px; /* meta, sub-lines — always --text-secondary */
  --fs-label: 12px;     /* labels, buttons, badges, segments, nav — the floor for tracked caps */
  --fs-floor: 11px;     /* absolute minimum anywhere (footers, legal) */
  --lh-body: 1.6;
  --lh-tight: 1.15;

  --track-caps: .18em;
  --track-wordmark: .20em;
  --wordsp-wordmark: .35em;

  /* ── Wordmark ── */
  --wm-size: 13px;
  --wm-size-mobile: 11px;

  /* ── Descriptor lockup (em = wordmark font-size) ── */
  --desc-size: .56em;
  --desc-gap-top: .42em;
  --desc-rule-w: .90em;
  --desc-rule-h: .04em;
  --desc-gap-bottom: .30em;

  /* ── Geometry ── */
  --radius: 2px;
  --rule: .5px solid var(--honey-stone);
  --touch: 44px;
  --gutter: 28px;
  --gutter-mobile: 16px;
  --bp: 720px;   /* single breakpoint (documentation; use the media query below) */
}

/* ═══ Base ═══ */
html { -webkit-text-size-adjust: 100%; }
body.honey,
.honey {
  background: var(--honey-cream);
  color: var(--text);
  font-family: var(--font-brand);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
}
.honey a { color: var(--text-strong); text-decoration: none; }
.honey a:hover { text-decoration: underline; text-underline-offset: .15em; }
.honey :focus-visible {
  outline: 2px solid var(--honey-midnight);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ═══ Wordmark ═══ */
.thc-wordmark {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: var(--wm-size);
  text-transform: uppercase;
  letter-spacing: var(--track-wordmark);
  word-spacing: var(--wordsp-wordmark);
  line-height: 1;
  white-space: nowrap;
  color: var(--text-strong);
}
.thc-wordmark .the { opacity: var(--tone-the); }
.thc-wordmark.is-reversed {
  color: var(--text-on-dark);
  -webkit-text-stroke: .008em currentColor;   /* restores optical weight on dark ground */
  paint-order: stroke fill;
}
.thc-descriptor { font-size: inherit; }
.thc-descriptor__rule {
  width: var(--desc-rule-w);
  height: var(--desc-rule-h);
  min-height: 2px;
  background: var(--honey-amber);
  margin: var(--desc-gap-top) 0 var(--desc-gap-bottom);
}
.thc-descriptor__text {
  font-size: var(--desc-size);
  text-transform: uppercase;
  letter-spacing: var(--track-wordmark);
  word-spacing: var(--wordsp-wordmark);
  opacity: var(--tone-secondary);
  line-height: 1;
}

/* ═══ App bar ═══ */
.app-nav {
  background: var(--honey-midnight);
  padding: 18px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.app-nav .thc-wordmark { flex-shrink: 0; }
.app-nav__items { display: flex; gap: 8px; align-items: center; }
.app-nav__item {
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-on-dark-2);
  padding: 16px 10px;             /* 44px tall touch target */
  border-bottom: 1px solid transparent;
  line-height: 1;
}
.app-nav__item.is-active { color: var(--honey-amber); border-bottom-color: var(--honey-amber); }
.app-nav__user {
  font-size: var(--fs-secondary);
  color: var(--text-on-dark-2);
  margin-left: 12px;
  padding: 16px 0;
}

/* ═══ Page scaffold ═══ */
.app-body { padding: var(--gutter); }
.crumb {
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.h1 { font-size: var(--fs-h1); color: var(--text-strong); letter-spacing: .02em; line-height: var(--lh-tight); margin-bottom: 6px; }
.h1-sub { font-size: var(--fs-secondary); color: var(--text-secondary); margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
/* Asymmetric two-column layouts. Use these, never inline grid-template-columns —
   an inline style defeats the mobile reset below. */
.grid-2--lead-left  { grid-template-columns: 1.2fr 1fr; }
.grid-2--lead-right { grid-template-columns: 1fr 1.2fr; }

/* ═══ Card ═══ */
.card {
  background: var(--honey-white);
  border: var(--rule);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.card__label {
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1;
}
/* Cards that need action carry the descriptor device — a short Amber rule.
   Amber marks the card; it is never the label's text colour. */
.card--action .card__label::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  background: var(--honey-amber);
  margin-bottom: 12px;
}
.card__value { font-size: var(--fs-display); color: var(--text-strong); line-height: 1; margin-bottom: 8px; }
.card__title { font-size: var(--fs-title); color: var(--text-strong); margin-bottom: 4px; line-height: 1.3; }
.card__sub { font-size: var(--fs-secondary); color: var(--text-secondary); line-height: 1.7; }

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0 22px;
  font-family: var(--font-brand);
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  line-height: 1;
  border-radius: var(--radius);
  border: .5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  margin: 14px 8px 0 0;
  background: none;
}
.btn:hover { text-decoration: none; }
.btn--primary     { background: var(--honey-midnight); color: var(--text-on-dark); }
.btn--secondary   { background: var(--honey-amber);    color: var(--text-strong); }   /* 6.5:1 */
.btn--tertiary    { background: var(--honey-white);    color: var(--text-strong); border-color: var(--honey-stone); }
.btn--ghost       { background: transparent;           color: var(--text-strong); border-color: var(--honey-stone); }
.btn--destructive { background: transparent;           color: var(--text-secondary); border-color: var(--honey-stone); }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: default; }

/* ═══ Rows (lists) ═══ */
.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: var(--rule);
  font-size: var(--fs-body);
  min-height: var(--touch);
}
.row:last-child { border-bottom: none; }
.row__l { color: var(--text); }
.row__r { color: var(--text-strong); text-align: right; flex-shrink: 0; }
.row__s { font-size: var(--fs-secondary); color: var(--text-secondary); margin-top: 3px; }
.row__r .row__s { text-align: right; }

/* ═══ Status badge — a word with a dot. The word carries the meaning. ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-strong);
  line-height: 1;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; box-sizing: border-box; background: var(--honey-stone); flex-shrink: 0; }
.badge--received::before,
.badge--reviewed::before      { background: transparent; border: 1.5px solid var(--text-secondary); }  /* queued: hollow ring */
.badge--scheduled::before,
.badge--in-progress::before   { background: var(--honey-amber); }                                    /* current */
.badge--completed::before     { background: var(--honey-midnight); }                                 /* done */
.badge--needs-information     { color: var(--text-secondary); }
.badge--needs-information::before { background: var(--honey-warm-gray); }                            /* waiting on resident */
.badge--cancelled             { color: var(--text-secondary); }
.badge--cancelled::before     { background: var(--honey-stone); }                                    /* closed, nothing done */

/* ═══ Forms ═══ */
.field { margin-bottom: 18px; }
.card__label + .field { margin-top: 20px; }
.field__label {
  display: block;
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1;
}
.field__hint { text-transform: none; letter-spacing: 0; opacity: .8; }
.input,
.textarea {
  width: 100%;
  min-height: var(--touch);
  border: var(--rule);
  border-radius: var(--radius);
  background: var(--honey-white);
  padding: 12px 14px;
  font-family: var(--font-brand);
  font-size: var(--fs-body);
  color: var(--text);
  line-height: 1.5;
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-secondary); opacity: 1; }
.input:focus, .textarea:focus { border-color: var(--honey-midnight); outline: 2px solid var(--honey-midnight); outline-offset: 2px; }
.input.is-focus { border-color: var(--honey-midnight); outline: 2px solid var(--honey-midnight); outline-offset: 2px; }  /* static demo of focus */
.placeholder { color: var(--text-secondary); }

/* Segmented control — up to five options; beyond that it's a list.
   Options wrap on narrow screens and the last row stretches to fill, so the
   control never clips a label and never collapses into a <select>. Each option
   draws its own right/bottom hairline; the negative margins tuck the outermost
   ones under the container border so nothing doubles. */
.seg {
  display: flex;
  flex-wrap: wrap;
  border: var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--honey-white);
}
.seg__opt {
  flex: 1 1 96px;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--honey-white);
  border-right: var(--rule);
  border-bottom: var(--rule);
  margin: 0 -.5px -.5px 0;
  cursor: pointer;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.seg__opt.is-on { background: var(--honey-midnight); color: var(--text-on-dark); }

.photos { display: flex; gap: 8px; margin-top: 8px; }
.photos__thumb { width: 64px; height: 64px; background: var(--honey-stone); border-radius: var(--radius); }
.photos__add   { width: 64px; height: 64px; background: var(--honey-white); border: .5px dashed var(--text-secondary); border-radius: var(--radius); }

/* ═══ Inline messages — nothing floats ═══ */
.msg {
  border-left: 2px solid var(--honey-amber);        /* success / confirmation */
  background: var(--honey-cream);
  padding: 14px 16px;
  font-size: var(--fs-secondary);
  line-height: 1.7;
  color: var(--text);
  margin-top: 16px;
}
.msg--error { border-left-color: var(--text-secondary); }   /* midnight at 65% — never red, never amber */
.alert {                                               /* standing information, e.g. the emergency line */
  border: var(--rule);
  border-left: 2px solid var(--honey-midnight);
  background: var(--honey-white);
  padding: 14px 16px;
  font-size: var(--fs-secondary);
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 18px;
}
.alert strong { font-weight: 400; color: var(--text-strong); }

/* ═══ Timeline ═══ */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 3.5px; top: 8px; bottom: 8px; width: .5px; background: var(--honey-stone); }
.tl { position: relative; padding-bottom: 16px; }
.tl::before { content: ""; position: absolute; left: -21px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--honey-stone); }
.tl--current::before { background: var(--honey-amber); }
.tl--done::before    { background: var(--honey-midnight); }
.tl__t { font-size: var(--fs-body); color: var(--text-strong); line-height: 1.3; }
.tl__d { font-size: var(--fs-secondary); color: var(--text-secondary); margin-top: 3px; }
/* The current step is named in text, not only by dot colour (WCAG 1.4.1). */
.tl__flag { font-size: var(--fs-label); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-secondary); margin-left: 10px; }

/* ═══ Loading — one amber rule. No spinner, no skeleton. ═══
   The rule is decorative: pair it with role="status" and visually-hidden text ("Loading")
   so assistive tech is told, since Amber on Cream does not meet 3:1 on its own. */
.loading { height: 2px; background: var(--honey-stone); position: relative; overflow: hidden; border-radius: 1px; }
.loading::after { content: ""; position: absolute; inset: 0; width: 30%; background: var(--honey-amber); animation: honey-sweep 1.2s ease-in-out infinite; }
@keyframes honey-sweep { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
@media (prefers-reduced-motion: reduce) { .loading::after { animation: none; left: 35%; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ═══ Empty state — one line of type ═══ */
.empty { font-size: var(--fs-body); color: var(--text-secondary); text-align: center; padding: 32px 0; }

/* ═══ Mobile — same product, one column ═══ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--honey-white);
  border-top: var(--rule);
  display: flex;
  justify-content: space-around;
  padding: 0 0 env(safe-area-inset-bottom);
}
.tabbar__item {
  flex: 1;
  min-height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-secondary);
  border-top: 2px solid transparent;
  margin-top: -.5px;
  line-height: 1;
}
.tabbar__item.is-active { color: var(--text-strong); border-top-color: var(--honey-amber); }

@media (max-width: 720px) {
  .app-nav { padding: 14px var(--gutter-mobile); }
  .app-nav .thc-wordmark { font-size: var(--wm-size-mobile); }
  .app-nav__items { display: none; }          /* destinations move to the tab bar */
  .app-body { padding: var(--gutter-mobile) var(--gutter-mobile) 80px; }
  .h1 { font-size: var(--fs-h1-mobile); }
  .grid-2, .grid-2--lead-left, .grid-2--lead-right, .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .card__value { font-size: 26px; }
  .btn { padding: 0 16px; }
}
