/* KTS v1.5.2 full-site readability & spacing quality pass
   Scope: public pages, forms, dashboards, admin pages, policy pages.
   No data model or JavaScript behavior changes. */

:root {
  --kts-readable-ink: #211a12;
  --kts-readable-copy: #4a4034;
  --kts-readable-muted: #716657;
  --kts-control-height: 48px;
  --kts-touch-height: 44px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  line-height: 1.66;
}

h1,
.hero-panel h1,
.section-title h1,
.workflow-hero h1 {
  line-height: 1.12;
}

h2,
.section-title h2,
.policy-cta-panel h2 {
  line-height: 1.22;
}

h3,
.panel h3,
.product-card h3,
.flow-step h3,
.position-card h3 {
  line-height: 1.36;
}

p,
li,
small,
.form-note,
.field-help,
.meta,
.muted {
  line-height: 1.68;
}

.section-heading > h2,
.copy-block > h2 {
  margin-bottom: 14px;
}

.section-heading > p:not(.eyebrow),
.copy-block > p:not(.eyebrow) {
  margin-top: 12px;
}

.section-heading > :last-child,
.copy-block > :last-child,
.panel > :last-child,
.form-panel > :last-child,
.product-card > :last-child,
.policy-summary-card > :last-child,
.policy-followup-grid article > :last-child {
  margin-bottom: 0;
}

/* Explicit text color on every light surface. */
.panel,
.form-panel,
.product-card,
.flow-step,
.position-card,
.policy-summary-card,
.policy-update-card,
.policy-followup-grid article,
.policy-status-panel,
.policy-status-grid article,
.policy-source-list.source-cards a,
.notice-box,
.simple-notice,
.consent-group,
.detail-section,
.workflow-checklist-section,
.manual-record-box,
.link-box,
.empty-state,
.summary-card,
.metric,
.history-summary span,
.record-item,
.workflow-record-card {
  color: var(--kts-readable-ink);
}

.panel p,
.form-panel p,
.product-card p,
.flow-step p,
.position-card p,
.policy-summary-card p,
.policy-update-card p,
.policy-followup-grid article p,
.policy-status-panel p,
.policy-status-grid article p,
.policy-source-list.source-cards span,
.detail-section p,
.manual-record-box p,
.link-box p,
.empty-state p,
.summary-card p,
.metric p,
.record-item p,
.workflow-record-card p {
  color: var(--kts-readable-copy);
}

/* Policy center: fix dark-on-dark text and lock light-card contrast. */
.policy-page .dark-section > .section-inner > .section-heading > p:not(.eyebrow) {
  color: rgba(255, 248, 234, .82) !important;
}

.policy-page .dark-section .policy-empty {
  color: #fff8ea !important;
  border-color: rgba(243, 214, 141, .42);
  background: rgba(255, 248, 234, .035);
}

.policy-page .policy-summary-card,
.policy-page .policy-status-panel,
.policy-page .policy-status-grid article,
.policy-page .policy-followup-grid article,
.policy-page .policy-source-list.source-cards a,
.policy-page .lead-form-panel,
.policy-page .form-panel {
  color: var(--kts-readable-ink) !important;
}

.policy-page .policy-summary-card p,
.policy-page .policy-status-panel p,
.policy-page .policy-status-grid p,
.policy-page .policy-followup-grid article p,
.policy-page .policy-source-list.source-cards span,
.policy-page .lead-form-panel p,
.policy-page .form-panel p {
  color: var(--kts-readable-copy) !important;
}

.policy-page .policy-source-list.source-cards strong,
.policy-page .policy-summary-card strong,
.policy-page .policy-followup-grid article strong {
  color: #5f4215 !important;
}

.policy-page .policy-record-check,
.policy-page .policy-record-check h3,
.policy-page .policy-record-check strong {
  color: #fff8ea;
}

.policy-page .policy-record-check p {
  color: rgba(255, 248, 234, .76) !important;
}

/* Dark callouts and dark policy blocks. */
.dark-section .eyebrow,
.policy-contact-v150 .eyebrow {
  color: var(--kts-gold-2);
}

.policy-contact-v150,
.policy-contact-v150 h2,
.policy-contact-v150 h3 {
  color: #fff8ea;
}

.policy-contact-v150 p,
.policy-contact-v150 li,
.policy-cta-panel p {
  color: rgba(255, 248, 234, .82) !important;
}

