/* TradesmanIreland invoice and quote generator. Phone layout first; the two-column desk layout starts at 960px.
   Form controls are scoped with #tidoc so the theme's and Elementor's own input/button rules cannot leak in. */

.tidoc {
  --ink: #111111;
  --yellow: #F3B800;
  --yellow-hi: #FFCF2E;
  --paper: #ffffff;
  --wash: #F8F8F8;
  --line: #D4D6DD;
  --soft: #575757;
  --focus: 0 0 0 3px rgba(243, 184, 0, .55);
  box-sizing: border-box;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  color: var(--ink);
  font-family: var(--e-global-typography-text-font-family, "Poppins"), system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}
.tidoc *, .tidoc *::before, .tidoc *::after { box-sizing: border-box; }
.tidoc [hidden] { display: none !important; }
.tidoc-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.tidoc-lock { overflow: hidden; }

/* ---------- intro ---------- */

#tidoc .tidoc-intro { margin: 0 0 24px; }
#tidoc .tidoc-intro h1 {
  margin: 0 0 12px; padding: 0;
  font-size: clamp(30px, 8.4vw, 48px); line-height: 1.08; font-weight: 600; letter-spacing: -.025em; color: var(--ink);
  max-width: 16ch;
}
#tidoc .tidoc-intro p { margin: 0; max-width: 56ch; font-size: 17px; color: var(--soft); }

/* ---------- quote / invoice switch ---------- */

#tidoc .tidoc-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--ink); border-radius: 14px; }
#tidoc .tidoc-switch label { position: relative; display: block; margin: 0; cursor: pointer; }
#tidoc .tidoc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#tidoc .tidoc-switch span {
  display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 10px;
  font-size: 18px; font-weight: 600; color: #fff; transition: background-color .15s, color .15s;
}
#tidoc .tidoc-switch input:checked + span { background: var(--yellow); color: var(--ink); }
#tidoc .tidoc-switch input:focus-visible + span { outline: 3px solid #fff; outline-offset: -5px; }
#tidoc .tidoc-hint { margin: 0; font-size: 14px; line-height: 1.45; color: var(--soft); }
#tidoc .tidoc-switch-hint { margin: 10px 2px 0; }
.tidoc[data-type="invoice"] .tidoc-switch-hint { display: none; }

/* ---------- sections: ruled like a docket, not boxed ---------- */

#tidoc .tidoc-form { margin: 0; padding: 0 0 96px; }
#tidoc .tidoc-sec { margin: 28px 0 0; padding: 18px 0 0; border: 0; border-top: 2px solid var(--ink); }
#tidoc .tidoc-sec h2 { margin: 0; padding: 0; font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
#tidoc .tidoc-sec > h2 { margin-bottom: 16px; }
#tidoc .tidoc-fields { display: grid; gap: 14px; }
#tidoc .tidoc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tidoc[data-type="quote"] .tidoc-invoice-only { display: none; }

#tidoc .tidoc-fold > summary {
  display: flex; align-items: center; gap: 12px; min-height: 44px; margin: -8px 0 0; padding: 0;
  list-style: none; cursor: pointer; border-radius: 6px;
}
#tidoc .tidoc-fold > summary::-webkit-details-marker { display: none; }
#tidoc .tidoc-fold > summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin: -4px 6px 0 auto;
  border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s;
}
#tidoc .tidoc-fold[open] > summary::after { transform: rotate(-135deg); margin-top: 6px; }
#tidoc .tidoc-fold > summary:focus-visible { outline: 0; box-shadow: var(--focus); }
#tidoc .tidoc-fold-sum { min-width: 0; font-size: 14px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tidoc .tidoc-fold[open] .tidoc-fold-sum { display: none; }
#tidoc .tidoc-fold > .tidoc-fields { margin-top: 10px; }

/* ---------- fields ---------- */

#tidoc .tidoc-f { display: block; margin: 0; padding: 0; min-width: 0; }
#tidoc .tidoc-f > span { display: block; margin: 0 0 6px; font-size: 14px; line-height: 1.3; font-weight: 500; color: var(--ink); }
#tidoc .tidoc-f > span em { font-style: normal; font-weight: 400; color: var(--soft); }
#tidoc .tidoc-in {
  display: block; width: 100%; min-height: 48px; margin: 0; padding: 11px 12px;
  font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; box-shadow: none;
  -webkit-appearance: none; appearance: none; outline: 0; transition: border-color .12s, box-shadow .12s;
}
#tidoc textarea.tidoc-in { height: auto; resize: vertical; }
#tidoc .tidoc-item textarea.tidoc-in { resize: none; overflow: hidden; }
#tidoc .tidoc-in::placeholder { color: #9A9CA5; opacity: 1; }
#tidoc .tidoc-in:hover { border-color: #949CA2; }
#tidoc .tidoc-in:focus { border-color: var(--ink); box-shadow: var(--focus); }
#tidoc input[type="date"].tidoc-in { min-width: 0; }

