/* =========================================================
   BellyDay — Contraction timer
   Page-scoped additions only. Shared components live in assets/site.css.
   Loads after /assets/site.css.
   ========================================================= */

body.ct {
  /* Darker muted ink than the shared token: 10–12px hints must clear 4.5:1. */
  --ink-55: rgba(44, 27, 42, 0.68);
  background:
    radial-gradient(circle at 6% -8%, rgba(224, 138, 95, 0.14), transparent 42%),
    radial-gradient(circle at 100% 3%, rgba(184, 69, 95, 0.09), transparent 34%),
    var(--bone);
}

/* ---------- Breadcrumbs ---------- */

.crumbs {
  padding-top: 18px;
  font-size: 11.5px;
  color: var(--ink-55);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--ink-55);
}

.crumbs a { color: inherit; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current="page"] { color: var(--ink-70); }

/* ---------- Hero ---------- */

.ct .hero {
  padding-bottom: clamp(18px, 2.4vw, 28px);
}

.ct .hero h1 {
  max-width: 20ch;
  font-size: clamp(40px, 6.2vw, 68px);
}

.ct .hero__lede {
  max-width: 66ch;
}

.ct .hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 20px;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--ink-55);
}

.ct .hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ct .hero__meta span::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--apricot);
  border-radius: 50%;
}

/* ---------- Tool: single-column timer card ---------- */

.ct-tool {
  grid-template-columns: minmax(0, 1fr);
  max-width: 720px;
  margin-inline: auto;
}

.ct-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(22px, 3vw, 34px);
  box-shadow: 5px 5px 0 rgba(44, 27, 42, 0.09);
}

.ct-head__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ct-head__sub {
  margin-top: 5px;
  color: var(--ink-70);
  font-size: 13.5px;
  line-height: 1.5;
}

/* Current-contraction counter, e.g. "Contraction 4" */
.ct-count {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

/* Live mm:ss */
.ct-clock {
  font-family: var(--font-display);
  font-size: clamp(56px, 15vw, 88px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.ct-clock-note {
  margin-top: -4px;
  font-size: 11.5px;
  color: var(--ink-55);
}

.ct-last {
  padding: 12px 14px;
  border-left: 2px solid var(--apricot);
  background: var(--apricot-soft);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-70);
}

.ct-last strong { color: var(--ink); }

/* ---------- The one primary button ---------- */

.ct-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  margin-top: 2px;
  padding: 16px 20px;
  border: 1px solid var(--ink);
  background: var(--panel);
  color: var(--panel-ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ct-start:hover { background: var(--panel-2); }

.ct-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ct-start__dot {
  flex: none;
  width: 16px;
  height: 16px;
  background: var(--panel-rose);
  border-radius: 50%;
  transition: border-radius 0.15s ease, background-color 0.15s ease;
}

/* Running state: same size and position, different colour and shape. */
.ct-start[data-state="running"] {
  background: var(--rose);
  border-color: var(--rose-deep);
  color: #fff;
}

.ct-start[data-state="running"]:hover { background: var(--rose-deep); }

.ct-start[data-state="running"] .ct-start__dot {
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 3px;
}

/* ---------- Inline hint and notes ---------- */

.ct-hint {
  padding: 10px 12px;
  border-left: 2px solid var(--apricot);
  background: var(--apricot-soft);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-70);
}

.ct-hint[hidden] { display: none; }

.ct-hint.is-amber {
  border-left-color: #b06a1f;
  background: rgba(176, 106, 31, 0.1);
}

.ct-noscript {
  padding: 10px 12px;
  border-left: 2px solid var(--rose);
  background: var(--rose-tint);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-70);
}

/* ---------- Secondary actions ---------- */

.ct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ct-panel .btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink-70);
}

.ct-panel .btn--ghost:hover {
  border-color: var(--rose);
  color: var(--rose-deep);
}

/* ---------- Wake lock, privacy, saving ---------- */

.ct-wake,
.ct-save__row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-70);
  cursor: pointer;
}

.ct-wake input,
.ct-save__row input {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--rose);
}

.ct-wake__note { color: var(--ink-55); }

.ct-privacy {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-55);
}

