/* ==========================================================================
   Cendraq — shared styles
   Concrete grey, graphite ink, hi-vis yellow. Barlow (highway-sign type).
   ========================================================================== */

:root {
  --bg: #e9edf1;
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --ink: #1e252d;
  --muted: #5a6672;
  --line: #d3dae1;
  --line-strong: #b8c2cc;
  --hi: #f4b400;          /* hi-vis yellow */
  --hi-ink: #1e252d;      /* text on yellow */
  --hi-soft: #fff1bf;
  --rec: #d7263d;
  --ok: #1d7f47;
  --ok-soft: #ddf3e6;
  --danger: #c0262f;
  --link: #1f5fbf;
  --focus: #1f5fbf;
  --shadow: 0 1px 0 rgba(30, 37, 45, .06), 0 6px 18px -10px rgba(30, 37, 45, .35);

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161b;
    --surface: #1b2128;
    --surface-2: #222a32;
    --ink: #e7ebef;
    --muted: #9aa6b2;
    --line: #2d3640;
    --line-strong: #3d4854;
    --hi: #f4b400;
    --hi-ink: #1a1f25;
    --hi-soft: rgba(244, 180, 0, .14);
    --rec: #f0485c;
    --ok: #4cc283;
    --ok-soft: rgba(76, 194, 131, .14);
    --danger: #f06470;
    --link: #7fb0ff;
    --focus: #7fb0ff;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-cond);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0;
}
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

a { color: var(--link); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

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

/* ---------- App shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.wordmark-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--hi);
  display: grid;
  place-items: center;
}
.wordmark-mark svg { width: 14px; height: 14px; color: var(--hi-ink); }

.nav { display: flex; gap: 4px; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--r-sm);
  position: relative;
}
.nav a svg { width: 18px; height: 18px; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--hi);
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}
.page.wide { max-width: 1120px; }

.page-head { margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* Phone: tabs move to a bottom bar within thumb reach */
@media (max-width: 720px) {
  .topbar .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--nav-h);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    justify-content: space-around;
    gap: 0;
  }
  .nav a {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    padding: 6px 4px;
  }
  .nav a svg { width: 22px; height: 22px; }
  .nav a[aria-current="page"]::after {
    top: -7px;
    bottom: auto;
    left: 28%;
    right: 28%;
    border-radius: 0 0 3px 3px;
  }
  .page { padding-bottom: calc(var(--nav-h) + 32px); }
  h1 { font-size: 26px; }
}

/* ---------- Surfaces ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
}
.panel + .panel { margin-top: 16px; }
.panel-title {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 12px;
}
.panel-sub { margin: -6px 0 6px; color: var(--muted); font-size: 15px; }
.section-title {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 18px;
  margin: 32px 0 12px;
}

/* ---------- Forms ---------- */

.field {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;   /* 16px stops iOS zooming into fields */
}
.field:hover { border-color: var(--muted); }
.field:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
textarea.field { resize: vertical; line-height: 1.45; min-height: 44px; }
select.field { appearance: auto; }