/* ---------- buttons ---------- */

#tidoc .tidoc-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin: 0; padding: 0 18px;
  font: inherit; font-size: 16px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; text-transform: none; letter-spacing: 0;
  border: 1.5px solid transparent; border-radius: 10px; box-shadow: none; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
#tidoc .tidoc-btn-go { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
#tidoc .tidoc-btn-go:hover { background: var(--yellow-hi); border-color: var(--yellow-hi); color: var(--ink); }
#tidoc .tidoc-btn-quiet { background: var(--paper); border-color: var(--ink); color: var(--ink); }
#tidoc .tidoc-btn-quiet:hover { background: var(--wash); }
#tidoc .tidoc-btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
#tidoc .tidoc-btn-ghost:hover { border-color: #fff; }
#tidoc .tidoc-btn:focus-visible { outline: 0; box-shadow: var(--focus); }
#tidoc .tidoc-btn[disabled] { opacity: .6; cursor: progress; }
#tidoc .tidoc-link {
  display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-transform: none; cursor: pointer;
}
#tidoc .tidoc-link:hover { background: none; color: var(--ink); text-decoration-thickness: 2px; }
#tidoc .tidoc-link:focus-visible { outline: 0; box-shadow: var(--focus); border-radius: 4px; }

/* ---------- logo ---------- */

#tidoc .tidoc-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
#tidoc .tidoc-logo img { max-width: 120px; max-height: 56px; width: auto; height: auto; border-radius: 4px; }

/* ---------- lines ---------- */

#tidoc .tidoc-item { padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px dashed var(--line); }
#tidoc .tidoc-item-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; align-items: stretch; }
#tidoc .tidoc-item-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; min-width: 0; }
#tidoc .tidoc-item-total { order: 2; height: 48px; line-height: 48px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
#tidoc .tidoc-item-rm {
  order: 1; margin: -13px 0 -11px; padding: 0; min-height: 44px; background: none; border: 0; box-shadow: none;
  font: inherit; font-size: 14px; font-weight: 400; line-height: 1.3; color: var(--soft); text-decoration: underline; text-underline-offset: 3px; text-transform: none; cursor: pointer;
}
#tidoc .tidoc-item-rm:hover { background: none; color: #B91C1C; }
#tidoc .tidoc-item-rm:focus-visible { outline: 0; box-shadow: var(--focus); border-radius: 4px; }
#tidoc .tidoc-add {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin: 0; padding: 0 16px;
  background: var(--paper); border: 1.5px dashed var(--ink); border-radius: 10px; box-shadow: none;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); text-transform: none; cursor: pointer;
}
#tidoc .tidoc-add::before { content: "+"; font-size: 22px; font-weight: 400; line-height: 1; margin-top: -2px; }
#tidoc .tidoc-add:hover { background: #FFF8DC; color: var(--ink); }
#tidoc .tidoc-add:focus-visible { outline: 0; box-shadow: var(--focus); }

/* ---------- VAT chips and colour swatches ---------- */

#tidoc .tidoc-vat { margin-top: 22px; }
#tidoc .tidoc-vat .tidoc-hint { margin-top: 10px; }
#tidoc .tidoc-vat-other { margin-top: 12px; max-width: 160px; }
#tidoc .tidoc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#tidoc .tidoc-chips label, #tidoc .tidoc-swatches label { position: relative; display: block; margin: 0; cursor: pointer; }
#tidoc .tidoc-chips input, #tidoc .tidoc-swatches input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#tidoc .tidoc-chips span {
  display: flex; align-items: center; min-height: 44px; padding: 0 15px; border: 1.5px solid var(--line); border-radius: 22px;
  background: var(--paper); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink);
}
#tidoc .tidoc-chips input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
#tidoc .tidoc-chips input:focus-visible + span, #tidoc .tidoc-swatches input:focus-visible + span { box-shadow: var(--focus); }
#tidoc .tidoc-swatches { display: flex; gap: 12px; }
#tidoc .tidoc-swatches span { display: block; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--paper); outline: 1.5px solid var(--line); }
#tidoc .tidoc-swatches input:checked + span { outline: 2.5px solid var(--ink); }

#tidoc .tidoc-reset { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 28px; padding-top: 12px; border-top: 2px solid var(--ink); }

