/* Ad slots and form controls for the England rent date checker.
   Loaded after tool-page.css. Hidden slots stay collapsed. Visible reserves
   stay inside the column: corresponding-day sizing, centred, never wider
   than the column. The shared tool-page.css file is left unchanged. */

.tool-layout,
.tool-content,
.tool-workspace,
.tool-result,
.tool-section,
.tool-workspace fieldset,
.tool-workspace label {
  min-width: 0;
  max-width: 100%;
}

h3 {
  margin: 16px 0 8px;
  font-size: 1.05rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.not-covered {
  margin: 0 0 16px;
  min-width: 0;
  max-width: 100%;
}

.not-covered ul {
  margin: 8px 0;
  padding-left: 1.2rem;
}

.tool-workspace legend,
.date-field,
.date-field span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.tool-workspace [hidden] { display: none !important; }

.tool-workspace fieldset {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}

.tool-workspace legend {
  font-weight: 700;
  margin: 0 0 4px;
  padding: 0;
}

.field-help {
  margin: 0 0 8px;
  color: var(--soft);
  font-size: 0.92rem;
}

.tool-workspace input[type="radio"] {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  max-width: none;
  margin: 0.15rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--ink);
}

.tool-workspace label.choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 48px;
  margin: 0 0 4px;
}

.tool-workspace input[type="date"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.tool-workspace input[type="date"]::-webkit-datetime-edit,
.tool-workspace input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
}

.result-date,
.result-note { margin: 0 0 14px; }

.result-date .result-label,
.result-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.result-date time {
  display: block;
  margin-top: 2px;
  font-size: 1.5rem;
  font-weight: 700;
}

.tool-result ol,
.tool-result ul { margin: 8px 0 0; padding-left: 1.2rem; }

.step-deciding { font-weight: 700; }

.tool-print {
  display: inline-block;
  max-width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ad-slot[hidden] {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}

.ad-label {
  margin: 0 0 4px;
  height: 16px;
  font-size: 12px;
  line-height: 16px;
  color: var(--soft);
  white-space: nowrap;
}

.ad-reserve {
  display: block;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: transparent;
}

.ad-slot:not([hidden]) {
  display: block;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 24px 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.ad-slot:not([hidden]) .ad-label { text-align: center; }

.ad-slot:not([hidden]) .ad-reserve {
  margin-inline: auto;
  max-width: 100%;
}

.ad-slot[data-slot="top"]:not([hidden]) .ad-reserve {
  width: 320px;
  height: 100px;
}

.ad-slot[data-slot="after-result"]:not([hidden]) .ad-reserve,
.ad-slot[data-slot="before-related"]:not([hidden]) .ad-reserve {
  width: 300px;
  height: 250px;
}

.ad-slot[data-slot="side"] { display: none; }

@media (min-width: 1024px) {
  .ad-slot[data-slot="top"]:not([hidden]) .ad-reserve {
    width: 728px;
    height: 90px;
  }
}

@media (min-width: 1084px) {
  body.has-ads .tool-layout:has(> .ad-slot[data-slot="side"]:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 24px;
    align-items: start;
  }
  body.has-ads .ad-slot[data-slot="side"]:not([hidden]) {
    display: block;
    position: sticky;
    top: 16px;
    width: 300px;
    margin: 0;
  }
  .ad-slot[data-slot="side"]:not([hidden]) .ad-reserve {
    width: 300px;
    height: 600px;
  }
}
