/* Phone org card (spec 2026-11-01 section 5). Ported from the approved
   mockup design/renders/mobile-card-forms-src (sheet-v2.html + cards.css).
   Everything is scoped under #org-card.mc-phone so desktop is untouched. */

/* Sheet contract inside the explorer. The sheet box rule is written as
   `html body #org-card.mc-phone` (1 id, 1 class, 2 elements) so it outranks
   the explorer's own card rules without restating values there:
   body.look-model #org-card (Model look chrome: background, radius,
   shadow; 1 id, 1 class, 1 element, and later in source order) and the
   <=760px media rule's max-height (36vh = 194px at 540 tall, under the
   sheet's fixed 218px). Only #org-card-mobile shows while the phone class
   is on; the desktop card body stays in the DOM for the desktop path. */
#org-card.mc-phone > :not(#org-card-mobile) { display: none; }
#org-card.mc-phone > #org-card-mobile { height: 100%; }

html body #org-card.mc-phone {
  --mc-canvas: var(--m-canvas, #f9fff7);
  --mc-ink: var(--m-ink, #242424);
  --mc-graphite: var(--m-graphite, #48524a);
  --mc-smoke: var(--m-smoke, #797776);
  --mc-lake: var(--m-lake, #2453b8);
  --mc-border: var(--m-border, #cad7c7);
  --mc-display: var(--m-display, Sentient, Georgia, serif);
  --mc-body: var(--m-body, 'Cabinet Grotesk', system-ui, sans-serif);
  --mc-mono: var(--m-mono, 'IBM Plex Mono', ui-monospace, monospace);
  position: absolute;
  left: 8px; right: 8px; bottom: 8px; top: auto;
  width: auto; max-width: none;
  height: min(218px, 42vh);
  max-height: none;
  padding: 0; margin: 0;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--mc-border);
  box-shadow: 0 -6px 26px #23443418;
  overflow: hidden;
  overscroll-behavior: auto; /* final fix 5: desktop #org-card keeps contain; let page scroll chain on phone */
  box-sizing: border-box;
  font-family: var(--mc-body);
  color: var(--mc-ink);
}
#org-card.mc-phone *, #org-card.mc-phone *::before, #org-card.mc-phone *::after { box-sizing: border-box; }

#org-card.mc-phone .mc {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  --tc: #37be9f; --tcd: #16765f; --tcl: #d9f4ec;
}
#org-card.mc-phone .mc::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--tc);
}
/* three paper treatments */
#org-card.mc-phone .mc--service { --tc: #f3947a; --tcd: #b4492b; --tcl: #fde6de; background: linear-gradient(180deg, #fffaf5, #fff 60%); }
#org-card.mc-phone .mc--builder { --tc: #9789f3; --tcd: #5443c4; --tcl: #e9e5fd; background: linear-gradient(180deg, #fbfaff, #fff 60%); }
#org-card.mc-phone .mc--operational { background: repeating-linear-gradient(180deg, #fff 0 25px, #f1f7f4 25px 26px); }

#org-card.mc-phone button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }

#org-card.mc-phone .mc-grab { width: 34px; height: 4px; border-radius: 4px; background: #d5ddd3; margin: 9px auto 0; flex: none; }
#org-card.mc-phone .mc-close { position: absolute; right: 12px; top: 10px; font-size: 15px; color: var(--mc-smoke); line-height: 1; z-index: 2; }

#org-card.mc-phone .mc-body {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 12px;
  padding: 6px 14px 0 15px;
  overflow: hidden;
}
#org-card.mc-phone .mc-story { min-width: 0; min-height: 0; overflow: hidden; }

#org-card.mc-phone .mc-tabs { flex: none; display: flex; border-top: 1px solid #e3e9e1; height: 36px; background: inherit; }
#org-card.mc-phone .mc-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  font: 600 12px var(--mc-body); color: var(--mc-smoke); position: relative;
}
#org-card.mc-phone .mc-tab--on { color: var(--mc-ink); }
#org-card.mc-phone .mc-tab--on::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--tc);
}
#org-card.mc-phone .mc-tab em {
  font: 600 10.5px var(--mc-mono); font-style: normal; padding: 2px 6px; border-radius: 999px; background: var(--tcl); color: var(--tcd);
}

