/* ──────────────────────────────────────────────────────────────────────────
 * TrueTime one-product kit (2026-10-12).
 *
 * The SAME small file ships in QA and PCR so both tools share the platform's
 * look: the brand bar with "Back to My cases", the "Review and accept" card,
 * its "Accepted by {name} on {date}" stamp, and the in-page confirm that
 * replaces the browser's native confirm() box. Values mirror the platform
 * (truetime---api/frontend tailwind.config.ts + globals.css): DM Sans body,
 * Fraunces headings, indigo #6366F1, 14px cards, pill badges.
 *
 * Similar, not identical: each tool keeps its own page styles; this file only
 * adds the shared pieces. Everything here is prefixed tt- so it never collides.
 * Keep the QA and PCR copies byte-identical.
 * ──────────────────────────────────────────────────────────────────────── */

:root {
  --tt-brand: #6366F1;
  --tt-brand-dark: #4F46E5;
  --tt-brand-700: #4338CA;
  --tt-brand-50: #EEF0FF;
  --tt-brand-100: #E0E3FF;
  --tt-navy: #0D3A6E;
  --tt-ink: #101828;
  --tt-ink-muted: #475467;
  --tt-ink-subtle: #98A2B3;
  --tt-line: #EAECF0;
  --tt-line-strong: #D0D5DD;
  --tt-surface: #FFFFFF;
  --tt-surface-muted: #F7F8FA;
  --tt-success-50: #ECFDF5;
  --tt-success-200: #A7F3D0;
  --tt-success-700: #047857;
  --tt-radius: 10px;
  --tt-radius-card: 14px;
  --tt-shadow-card: 0 1px 3px rgba(16,24,40,.06), 0 4px 12px rgba(16,24,40,.04);
  --tt-shadow-pop: 0 12px 32px rgba(16,24,40,.18), 0 2px 6px rgba(16,24,40,.08);
  --tt-focus: 0 0 0 3px rgba(99,102,241,.35);
  --tt-font: 'DM Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tt-serif: 'Fraunces', Georgia, serif;
  --tt-bar-h: 58px;
}

/* Nothing on an agency page may push the page wider than the screen. `clip`,
   not `hidden`: hidden would make <body> a scroll box and unstick the bar. */
body { max-width: 100%; overflow-x: clip; }
img, video, canvas, iframe { max-width: 100%; }
pre, table { max-width: 100%; }

/* ── Brand bar: logo, the case, and one clear way back. In the page flow
      (sticky), never a fixed overlay, so it never covers content. ── */
