/* Free tools (app/tools.php, assets/js/tools.js): the hub, then each tool as form cards on the left and the results on
   the right, in the site's forms look (underlined boxes, cards with a title, a muted line and a divider) */

.tool-page { padding-bottom: 40px; }
.tool-hero { max-width: 760px; margin-bottom: 26px; }
.tool-hero .lead { margin-bottom: 12px; }
.tool-private { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.tool-private .ic { flex: none; margin-top: 2px; color: var(--gold); }
.tool-crumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; color: var(--text-3); }
.tool-crumbs a { color: var(--text-2); }
.tool-disc { margin: 22px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }

/* ---------- the hub ---------- */
.tool-hub { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; height: 100%; padding: 22px 22px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.tool-card .ic-box { margin-bottom: 6px; }
.tool-card b { font: 700 16.5px/1.3 var(--head); color: var(--text); }
.tool-card > span:not(.ic-box) { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.tool-card em { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-style: normal; font-weight: 600; font-size: 14px; color: var(--gold); }
.tool-card:hover { border-color: var(--gold-line); transform: translateY(-2px); box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .7); }
.tool-card-kit { background: radial-gradient(120% 140% at 100% 0%, var(--gold-soft), transparent 60%), var(--surface); }

/* ---------- a tool: form on the left, results on the right ---------- */
.tool-two { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
.tool-two > div { display: grid; gap: 18px; min-width: 0; }
.tool-side { position: sticky; top: 92px; }
.tool-sec { padding: 24px 28px 26px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); min-width: 0; }
.tool-sec-h { margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.tool-sec-h h2 { margin: 0 0 4px; font: 700 17px/1.3 var(--head); color: var(--text); }
.tool-sec-h p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-3); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 26px; align-items: start; }
.tg1 { grid-column: span 1; min-width: 0; }
.tg2 { grid-column: span 2; min-width: 0; }

/* underlined boxes, with $ or % inside the line */
.tool-f { display: grid; gap: 2px; margin: 0; }
.tool-f label, .tool-f .tool-l { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.tool-in { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); transition: border-color .15s ease, box-shadow .15s ease; }
.tool-in:hover { border-color: var(--text-3); }
.tool-in:focus-within { border-color: var(--gold); box-shadow: 0 1px 0 0 var(--gold); }
.tool-in i { font-style: normal; font-size: 14px; color: var(--text-3); white-space: nowrap; }
.tool-in input, .tool-in select { flex: 1; min-width: 0; min-height: 40px; padding: 8px 0 9px; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.tool-in input:focus, .tool-in select:focus { outline: none; box-shadow: none; }
.tool-in input::placeholder { color: var(--text-3); opacity: .7; }
.tool-in select { appearance: none; cursor: pointer; padding-right: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239EA18C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 2px center / 12px 8px no-repeat; }
.tool-in select option { background: var(--surface); color: var(--text); }
.tool-in input[type="date"] { color-scheme: dark; }
:root[data-theme="light"] .tool-in input[type="date"] { color-scheme: light; }
.tool-f .hint { margin: 6px 0 0; }

/* rows of cards or debts: plain rows, a × at the end */
.tool-rows { list-style: none; margin: 0; padding: 0; }
.tool-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 10px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--border); }
.tool-row:first-child { padding-top: 0; }
.tool-x { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; }
.tool-x:hover { color: var(--err); background: var(--err-soft); }
.tool-add { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 0; border: 0; background: none; font: 600 14px/1.4 var(--sans); color: var(--gold); cursor: pointer; }
.tool-add span { font-size: 18px; line-height: 1; }

/* choices: plain options with a dot */
.tool-dots { margin: 20px 0 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 26px; }
.tool-dots legend { padding: 0; margin-bottom: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.tool-dots label { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; align-items: start; padding: 9px 0; cursor: pointer; }
.tool-dots input { appearance: none; width: 18px; height: 18px; margin: 2px 0 0; border: 2px solid var(--border); border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.tool-dots input:checked { border-color: var(--gold); background: radial-gradient(circle, var(--gold) 0 42%, transparent 46%); }
.tool-dots input:focus-visible { box-shadow: var(--focus); }
.tool-dots b { display: block; font-weight: 600; font-size: 14.5px; color: var(--text); }
.tool-dots small { display: block; margin-top: 1px; font-size: 13px; color: var(--text-3); }
.tool-dots label:has(input:checked) b { color: var(--gold); }
.tool-sec > .tool-dots:first-child { margin-top: 0; }
.tool-dots3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 18px; }
.tool-dots4 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.tool-q { margin: 0; padding: 16px 0; border: 0; border-bottom: 1px solid var(--border); }
.tool-q:first-of-type { padding-top: 0; }
.tool-q:last-of-type { border-bottom: 0; padding-bottom: 0; }
.tool-q legend { display: flex; gap: 10px; align-items: baseline; padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 15px; color: var(--text); }
.tool-qn { flex: none; font: 800 13px/1 var(--head); color: var(--gold); font-variant-numeric: tabular-nums; }

/* tick lines */
.tool-ticks { list-style: none; margin: 0; padding: 0; }
.tool-ticks li { border-bottom: 1px solid var(--border); }
.tool-ticks li:last-child { border-bottom: 0; }
.tool-ticks label { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; align-items: start; padding: 11px 0; cursor: pointer; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.tool-ticks input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--gold); cursor: pointer; }
.tool-ticks label:has(input:checked) span { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border); }

