/* TechStone Field — modules/meetings.css — Meetings (BUILD-SPEC-v2 §8.1; Field fix A). Brand Light tokens from
 * app.css only; every rule keeps the app.css rulings (no sideways scroll, targets 44 px+, inputs 16 px, nowrap only
 * on pills/times — checked statically by test/field-app-css.test.js). Nothing is added to app.css itself.
 */

/* Fix A2 (A-10): a long subject is clamped to two lines in the title (it took 81 % of a 320×480 screen); the whole
   subject is in the Subject field. */
.mt-face .face-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* H1 (re-audit A2-4): the appointment sheet's title (a calendar subject can run to 230 characters) is clamped to three
   lines, so Start meeting is on screen when the sheet opens, even at 320 × 480. */
.mt-sheet-t {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  flex: 0 0 auto;
}

/* ------------------------------------------------------------------ Type picker */
.mt-groups { display: flex; flex-direction: column; gap: 20px; }
.mt-group h2, .mt-h { font: 600 13px/1.3 var(--f-body); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px; }
.mt-cards { display: flex; flex-direction: column; gap: 8px; }
.mt-card {
  min-height: 56px;
  padding: 12px 16px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 600 16px/1.3 var(--f-body);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.mt-card:active { border-color: var(--ink, var(--basalt)); }

/* ------------------------------------------------------------------ Quick form */
.hint { font: 400 14px/1.4 var(--f-body); color: var(--ink-soft); margin: 0; }
.mt-lab { font: 600 14px/1.3 var(--f-body); color: var(--ink, var(--basalt)); }
.mt-linked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--info-bg);
  color: var(--ink, var(--basalt));
  font: 500 14px/1.4 var(--f-body);
  overflow-wrap: anywhere;
}
.mt-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
}
.mt-section h2 { font: 600 15px/1.3 var(--f-body); margin: 0; }
.mt-section > * { min-width: 0; }
.mt-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }

/* Company / contact: a button that reads as a field and opens the search sheet. */
.mt-pick {
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px solid var(--grey-solid, var(--mineral));
  border-radius: 10px;
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 500 16px/1.3 var(--f-body);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.mt-pick:disabled { opacity: .55; }
.mt-pick .muted { font-weight: 400; }
.mt-unlinked { color: var(--warn); font-weight: 500; }

/* Chips: duration, outcome, substrate, setting, colleagues, systems — one toggle-button grid. */
.mt-chipgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-chipgrid[data-loading] { color: var(--ink-soft); font: 400 14px/1.4 var(--f-body); }
.chip-btn {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1.5px solid var(--btn-rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 500 15px/1.2 var(--f-body);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.chip-btn.on { border-color: var(--copper-deep); background: var(--p-cop-bg); color: var(--copper-deep); font-weight: 600; }
.chip-btn:disabled { opacity: .6; }

.mt-ck { display: flex; align-items: center; gap: 12px; min-height: 48px; font: 500 16px/1.3 var(--f-body); cursor: pointer; }
.mt-ck input { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--copper-solid, var(--basalt)); }

/* A status word that may be long ("Waiting to send", "Linked to appointment"): wraps, unlike app.css .chip. */
.mt-tag {
  display: inline-block;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--p-min-bg);
  color: var(--p-min);
  font: 600 13px/1.3 var(--f-body);
  overflow-wrap: anywhere;
}
.mt-tag-info { background: var(--card); color: var(--info); }
.mt-tag-warn { background: var(--p-amb-bg); color: var(--p-amb); }
.mt-tag-ok { background: var(--p-grn-bg); color: var(--p-grn); }

/* Visit updates (3 Nov 2026): notes logged on a calendar entry with no client, waiting for the rep to choose one. */
.mt-wait { border: 1.5px solid var(--btn-rule); border-left: 4px solid var(--p-amb); border-radius: 12px; background: var(--card); padding: 12px 14px; margin: 0 0 16px; display: grid; gap: 10px; }
.mt-wait-lead { font: 400 14px/1.45 var(--f-body); color: var(--ink-soft); margin: 0; }
.mt-wait-item { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--btn-rule); }
.mt-wait-item:first-of-type { border-top: 0; padding-top: 0; }
.mt-wait-subj { font: 600 15px/1.3 var(--f-body); color: var(--ink, var(--basalt)); overflow-wrap: anywhere; }
.mt-wait-meta { font: 400 13px/1.4 var(--f-body); color: var(--ink-soft); }
.mt-wait-body { font: 400 14px/1.45 var(--f-body); color: var(--ink, var(--basalt)); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7.3em; overflow-y: auto; background: var(--ground, var(--offwhite)); border-radius: 8px; padding: 8px 10px; }
.mt-wait-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-wait-btns .btn { flex: 1 1 150px; }
.mt-wait-pick { display: grid; gap: 6px; }
.mt-wait-pick[hidden] { display: none; }   /* the display rule above outranks the hidden attribute's own */
.mt-wait-pick input { width: 100%; min-height: 48px; font: 400 16px/1.3 var(--f-body); border: 1.5px solid var(--btn-rule); border-radius: 10px; padding: 10px 12px; background: var(--card); color: var(--ink, var(--basalt)); }
.mt-wait-msg { font: 500 13px/1.4 var(--f-body); color: var(--ink-soft); }