.label {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.label .field { margin-top: 6px; font-weight: 400; }
.label .hint { font-weight: 400; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { border-color: var(--muted); background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--hi); border-color: var(--hi); color: var(--hi-ink); }
.btn.primary:hover { filter: brightness(.96); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.btn.block { width: 100%; min-height: 50px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.is-saved { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- Status line ---------- */

.status { min-height: 24px; margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

/* ---------- Work-order ticket ---------- */

.tickets { display: grid; gap: 12px; }

.ticket {
  display: grid;
  grid-template-columns: 76px 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ticket-stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 6px;
  background: var(--surface-2);
  border-right: 2px dashed var(--line-strong);
  text-align: center;
}
/* punched notches where the stub tears off */
.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  right: -9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
}
.ticket-stub::before { top: -9px; }
.ticket-stub::after { bottom: -9px; }
.ticket-day {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
}
.ticket-month { font-weight: 600; font-size: 14px; color: var(--muted); margin-top: 2px; }
.ticket-year { font-size: 12px; color: var(--muted); }
.ticket.is-today .ticket-stub { background: var(--hi-soft); }

.ticket-body { padding: 14px 16px 14px 18px; min-width: 0; }
.ticket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.ticket-client {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.ticket-client a { color: inherit; text-decoration: none; }
.ticket-client a:hover { text-decoration: underline; }
.ticket-client.none { color: var(--muted); font-weight: 600; }
.ticket-where { margin-top: 2px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.ticket-where.solo { margin-top: 4px; }
.ticket-actions { display: flex; gap: 2px; flex-shrink: 0; margin: -4px -6px 0 0; }
.ticket-work.first { margin-top: 6px; }

.ticket-work { list-style: none; margin: 10px 0 0; padding: 0; }
.ticket-work li {
  position: relative;
  padding-left: 24px;
  margin-top: 4px;
  line-height: 1.4;
}
.ticket-work li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='%23fff' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}

.ticket-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.ticket-facts dt { color: var(--muted); }
.ticket-facts dd { margin: 0; overflow-wrap: anywhere; }
.ticket-facts .due { font-weight: 600; }

@media (max-width: 420px) {
  .ticket { grid-template-columns: 62px 1fr; }
  .ticket-day { font-size: 28px; }
  .ticket-body { padding: 12px 12px 12px 14px; }
  .ticket-facts { gap: 4px 10px; }
}
@media (max-width: 340px) {
  .ticket-facts { grid-template-columns: 1fr; gap: 0; }
  .ticket-facts dd { margin-bottom: 6px; }
}

/* ---------- Appointment / reminder cards ---------- */

.ticket-dow { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ticket.appt .ticket-stub { background: var(--ink); color: var(--surface); border-right-color: var(--ink); }
.ticket.appt .ticket-month,
.ticket.appt .ticket-dow { color: color-mix(in srgb, var(--surface) 75%, transparent); }
.ticket.appt.reminder .ticket-stub { background: var(--surface); color: var(--ink); border-right: 2px dashed var(--line-strong); }
.ticket.appt.reminder .ticket-month,
.ticket.appt.reminder .ticket-dow { color: var(--muted); }
.ticket.appt.reminder { border-style: dashed; border-color: var(--line-strong); box-shadow: none; }
.ticket.appt.is-done { opacity: .62; }
.ticket.appt.is-done .appt-title { text-decoration: line-through; text-decoration-thickness: 2px; }
.ticket.appt.overdue { border-color: var(--danger); }

.appt-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; font-weight: 600; }
.appt-kind { color: var(--muted); font-weight: 500; }
.appt-title { margin-top: 2px; }
.appt-sub { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.appt-sub a { color: var(--ink); font-weight: 600; }
.appt-notes { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}
.badge.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

/* Segmented control (Appointment | Reminder) */
.seg {
  display: inline-flex;
  margin-top: 14px;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg-btn {
  min-height: 36px;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.form-grid.tight { gap: 0 10px; }

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
}

/* ---------- Dialog (job editor, confirm) ---------- */

dialog.sheet {
  width: min(640px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45);
}
dialog.sheet::backdrop { background: rgba(18, 22, 27, .55); }
dialog.sheet[open] { animation: sheet-in .18s ease-out; }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sheet-body { padding: 4px 20px 20px; }
.sheet-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.sheet-foot .spacer { flex: 1; }
@media (max-width: 520px) {
  dialog.sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
    max-height: 92dvh;
  }
}

/* ---------- Client match hint ---------- */

.client-status { margin-top: 6px; font-size: 14px; font-weight: 400; min-height: 20px; color: var(--muted); }
.client-status.ok { color: var(--ok); font-weight: 600; }
.chip {
  display: inline-flex;
  align-items: center;
  margin: 4px 6px 0 0;
  padding: 4px 12px;
  min-height: 32px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { background: var(--hi); border-color: var(--hi); color: var(--hi-ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* ---------- Sign-in pages ---------- */

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth .wordmark { margin-bottom: 24px; font-size: 26px; }
.auth .wordmark-mark { width: 28px; height: 28px; border-radius: 7px; }
.auth .wordmark-mark svg { width: 18px; height: 18px; }
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 5px solid var(--hi);
  border-radius: var(--r-md);
  padding: 26px 24px 24px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 26px; }
.auth-card .lede { margin: 6px 0 4px; color: var(--muted); }
.auth-card .btn.block { margin-top: 22px; }
.auth-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 15px; }
.auth-foot a { font-weight: 600; }
.pw-wrap { position: relative; }
.pw-wrap .field { padding-right: 70px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-height: 32px;
  padding: 2px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--hi-soft);
  color: var(--ink);
  font-size: 15px;
}
.notice.ok { background: var(--ok-soft); }

/* ---------- Photos ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.photo-tile.uploading img { opacity: .45; }
.photo-tile.failed { border-color: var(--danger); }
.photo-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
}
.photo-tile.failed .photo-badge { color: var(--danger); }
.photo-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 22, 27, .72);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.photo-x svg { width: 16px; height: 16px; }
.photo-add {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.photo-add:hover { border-color: var(--ink); background: var(--surface-2); }
.photo-add svg { width: 28px; height: 28px; }

.ticket-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ticket-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
}
.ticket-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ticket-thumb.uploading { cursor: default; }
.ticket-thumb.uploading img { opacity: .45; }
.ticket-wait {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid var(--surface);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: ticket-spin .8s linear infinite;
}
@keyframes ticket-spin { to { transform: rotate(360deg); } }
.ticket-add {
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.ticket-add:hover { border-color: var(--ink); background: var(--surface-2); }
.ticket-add svg { width: 26px; height: 26px; }
.ticket-add-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 12px 4px 10px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ticket-add-pill:hover { border-color: var(--ink); background: var(--surface-2); }
.ticket-add-pill svg { width: 18px; height: 18px; }
@media (max-width: 420px) { .ticket-thumb { width: 58px; height: 58px; } }
.ticket-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(18, 22, 27, .58);
  color: #fff;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 18px;
}

/* Full-screen viewer */
dialog.viewer {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0d1014;
  color: #fff;
}
dialog.viewer[open] { display: flex; flex-direction: column; }
dialog.viewer::backdrop { background: #0d1014; }
.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
}
.viewer-count { font-weight: 600; }
.viewer-actions { display: flex; gap: 8px; }
.viewer .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }
.viewer .btn:hover { background: rgba(255, 255, 255, .18); }
.viewer .btn.danger { color: #ff8a93; }
.viewer .btn svg { width: 18px; height: 18px; }
.viewer-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px max(12px, env(safe-area-inset-bottom));
}
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.viewer-nav svg { width: 24px; height: 24px; }
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }

/* ---------- Install banner ---------- */

.install-banner {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 20px;
  padding: 12px 8px 12px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--hi);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}
.install-banner img { border-radius: 10px; display: block; }
.install-text { display: grid; gap: 2px; font-size: 15px; line-height: 1.4; }
.install-text strong { font-family: var(--font-cond); font-size: 17px; }
.install-text .btn { margin-left: 4px; vertical-align: middle; }
.share-glyph { display: inline-flex; vertical-align: -3px; color: var(--link); }
.share-glyph svg { width: 18px; height: 18px; }
.install-close { align-self: start; padding: 4px; min-height: 32px; }
.install-close svg { width: 18px; height: 18px; }

/* Installed app: no browser chrome, so keep the header clear of the notch in landscape */
@media (display-mode: standalone) {
  .topbar-inner { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
  box-shadow: var(--shadow);
}
@media (max-width: 720px) { .toast { bottom: calc(var(--nav-h) + 16px); } }

/* ---------- Plan & billing ---------- */

.plan-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--hi) 60%, var(--line));
  background: var(--hi-soft);
  text-align: left;
}
.plan-notice.stop {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.plan-notice-text { display: grid; gap: 2px; flex: 1 1 240px; font-size: 15px; }
.plan-notice-text strong { font-family: var(--font-cond); font-size: 17px; }
.plan-notice.stop .plan-notice-text strong { color: var(--danger); }
.plan-ask { font-size: 14px; color: var(--muted); }
.plan-line { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.plan-line a { color: var(--link); font-weight: 600; }

.plan-summary { display: grid; gap: 4px; }
.plan-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-name { font-family: var(--font-cond); font-weight: 700; font-size: 26px; line-height: 1.1; }
.plan-sub { margin: 0; color: var(--muted); }
.badge.hi { background: var(--hi); color: var(--hi-ink); }
.badge:not(.ok):not(.danger):not(.hi) { background: var(--surface-2); color: var(--muted); }

.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; margin-top: 14px; }
@media (max-width: 560px) { .meters { grid-template-columns: 1fr; } }
.meter-row { display: grid; gap: 6px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.meter-num { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ink); border-radius: inherit; }
.bar.high span { background: var(--hi); }
.bar.full span { background: var(--danger); }

.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
@media (max-width: 860px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.plan-card.current { border: 2px solid var(--ink); padding: 19px; }
.plan-card.popular { border-top: 6px solid var(--hi); padding-top: 15px; }
.plan-card.current.popular { padding-top: 14px; }
.plan-flag {
  position: absolute;
  top: -11px;
  right: 14px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
}
.plan-card h3 { margin: 0; font-family: var(--font-cond); font-size: 22px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-price b { font-family: var(--font-cond); font-size: 40px; line-height: 1; }
.plan-price span { color: var(--muted); }
.plan-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-feats li { position: relative; padding-left: 22px; }
.plan-feats li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .45em;
  width: 10px;
  height: 6px;
  border-left: 2.5px solid var(--ok);
  border-bottom: 2.5px solid var(--ok);
  transform: rotate(-45deg);
}
.plan-blurb { margin: 0; color: var(--muted); font-size: 15px; }
.plan-card .btn { margin-top: auto; }
.plan-note { margin: 0; font-size: 13px; color: var(--muted); }
.fine { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.fine + .fine { margin-top: 6px; }
.test-card { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.notice.error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.rec.is-paused { filter: grayscale(1); opacity: .45; }
.recorder .plan-notice { margin: 16px 0 0; }

/* ---------- Public pages: header, footer, legal ---------- */

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.site-head { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-head .topbar-inner { max-width: 1120px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
@media (max-width: 520px) { .head-actions .btn.ghost { display: none; } }

.site-foot { padding: 48px 0 32px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.3fr 1fr; gap: 32px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 460px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand .wordmark { font-size: 22px; }
.foot-brand p { margin: 10px 0 0; max-width: 34ch; }
.foot-owner { color: var(--ink); }
.foot-col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.foot-col h2 { margin: 0 0 4px; font-family: var(--font-cond); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.foot-col a { color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.foot-col a:hover { color: var(--ink); text-decoration: underline; }
.foot-base { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }

.legal-page { padding: 40px 0 72px; }
.legal-wrap { display: grid; grid-template-columns: 200px minmax(0, 720px); gap: 48px; justify-content: center; }
.legal-nav { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.legal-nav a {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.legal-nav a:hover { background: var(--surface); color: var(--ink); }
.legal-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); border-left-color: var(--hi); }
@media (max-width: 860px) {
  .legal-wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .legal-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .legal-nav a { border-left: none; border-bottom: 3px solid transparent; border-radius: var(--r-sm) var(--r-sm) 0 0; }
  .legal-nav a[aria-current="page"] { border-bottom-color: var(--hi); }
}
.legal { font-size: 17px; line-height: 1.65; }
.legal-kicker { margin: 0; font-family: var(--font-cond); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.legal h1 { margin: 6px 0 0; font-size: clamp(32px, 5vw, 44px); line-height: 1.05; }
.legal-meta { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.legal-short {
  margin: 28px 0 8px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--hi);
  border-radius: var(--r-md);
}
.legal-short h2 { margin: 0 0 6px; font-size: 18px; }
.legal-short ul { margin: 0; padding-left: 20px; }
.legal-short li + li { margin-top: 4px; }
.legal h2 { margin: 36px 0 8px; font-family: var(--font-cond); font-size: 23px; line-height: 1.2; scroll-margin-top: 90px; }
.legal h3 { margin: 20px 0 4px; font-size: 18px; }
.legal p { margin: 10px 0 0; }
.legal ul { margin: 10px 0 0; padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--link); }
.legal strong { font-weight: 700; }
.legal-contact { margin-top: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.legal-contact p { margin: 2px 0; }
.legal-agree { margin: 14px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.legal-agree a { color: var(--ink); font-weight: 600; }
.app-legal { margin: 28px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.app-legal a { color: var(--muted); }
.app-legal a:hover { color: var(--ink); }
.fine a { color: var(--link); }
.legal .legal-short h2 { margin: 0 0 6px; font-size: 18px; font-family: var(--font); }
@media (max-width: 860px) {
  .legal-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
  .legal-nav::-webkit-scrollbar { display: none; }
  .legal-nav a { flex: 0 0 auto; padding: 8px 10px; font-size: 15px; }
}

/* ---------- Work summary ---------- */
.ticket-send { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.ticket-sent { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--ok); font-weight: 600; overflow-wrap: anywhere; }
.ticket-sent svg { width: 16px; height: 16px; flex-shrink: 0; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin-top: 6px; }
@media (max-width: 520px) { .check-grid { grid-template-columns: 1fr; } }
.check-line { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 15px; font-weight: 600; cursor: pointer; }
.check-line input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--ink); }
.check-line .hint { font-weight: 400; }
.mail-preview-wrap { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #eef1f4; }
.mail-preview { display: block; width: 100%; height: 520px; border: 0; background: #eef1f4; }
.appt-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.notify-block { margin-top: 16px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.notify-block .check-line { padding: 2px 0; }
.seg.chips { display: flex; flex-wrap: wrap; margin-top: 8px; }
.btn.is-disabled { opacity: .55; }
.offline-note { text-align: left; margin-top: 14px; }
.queue-list { display: grid; gap: 10px; }
.queue-item { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.queue-item.active { border-color: var(--hi); box-shadow: inset 4px 0 0 var(--hi); }
.queue-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.queue-when { font-weight: 700; }
.queue-actions { display: flex; gap: 6px; }
.queue-item audio { width: 100%; margin-top: 8px; height: 36px; }

/* ---------- Money sub-tabs (Expenses & mileage | Quotes) ---------- */
.subtabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subtabs a {
  padding: 10px 14px; margin-bottom: -1px; border-bottom: 3px solid transparent;
  color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--hi); }
.subtabs .tab-short { display: none; }
@media (max-width: 480px) {
  .subtabs a { padding: 10px 11px; }
  .subtabs .tab-long { display: none; }
  .subtabs .tab-short { display: inline; }
}

/* ---------- Admin link (only for the person who runs Cendraq) ---------- */
.topbar-inner:has(.admin-link) { justify-content: flex-start; }
.topbar-inner:has(.admin-link) .nav { margin-left: auto; }
.admin-link {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.admin-link svg { width: 16px; height: 16px; }
.admin-link:hover { background: var(--surface-2); }
.admin-link[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
@media (max-width: 720px) { .admin-link { margin-left: auto; } }

/* Feedback button (top bar, every page) */
.topbar-inner:has(.feedback-link) { justify-content: flex-start; }
.topbar-inner:has(.feedback-link) .nav { margin-left: auto; }
.feedback-link {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.feedback-link svg { width: 16px; height: 16px; }
.feedback-link:hover { background: var(--surface-2); }
@media (max-width: 720px) {
  .feedback-link { margin-left: auto; }
  .feedback-link + .admin-link { margin-left: 8px; }
}
@media (min-width: 721px) and (max-width: 1000px) {
  /* Tablet widths: icons only for Feedback and Admin, tighter tabs */
  .feedback-link, .admin-link { padding: 7px 9px; }
  .feedback-link span, .admin-link span { display: none; }
  .topbar .nav a { padding: 8px 9px; gap: 6px; }
}
@media (min-width: 721px) and (max-width: 860px) {
  .topbar .wordmark { font-size: 0; gap: 0; }   /* just the logo mark */
}
@media (max-width: 400px) {
  .feedback-link { padding: 7px 9px; }
  .feedback-link span { display: none; }
}
@media print { .feedback-link { display: none !important; } }
.fb-intro { margin: 10px 0 0; color: var(--muted); }
.fb-add { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.fb-add .btn svg { width: 16px; height: 16px; }
.fb-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fb-shots:empty { display: none; }
.fb-shot { position: relative; width: 84px; height: 84px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.fb-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-shot-x { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; padding: 4px; border: none; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; }
.fb-shot-x svg { width: 18px; height: 18px; }
.fb-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* Two-step sign-in: the code step on the sign-in page */
.code-field { font-size: 22px; letter-spacing: .12em; text-align: center; }
.remember-line { margin: 12px 0 14px; font-weight: 500; }
.linkish { padding: 0; border: none; background: none; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; }
.auth > .notice { width: 100%; max-width: 420px; margin: 0 0 14px; }

/* Cendraq doesn't contact clients. Client-email controls show only when the server switches client emails on. */
html:not(.client-emails-on) .client-email-only { display: none !important; }

/* ---------- repeat maintenance ---------- */
.mcards { display: grid; gap: 10px; }
.mcard {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 4px 12px;
  align-items: start;
  padding: 12px 12px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}
.mcard.due { border-left-color: var(--hi); }
.mcard.overdue { border-left-color: var(--danger); }
.mcard-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink);
}
.mcard-icon svg { width: 20px; height: 20px; }
.mcard-body { min-width: 0; }
.mcard-title { font-family: var(--font-cond); font-weight: 700; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.mcard-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; font-size: 14px; color: var(--muted); }
.mcard-sub a { color: var(--link); font-weight: 600; text-decoration: none; }
.mcard-sub a + span::before { content: "·"; margin-right: 10px; }
.mcard-last { font-size: 14px; color: var(--muted); }
.mcard-status { margin-top: 6px; }
.mcard-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .mcard { grid-template-columns: 40px 1fr; }
  .mcard-actions { grid-column: 2; justify-content: flex-start; margin-top: 6px; }
}
.badge.maint { display: inline-flex; align-items: center; gap: 4px; }
.badge.maint svg { width: 12px; height: 12px; }
.maint-note { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 8px; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 14px; color: var(--muted); }
.maint-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--ink); }
.every-row { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
.section-sub { margin: -6px 0 10px; color: var(--muted); font-size: 14px; }

/* ---------- site notes on an appointment ---------- */
.site-notes { margin: 10px 0 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--hi-soft); font-size: 14px; }
.site-notes-head { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.site-notes-head svg { width: 15px; height: 15px; }
details.site-notes { background: var(--surface-2); }
details.site-notes > summary { cursor: pointer; list-style: none; }
details.site-notes > summary::-webkit-details-marker { display: none; }
details.site-notes > summary::after { content: "Show"; margin-left: auto; font-weight: 600; color: var(--link); }
details.site-notes[open] > summary::after { content: "Hide"; }
.site-notes ul { margin: 4px 0 0; padding-left: 21px; }
.site-notes li { margin-top: 2px; line-height: 1.4; overflow-wrap: anywhere; }

/* ---------- equipment at a client's site ---------- */
.ecards { display: grid; gap: 10px; }
.ecard {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 4px 12px; align-items: start;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.ecard.removed { opacity: .62; box-shadow: none; }
.ecard-photo {
  position: relative; width: 64px; height: 64px; border-radius: var(--r-sm); overflow: hidden; padding: 0;
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
}
.ecard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ecard-photo.empty { display: grid; place-items: center; color: var(--muted); cursor: default; }
.ecard-photo.empty svg { width: 26px; height: 26px; }
.ecard-count { position: absolute; right: 3px; bottom: 3px; min-width: 18px; padding: 0 4px; border-radius: 9px;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.ecard-body { min-width: 0; }
.ecard-title { font-family: var(--font-cond); font-weight: 700; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.ecard-model { font-size: 14px; font-weight: 600; margin-top: 1px; overflow-wrap: anywhere; }
.ecard-facts { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 0 5px; font-size: 14px; color: var(--muted); }
.ecard-facts a { color: var(--link); font-weight: 600; text-decoration: none; }
.ecard-facts .serial { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--ink); }
@media (max-width: 560px) {
  .ecard { grid-template-columns: 56px 1fr; }
  .ecard-photo { width: 56px; height: 56px; }
  .ecard-actions { grid-column: 2; }
  .ecard-actions .btn { margin-left: -10px; }
}
.quick-years { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.quick-years .chip { margin: 0; }

/* ---------- ask your records ---------- */
.ask-box { margin: 18px 0 0; }
.ask-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.ask-field { position: relative; }
.ask-field svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ask-field .field { padding-left: 38px; margin: 0; }
.ask-tip { margin: 6px 2px 0; font-size: 13px; color: var(--muted); }
.ask-tip button { font: inherit; color: var(--link); background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ask-answer { margin-top: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--link);
  border-radius: var(--r-md); box-shadow: var(--shadow); }
.ask-q { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.ask-q strong { color: var(--ink); }
.ask-text { margin: 8px 0 0; font-size: 17px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.ask-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ask-sources a { display: inline-block; max-width: 100%; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px;
  color: var(--link); text-decoration: none; background: var(--surface-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-looked { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.ask-answer.loading .ask-text { color: var(--muted); }

/* ---------- voice note sheet (site surveys) ---------- */
.rv-body { text-align: center; padding-top: 14px; }
.rv-hint { margin: 0 0 12px; color: var(--muted); font-size: 15px; text-align: left; }
.rv-dot { width: 76px; height: 76px; margin: 6px auto 8px; border-radius: 50%; display: grid; place-items: center; background: var(--rec); color: #fff;
  animation: rv-pulse 1.4s ease-in-out infinite; }
.rv-dot svg { width: 34px; height: 34px; }
@keyframes rv-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rec) 45%, transparent); } 50% { box-shadow: 0 0 0 14px transparent; } }
@media (prefers-reduced-motion: reduce) { .rv-dot { animation: none; } }
.rv-time { font-family: var(--font-cond); font-weight: 700; font-size: 30px; font-variant-numeric: tabular-nums; }
.rv-meter { height: 6px; margin: 10px auto 0; max-width: 260px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.rv-fill { height: 100%; width: 0; background: var(--ok); transition: width .08s linear; }
.rv-status { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

/* client page: site surveys */
.svy-mini { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.svy-mini li + li { border-top: 1px solid var(--line); }
.svy-mini a { display: block; padding: 10px 14px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.svy-mini a:hover { background: var(--surface-2); }
.svy-mini .svy-tot { display: block; font-size: 14px; color: var(--muted); }
.small-empty { padding: 16px; font-size: 15px; }