.tt-bar {
  position: sticky; top: 0; z-index: 40;
  background: var(--tt-surface); border-bottom: 1px solid var(--tt-line);
  font-family: var(--tt-font);
}
.tt-bar-inner {
  max-width: 1140px; margin: 0 auto; padding: 10px 20px;
  min-height: var(--tt-bar-h);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.tt-bar-brand {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  text-decoration: none; color: var(--tt-navy);
  font-family: var(--tt-serif); font-weight: 600; font-size: 17px; line-height: 1;
}
.tt-bar-brand img { width: 32px; height: 32px; border-radius: 7px; object-fit: contain; display: block; }
.tt-bar-brand .tt-thin { font-weight: 500; color: var(--tt-ink-muted); }
.tt-bar-case {
  flex: 1 1 auto; min-width: 0;
  padding-left: 12px; border-left: 1px solid var(--tt-line);
  font-size: 14px; color: var(--tt-ink-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tt-bar-case strong { color: var(--tt-ink); font-weight: 600; }
.tt-bar-spacer { flex: 1 1 auto; }
.tt-back {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 9999px;
  background: var(--tt-brand-50); color: var(--tt-brand-700);
  font: 600 14px/1.2 var(--tt-font); text-decoration: none; white-space: nowrap;
  transition: background .2s ease;
}
.tt-back:hover { background: var(--tt-brand-100); }
.tt-back:focus-visible { outline: none; box-shadow: var(--tt-focus); }
@media (max-width: 600px) {
  .tt-bar-inner { padding: 8px 16px; gap: 8px 10px; }
  .tt-bar-brand { font-size: 15px; }
  .tt-bar-brand .tt-thin { display: none; }
  /* The case name drops to its own line under the logo and the back link. */
  .tt-bar-case { order: 3; flex-basis: 100%; padding-left: 0; border-left: 0; font-size: 13px; }
  .tt-back { padding: 7px 12px; font-size: 13px; margin-left: auto; }
}

/* ── "Review and accept": the same card at the end of every result. ── */
.tt-accept {
  scroll-margin-top: calc(var(--tt-bar-h) + 16px);
  border-left: 4px solid var(--tt-brand) !important;
}
.tt-accept-kicker {
  display: block; margin: 0 0 4px;
  font: 700 11px/1.2 var(--tt-font); letter-spacing: .08em; text-transform: uppercase;
  color: var(--tt-brand-dark);
}
.tt-accept-means { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--tt-ink-muted); }
.tt-stamp {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 2px 0 8px; padding: 6px 12px; border-radius: 9999px;
  background: var(--tt-success-50); color: var(--tt-success-700);
  box-shadow: inset 0 0 0 1px var(--tt-success-200);
  font: 600 14px/1.4 var(--tt-font);
}
/* My cases links to #review-and-accept: land just under the brand bar, and
   ring the card for a moment so the eye finds it. */
.tt-accept-anchor { display: block; height: 0; scroll-margin-top: calc(var(--tt-bar-h) + 24px); }
#review-and-accept:target { scroll-margin-top: calc(var(--tt-bar-h) + 24px); }
.tt-accept:target, .tt-accept:has(> #review-and-accept:target) {
  animation: tt-ring 2.4s ease-out 1;
}
@keyframes tt-ring {
  0%, 60% { box-shadow: 0 0 0 4px rgba(99,102,241,.35), var(--tt-shadow-card); }
  100%    { box-shadow: var(--tt-shadow-card); }
}

/* ── In-page confirm (replaces the browser's confirm() box). ── */
.tt-confirm-backdrop {
  position: fixed; inset: 0; z-index: 2147483000;
  background: rgba(16,24,40,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  font-family: var(--tt-font);
}
.tt-confirm {
  width: 100%; max-width: 440px; background: var(--tt-surface);
  border-radius: var(--tt-radius-card); box-shadow: var(--tt-shadow-pop);
  border: 1px solid var(--tt-line); padding: 20px 22px;
}
.tt-confirm-title { margin: 0 0 6px; font: 600 18px/1.3 var(--tt-serif); color: var(--tt-ink); }
.tt-confirm-msg { margin: 0 0 18px; font-size: 14.5px; line-height: 1.5; color: var(--tt-ink-muted); white-space: pre-line; }
.tt-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.tt-confirm-actions button {
  font: 600 14px/1.2 var(--tt-font); border-radius: var(--tt-radius);
  padding: 10px 18px; cursor: pointer;
}
.tt-confirm-cancel { background: var(--tt-surface); color: var(--tt-ink-muted); border: 1px solid var(--tt-line-strong); }
.tt-confirm-cancel:hover { background: var(--tt-surface-muted); }
.tt-confirm-ok { background: var(--tt-brand); color: #fff; border: 1px solid var(--tt-brand); box-shadow: 0 4px 12px rgba(99,102,241,.25); }
.tt-confirm-ok:hover { background: var(--tt-brand-dark); }
.tt-confirm-actions button:focus-visible { outline: none; box-shadow: var(--tt-focus); }
@media (max-width: 600px) {
  .tt-confirm-backdrop { align-items: flex-end; padding: 0; }
  .tt-confirm { max-width: none; border-radius: var(--tt-radius-card) var(--tt-radius-card) 0 0; }
  .tt-confirm-actions button { flex: 1 1 auto; }
}