/* Capture: what is on the record, then the buttons that add more. */
.mt-capture-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-capture-btns { display: flex; flex-direction: column; gap: 8px; }

/* Stage (presentations and events). */
.mt-stage-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font: 400 14px/1.4 var(--f-body); overflow-wrap: anywhere; }
.mt-stage-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-stage-pick .btn { flex: 1 1 140px; }

/* ------------------------------------------------------------------ ActionBar (sticky, above the tab bar) */
/* Fix A2 (A-11): a form's face has no bottom padding, so the bar is flush with the bottom of the screen both while
   scrolling and at the end (bottom:-24px left a 24 px gap at scroll end). */
.mt-has-bar { padding-bottom: 0; }
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px calc(-1 * var(--gutter)) 0;
  padding: 10px var(--gutter);
  background: var(--card);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -6px 16px rgba(30, 31, 34, .08);
}
.action-bar .btn { flex: 1 1 140px; }

/* ------------------------------------------------------------------ Review */
.mt-review-acts { display: flex; flex-direction: column; gap: 14px; }
.mt-act { display: flex; flex-direction: column; gap: 6px; }

/* ------------------------------------------------------------------ List (L1: scrolls vertically) */
.mt-list { display: flex; flex-direction: column; gap: 8px; }
/* Fix A2 (A-11): list rows grow to two lines of subject instead of cutting it at one (app.css .srow is 72 px, 1 line). */
.mt-row { text-decoration: none; height: auto; min-height: var(--row-h); }
.mt-row .srow-subj { -webkit-line-clamp: 2; line-clamp: 2; }
.mt-row-static { cursor: default; }
#mt-local { display: flex; flex-direction: column; gap: 8px; }
#mt-local:empty { display: none; }

/* ------------------------------------------------------------------ Search sheet (company / contact)
   Fix A2 (A-2): rows never shrink below their text. They were flex items of a 40vh scroller inside the 60vh sheet (both
   flex columns), so a wrapped company name was squeezed into a 48 px row and drawn over the next one — a rep could
   tap the wrong CRM account. Now each row is as tall as its whole name, rows are 8 px apart, and the sheet itself
   (≤ 60 vh, app.css) is the only scroller. */
.mt-search-results { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; }
.mt-search-row {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 500 16px/1.3 var(--f-body);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.mt-search-row:active { border-color: var(--ink, var(--basalt)); }

/* Narrow phones: the two-up date/time row stacks; chip grids still wrap freely. */
@media (max-width: 359px) {
  .mt-row2 { grid-template-columns: minmax(0, 1fr); }
}
