/* GigToolbox — shared stylesheet. Mobile-first, no external fonts. */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #16202f;
  --muted: #566176;
  --border: #d9dee8;
  --brand: #0f766e;
  --brand-strong: #0b5e58;
  --brand-soft: #e3f4f2;
  --on-brand: #ffffff;
  --accent: #f59e0b;
  --danger: #b42318;
  --ok: #067647;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .06);
  --maxw: 1120px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #171e28;
    --surface-2: #1f2834;
    --text: #e8edf4;
    --muted: #a3aebf;
    --border: #2d3846;
    --brand: #2dd4bf;
    --brand-strong: #5eead4;
    --brand-soft: #123532;
    --on-brand: #04201d;
    --danger: #f97066;
    --ok: #47cd89;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.25);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand-strong); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 1.4em 0 .5em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin-top: .4em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p, ul, ol { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.logo span b { color: var(--brand); }
.nav-toggle { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }
.site-nav { display: none; width: 100%; padding: 8px 0 14px; }
.site-nav.open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-nav a { display: block; padding: 10px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.header-inner { flex-wrap: wrap; }
@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; width: auto; padding: 0; }
  .site-nav ul { display: flex; gap: 2px; }
  .site-nav a { padding: 8px 10px; font-size: .95rem; }
}

main { padding: 20px 0 40px; }
.breadcrumb { font-size: .9rem; color: var(--muted); margin: 6px 0 0; }
.breadcrumb a { color: var(--muted); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 70ch; }
.prose { max-width: 75ch; }
.prose li { margin-bottom: .35em; }

/* Hero */
.hero { padding: 26px 0 8px; }
.hero h1 { max-width: 22ch; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.badges li { background: var(--brand-soft); color: var(--brand-strong); border-radius: 999px; padding: 4px 12px; font-size: .9rem; font-weight: 600; }

/* Cards */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tool-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.tool-card h3 { margin: 4px 0 0; color: var(--brand-strong); }
.tool-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.tool-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-weight: 800; font-size: .95rem; }

/* Tool layout */
.tool-layout { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .tool-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.tool-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tool-panel h2 { margin-top: 0; font-size: 1.15rem; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label, .label { font-weight: 600; font-size: .93rem; }
.field small, .hint { color: var(--muted); font-size: .85rem; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .row-2 { grid-template-columns: 1fr 1fr; } .row-3 { grid-template-columns: 1fr 1fr 1fr; } }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-soft); }
.input-group { display: flex; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border); border-left: 0; border-radius: 0 8px 8px 0; background: var(--surface-2); color: var(--muted); min-width: 44px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 14px; flex-wrap: wrap; }
.segmented button { font: inherit; border: 0; background: var(--surface); color: var(--text); padding: 9px 14px; cursor: pointer; min-height: 44px; }
.segmented button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; min-height: 44px; cursor: pointer; border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); text-decoration: none; }
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-secondary { background: var(--surface); color: var(--brand-strong); }
.btn-secondary:hover { background: var(--brand-soft); color: var(--brand-strong); }
.btn-small { padding: 6px 10px; min-height: 36px; font-size: .9rem; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
details.advanced { margin: 6px 0 12px; border: 1px dashed var(--border); border-radius: 10px; padding: 8px 12px; }
details.advanced summary { cursor: pointer; font-weight: 600; }

.results { display: grid; gap: 10px; }
.result-main { background: var(--brand-soft); border-radius: 10px; padding: 14px; }
.result-main .label { color: var(--brand-strong); }
.result-main .value { font-size: clamp(1.7rem, 6vw, 2.2rem); font-weight: 800; color: var(--brand-strong); line-height: 1.2; word-break: break-word; }
.result-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.result-table th, .result-table td { padding: 8px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.result-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.note { font-size: .88rem; color: var(--muted); }
.warn { color: var(--danger); font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }

/* Content tables */
.table-wrap { overflow-x: auto; margin: 0 0 1em; }
.data-table { border-collapse: collapse; min-width: 420px; width: 100%; background: var(--surface); }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.data-table th { background: var(--surface-2); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .6em 0 0; }

/* Ad slot placeholder: reserved height prevents layout shift. Hidden until ads are enabled. */
.ad-slot { display: none; margin: 24px auto; max-width: 100%; min-height: 100px; text-align: center; }
.ads-enabled .ad-slot { display: block; }

.related { margin-top: 32px; }
.callout { border-left: 4px solid var(--brand); background: var(--surface); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 0 0 1em; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 28px 0 18px; font-size: .93rem; color: var(--muted); }
.footer-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { font-size: 1rem; margin: 0 0 8px; color: var(--text); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 4px; }
.site-footer a { color: var(--muted); }
.copyright { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* Invoice / quote document */
.doc-editor .items { width: 100%; border-collapse: collapse; }
.doc-editor .items th { text-align: left; font-size: .85rem; color: var(--muted); padding: 4px; }
.doc-editor .items td { padding: 4px; vertical-align: top; }
.doc-editor .items input { min-height: 40px; padding: 8px; }
.doc-editor .col-qty { width: 70px; } .doc-editor .col-rate { width: 110px; } .doc-editor .col-amt { width: 100px; text-align: right; } .doc-editor .col-del { width: 44px; }
@media (max-width: 560px) {
  .doc-editor .items thead { display: none; }
  .doc-editor .items tr { display: grid; grid-template-columns: 1fr 1fr 1fr 44px; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .doc-editor .items td.col-desc { grid-column: 1 / -1; }
  .doc-editor .items td { padding: 0; width: auto; }
  .doc-editor .col-amt { align-self: center; }
}
.preview-doc { background: #fff; color: #111; border: 1px solid #d9dee8; border-radius: 8px; padding: 28px; font-size: 14px; line-height: 1.5; overflow-x: auto; }
.preview-doc .doc-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.preview-doc h2 { margin: 0; font-size: 26px; letter-spacing: 1px; color: #0f766e; }
.preview-doc .doc-meta { text-align: right; }
.preview-doc .doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.preview-doc .doc-parties h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #555; margin: 0 0 4px; }
.preview-doc table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.preview-doc th { background: #f1f5f9; text-align: left; padding: 8px; font-size: 12px; text-transform: uppercase; }
.preview-doc td { padding: 8px; border-bottom: 1px solid #e5e7eb; }
.preview-doc .num { text-align: right; white-space: nowrap; }
.preview-doc .totals { margin-left: auto; width: min(100%, 300px); }
.preview-doc .totals td { border: 0; padding: 4px 8px; }
.preview-doc .totals .grand td { border-top: 2px solid #111; font-weight: 700; font-size: 16px; }
.preview-doc .doc-notes { white-space: pre-wrap; margin-top: 16px; color: #333; }
.preview-doc .pre { white-space: pre-wrap; }

@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; }
  .no-print, .site-header, .site-footer, .ad-slot, .breadcrumb, .tool-content, .related, .hero-tool-text { display: none !important; }
  main { padding: 0; }
  .container { max-width: none; padding: 0; }
  .tool-layout { display: block; }
  .print-area { display: block !important; }
  .preview-doc { border: 0; padding: 0; font-size: 12pt; }
  .print-area .tool-panel { border: 0; box-shadow: none; padding: 0; }
  .print-area .tool-panel > h2 { display: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.placeholder { background: #fff3cd; color: #7a4b00; padding: 2px 6px; border-radius: 4px; }
[hidden] { display: none !important; }