/* ---------- total bar (phones) ---------- */

#tidoc .tidoc-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) 16px;
  background: var(--ink); color: #fff;
  transform: translateY(105%); transition: transform .2s ease;
}
.tidoc.is-live #tidoc-bar { transform: none; }
.tidoc.is-previewing #tidoc-bar { transform: translateY(105%); }
#tidoc .tidoc-bar-total { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
#tidoc .tidoc-bar-total span { font-size: 12px; color: #BDBDBD; }
#tidoc .tidoc-bar-total strong { font-size: 21px; font-weight: 600; color: var(--yellow); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tidoc .tidoc-bar .tidoc-btn { flex: none; padding: 0 14px; font-size: 15px; }
#tidoc .tidoc-bar .tidoc-btn:focus-visible { box-shadow: 0 0 0 3px #fff; }

#tidoc .tidoc-say {
  position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 100001;
  padding: 13px 16px; background: var(--ink); color: #fff; border-left: 5px solid var(--yellow); border-radius: 10px;
  font-size: 15px; line-height: 1.4; box-shadow: 0 10px 30px rgba(17, 17, 17, .28);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .18s, transform .18s, visibility 0s .18s;
}
#tidoc .tidoc-say.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* ---------- preview ---------- */

#tidoc .tidoc-preview { display: none; }
.tidoc.is-previewing #tidoc-preview {
  display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 100000; background: #E9E9E6;
}
#tidoc .tidoc-preview-top {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px 10px 16px; background: var(--ink); color: #fff;
}
#tidoc .tidoc-preview-top strong { font-size: 17px; font-weight: 600; color: #fff; }
#tidoc .tidoc-preview-acts { display: flex; gap: 8px; }
#tidoc .tidoc-preview-acts .tidoc-btn { min-height: 44px; padding: 0 14px; font-size: 15px; }
#tidoc .tidoc-preview-acts .tidoc-btn-quiet { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
#tidoc .tidoc-preview-acts .tidoc-btn:focus-visible { box-shadow: 0 0 0 3px #fff; }
#tidoc .tidoc-print { display: none; }
#tidoc .tidoc-stage { flex: 1 1 auto; overflow: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
#tidoc .tidoc-fit { margin: 0 auto; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(17, 17, 17, .12), 0 14px 34px rgba(17, 17, 17, .14); }

/* The sheet is laid out at a fixed A4-shaped size and scaled to fit, so it looks like the PDF at any width. */
#tidoc .tidoc-paper {
  width: 760px; min-height: 1075px; padding: 58px; position: relative;
  background: #fff; color: #111; font-size: 13px; line-height: 1.5; transform-origin: 0 0;
}
#tidoc .tidoc-paper table { width: auto; margin: 0; border: 0; border-collapse: collapse; background: none; font-size: inherit; }
#tidoc .tidoc-paper th, #tidoc .tidoc-paper td { border: 0; background: none; padding: 0; font-size: inherit; line-height: inherit; color: inherit; text-align: left; vertical-align: top; text-transform: none; }
#tidoc .p-head { display: flex; justify-content: space-between; gap: 32px; }
#tidoc .p-from { min-width: 0; max-width: 360px; }
#tidoc .p-logo { display: block; max-width: 170px; max-height: 82px; width: auto; height: auto; margin: 0 0 14px; }
#tidoc .p-name { font-size: 20px; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
#tidoc .p-meta { margin-top: 4px; font-size: 12px; color: #5F6368; overflow-wrap: anywhere; }
#tidoc .p-ghost { color: #B5B7BD; font-weight: 400; }
#tidoc .p-doc { flex: none; text-align: right; }
#tidoc .p-title { font-size: 36px; line-height: 1.05; font-weight: 700; letter-spacing: -.02em; margin-bottom: 10px; }
#tidoc .p-facts { margin-left: auto !important; }
#tidoc .p-facts th { padding: 1px 14px 1px 0; font-size: 12px; font-weight: 400; color: #5F6368; text-align: right; }
#tidoc .p-facts td { padding: 1px 0; font-size: 12px; font-weight: 700; text-align: right; }
#tidoc .p-rule { height: 5px; margin: 26px 0 28px; }
#tidoc .p-label { font-size: 11.5px; color: #5F6368; margin-bottom: 2px; }
#tidoc .p-to { margin-bottom: 30px; }
#tidoc .p-to-name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
#tidoc .p-items { width: 100% !important; table-layout: fixed; }
#tidoc .p-items th { padding: 9px 12px; background: #F4F4F2; font-size: 11.5px; font-weight: 700; }
#tidoc .p-items td { padding: 10px 12px; border-bottom: 1px solid #D6D8DD; overflow-wrap: anywhere; white-space: pre-wrap; }
#tidoc .p-items th:nth-child(2), #tidoc .p-items td:nth-child(2) { width: 64px; text-align: right; }
#tidoc .p-items th:nth-child(3), #tidoc .p-items td:nth-child(3) { width: 116px; text-align: right; }
#tidoc .p-items th:nth-child(4), #tidoc .p-items td:nth-child(4) { width: 124px; text-align: right; }
#tidoc .p-items td:nth-child(n+2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
#tidoc .p-items td.p-ghost { color: #B5B7BD; }
#tidoc .p-sums { width: 300px !important; margin: 16px 0 0 auto !important; }
#tidoc .p-sums th { padding: 6px 12px; font-weight: 400; color: #5F6368; }
#tidoc .p-sums td { padding: 6px 12px; text-align: right; font-variant-numeric: tabular-nums; }
#tidoc .p-total { display: flex; justify-content: space-between; width: 300px; margin: 4px 0 34px auto; padding: 11px 12px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
#tidoc .p-block { margin-bottom: 20px; }
#tidoc .p-block .p-label { font-weight: 700; }
#tidoc .p-text { white-space: pre-wrap; overflow-wrap: anywhere; }
#tidoc .p-credit { position: absolute; left: 58px; bottom: 30px; font-size: 10.5px; color: #9A9A9A; }