/* seal column: same place and shape on every type */
#org-card.mc-phone .mc-sealcol { display: flex; flex-direction: column; align-items: center; padding-top: 6px; min-width: 0; }
#org-card.mc-phone .mc-seal {
  width: 98px; height: 98px; border-radius: 50%; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 38%, #fff 0%, var(--tcl) 100%);
  border: 2px solid var(--tc);
}
#org-card.mc-phone .mc-seal::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1.5px dashed var(--tc); opacity: .7; }
#org-card.mc-phone .mc-seal b { font: 500 40px/1 var(--mc-display); color: var(--tcd); letter-spacing: -.03em; margin-top: 2px; }
#org-card.mc-phone .mc-seal--three b { font-size: 34px; }
#org-card.mc-phone .mc-seal--four b { font-size: 28px; letter-spacing: -.04em; }
#org-card.mc-phone .mc-seal small { font: 600 8.5px/1 var(--mc-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--tcd); margin-top: 5px; }
#org-card.mc-phone .mc-stack { display: flex; gap: 3px; margin-top: 9px; justify-content: center; }
#org-card.mc-phone .mc-latest { margin-top: 5px; font: 500 10px/1.3 var(--mc-mono); color: var(--mc-graphite); text-align: center; white-space: nowrap; }

/* logos: the explorer's badge element, boxed to 22px */
#org-card.mc-phone .mc-logo { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 50%; }
#org-card.mc-phone .mc-logo > * { max-width: 100%; max-height: 100%; }
#org-card.mc-phone .mc-roof {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--tc);
}
#org-card.mc-phone .mc-roof--sm { width: 18px; height: 18px; }
#org-card.mc-phone .mc-roof > * { max-width: 100%; max-height: 100%; }

#org-card.mc-phone .mc-eyebrow {
  display: flex; align-items: center; gap: 7px; margin: 4px 0 0;
  font: 600 10px/1 var(--mc-mono); letter-spacing: .11em; text-transform: uppercase; color: var(--tcd);
}
#org-card.mc-phone .mc-dot { width: 9px; height: 9px; border-radius: 2px; background: var(--tc); flex: none; }
#org-card.mc-phone .mc-namerow { display: flex; align-items: center; gap: 9px; margin-top: 9px; min-width: 0; }
#org-card.mc-phone .mc-namerow p { margin: 0; min-width: 0; }
#org-card.mc-phone .mc-domain {
  font: 500 12.5px/1.15 var(--mc-body); color: var(--mc-graphite);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; word-break: break-word;
}
#org-card.mc-phone .mc-opdomain {
  font: 500 20px/1.12 var(--mc-display); letter-spacing: -.01em; word-break: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}

/* service: price tag */
#org-card.mc-phone .mc-pitch {
  font: 500 19px/1.18 var(--mc-display); letter-spacing: -.01em; margin: 7px 0 0; color: #2a2522;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; word-break: break-word;
}
#org-card.mc-phone .mc-tagrow { display: flex; gap: 6px; margin-top: 11px; align-items: center; }
#org-card.mc-phone .mc-ptag {
  position: relative; display: inline-flex; align-items: center; height: 28px; padding: 0 11px 0 22px;
  background: #2a2522; color: #fff; font: 600 12.5px var(--mc-mono); white-space: nowrap; max-width: 150px; overflow: hidden;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}
/* Final fix 3: long costs size to content, wrap if they must, never clip */
#org-card.mc-phone .mc-ptag--long { max-width: 100%; height: auto; min-height: 28px; padding-top: 4px; padding-bottom: 4px; white-space: normal; font-size: 12px; line-height: 1.2; }
#org-card.mc-phone .mc-ptag::before { content: ""; position: absolute; left: 9px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #fffaf5; }
#org-card.mc-phone .mc-chip {
  height: 26px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px;
  border: 1px solid #efcfc3; font: 400 12px var(--mc-body); color: #6b4a3f; background: #fff; white-space: nowrap;
}

/* builder: byline */
#org-card.mc-phone .mc-byline { display: flex; gap: 10px; align-items: center; margin-top: 9px; min-width: 0; }
#org-card.mc-phone .mc-byline > div:last-child { min-width: 0; }
#org-card.mc-phone .mc-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--tc); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; font: 500 16px var(--mc-display);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px #d9d3fb;
}
#org-card.mc-phone .mc-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden;
  font: 500 19px/1.1 var(--mc-display); letter-spacing: -.01em;
}
#org-card.mc-phone .mc-builds { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mc-graphite); margin-top: 3px; min-width: 0; }
#org-card.mc-phone .mc-buildsdom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#org-card.mc-phone .mc-bio {
  font: italic 400 15.5px/1.3 var(--mc-display); color: #3a3550; margin: 10px 0 0; padding-left: 10px; border-left: 2px solid #d9d3fb;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; word-break: break-word;
}
#org-card.mc-phone .mc-bio--full { margin-top: 4px; }
#org-card.mc-phone .mc-selfdec {
  display: inline-block; margin-top: 9px; font: 600 9.5px var(--mc-mono); letter-spacing: .08em; text-transform: uppercase;
  color: #8a6d12; border: 1px solid #e3c766; background: #fdf6db; border-radius: 999px; padding: 4px 8px;
}

