/* FamCare component layer — built entirely from tokens.css.
   Load AFTER tokens.css. Never put a literal value in this file that isn't a token. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fc-paper);
  color: var(--fc-text);
  font-family: var(--fc-font-ui);
  font-size: var(--fc-size-body);
  line-height: var(--fc-lh-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fc-clay); text-decoration: none; }
a:hover { color: var(--fc-clay-hover); text-decoration: underline; }

:focus-visible { outline: none; box-shadow: var(--fc-focus-ring); border-radius: var(--fc-radius-sm); }

/* ---------- Type ---------- */
.fc-display-1, .fc-display-2, .fc-display-3, .fc-display-4 {
  font-family: var(--fc-font-display); font-weight: 400;
  line-height: var(--fc-lh-tight); color: var(--fc-text); margin: 0;
}
.fc-display-1 { font-size: var(--fc-size-d1); }
.fc-display-2 { font-size: var(--fc-size-d2); }
.fc-display-3 { font-size: var(--fc-size-d3); }
.fc-display-4 { font-size: var(--fc-size-d4); }
.fc-hero-numeral { font-family: var(--fc-font-display); font-size: var(--fc-size-hero); line-height: 1; }

.fc-eyebrow {
  font-size: var(--fc-size-eyebrow); font-weight: 600;
  letter-spacing: var(--fc-eyebrow-tracking); text-transform: uppercase;
  color: var(--fc-text-faint);
}
.fc-muted { color: var(--fc-text-muted); }
.fc-faint { color: var(--fc-text-faint); }

/* ---------- App shell ---------- */
.fc-app { display: flex; min-height: 100vh; }

.fc-rail {
  width: 248px; flex: none; background: var(--fc-ink); color: var(--fc-text-on-ink-2);
  padding: var(--fc-space-6) var(--fc-space-5);
  display: flex; flex-direction: column; gap: var(--fc-space-7);
}
.fc-rail__brand { display: flex; align-items: center; gap: var(--fc-space-3);
  font-family: var(--fc-font-display); font-size: 22px; color: var(--fc-text-on-ink); }
.fc-rail__mark { width: 32px; height: 32px; border-radius: var(--fc-radius-sm);
  background: var(--fc-clay); display: grid; place-items: center; color: #fff; }
.fc-rail__nav { display: flex; flex-direction: column; gap: var(--fc-space-1); }

.fc-navitem {
  display: flex; align-items: center; gap: var(--fc-space-3);
  min-height: var(--fc-control-h); padding: 0 var(--fc-space-4);
  border-radius: var(--fc-radius-sm); color: inherit; font-size: var(--fc-size-body);
  white-space: nowrap;
}
.fc-navitem:hover { background: var(--fc-ink-panel); text-decoration: none; color: var(--fc-text-on-ink); }
.fc-navitem[aria-current="page"] { background: var(--fc-ink-raised); color: var(--fc-text-on-ink); font-weight: 600; }
.fc-navitem__count { margin-left: auto; background: var(--fc-clay); color: #fff;
  font-size: var(--fc-size-xs); font-weight: 700; border-radius: var(--fc-radius-pill); padding: 2px 8px; }

.fc-rail__foot { margin-top: auto; border-top: 1px solid var(--fc-ink-line);
  padding-top: var(--fc-space-4); display: flex; align-items: center; gap: var(--fc-space-3); }

.fc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.fc-topbar {
  min-height: 72px; padding: 0 var(--fc-space-8);
  display: flex; align-items: center; justify-content: space-between; gap: var(--fc-space-4);
  border-bottom: 1px solid var(--fc-line); background: var(--fc-card);
}
/* The sharing model lives here and nowhere else. Quiet by design. */
/* Normal inline flow — NOT flex. Raw text next to a flex parent becomes an
   anonymous flex item that collapses to min-content and cannot be styled. */
.fc-context { font-size: var(--fc-size-sm); color: #5B6472; }
.fc-context strong { color: var(--fc-text); font-weight: 600; }
.fc-context__role { color: var(--fc-teal); font-weight: 500; }

.fc-banner {
  padding: var(--fc-space-3) var(--fc-space-8); display: flex; align-items: center; gap: var(--fc-space-3);
  font-size: var(--fc-size-sm); background: var(--fc-teal-soft); color: var(--fc-teal);
  border-bottom: 1px solid #D3E0E2;
}
.fc-banner > span { flex: 1 1 auto; min-width: 0; }

.fc-page { padding: var(--fc-space-7) var(--fc-space-8);
  display: flex; flex-direction: column; gap: var(--fc-space-6); }
.fc-page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--fc-space-5); }