/* ---------- results ---------- */
.tool-out { background: radial-gradient(130% 90% at 100% 0%, var(--gold-soft), transparent 55%), var(--surface); }
.tool-big { display: grid; gap: 4px; margin-bottom: 16px; }
.tool-big b { font: 800 40px/1.1 var(--head); color: var(--text); font-variant-numeric: tabular-nums; }
.tool-big span { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.tool-meter { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.tool-meter > span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: var(--gold); transition: width .35s ease; }
.tool-meter > i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); }
.tool-meter .m10 { left: 10%; } .tool-meter .m30 { left: 30%; } .tool-meter .m50 { left: 50%; }
.tool-meter-k { position: relative; height: 18px; margin: 6px 0 16px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tool-meter-k span { position: absolute; top: 0; transform: translateX(-50%); }
.tool-meter-k span:nth-child(1) { left: 0; transform: none; } .tool-meter-k span:nth-child(2) { left: 10%; } .tool-meter-k span:nth-child(3) { left: 30%; }
.tool-meter-k span:nth-child(4) { left: 50%; } .tool-meter-k span:nth-child(5) { right: 0; left: auto; transform: none; }
[data-band="mid"] .tool-meter > span { background: var(--warn); }
[data-band="high"] .tool-meter > span { background: var(--err); }
.tool-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 0; }
.tool-facts > div { padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.tool-facts dt { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tool-facts dd { margin: 2px 0 0; font: 700 16px/1.3 var(--head); color: var(--text); font-variant-numeric: tabular-nums; }
.tool-note { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.tool-cards { list-style: none; margin: 12px 0 0; padding: 0; }
.tool-cards:empty { display: none; }
.tool-cards li { display: grid; grid-template-columns: minmax(0, 1fr) 70px 60px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.tool-order li { grid-template-columns: minmax(0, 1fr) auto; }
.tc-t { display: grid; gap: 1px; min-width: 0; }
.tc-t b { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-t span { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tc-m { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.tc-m span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--gold); }
.tool-cards strong { font-weight: 700; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.tc-mid .tc-m span { background: var(--warn); } .tc-high .tc-m span { background: var(--err); }
.tc-high strong { color: var(--err); }
.tool-split { height: 10px; border-radius: 99px; background: var(--warn); overflow: hidden; margin-top: 16px; }
.tool-split .sp-a { display: block; height: 100%; width: 100%; background: var(--gold); border-right: 2px solid var(--surface); }
.tool-split-k { display: flex; gap: 18px; margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.tool-split-k i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.tool-split-k .sp-a { background: var(--gold); } .tool-split-k .sp-b { background: var(--warn); }
.tool-table-wrap { overflow-x: auto; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tool-table th { text-align: left; padding: 0 10px 8px 0; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); }
.tool-table td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--border); color: var(--text-2); }
.tool-table td:first-child { color: var(--text); font-weight: 600; }
.tool-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.tool-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tool-acts .btn .ic { margin-right: 4px; }
.tp-ph + .tp-ph { margin-top: 12px; }
.tp-ph h3 { margin: 0; padding: 10px 0 2px; font: 700 12px/1.3 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.tool-areas { list-style: none; margin: 0; padding: 0; }
.tool-areas li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); }
.tool-areas b { font-weight: 600; font-size: 14px; color: var(--text); }
.ta-pill { flex: none; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.ta-ok .ta-pill { color: var(--ok); }
.ta-high .ta-pill { background: var(--gold-soft); color: var(--gold); }
.tool-h3 { margin: 18px 0 4px; font: 700 15px/1.3 var(--head); color: var(--text); }
.tool-todo { margin: 0; padding: 0 0 0 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--text-2); }

/* other tools, then the kit */
.tool-more { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 30px 0 26px; }
.tool-more > span { margin-right: 6px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.tool-more a { padding: 7px 14px; border: 1px solid var(--border); border-radius: 99px; font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.tool-more a:hover { border-color: var(--gold-line); color: var(--gold); }

@media (max-width: 1100px) {
  .tool-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .tool-two { grid-template-columns: minmax(0, 1fr); }
  .tool-side { position: static; }
}
@media (max-width: 640px) {
  .tool-hub { grid-template-columns: minmax(0, 1fr); }
  .tool-sec { padding: 20px 16px 22px; border-radius: 16px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
  .tg2 { grid-column: 1 / -1; }
  .tool-dots, .tool-dots3, .tool-dots4 { grid-template-columns: minmax(0, 1fr); }
  .tool-big b { font-size: 34px; }
  .tool-cards li { grid-template-columns: minmax(0, 1fr) 50px 52px; }
}

/* print: just the tool and its results */
@media print {
  .site-header, .site-footer, .tool-crumbs, .tool-more, .tool-kit, .tool-acts, .tool-add, .tool-x, .chat-btn, .preview-bar, .notice-bar, .toasts, .tool-disc { display: none !important; }
  body, .tool-sec { background: #fff !important; color: #000 !important; }
  .tool-two { grid-template-columns: 1fr 1fr; }
  .tool-side { position: static; }
  .tool-sec { border-color: #ccc; break-inside: avoid; }
}
