/* ==========================================================================
   Embed this calculator — (a) the disclosure shown under each embeddable tool
   and (b) the chrome-free embed view served at /embed/<tool>/ inside iframes.
   Uses only the tokens from main.css.
   ========================================================================== */

/* ---- (a) Disclosure on the tool page ---- */
.embed-this {
  margin-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}
.embed-this__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
  cursor: pointer;
  font-weight: 600;
  color: var(--color-accent);
  list-style: none;
}
.embed-this__toggle::-webkit-details-marker { display: none; }
.embed-this__toggle::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--motion-fast) var(--ease-out);
}
.embed-this details[open] .embed-this__toggle::before { transform: rotate(45deg); }
.embed-this__toggle:focus-visible { outline: 3px solid var(--color-accent-dark); outline-offset: 2px; }
.embed-this__body { padding-top: var(--space-2); }
.embed-this__lede { margin: 0 0 var(--space-3); color: var(--color-ink-soft); max-width: var(--measure); }
.embed-this__code {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 9rem;
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-ink);
  background: var(--color-sheet);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  resize: vertical;
}
.embed-this__code:focus-visible { outline: 3px solid var(--color-accent-dark); outline-offset: 2px; }
.embed-this__actions { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); flex-wrap: wrap; }
.embed-this__status { font-size: 0.9rem; color: var(--color-success); }

/* ---- (b) The embed view itself ---- */
body.embed { margin: 0; background: var(--color-paper); }
.embed__main { max-width: var(--container); margin: 0 auto; padding: var(--space-4) var(--space-4) var(--space-2); }
.embed__credit {
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  max-width: var(--container);
  margin-inline: auto;
  font-size: 0.9rem;
  color: var(--color-ink-muted);
  text-align: right;
}
.embed__credit a { color: var(--color-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.embed__credit a:hover { color: var(--color-accent-dark); }

/* Embed shows the calculator only: the reference charts, the PDF download and
   the "Use in invoice" hand-off belong to the full tool page. The elements
   stay in the DOM (the page scripts bind to them), they are just not shown. */
.embed .time-chart,
.embed .chart-download,
.embed .time-convert__actions,
.embed .timesheet__actions:has(#useInInvoiceBtn) { display: none; }