/* ---------- Buttons — never below 44px ---------- */
.fc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--fc-space-2);
  min-height: var(--fc-control-h); padding: 0 var(--fc-space-5);
  border-radius: var(--fc-radius-sm); border: 1px solid transparent;
  font-family: inherit; font-size: var(--fc-size-body); font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.fc-btn:hover { text-decoration: none; }
.fc-btn--primary { background: var(--fc-clay); color: #fff; }
.fc-btn--primary:hover { background: var(--fc-clay-hover); color: #fff; }
.fc-btn--secondary { background: var(--fc-card); color: var(--fc-text); border-color: var(--fc-border-field); }
.fc-btn--secondary:hover { background: var(--fc-card-alt); }
.fc-btn--quiet { background: transparent; color: var(--fc-teal); padding: 0 var(--fc-space-2); }
.fc-btn--on-ink { background: transparent; color: var(--fc-text-on-ink-2); border-color: #46587A; }
.fc-btn--on-ink:hover { background: var(--fc-ink-panel); color: var(--fc-text-on-ink); }
.fc-btn--lg { min-height: var(--fc-control-h-lg); font-size: var(--fc-size-body-lg); }
.fc-btn--block { width: 100%; }
.fc-btn:disabled, .fc-btn[aria-disabled="true"] { background: #E2DDD6; color: #A29C93; border-color: transparent; cursor: not-allowed; }

/* ---------- Fields ---------- */
.fc-field { display: flex; flex-direction: column; gap: var(--fc-space-2); }
.fc-label { font-size: var(--fc-size-xs); font-weight: 600; color: var(--fc-text); }
.fc-input, .fc-select, .fc-textarea {
  min-height: 48px; padding: var(--fc-space-3) var(--fc-space-4);
  background: var(--fc-card); border: 1px solid var(--fc-border-field);
  border-radius: var(--fc-radius-sm); font-family: inherit;
  font-size: var(--fc-size-body-lg); color: var(--fc-text); width: 100%;
}
.fc-textarea { min-height: 96px; resize: vertical; }
.fc-input:focus, .fc-select:focus, .fc-textarea:focus {
  outline: none; border-color: var(--fc-teal); box-shadow: var(--fc-focus-ring);
}
.fc-input[aria-invalid="true"] { border-color: var(--fc-clay); }
.fc-field__error { font-size: var(--fc-size-xs); color: var(--fc-clay); font-weight: 500; }
.fc-field__hint { font-size: var(--fc-size-xs); color: var(--fc-text-muted); }

.fc-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--fc-space-4);
  min-height: var(--fc-control-h); padding: 0 var(--fc-space-4);
  background: var(--fc-neutral-soft); border-radius: var(--fc-radius-sm); }

/* ---------- Cards ---------- */
.fc-card {
  background: var(--fc-card); border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-md); padding: var(--fc-space-6);
  box-shadow: var(--fc-shadow-card);
}
.fc-card__head { display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--fc-space-4); margin-bottom: var(--fc-space-4); }

/* The atom of the product. Left border carries status. */
.fc-appt { display: block; background: var(--fc-card); border: 1px solid var(--fc-line);
  border-left: 4px solid transparent; border-radius: var(--fc-radius-md);
  padding: var(--fc-space-5); color: inherit; }
.fc-appt:hover { border-color: var(--fc-border-field); text-decoration: none; }
.fc-appt--action-needed { border-left-color: var(--fc-clay); }
.fc-appt--prep-needed  { border-left-color: var(--fc-amber); }
.fc-appt--confirmed    { border-left-color: var(--fc-teal); }
.fc-appt__when { display: flex; align-items: center; gap: var(--fc-space-2);
  font-size: var(--fc-size-xs); font-weight: 600; color: var(--fc-text-muted); }
