/* ── Free tools (components/tools/*.php) ───────────────────────────── */
.tool-wrap { margin: 0 0 2rem; }
.tool { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-md); padding: clamp(1rem, 3vw, 1.6rem); }
.tool-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.tool-head h2 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.2rem; font-weight: 800; color: var(--ink); margin: 0; }
.tool-head .tool-badge { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--green-d); background: rgba(29, 191, 115, .1); padding: .2rem .55rem; border-radius: 99px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.tool-grid.one { grid-template-columns: minmax(0, 1fr); }

.tool-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.tool-form .full { grid-column: 1 / -1; }
.tool-form label, .tool-field { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; font-weight: 700; color: var(--ink); min-width: 0; }
.tool-form input, .tool-form select, .tool-form textarea, .tool-field input, .tool-field select, .tool-field textarea {
  width: 100%; min-width: 0; font: inherit; font-size: .95rem; padding: .6rem .75rem; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink); }
.tool-form input:focus, .tool-form select:focus, .tool-form textarea:focus { outline: none; border-color: var(--green-d); }
.tool-form textarea { resize: vertical; min-height: 80px; }
.tool-hint { font-size: .74rem; font-weight: 500; color: var(--muted); }
.tool-err { font-size: .78rem; font-weight: 600; color: #b91c1c; min-height: 1em; }
.tool-count { font-size: .74rem; font-weight: 600; color: var(--muted); }
.tool-count.warn { color: #b45309; } .tool-count.bad { color: #b91c1c; } .tool-count.ok { color: var(--green-d); }

.tool-out { border: 1px dashed var(--border); border-radius: var(--radius); padding: 1rem; background: var(--off); display: flex; flex-direction: column; gap: .8rem; align-items: stretch; min-width: 0; }
.tool-preview { display: flex; justify-content: center; }
.tool-preview canvas, .tool-preview img { max-width: 100%; height: auto; border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); }
.tool-code { position: relative; }
.tool-code pre { background: #111110; color: #e9f7ef; padding: .8rem 1rem; border-radius: 10px; overflow-x: auto; font-size: .78rem; line-height: 1.55; margin: 0; white-space: pre-wrap; word-break: break-word; max-height: 360px; }
.tool-link { font-family: ui-monospace, monospace; font-size: .85rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem; word-break: break-all; }

.tool-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.tool-actions button, .tool-actions a { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-size: .85rem; font-weight: 700; padding: .6rem 1rem; border-radius: 10px; cursor: pointer; border: 1.5px solid var(--border); background: #fff; color: var(--ink); text-decoration: none; }
.tool-actions .primary { background: var(--green); border-color: var(--green); color: #fff; }
.tool-actions .primary:hover { filter: brightness(1.05); }
.tool-actions button:disabled { opacity: .7; cursor: default; }
.tool-actions svg { width: 16px; height: 16px; }
.tool-made { font-size: .72rem; color: var(--muted); text-align: center; }

.tool-cta { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--radius); background: linear-gradient(135deg, rgba(29, 191, 115, .08), rgba(124, 58, 237, .05)); border: 1px solid rgba(29, 191, 115, .3); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; font-size: .9rem; }
.tool-cta a { font-weight: 700; color: var(--green-d); }

/* Tabs and chips */
.tool-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.tool-tabs button { font: inherit; font-size: .82rem; font-weight: 700; padding: .45rem .9rem; border-radius: 99px; border: 1.5px solid var(--border); background: #fff; color: var(--ink); cursor: pointer; }
.tool-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tool-checks { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .8rem; }
.tool-checks label { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 600; font-size: .85rem; }
.tool-checks input { width: auto; margin-top: .2rem; }

/* Result summary (calculators) */
.tool-result { text-align: center; }
.tool-result .big { font-family: 'Bricolage Grotesque', sans-serif; font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; color: var(--ink); line-height: 1.15; }
.tool-result .sub { font-size: .85rem; color: var(--muted); }
.tool-lines { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tool-lines td { padding: .35rem .2rem; border-bottom: 1px solid var(--border); }
.tool-lines td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }

/* Invoice items table */
.inv-items { width: 100%; border-collapse: collapse; font-size: .85rem; }
.inv-items th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .3rem; }
.inv-items td { padding: .25rem; vertical-align: top; }
.inv-items input, .inv-items select { padding: .45rem .5rem; font-size: .85rem; }
.inv-items .del { border: 0; background: none; color: #b91c1c; font-size: 1.1rem; cursor: pointer; padding: .3rem; }
.inv-scroll { overflow-x: auto; }
.inv-totals { margin-left: auto; min-width: 240px; }

/* Google SERP preview (meta tag tool) */
.serp { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1rem; font-family: Arial, sans-serif; max-width: 600px; }
.serp-site { font-size: 12px; color: #202124; display: flex; align-items: center; gap: .45rem; }
.serp-site i { width: 22px; height: 22px; border-radius: 50%; background: #f1f3f4; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; color: #5f6368; }
.serp-url { color: #4d5156; font-size: 12px; }
.serp-title { color: #1a0dab; font-size: 20px; line-height: 1.3; margin: .25rem 0 .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-desc { color: #4d5156; font-size: 14px; line-height: 1.58; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 760px) {
  .tool-grid, .tool-form, .tool-checks { grid-template-columns: minmax(0, 1fr); }
}