/* ---------- below the tool ---------- */

#tidoc .tidoc-info { margin: 0; padding: 26px 0 30px; border-top: 2px solid var(--ink); max-width: 720px; }
#tidoc .tidoc-info h2 { margin: 0 0 16px; padding: 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
#tidoc .tidoc-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 16px; }
#tidoc .tidoc-steps li { position: relative; margin: 0; padding: 4px 0 0 52px; min-height: 38px; color: var(--soft); counter-increment: step; }
#tidoc .tidoc-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--yellow); color: var(--ink); font-weight: 600;
}
#tidoc .tidoc-steps strong { color: var(--ink); font-weight: 600; }
#tidoc .tidoc-q { border-bottom: 1px solid var(--line); }
#tidoc .tidoc-q summary { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 0; list-style: none; font-size: 17px; font-weight: 500; cursor: pointer; }
#tidoc .tidoc-q summary::-webkit-details-marker { display: none; }
#tidoc .tidoc-q summary::after { content: "+"; margin-left: auto; font-size: 24px; font-weight: 400; line-height: 1; }
#tidoc .tidoc-q[open] summary::after { content: "\2212"; }
#tidoc .tidoc-q summary:focus-visible { outline: 0; box-shadow: var(--focus); border-radius: 4px; }
#tidoc .tidoc-q p { margin: 0 0 18px; max-width: 62ch; color: var(--soft); }
#tidoc .tidoc-cta {
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 8px; padding: 26px 20px;
  background: var(--ink); color: #fff; border-radius: 14px;
}
#tidoc .tidoc-cta h2 { margin: 0 0 6px; padding: 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; color: #fff; }
#tidoc .tidoc-cta p { margin: 0; max-width: 46ch; color: #D6D6D6; }
#tidoc .tidoc-cta .tidoc-btn:focus-visible { box-shadow: 0 0 0 3px #fff; }

/* ---------- desk ---------- */

@media (min-width: 960px) {
  .tidoc { padding: 48px 24px 72px; }
  #tidoc .tidoc-intro { margin-bottom: 36px; }
  #tidoc .tidoc-intro h1 { max-width: 18ch; }
  #tidoc .tidoc-app { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 48px; align-items: start; margin-bottom: 56px; }
  #tidoc .tidoc-form { padding-bottom: 0; }
  #tidoc .tidoc-bar { display: none; }
  #tidoc .tidoc-preview, .tidoc.is-previewing #tidoc-preview {
    display: flex; flex-direction: column; position: sticky; inset: auto; top: 96px; z-index: 1;
    max-height: calc(100vh - 120px); background: #E9E9E6; border-radius: 14px; overflow: hidden;
  }
  #tidoc .tidoc-close { display: none; }
  #tidoc .tidoc-print { display: inline-flex; }
  #tidoc .tidoc-stage { padding: 24px; }
  #tidoc .tidoc-say { left: auto; right: 24px; bottom: 24px; max-width: 380px; }
  #tidoc .tidoc-cta { flex-direction: row; align-items: center; justify-content: space-between; padding: 34px 36px; }
}

@media (prefers-reduced-motion: reduce) {
  #tidoc *, #tidoc *::before, #tidoc *::after { transition: none !important; }
}
