/* ---------------------------------------------------------------------------
   Dot Micro Enquiry Manager — brand styling.

   Taken from the live site (dot-micro.com) by inspecting computed styles on
   2026-09-21, not from memory or the archived snapshot:

     headings  Epilogue, tight negative tracking (-2.5px at 60px), capitalised
     body      Mulish 300, colour #595959
     page      #f5f5f5
     dark      #121212 / #000000  (the logo is a WHITE wordmark: it only ever
                                   sits on a dark surface)
     accent    #FF7500
     buttons   pill, border-radius 100px, padding 20px 40px
     arrows    circle, border-radius 50%

   The aim is that opening this on his phone feels like the same business as
   his website, not a third piece of software with its own opinions.

   One deliberate departure: the site sets body copy at weight 300, which is
   right at desktop sizes on a large screen. On a phone, in a bright studio,
   the things Mark actually reads - messages, snippets, panel text - are set
   at 400. Headings and large text keep the site's weights exactly.
   --------------------------------------------------------------------------- */

/* Self-hosted, subset to Latin, variable weight. No third-party request on a
   page that shows clinical photographs, no render-blocking import, and the
   fonts work offline once the shell is cached. */
@font-face {
  font-family: 'Epilogue';
  src: url('/fonts/epilogue.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mulish';
  src: url('/fonts/mulish.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand */
  --dm-orange: #ff7500;
  --dm-orange-ink: #b85400;
  --dm-black: #000000;
  --dm-charcoal: #121212;
  --dm-page: #f5f5f5;
  --dm-white: #ffffff;
  --dm-body: #595959;
  --dm-steel: #54595f;

  /* Derived */
  --ink: var(--dm-black);
  --ink-2: var(--dm-body);
  --ink-3: #8b8b8b;
  --line: #e4e4e4;
  --line-strong: #d2d2d2;
  --bg: var(--dm-page);
  --card: var(--dm-white);

  /* Status. Orange is the brand, so it cannot also mean "danger". */
  --ok: #1f7a4d;
  --warn: var(--dm-orange-ink);
  --bad: #c0392b;
  --ai: var(--dm-steel);

  --radius: 14px;
  --pill: 100px;
  --tap: 46px;
  --bar-h: 50px;

  --head: 'Epilogue', 'Segoe UI', system-ui, sans-serif;
  --body: 'Mulish', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

html {
  /* No grey flash on tap, no rubber-band at the page edges inside the
     standalone app, and no 300ms tap delay on older WebKit. */
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100dvh; }

main {
  padding: 14px 16px calc(40px + env(safe-area-inset-bottom));
  max-width: 760px;
  margin: 0 auto;
}
/* A page with a fixed composer at the foot needs room to scroll past it. */
body.has-composer main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

button, a, summary, label, input, textarea { touch-action: manipulation; }

/* ---- top bar: dark, like the site header over its hero ---- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: var(--dm-charcoal);
  color: var(--dm-white);
}
.bar .logo { height: 21px; width: auto; display: block; }
.bar-title {
  font-family: var(--body);
  font-weight: 300;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.62);
  margin-left: auto;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.back {
  color: var(--dm-white);
  text-decoration: none;
  font-weight: 400;
  font-size: 15px;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.back .arrow {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

/* Reach strip: what this installation can actually message right now. Sits
   under the header on every screen, because a safety rail nobody can see is
   one people forget is there. Hidden in live mode - a permanent banner during
   normal running is noise, and noise gets ignored. */
.reach {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-family: var(--body);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.reach .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.reach-simulation { background: #ececec; color: #4a4a4a; }
.reach-simulation .dot { background: #9a9a9a; }
.reach-pilot { background: #fff1e2; color: #8a4a00; }
.reach-pilot .dot { background: var(--dm-orange); }

/* ---- headings, in the site's voice ---- */

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 400;
  color: var(--dm-black);
  letter-spacing: -0.04em;
  margin: 0;
}
h2.section {
  font-size: 12.5px;
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 26px 0 10px;
}
h3 { font-size: 22px; line-height: 1.2; }

/* ---- page header for a person or a case ---- */

.who-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}
.who-header h1 { font-size: 28px; line-height: 1.1; font-weight: 500; letter-spacing: -0.035em; }
.who-header .sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.who-header .sub b { font-weight: 600; color: var(--ink-2); }
.who-header .ref-link {
  flex: none;
  font-size: 13px;
  padding: 9px 14px;
  min-height: 40px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--dm-black);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ---- view tabs ---- */

.views {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
  scrollbar-width: none;
  /* A soft edge says "there is more this way" without a scrollbar. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.views::-webkit-scrollbar { display: none; }
.views a {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.views a:last-child { margin-right: 28px; }
.views a[aria-current='page'] {
  background: var(--dm-black);
  color: var(--dm-white);
  border-color: var(--dm-black);
  font-weight: 600;
}
.views .count {
  margin-left: 7px;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
  font-weight: 400;
}
.views a[aria-current='page'] .count { opacity: 0.75; }

/* ---- enquiry cards ---- */

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 13px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, background-color 120ms ease;
}
.card:active { transform: scale(0.985); background: #fbfbfb; }
.card.alert { border-left: 3px solid var(--dm-orange); }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.name {
  font-family: var(--head);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.03em;
  color: var(--dm-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.when { color: var(--ink-3); font-size: 12.5px; flex: none; font-variant-numeric: tabular-nums; }
.ref {
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.snippet {
  display: block;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 400;
  margin: 5px 0 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.meta { color: var(--ink-3); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; }

/* The one line that says what Mark has to do. Orange, first, alone. */
.need-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dm-orange-ink);
}
.need-line .due { font-weight: 400; color: var(--ink-3); }
.need-line .due.overdue { color: var(--bad); font-weight: 600; }

/* ---- chips ---- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip {
  font-size: 12px;
  font-weight: 400;
  padding: 4px 11px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  background: transparent;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chip.need {
  border-color: var(--dm-orange);
  color: var(--dm-orange-ink);
  background: #fff4ea;
  font-weight: 600;
}
.chip.ok { border-color: #b4d6c3; color: var(--ok); background: #f1f8f4; }
.chip.warn { border-color: #e8bfb9; color: var(--bad); background: #fdf2f0; }
.chip.ai { border-color: var(--line); color: var(--ink-3); }
/* Status, not a call to action: it must never out-shout the orange line. */
.chip.stop { border-color: var(--line-strong); color: var(--ink-2); background: var(--dm-page); }

/* ---- panels ---- */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.panel.action { border-left: 3px solid var(--dm-orange); }
.panel h3 { margin: 0 0 8px; }
.panel p { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; font-weight: 400; }
.panel p:last-child { margin-bottom: 0; }
.panel .actions + .label { margin-top: 14px; }

/* What a form said: question small and grey, answer in the body voice. */
.facts { list-style: none; margin: 4px 0 10px; padding: 0; }
.facts li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.facts li:first-child { border-top: 0; padding-top: 2px; }
.facts li span { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }
.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-weight: 700;
  margin-bottom: 6px;
}
details.panel { padding: 0; }
details.panel > summary { padding: 14px 18px; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary h3 { margin: 0; font-size: 18px; }
details.panel > summary::after {
  content: '+';
  margin-left: auto;
  font-family: var(--head);
  font-size: 22px;
  color: var(--ink-3);
}
details.panel[open] > summary::after { content: '–'; }
details.panel > :not(summary) { padding: 0 18px; }
details.panel > :last-child { padding-bottom: 18px; }

/* The suggested wording Mark is asked to approve. Set apart so it reads as
   "this is what it would say", not as more explanation. */
.proposed {
  border-left: 2px solid var(--dm-orange);
  padding: 4px 0 4px 14px;
  margin: 10px 0 12px;
  font-size: 15.5px;
  font-weight: 400;
  color: var(--dm-black);
}
.proposed.blank { color: var(--ink-3); font-style: italic; }

/* ---- conversation: the lanes stay visually distinct ---- */

.msg {
  margin-bottom: 10px;
  padding: 12px 15px;
  border-radius: var(--radius);
  max-width: 88%;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.msg .who {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 700;
  margin-bottom: 5px;
}
.msg.client { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.ai { background: #ededed; border: 1px solid #e0e0e0; margin-left: auto; border-bottom-right-radius: 4px; }
.msg.operator {
  background: var(--dm-charcoal);
  border: 1px solid var(--dm-charcoal);
  color: rgba(255, 255, 255, 0.92);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.msg.operator .who { color: rgba(255, 255, 255, 0.55); }
.msg .state { font-size: 11.5px; margin-top: 7px; font-weight: 400; }
.msg .state.queued { color: var(--warn); }
.msg .state.sent { color: var(--ink-3); }
.msg.operator .state.sent { color: rgba(255, 255, 255, 0.55); }
.msg .state.delivered { color: var(--ok); }
.msg.operator .state.delivered { color: #8fd6ae; }
.msg .state.failed,
.msg .state.blocked { color: var(--bad); font-weight: 600; }
.msg.operator .state.blocked,
.msg.operator .state.failed { color: #ff9b8f; }
.msg .state.suppressed { color: var(--ink-3); font-style: italic; }

.interp {
  border-left: 2px solid var(--dm-orange);
  padding: 8px 14px;
  margin: 10px 0;
  font-size: 14px;
  color: var(--ink-2);
}
.interp .label { color: var(--dm-orange-ink); }

/* ---- photographs ---- */

.media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  background: var(--card);
  min-width: 130px;
}
.thumb.bad { border-color: #e8bfb9; background: #fdf2f0; color: var(--bad); }
.thumb b {
  display: block;
  font-family: var(--head);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: -0.02em;
  color: var(--dm-black);
}
.thumb.bad b { color: var(--bad); }
.thumb .sub { color: var(--ink-3); }

/* ---- forms and buttons ---- */

form { margin: 0; }
label { display: block; font-size: 13px; color: var(--ink-3); margin: 10px 0 4px; }
label input { margin-top: 4px; }
textarea,
input[type='text'],
input[type='search'],
input[type='datetime-local'] {
  width: 100%;
  font-family: var(--body);
  /* 16px is the smallest size iOS Safari will focus without zooming the page. */
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--dm-page);
  min-height: var(--tap);
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 96px; resize: vertical; }
textarea:focus,
input:focus { outline: 2px solid var(--dm-orange); outline-offset: 1px; border-color: transparent; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

button,
.btn {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  min-height: var(--tap);
  padding: 0 22px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--dm-black);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 100ms ease, filter 100ms ease;
}
button:active, .btn:active { transform: scale(0.97); filter: brightness(0.96); }
button.primary {
  background: var(--dm-orange);
  color: var(--dm-white);
  border-color: var(--dm-orange);
}
button.dark {
  background: var(--dm-black);
  color: var(--dm-white);
  border-color: var(--dm-black);
}
button.danger { color: var(--bad); border-color: #e0b7b1; }
button.quiet { border-color: transparent; background: transparent; color: var(--ink-2); font-weight: 400; }

/* ---- the reply composer: always within thumb's reach ---- */

.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.composer > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.composer .row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
  min-height: var(--tap);
  max-height: 160px;
  padding: 12px 16px;
  border-radius: 23px;
  background: var(--dm-page);
  resize: none;
  flex: 1;
}
.composer .send {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border-radius: 50%;
  background: var(--dm-orange);
  border-color: var(--dm-orange);
  color: var(--dm-white);
  font-size: 18px;
}
.composer .send:disabled { background: var(--line-strong); border-color: var(--line-strong); }
.composer .more-toggle {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 300;
  color: var(--ink-2);
}
.composer details { margin-top: 8px; }
.composer details > summary { display: none; }
.composer .more {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 8px;
}
.composer .more .wide { grid-column: 1 / -1; }
.composer .more button, .composer .more .btn { width: 100%; font-size: 14px; padding: 0 12px; }
.composer .more input[type='datetime-local'] { font-size: 14px; padding: 10px 12px; min-height: 42px; }
.composer .pending { margin: 6px 0 0; }
.composer .status { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* ---- odds and ends ---- */

.note { font-size: 13.5px; color: var(--ink-3); margin-top: 14px; }
.note a { color: var(--dm-orange-ink); }
.empty { text-align: center; color: var(--ink-3); padding: 48px 20px; font-size: 15px; }
.empty b { display: block; font-family: var(--head); font-weight: 400; font-size: 20px; color: var(--dm-black); margin-bottom: 6px; letter-spacing: -0.03em; }

.banner {
  border-radius: var(--radius);
  padding: 12px 15px;
  font-size: 13.5px;
  font-weight: 400;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
}
.banner.bad { border-color: #e0b7b1; color: var(--bad); background: #fdf2f0; }
.banner.info { border-color: #cfd8e3; background: #f3f6fa; color: #2f4a66; }
.banner.good { border-color: #b4d6c3; color: var(--ok); background: #f1f8f4; }

.source { font-size: 12.5px; color: var(--ink-3); }
details summary {
  cursor: pointer;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
/* A plain disclosure line says it can open. The panel variant has its own
   larger mark, defined with the panel. */
details:not(.panel) > summary::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(-45deg);
  transition: transform 150ms ease;
  flex: none;
  margin-right: 2px;
}
details:not(.panel)[open] > summary::before { transform: rotate(45deg); }

a { color: var(--dm-orange-ink); }

/* ---- media ---- */

.shot {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: var(--dm-page);
  margin-bottom: 8px;
}
.shot img { display: block; width: 100%; height: 120px; object-fit: cover; }
.shot.inline { margin-top: 8px; max-width: 220px; }
.shot.inline img { height: 160px; }
.thumb .shot { margin: -4px -4px 8px; }

audio { display: block; width: 100%; margin-top: 8px; max-width: 260px; }
.failed-media { color: var(--bad); }
input[type='file'] { display: none; }

/* ---- stats ---- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow);
}
.stat-value {
  font-family: var(--head);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.04em;
  color: var(--dm-black);
  line-height: 1.05;
}
.stat-label { font-size: 13.5px; color: var(--ink-2); font-weight: 400; }

/* ---- footer nav ---- */

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.footer-links a {
  flex: 1 1 auto;
  text-align: center;
  padding: 11px 14px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search { margin-bottom: 10px; }
.search input { padding: 11px 16px; border-radius: var(--pill); }

/* A refresh that changed something says so for a moment, then gets out of
   the way. Never a full-page flash. */
main.refreshed { animation: settle 500ms ease; }
@keyframes settle { from { opacity: 0.6; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