.ct-privacy p + p { margin-top: 5px; }
.ct-privacy strong { color: var(--ink-70); }

.ct-save { margin-top: 2px; }

.ct-saved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
}

.ct-saved[hidden] { display: none; }

.ct-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--sage);
  color: var(--sage);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ct-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--sage);
  border-radius: 50%;
}

.ct-linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--rose-deep);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ct-nosave {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-55);
}

.ct-nosave[hidden] { display: none; }

/* ---------- When-to-call card (static, always visible) ---------- */

.ct-when__card {
  margin-top: 6px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--rose);
}

.ct-when__head h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.ct-when__head p {
  max-width: 62ch;
  margin-top: 8px;
  color: var(--ink-70);
  font-size: 13.5px;
  line-height: 1.55;
}

.ct-511 {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  background: var(--bone-deep);
}

.ct-511__kicker {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

.ct-511 p + p { margin-top: 8px; }

.ct-511 p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-70);
}

.ct-511 strong { color: var(--ink); }

.ct-call {
  margin-top: 22px;
  padding: 18px 20px;
  border-left: 3px solid var(--rose);
  background: var(--rose-tint);
}

.ct-call__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.ct-call__list {
  margin-top: 10px;
  padding-left: 20px;
  list-style: disc;
}

.ct-call__list li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-70);
}

.ct-call__list li + li { margin-top: 7px; }

.ct-when__close {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.ct-when__emergency {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-70);
}

/* ---------- Session summary ---------- */

.ct-summary {
  padding: clamp(20px, 2.6vw, 30px);
  border: 1px solid var(--ink);
  background: var(--panel);
  color: var(--panel-ink);
  box-shadow: var(--shadow);
}

.ct-summary[hidden] { display: none; }

.ct-summary h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ct-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  border-top: 1px solid var(--panel-line);
}

.ct-facts > div {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--panel-line);
}

.ct-facts dt {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--panel-muted);
}

.ct-facts dd {
  margin-top: 5px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.ct-facts dd small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--panel-muted);
}

.ct-pattern {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--panel-apricot);
}

.ct-pattern__note {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--panel-muted);
}

/* ---------- Session list ---------- */

.ct-list {
  margin-top: 24px;
}

.ct-list[hidden] { display: none; }

.ct-list__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 18px;
}

.ct-list__head h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.ct-order {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-70);
  cursor: pointer;
}

.ct-order input {
  width: 16px;
  height: 16px;
  accent-color: var(--rose);
}

.ct-empty {
  margin-top: 8px;
  padding: 18px 0;
  color: var(--ink-55);
  font-size: 14px;
}

.ct-empty[hidden] { display: none; }

.ct-list table td:first-child { color: var(--ink-55); font-size: 12.5px; }

.ct-list .ct-row-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}

.ct-flag {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border: 1px solid #b06a1f;
  color: #8a4f14;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ct-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.ct-row-btn {
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--ink-70);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.ct-row-btn:hover {
  border-color: var(--rose);
  color: var(--rose-deep);
}

.ct-day-label {
  display: inline-block;
  margin-left: 6px;
  color: var(--ink-55);
  font-size: 11px;
}

/* ---------- Strip chart ---------- */

.ct-chart {
  margin-top: 18px;
}

.ct-chart[hidden] { display: none; }

.ct-chart__scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--paper);
}

.ct-chart svg {
  display: block;
  width: 100%;
  min-width: 460px;
  height: auto;
}

.ct-chart figcaption {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--ink-55);
}

.ct-bar { fill: var(--rose); }
.ct-bar.is-running { fill: var(--apricot); }
.ct-grid { stroke: var(--line); stroke-width: 1; }
.ct-axis { stroke: var(--line-strong); stroke-width: 1.5; }
.ct-grid-label { fill: var(--ink-55); font-size: 10px; font-family: var(--font-ui); }
.ct-bar-label { fill: var(--ink); font-size: 9.5px; font-family: var(--font-ui); }

/* ---------- Manual add / edit ---------- */

.ct-editor {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--ink);
  background: var(--bone-deep);
}

.ct-editor[hidden] { display: none; }