/* Buttons: consistent height, vertical centering, and explicit contrast. */
button,
.btn,
[role="button"] {
  min-height: var(--kts-touch-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
}

.btn.primary,
button.btn.primary,
button.primary {
  color: #fff8ea !important;
}

.btn.secondary,
.btn.light,
.btn.ghost {
  color: #1c160d !important;
}

.policy-contact-v150 .btn.light,
.policy-contact-v150 .btn.ghost,
.policy-cta-panel .btn.secondary {
  color: #1c160d !important;
  background: #fffdf8 !important;
  border-color: rgba(255,255,255,.7) !important;
}

/* Form rhythm and controls. */
label {
  line-height: 1.45;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: var(--kts-control-height);
  color: #17130d !important;
  background: #fffdf8 !important;
}

textarea {
  min-height: 112px;
  line-height: 1.58;
}

input::placeholder,
textarea::placeholder {
  color: #8a7d6b;
  opacity: 1;
}

.grid,
.lead-form.grid,
.booking-form-grid,
.booking-form-grid-compact,
.booking-settings-form,
.manual-record-form,
.quick-form,
.memo-grid {
  row-gap: 16px;
}

.form-panel,
.public-form-panel,
.lead-form-panel {
  padding-top: clamp(20px, 3vw, 28px);
  padding-bottom: clamp(20px, 3vw, 28px);
}

/* Checkbox/radio alignment and touch targets. */
input[type="checkbox"],
input[type="radio"],
.check input[type="checkbox"],
.core-check input[type="checkbox"],
.question-item input[type="checkbox"],
.consent-line input[type="checkbox"],
.checkline input[type="checkbox"],
.checkbox-fieldset input[type="checkbox"],
.setup-list input[type="checkbox"],
.workflow-checklist input[type="checkbox"] {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  flex: 0 0 20px !important;
  margin: .12em 0 0 !important;
  accent-color: var(--kts-gold-3);
}

.check,
.core-check,
.question-item,
.consent-line,
.checkline,
.checkbox-fieldset label,
.setup-list label {
  min-height: 44px;
  gap: 11px !important;
  align-items: flex-start !important;
  line-height: 1.58 !important;
}

.check,
.core-check,
.question-item,
.consent-line,
.setup-list label {
  padding: 12px 13px;
}

.checkbox-fieldset {
  gap: 12px;
}

.checkbox-fieldset label {
  margin: 0;
  padding: 8px 6px;
}

.checkbox-fieldset legend {
  margin-bottom: 4px;
  line-height: 1.45;
}

/* Small controls that were visually short. */
.workflow-tab,
.security-setting button,
.security-setting select,
.booking-filter-grid button,
.booking-filter-grid select {
  min-height: 42px;
}

/* Tables and long content must not force horizontal overflow. */
.table-wrap,
.record-table-wrap,
.policy-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  max-width: 100%;
}

/* Mobile spacing and consistent touch layout. */
@media (max-width: 640px) {
  body {
    line-height: 1.64;
  }

  h1,
  .hero-panel h1,
  .section-title h1,
  .workflow-hero h1 {
    line-height: 1.16;
  }

  h2,
  .section-title h2,
  .policy-cta-panel h2 {
    line-height: 1.24;
  }

  h3 {
    line-height: 1.4;
  }

  p,
  li,
  small,
  .form-note,
  .field-help,
  .meta,
  .muted {
    line-height: 1.7;
  }

  .section {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .panel,
  .form-panel,
  .product-card,
  .flow-step,
  .position-card,
  .policy-status-panel,
  .policy-summary-card,
  .policy-followup-grid article,
  .policy-source-list.source-cards a,
  .detail-section,
  .manual-record-box,
  .consent-group {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-nav a {
    min-height: 42px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  button,
  .btn,
  [role="button"] {
    min-height: 46px;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select {
    min-height: 50px;
  }

  .check,
  .core-check,
  .question-item,
  .consent-line,
  .checkline,
  .checkbox-fieldset label,
  .setup-list label {
    font-size: 13px;
  }

  .policy-page .dark-section > .section-inner > .section-heading > p:not(.eyebrow) {
    color: rgba(255, 248, 234, .86) !important;
  }
}

@media print {
  .dark-section,
  .policy-contact-v150,
  .policy-cta-panel,
  .policy-record-check {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
