/*
 * WhatDateTime / instrument workbench.
 * Shared inner-page surfaces only. WordPress keeps the native templates, widths,
 * current palette, and calculator block controls; data is rendered by PHP.
 */

.wdt-main :where(.wdt-page-heading .breadcrumb) {
  margin-block: 0 .75rem;
  color: var(--wp--preset--color--muted);
  font-size: .875rem;
  line-height: 1.45;
}

.wdt-main :where(.wdt-page-heading > h1) {
  margin-block: 0 .375rem;
  text-wrap: balance;
}

.wdt-main :where(.wdt-page-heading > p) {
  max-inline-size: 68ch;
  margin-block: 0;
  color: var(--wp--preset--color--muted);
}

.wdt-main :where(.calculator-workspace) {
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 8px;
  padding: clamp(.875rem, 2.3vw, 1.625rem);
}

.wdt-main :where(.calculator-inputs > h2) {
  margin-block: 0 1rem;
  font-family: var(--wp--preset--font-family--display, inherit);
  font-size: var(--wp--preset--font-size--small-heading, 1.125rem);
}

.wdt-main :where([data-calculator] .inputs label:not(.difference-mode)) {
  display: grid;
  align-content: start;
  gap: .35rem;
  min-inline-size: 0;
  line-height: 1.35;
}

.wdt-main :where([data-calculator] :is(input,select):not([type="checkbox"],[type="radio"],[type="hidden"])) {
  border-color: var(--wp--preset--color--border);
  border-radius: 5px;
  min-block-size: 2.875rem;
  padding-inline: .7rem;
  font-variant-numeric: tabular-nums;
}

.wdt-main :where([data-calculator] .actions) {
  gap: .5rem;
  margin-block-start: 1.125rem;
}

.wdt-main :where([data-calculator] .actions button) {
  border-radius: 5px;
  line-height: 1.25;
}

.wdt-main :where([data-calculator] .actions .secondary:not(:disabled):hover) {
  background-color: var(--wp--preset--color--subtle);
  border-color: var(--wp--preset--color--primary);
}

.wdt-main :where([data-calculator] [data-error]:empty) {
  margin: 0;
}

.wdt-main :where([data-calculator] [data-status]) {
  margin-block: .65rem 0;
  font-size: .875rem;
  line-height: 1.4;
}

/* The result is presented as one readout, not a stack of competing cards. */
.wdt-main :where(.calculator-workspace .answer) {
  min-block-size: 0;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  border: 1px solid var(--wp--preset--color--border);
  border-block-start: 3px solid var(--wp--preset--color--primary);
  border-radius: 5px;
  color: var(--wp--preset--color--text);
  background: var(--wp--preset--color--subtle);
  text-align: start;
}

.wdt-main :where(.calculator-workspace .answer > p) {
  margin-block: .65rem 0;
}

.wdt-main :where(.calculator-workspace .answer > .eyebrow) {
  margin-block: 0 .45rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.3;
}

.wdt-main :where(.calculator-workspace .answer-value) {
  font-family: var(--wp--preset--font-family--display, inherit);
  font-size: var(--wp--preset--font-size--answer, 2.125rem);
  line-height: 1.08;
  text-wrap: pretty;
}

.wdt-main :where(.calculator-workspace [data-answer-basis]) {
  font-size: .925rem;
}

.wdt-main :where(.calculator-workspace [data-formula]) {
  padding-block-start: .65rem;
  border-block-start: 1px solid var(--wp--preset--color--border);
  font-family: var(--wdt-data-font, ui-monospace, monospace);
  font-size: .875rem;
  line-height: 1.55;
}

.wdt-main :where(.calculator-workspace :is(.answer-conditions, .paired-times)) {
  margin-block: .95rem 0;
  padding-block: .65rem;
  border-block: 1px solid var(--wp--preset--color--border);
  gap: .65rem 1rem;
}

.wdt-main :where(.calculator-workspace .paired-times p) {
  margin-block: .2rem 0;
}

.wdt-main :where(.calculator-workspace :is(.answer-conditions dt, .paired-times strong)) {
  color: var(--wp--preset--color--muted);
  font-size: .82rem;
  font-weight: 650;
}

.wdt-main :where(.calculator-workspace .answer .note) {
  padding: 0;
  border: 0;
  color: var(--wp--preset--color--muted);
  background: transparent;
  font-size: .9rem;
}

.wdt-main :where(.calculator-workspace [data-details] > h2, .wdt-city-clocks > h2) {
  margin-block: 1.5rem .65rem;
  font-family: var(--wp--preset--font-family--display, inherit);
}

/* Three real samples along a single elapsed-time rule: start, halfway, result. */
.wdt-main :where(.calculator-workspace .timeline) {
  gap: 0;
  padding-block: .65rem 0;
  border: 0;
}

.wdt-main :where(.calculator-workspace .timeline li) {
  position: relative;
  border-block-start: 1px solid var(--wp--preset--color--border);
  padding: .75rem .55rem 0 0;
  line-height: 1.45;
}

.wdt-main :where(.calculator-workspace .timeline li)::before {
  position: absolute;
  inset-block-start: -.25rem;
  inset-inline-start: 0;
  inline-size: .45rem;
  block-size: .45rem;
  border: 1px solid var(--wp--preset--color--primary);
  border-radius: 50%;
  background: var(--wp--preset--color--surface);
  content: "";
}

.wdt-main :where(.calculator-workspace .timeline li:last-child)::before {
  background: var(--wp--preset--color--primary);
}

.wdt-main :where(.calculator-workspace .table-scroll, .wdt-city-clocks .table-scroll, .wdt-clock:not(.home-clock) .table-scroll) {
  max-inline-size: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 5px;
}

.wdt-main :where(.calculator-workspace .table-scroll, .wdt-city-clocks .table-scroll):focus-visible {
  outline-offset: 2px;
}

.wdt-main :where(.calculator-workspace .table-scroll table, .wdt-city-clocks .table-scroll table) {
  font-variant-numeric: tabular-nums;
  text-align: start;
}

.wdt-main :where(.calculator-workspace .table-scroll :is(th,td), .wdt-city-clocks .table-scroll :is(th,td)) {
  padding: .56rem .7rem;
  border: 0;
  border-block-end: 1px solid var(--wp--preset--color--border);
}

.wdt-main :where(.calculator-workspace .table-scroll tbody tr:last-child td, .wdt-city-clocks .table-scroll tbody tr:last-child td) {
  border-block-end: 0;
}

.wdt-main :where(.calculator-workspace .table-scroll .calendar :is(th,td)) {
  padding: .5rem .1rem;
  text-align: center;
}

.wdt-main :where(.calculator-workspace:has(.paired-times) .table-scroll table:not(.calendar)) {
  min-inline-size: 23rem;
}

.wdt-main :where(.compact-clock .panel, .wdt-clock:not(.home-clock) [data-clock-root]) {
  border-radius: 6px;
}

.wdt-main :where(.compact-clock .clock-value, .wdt-clock:not(.home-clock) .clock-value) {
  font-family: var(--wp--preset--font-family--display, inherit);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .wdt-main :where(.calculator-workspace .answer-conditions > * + *) {
    padding-block-start: .5rem;
    border-block-start: 1px solid var(--wp--preset--color--border);
  }

  .wdt-main :where(.calculator-workspace .timeline li) {
    padding-inline-end: .4rem;
    font-size: .875rem;
  }
}
