/* Free tools — self-contained styles (no framework dependency, loads fast). */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: #f8fafc; color: #0f172a; line-height: 1.6; }
.tl-wrap { max-width: 860px; margin: 0 auto; padding: 0 18px; }
.tl-top { background: #fff; border-bottom: 1px solid #e2e8f0; }
.tl-top-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; flex-wrap: wrap; }
.tl-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 800; color: #1B2A4A; text-decoration: none; }
.tl-brand img { display: block; border-radius: 7px; }
.tl-brand:hover { color: #4f46e5; }
.tl-tool-head { display: flex; gap: 14px; align-items: flex-start; }
.tl-tool-badge, .tl-card-badge {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bb-brand-50, #EEF2FF); color: #4f46e5;
  border: 1px solid #E0E7FF;
}
.tl-card-badge { width: 36px; height: 36px; border-radius: 10px; color: #1B2A4A; background: #F0FDFA; border-color: #CCFBF1; }
.tl-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tl-nav a { color: #475569; text-decoration: none; font-size: .92rem; font-weight: 600; }
.tl-nav a:hover { color: #4f46e5; }
.tl-nav-cta { background: #4f46e5; color: #fff !important; padding: 8px 16px; border-radius: 9px; }
.tl-crumbs { margin: 20px 0 4px; font-size: .83rem; color: #64748b; }
.tl-crumbs a { color: #4f46e5; text-decoration: none; }
.tl-h1 { font-size: 1.55rem; margin: 18px 0 8px; line-height: 1.3; }
.tl-h2 { font-size: 1.15rem; margin: 0 0 10px; color: #1e293b; }
.tl-intro { color: #475569; font-size: .97rem; margin-bottom: 22px; max-width: 720px; }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 22px 0 40px; }
.tl-card { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.tl-card:hover { border-color: #4f46e5; box-shadow: 0 8px 24px rgba(79,70,229,.12); }
.tl-card-title { font-weight: 700; color: #0f172a; font-size: 1.02rem; }
.tl-card-text { color: #64748b; font-size: .86rem; flex: 1; }
.tl-card-go { color: #4f46e5; font-weight: 700; font-size: .86rem; }
.tl-tool { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 22px; margin-bottom: 30px; }
.tl-faq, .tl-next, .tl-related { margin-bottom: 30px; }
.tl-faq-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 8px; padding: 12px 16px; }
.tl-faq-item summary { cursor: pointer; font-weight: 600; font-size: .93rem; }
.tl-faq-item p { margin-top: 8px; color: #475569; font-size: .9rem; }
.tl-next { background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 16px; padding: 22px; }
.tl-next p { color: #3730a3; font-size: .95rem; margin-bottom: 14px; }
.tl-cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 !important; }
.tl-btn { display: inline-block; background: #4f46e5; color: #fff; text-decoration: none; font-weight: 700; font-size: .93rem; padding: 12px 22px; border-radius: 10px; border: none; cursor: pointer; }
.tl-btn-ghost { background: #fff; color: #4f46e5; border: 1px solid #c7d2fe; }
.tl-related-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.tl-related-list a { color: #4f46e5; text-decoration: none; font-size: .9rem; font-weight: 600; }
.tl-foot { border-top: 1px solid #e2e8f0; margin-top: 30px; padding: 22px 0 40px; }
.tl-foot p { color: #64748b; font-size: .83rem; }
.tl-foot a { color: #4f46e5; text-decoration: none; }


/* Tool internals (shared by every app/Tools/*.php include) */
.tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .tf-row { grid-template-columns: 1fr; } }
.tf-field { margin-bottom: 12px; }
.tf-field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 5px; }
.tf-field input, .tf-field select, .tf-field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid #cbd5e1; border-radius: 9px;
  font-size: .93rem; font-family: inherit; background: #fff;
}
.tf-field input:focus, .tf-field select:focus, .tf-field textarea:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.tf-hint { font-size: .78rem; color: #6b7584; margin-top: 4px; }
.tf-result { background: #f1f5f9; border-radius: 12px; padding: 16px; margin-top: 16px; }
.tf-result table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tf-result td { padding: 7px 4px; border-bottom: 1px solid #e2e8f0; }
.tf-result td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tf-result .tf-total td { border-bottom: none; font-size: 1.08rem; font-weight: 800; color: #4f46e5; padding-top: 12px; }
.tf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tf-btn { background: #4f46e5; color: #fff; border: none; border-radius: 9px; padding: 10px 18px; font-weight: 700; font-size: .88rem; cursor: pointer; }
.tf-btn-ghost { background: #fff; color: #4f46e5; border: 1.5px solid #c7d2fe; }
.tf-note { font-size: .8rem; color: #6b7584; margin-top: 10px; }
.tf-error { color: #b91c1c; font-size: .85rem; margin-top: 8px; display: none; }
.tf-items { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.tf-items th { text-align: left; font-size: .78rem; color: #64748b; padding: 4px 6px; }
.tf-items td { padding: 4px 6px; }
.tf-items input { width: 100%; padding: 8px 10px; border: 1.5px solid #cbd5e1; border-radius: 8px; font-size: .88rem; }
.tf-items .tf-del { color: #b91c1c; background: none; border: none; cursor: pointer; font-size: 1rem; padding: 4px 8px; min-width: 44px; min-height: 44px; }
.tf-items select { width: 100%; padding: 8px 6px; border: 1.5px solid #cbd5e1; border-radius: 8px; font-size: .88rem; background: #fff; }

/* Phones: a five-column line-item row left each number box ~20px wide, so
   "1000" showed as "1(" and the invoice and GST invoice generators could not
   be used on a phone at all. Each row becomes a small card: description
   across the top, the numbers two to a row, each labelled from the cell's
   data-label (the column header is hidden at this width). */
@media (max-width: 560px) {
    .tf-items thead { display: none; }
    .tf-items, .tf-items tbody { display: block; }
    .tf-items tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; margin-bottom: 10px;
                   border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; position: relative; }
    .tf-items td { display: block; padding: 0; min-width: 0; }
    .tf-items td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 600;
                                       color: #64748b; margin-bottom: 3px; }
    .tf-items td:first-child { grid-column: 1 / -1; padding-right: 44px; }
    .tf-items td.tf-del-cell { position: absolute; top: 4px; right: 4px; }
    .tf-items input, .tf-items select { min-height: 44px; font-size: 16px; }
}

/* Printable document output */
.tf-doc { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 28px; margin-top: 18px; display: none; }
.tf-doc h3 { font-size: 1.25rem; color: #4f46e5; }
.tf-doc-meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 14px 0; font-size: .88rem; }
.tf-doc-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .88rem; }
.tf-doc-table th { text-align: left; background: #f1f5f9; padding: 8px; border: 1px solid #e2e8f0; }
.tf-doc-table td { padding: 8px; border: 1px solid #e2e8f0; }
.tf-doc-table td.r, .tf-doc-table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tf-doc-total { text-align: right; font-size: 1.05rem; font-weight: 800; color: #0f172a; margin-top: 8px; }
.tf-doc-note { font-size: .8rem; color: #64748b; margin-top: 14px; white-space: pre-line; }
@media print {
  body * { visibility: hidden; }
  .tf-doc, .tf-doc * { visibility: visible; }
  .tf-doc { position: absolute; inset: 0; border: none; border-radius: 0; padding: 0 12px; }
}