/* operational: stamped record */
#org-card.mc-phone .mc-vstamp {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  font: 600 9.5px var(--mc-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mc-lake);
  border: 1.5px solid var(--mc-lake); border-radius: 5px; padding: 4px 7px; transform: rotate(-3deg); background: #fff;
}
#org-card.mc-phone .mc-kv { margin-top: 9px; font: 500 11px/1 var(--mc-mono); color: var(--mc-graphite); }
#org-card.mc-phone .mc-kv div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
#org-card.mc-phone .mc-kv b { color: var(--mc-ink); font-weight: 600; }

/* handshakes / third tab pages */
#org-card.mc-phone .mc-page { flex: 1; padding: 6px 14px 0; min-height: 0; overflow: hidden; }
#org-card.mc-phone .mc-ph { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 5px; padding-right: 22px;
  font: 600 10px/1 var(--mc-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mc-smoke); }
#org-card.mc-phone .mc-ph span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#org-card.mc-phone .mc-hrow {
  display: grid; grid-template-columns: 9px 22px auto minmax(0, 1fr) auto; gap: 8px; align-items: center;
  height: 28px; border-top: 1px solid #edf1eb; font-size: 12.5px;
}
#org-card.mc-phone .mc-d { width: 9px; height: 9px; border-radius: 2px; }
#org-card.mc-phone .mc-sq { font: 600 11.5px var(--mc-mono); color: var(--mc-lake); }
#org-card.mc-phone .mc-cp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mc-ink); min-width: 0; }
#org-card.mc-phone .mc-dt { font: 500 11px var(--mc-mono); color: var(--mc-smoke); }
#org-card.mc-phone .mc-more { display: block; text-align: center; font: 500 11.5px var(--mc-mono); color: var(--mc-smoke); margin-top: 5px; }

#org-card.mc-phone .mc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 58px; overflow: hidden; }
#org-card.mc-phone .mc-svline {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; padding-top: 6px;
  border-top: 1px solid #f3e2da; font-size: 12.5px; color: var(--mc-graphite);
}
#org-card.mc-phone .mc-svline b { font: 600 13px var(--mc-mono); color: var(--mc-ink); }
#org-card.mc-phone .mc-link { font: 600 12.5px var(--mc-body); color: var(--mc-lake); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#org-card.mc-phone .mc-line { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid #edf1eb; font: 500 11.5px var(--mc-mono); color: var(--mc-graphite); }
#org-card.mc-phone .mc-line b { color: var(--mc-ink); font-weight: 600; }
#org-card.mc-phone .mc-note {
  margin: 8px 0 0; font: 500 11px/1.3 var(--mc-body); color: var(--mc-graphite);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
#org-card.mc-phone .mc-note--tab { margin: 4px 0 0; font: 500 10px/1.3 var(--mc-body); color: var(--mc-smoke); -webkit-line-clamp: 1; line-clamp: 1; }
#org-card.mc-phone .mc-muted { font-size: 12px; color: var(--mc-smoke); }
#org-card.mc-phone .mc-credit { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; height: 24px; align-items: center; border-top: 1px solid #edf1eb; font-size: 12.5px; }

/* loading skeleton lines */
#org-card.mc-phone .mc-skel {
  height: 12px; border-radius: 6px; margin-top: 10px;
  background: linear-gradient(90deg, #ecf0ea 25%, #f6f8f4 50%, #ecf0ea 75%); background-size: 200% 100%;
  animation: mc-shimmer 1.4s linear infinite;
}
#org-card.mc-phone .mc-skel--1 { width: 92%; }
#org-card.mc-phone .mc-skel--2 { width: 78%; }
#org-card.mc-phone .mc-skel--3 { width: 55%; }
@keyframes mc-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { #org-card.mc-phone .mc-skel { animation: none; } }