.ct-editor h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.ct-editor__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.ct-editor .field__control { background: var(--paper); }
.ct-editor .field > label { font-size: 12px; }

.ct-editor__cross {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-70);
  cursor: pointer;
}

.ct-editor__cross input {
  width: 16px;
  height: 16px;
  accent-color: var(--rose);
}

.ct-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.ct-editor .btn--primary {
  background: var(--panel);
  color: var(--panel-ink);
}

.ct-editor .btn--primary:hover { background: var(--panel-2); }

.ct-editor .btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink-70);
}

.ct-editor .btn--ghost:hover {
  border-color: var(--rose);
  color: var(--rose-deep);
}

/* ---------- Copy fallback ---------- */

.ct-copy-fallback {
  max-width: 720px;
  margin: 22px auto 0;
  padding: 16px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.ct-copy-fallback[hidden] { display: none; }

.ct-copy-fallback label {
  display: block;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.ct-copy-fallback textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bone);
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
}

/* ---------- Print header (screen-hidden) ---------- */

.ct-print-head {
  display: none;
}

/* ---------- Sources, disclaimer, updated ---------- */

.ct .disclaimer { border-left-width: 3px; font-size: 12.5px; }

.updated {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-55);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .ct-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-editor__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .ct .hero { padding-top: 16px; padding-bottom: 18px; }
  .ct .hero h1 { margin-top: 10px; font-size: clamp(34px, 10vw, 48px); }
  .ct .hero__lede { margin-top: 10px; font-size: 14px; line-height: 1.5; }
  .ct .hero__meta { margin-top: 14px; }
  .ct-panel { gap: 12px; }
  .ct .panel { box-shadow: 6px 6px 0 var(--rose); }
  .ct-start { min-height: 72px; }
  .ct-actions { flex-direction: column; }
  .ct-actions .btn { width: 100%; }
  .ct-editor__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .ct .hero { padding-top: 12px; padding-bottom: 14px; }
  .ct .hero h1 { margin-top: 8px; font-size: clamp(30px, 9.4vw, 42px); }
  .ct .hero__lede { margin-top: 8px; font-size: 13.5px; line-height: 1.45; }
  .ct .hero__meta { margin-top: 11px; gap: 5px 14px; font-size: 12px; }
  .ct-panel { gap: 10px; padding: 18px; }
  .ct-clock { font-size: clamp(48px, 15.5vw, 68px); }
  .ct-start { font-size: 18px; }
  .ct-facts { grid-template-columns: 1fr 1fr; }
  .ct-facts dd { font-size: 13.5px; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .ct .btn,
  .ct .ct-start,
  .ct .ct-start__dot,
}

/* ---------- Print: contraction record ---------- */

@media print {
  .masthead,
  .crumbs,
  .ct .hero__lede,
  .ct .hero__meta,
  .ct-tool,
  .reviewstrip,
  .ct .faq,
  .ct .section--hide-print,
  .ct-copy-fallback,
  .ct-empty,
  .ct-editor,
  .dock,
  .ct .footer,
  .skip,
  .noscript {
    display: none !important;
  }

  body.ct { background: #fff; padding: 0; }

  .wrap { width: 100%; }

  .ct .hero {
    padding: 0 0 8px;
    border-bottom: 1px solid #000;
  }

  .ct .hero h1 { font-size: 24pt; color: #000; }

  .ct-print-head {
    display: block;
    margin: 10px 0 0;
    font-size: 10.5pt;
    color: #000;
  }

  .ct-when__card {
    box-shadow: none;
    border-color: #000;
    page-break-inside: avoid;
  }

  .ct-511 { background: none; border-color: #999; }
  .ct-call { background: none; border-left-color: #000; }

  .ct-summary {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .ct-summary h2,
  .ct-facts dd,
  .ct-pattern { color: #000; }

  .ct-facts { border-color: #bbb; }
  .ct-facts > div { border-color: #bbb; }
  .ct-facts dt,
  .ct-pattern__note { color: #333; }

  .ct-list table { min-width: 0; }
  .ct-row-actions { display: none; }
  .ct-flag { border-color: #000; color: #000; }
  .ct-chart { display: none !important; }
  .ct-day-label { color: #333; }
}