.fc-appt--action-needed .fc-appt__when { color: var(--fc-clay); }
.fc-appt__what { font-size: 17px; font-weight: 600; margin-top: var(--fc-space-2); }
.fc-appt__who { font-size: var(--fc-size-sm); color: var(--fc-text-muted); margin-top: var(--fc-space-1); }

/* Ink block = what's next. Never chrome. */
.fc-hero { background: var(--fc-ink); color: var(--fc-text-on-ink);
  border-radius: var(--fc-radius-lg); padding: var(--fc-space-7);
  display: flex; gap: var(--fc-space-8); align-items: flex-start; }
.fc-hero__date { flex: none; text-align: center;
  padding-right: var(--fc-space-8); border-right: 1px solid var(--fc-ink-line); }
.fc-hero__body { flex: 1; min-width: 0; }
.fc-hero__eyebrow { font-size: var(--fc-size-eyebrow); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--fc-clay-on-ink); }
.fc-hero__meta { display: flex; flex-direction: column; gap: var(--fc-space-2);
  font-size: var(--fc-size-body-lg); color: var(--fc-text-on-ink-2); }
.fc-hero__panel { flex: none; width: 224px; background: var(--fc-ink-panel);
  border-radius: var(--fc-radius-sm); padding: var(--fc-space-4) var(--fc-space-5); }
.fc-hero__actions { display: flex; gap: var(--fc-space-3); margin-top: var(--fc-space-5); flex-wrap: wrap; }

/* ---------- Badges — four values, no more ---------- */
.fc-badge { display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fc-size-eyebrow); font-weight: 600;
  padding: 5px var(--fc-space-3); border-radius: var(--fc-radius-pill); }
