/* Free Australian small-business tools — one stylesheet, no frameworks,
   no web fonts, no trackers. System font stack only, so the page paints
   immediately and nothing is requested from a third party. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #14181d;
  --text-soft: #55606d;
  --text-faint: #7b8794;
  --border: #dfe3e8;
  --border-strong: #c4cbd4;
  --accent: #0f7a52;
  --accent-hover: #0c6444;
  --accent-soft: #e6f4ee;
  --accent-text: #0b5c3e;
  --warn: #8a5300;
  --warn-soft: #fdf3e2;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --ok: #0f7a52;
  --ok-soft: #e6f4ee;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --maxw: 1080px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --surface: #171d23;
    --surface-2: #1f262e;
    --text: #e8edf2;
    --text-soft: #a8b4c0;
    --text-faint: #7f8c99;
    --border: #2a333c;
    --border-strong: #3a4650;
    --accent: #3fbc8c;
    --accent-hover: #58d3a4;
    --accent-soft: #12261f;
    --accent-text: #7fd8b4;
    --warn: #e0a942;
    --warn-soft: #2a2113;
    --danger: #f2807a;
    --danger-soft: #2c1a19;
    --ok: #3fbc8c;
    --ok-soft: #12261f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }

a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: 1.85rem; letter-spacing: -.015em; }
h2 { font-size: 1.28rem; margin-top: 1.8em; }
h3 { font-size: 1.05rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
small { color: var(--text-soft); }

/* ---------- header / nav ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 58px; flex-wrap: wrap;
}
.brand {
  font-weight: 700; letter-spacing: -.02em; color: var(--text);
  text-decoration: none; font-size: 1.02rem; white-space: nowrap;
}
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.site-nav a {
  color: var(--text-soft); text-decoration: none; font-size: .875rem;
  padding: 6px 9px; border-radius: var(--radius-sm); white-space: nowrap;
}
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

/* ---------- layout ---------- */

main { padding: 30px 0 64px; }

.page-head { margin-bottom: 26px; max-width: 760px; }
.page-head p { color: var(--text-soft); font-size: 1.03rem; }
.crumbs { font-size: .82rem; color: var(--text-faint); margin-bottom: 12px; }
.crumbs a { color: var(--text-faint); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-tool { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .grid-tool { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card-tight { padding: 16px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.tool-card { display: block; text-decoration: none; color: inherit; transition: border-color .12s, transform .12s; }
.tool-card:hover { border-color: var(--border-strong); }
.tool-card h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--accent-text); }
.tool-card p { margin: 0; font-size: .89rem; color: var(--text-soft); }
.tool-card .tag {
  display: inline-block; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700; color: var(--text-faint); margin-bottom: 8px;
}

/* ---------- forms ---------- */

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
label, .label {
  display: block; font-size: .84rem; font-weight: 600;
  margin-bottom: 5px; color: var(--text);
}
.hint { font-size: .78rem; color: var(--text-faint); font-weight: 400; margin-top: 4px; display: block; }
input[type="text"], input[type="number"], input[type="date"], input[type="email"],
input[type="tel"], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: .95rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
textarea { resize: vertical; min-height: 74px; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 150px; min-width: 0; }
.row-tight { gap: 8px; }
.row-tight > * { flex: 1 1 90px; }

.inline { display: flex; align-items: center; gap: 8px; }
.inline label { margin: 0; font-weight: 500; }

fieldset { border: 0; padding: 0; margin: 0 0 15px; }
legend { font-size: .84rem; font-weight: 600; padding: 0 0 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; font: inherit; font-size: .93rem; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary {
  background: var(--surface); color: var(--text); border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- results ---------- */

.result {
  background: var(--accent-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 15px; margin-top: 18px;
}
.result h2, .result h3 { margin-top: 0; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-soft); }
.big { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big-label { font-size: .8rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: .05em; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tr.total td { font-weight: 700; border-top: 2px solid var(--border-strong); }
.table-scroll { overflow-x: auto; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .93rem; }
.kv dt { color: var(--text-soft); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .01em;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-bad { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-neutral { background: var(--surface-2); color: var(--text-soft); }

.note {
  border-left: 3px solid var(--accent); background: var(--surface-2);
  padding: 11px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .88rem; color: var(--text-soft); margin: 16px 0;
}
.note-warn { border-left-color: var(--warn); }
.note :last-child { margin-bottom: 0; }
.note strong { color: var(--text); }

.source {
  font-size: .78rem; color: var(--text-faint); margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed var(--border);
}
.source a { color: var(--text-faint); }

details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin: 14px 0; background: var(--surface); }
details summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
details[open] summary { margin-bottom: 10px; }

/* ---------- ads / affiliate slots ---------- */
/* Reserved space, styled, but EMPTY. No third-party script is loaded — see
   docs/MONETISATION.md. A slot with no href renders nothing at all. */

.slot {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 16px; background: var(--surface); margin: 20px 0;
}
.slot-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); font-weight: 700; margin-bottom: 8px;
}
.slot.promo { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 28px 0 40px; margin-top: 40px; font-size: .86rem; color: var(--text-soft);
}
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; }
.site-footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); margin: 0 0 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 5px; }
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent-text); text-decoration: underline; }
.disclaimer {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: .8rem; color: var(--text-faint);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: #fff; padding: 10px 14px; z-index: 100; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

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

.invoice-preview {
  background: #fff; color: #14181d; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 26px; font-size: .86rem;
}
.invoice-preview h2 { font-size: 1.25rem; margin: 0; }
.invoice-preview .inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.invoice-preview .inv-title { font-size: 1.1rem; font-weight: 700; letter-spacing: .06em; }
.invoice-preview table { font-size: .84rem; }
.invoice-preview th { background: #f1f3f6; }
.invoice-preview .inv-total { font-size: 1.05rem; font-weight: 700; }
.line-items .line { display: grid; grid-template-columns: 2.2fr .6fr .9fr .8fr auto; gap: 8px; margin-bottom: 8px; align-items: start; }
@media (max-width: 700px) { .line-items .line { grid-template-columns: 1fr 1fr; } }
.line-items input { padding: 6px 8px; font-size: .88rem; }

@media print {
  .site-header, .site-footer, .no-print, .slot, .site-nav { display: none !important; }
  body { background: #fff; }
  .invoice-preview { border: 0; padding: 0; }
  main { padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
}