.fc-badge--action-needed { background: var(--fc-clay-soft); color: var(--fc-clay); }
.fc-badge--prep-needed   { background: var(--fc-amber-soft); color: var(--fc-amber-text); }
.fc-badge--confirmed     { background: var(--fc-teal-soft); color: var(--fc-teal); }
.fc-badge--past          { background: var(--fc-neutral-soft); color: #5B6472; }

/* ---------- People ---------- */
.fc-avatar { width: 44px; height: 44px; flex: none; border-radius: var(--fc-radius-pill);
  background: var(--fc-avatar); color: var(--fc-text);
  display: grid; place-items: center; font-weight: 600; font-size: var(--fc-size-sm); }
.fc-avatar--sm { width: 34px; height: 34px; font-size: var(--fc-size-xs); }
.fc-avatar--lg { width: 52px; height: 52px; font-size: 17px; }
.fc-avatar--ink { background: var(--fc-ink); color: var(--fc-text-on-ink); }

.fc-person { display: flex; align-items: center; gap: var(--fc-space-3); }
.fc-person__name { font-size: var(--fc-size-body-lg); font-weight: 600; }
.fc-person__role { font-size: var(--fc-size-sm); color: var(--fc-text-muted); }

/* ---------- Rows & tables ---------- */
.fc-list { display: flex; flex-direction: column; }
.fc-row { display: flex; align-items: center; gap: var(--fc-space-4);
  min-height: var(--fc-control-h); padding: var(--fc-space-4) 0;
  border-top: 1px solid var(--fc-line-soft); }
.fc-row:first-child { border-top: 0; }
.fc-row__icon { width: 36px; height: 36px; flex: none; border-radius: var(--fc-radius-sm);
  display: grid; place-items: center; background: var(--fc-neutral-soft); color: #5B6472; }
.fc-row__icon--action-needed { background: var(--fc-clay-soft); color: var(--fc-clay); }
.fc-row__icon--prep-needed { background: var(--fc-amber-soft); color: var(--fc-amber-text); }
.fc-row__body { flex: 1; min-width: 0; }
.fc-row__title { font-size: var(--fc-size-body); font-weight: 600; }
.fc-row__sub { font-size: var(--fc-size-sm); color: var(--fc-text-muted); margin-top: 2px; }

.fc-table { width: 100%; border-collapse: collapse; background: var(--fc-card); }
.fc-table th { text-align: left; padding: var(--fc-space-3) var(--fc-space-5);
  background: var(--fc-card-alt); border-bottom: 1px solid var(--fc-line);
  font-size: var(--fc-size-eyebrow); font-weight: 600;
  letter-spacing: var(--fc-eyebrow-tracking); text-transform: uppercase; color: var(--fc-text-faint); }
.fc-table td { padding: var(--fc-space-4) var(--fc-space-5);
  border-bottom: 1px solid var(--fc-line-soft); font-size: var(--fc-size-body); vertical-align: middle; }
.fc-table tr:last-child td { border-bottom: 0; }
.fc-table tr[data-status="action-needed"] td { background: #FDFAF8; }

/* ---------- Segmented control (density, list/calendar) ---------- */
.fc-segmented { display: inline-flex; background: #EDEBE4; border-radius: var(--fc-radius-sm); padding: 4px; gap: 4px; }
.fc-segmented__opt { min-height: 36px; display: inline-flex; align-items: center;
  padding: 0 var(--fc-space-4); border-radius: 6px; border: 0; background: transparent;
  font-family: inherit; font-size: var(--fc-size-xs); color: #7A8290; cursor: pointer; }
.fc-segmented__opt[aria-pressed="true"] { background: var(--fc-card); color: var(--fc-text); font-weight: 600; }

/* ---------- Visualizations — four, and only four ---------- */
.fc-ribbon { position: relative; height: 62px; }
.fc-ribbon__track { position: absolute; inset: 18px 0 auto 0; height: 2px; background: var(--fc-line-soft); }
.fc-ribbon__elapsed { position: absolute; top: 18px; left: 0; height: 2px; background: var(--fc-clay); }
.fc-ribbon__dot { position: absolute; top: 13px; width: 12px; height: 12px;
  border-radius: var(--fc-radius-pill); transform: translateX(-50%); }
.fc-ribbon__dot--next { top: 11px; width: 16px; height: 16px; background: var(--fc-clay);
  border: 3px solid var(--fc-card); box-shadow: 0 0 0 1.5px var(--fc-clay); }
.fc-ribbon__dot--confirmed { background: var(--fc-teal); }
.fc-ribbon__dot--prep { background: var(--fc-amber); }
.fc-ribbon__label { position: absolute; top: 40px; transform: translateX(-50%);
  font-size: var(--fc-size-xs); color: var(--fc-text-muted); white-space: nowrap; }

.fc-runway { display: flex; flex-direction: column; gap: var(--fc-space-3); }
.fc-runway__head { display: flex; justify-content: space-between; font-size: var(--fc-size-sm); margin-bottom: 5px; }
.fc-runway__bar { height: 8px; border-radius: 4px; background: var(--fc-line-soft); overflow: hidden; }
.fc-runway__fill { height: 100%; }
.fc-runway__fill--urgent { background: var(--fc-clay); }
.fc-runway__fill--soon { background: var(--fc-amber); }
.fc-runway__fill--ok { background: var(--fc-teal); }

.fc-cadence { display: flex; align-items: center; gap: var(--fc-space-3); }
.fc-cadence__label { width: 96px; flex: none; font-size: var(--fc-size-xs); color: #4B5563; }
.fc-cadence__months { flex: 1; display: flex; gap: 3px; }
.fc-cadence__month { flex: 1; height: 18px; border-radius: 3px; background: var(--fc-line-soft); }
.fc-cadence__month--visit { background: var(--fc-ink); }
.fc-cadence__month--upcoming { background: var(--fc-clay); }
.fc-cadence__month--due { background: var(--fc-amber); }

.fc-meter { display: flex; gap: 5px; align-items: flex-end; height: 26px; }
.fc-meter__bar { width: 12px; border-radius: 3px; }
.fc-meter__bar--action-needed { background: var(--fc-clay); }
.fc-meter__bar--prep-needed { background: var(--fc-amber); }
.fc-meter__bar--confirmed { background: #DDE6E7; }

.fc-legend { display: flex; gap: var(--fc-space-4); font-size: var(--fc-size-eyebrow); color: var(--fc-text-faint); }
.fc-legend__key { width: 9px; height: 9px; border-radius: var(--fc-radius-pill);
  display: inline-block; margin-right: 6px; }

/* ---------- Empty state: a sentence and a button. No illustrations. ---------- */
.fc-empty { display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--fc-space-3); padding: var(--fc-space-8); }
.fc-empty__body { max-width: 38ch; color: var(--fc-text-muted); }

/* ---------- Mobile ---------- */
.fc-tabbar { position: sticky; bottom: 0; display: flex; background: var(--fc-card);
  border-top: 1px solid var(--fc-line); padding-top: var(--fc-space-3);
  padding-bottom: env(safe-area-inset-bottom, var(--fc-space-3)); }
.fc-tabbar__tab { flex: 1; min-height: var(--fc-control-h);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: var(--fc-size-eyebrow); color: var(--fc-text-faint); white-space: nowrap;
}
.fc-tabbar__tab[aria-current="page"] { color: var(--fc-clay); font-weight: 600; }

@media (max-width: 860px) {
  .fc-rail { display: none; }
  .fc-page { padding: var(--fc-space-5) var(--fc-space-4); gap: var(--fc-space-5); }
  .fc-topbar { padding: 0 var(--fc-space-4); }
  .fc-hero { flex-direction: column; gap: var(--fc-space-5); padding: var(--fc-space-5); }
  .fc-hero__date { padding-right: 0; border-right: 0; text-align: left; }
  .fc-hero__panel { width: 100%; }
}

/* ---------- Print: the summary a person carries to the office ---------- */
.fc-sheet { background: #fff; color: #000; padding: var(--fc-space-8); max-width: 8.5in; }
.fc-sheet__head { display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid var(--fc-ink); padding-bottom: var(--fc-space-4); }
.fc-sheet__block { border-top: 1px solid var(--fc-line); padding-top: var(--fc-space-5);
  margin-top: var(--fc-space-5); }
.fc-sheet__foot { border-top: 1px solid var(--fc-line); padding-top: var(--fc-space-4);
  margin-top: var(--fc-space-5); font-size: var(--fc-size-xs); color: var(--fc-text-faint); }

@media print {
  .fc-rail, .fc-topbar, .fc-tabbar, .fc-btn, .fc-banner { display: none !important; }
  body { background: #fff; }
  .fc-sheet { padding: 0; }
}

/* ---------- Utilities (the only ones. Do not add more.) ---------- */
.fc-stack { display: flex; flex-direction: column; gap: var(--fc-space-4); }
.fc-stack--tight { gap: var(--fc-space-2); }
.fc-stack--loose { gap: var(--fc-space-6); }
/* .fc-cluster is for runs of ELEMENTS only (buttons, badges, cards).
   Never put raw text directly inside it — use .fc-inline-icon for icon+text. */
.fc-cluster { display: flex; align-items: center; gap: var(--fc-space-3); flex-wrap: wrap; }

/* Icon followed by text. The text MUST be wrapped in its own <span>. */
.fc-inline-icon { display: flex; align-items: center; gap: var(--fc-space-2); }
.fc-inline-icon--top { align-items: flex-start; }
.fc-inline-icon > span { flex: 1 1 auto; min-width: 0; }
.fc-split { display: flex; align-items: center; justify-content: space-between; gap: var(--fc-space-4); }
.fc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--fc-space-5); }
.fc-grid-main { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--fc-space-5); }
@media (max-width: 860px) { .fc-grid-2, .fc-grid-main { grid-template-columns: 1fr; } }
.fc-icon { width: var(--fc-icon-md); height: var(--fc-icon-md); flex: none;
  stroke: currentColor; stroke-width: var(--fc-icon-stroke); fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.fc-icon--sm { width: var(--fc-icon-sm); height: var(--fc-icon-sm); }
.fc-icon--lg { width: var(--fc-icon-lg); height: var(--fc-icon-lg); }
