/* The free tools at /tools/: a form beside its live result. Uses the site's tokens (css/site.css). */

.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.tool [hidden] { display: none !important; }
.tool-form { padding: clamp(18px, 2.4vw, 28px); border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 18px; min-width: 0; }
.tool-result { position: sticky; top: calc(var(--nav-h) + 20px); padding: clamp(18px, 2.4vw, 28px); border-radius: var(--r-card); background: linear-gradient(160deg, #1d120c 0%, var(--bg-2) 55%); border: 1px solid rgb(255 106 43 / .25); min-width: 0; }

.t-label { font-family: "Geist Mono", monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin: 0 0 10px; }
.tool-result .t-label:not(:first-child) { margin-top: 22px; }
.t-hint { color: var(--dim); font-size: 13px; }
.t-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.t-money { position: relative; display: block; }
.t-money > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; font-variant-numeric: tabular-nums; }
.field .t-money input, .t-line .t-money input { padding-left: 30px; font-variant-numeric: tabular-nums; }

.t-modes { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.t-modes label { position: relative; cursor: pointer; }
.t-modes input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.t-modes span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: 14.5px; transition: border-color .2s, color .2s, background .2s; }
.t-modes input:checked + span { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.t-modes input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.t-check { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 15px; cursor: pointer; }
.t-check input { width: 18px; height: 18px; accent-color: var(--accent); }

.t-rows { margin: 0; display: grid; }
.t-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.t-rows dt { color: var(--muted); font-size: 15px; }
.t-rows dd { margin: 0; text-align: right; font-family: "Geist Mono", monospace; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text); }
.t-rows dd small { display: block; font-family: "Geist", sans-serif; font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.t-rows .is-key dd { color: var(--accent); }
.t-rows .is-total { border-bottom: 0; padding-top: 16px; }
.t-rows .is-total dt { color: var(--text); font-weight: 600; font-size: 1.05rem; }
.t-rows .is-total dd { font-size: 1.35rem; font-weight: 500; }
.t-note { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin-top: 14px; }
.t-error { color: #ff8a65; font-size: 15px; line-height: 1.5; }
.t-warn { color: #ff8a65; font-weight: 600; }
.t-pre { white-space: pre-wrap; word-break: break-word; font-family: "Geist Mono", monospace; font-size: 13px; line-height: 1.6; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-input); padding: 14px 16px; color: var(--text); margin: 0; overflow-x: auto; }
.t-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.t-sample { color: var(--dim); font-size: 13.5px; margin-top: 14px; max-width: 80ch; }
.t-privacy { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13.5px; margin-top: 8px; }
.t-privacy .ph { color: var(--accent); }

.t-deadline { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r-input); background: var(--bg-2); border: 1px dashed var(--line-2); }
.t-deadline p { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin: 0; }
.t-deadline b { color: var(--text); }
.t-lines { gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.t-lines legend { margin-bottom: 4px; }
.t-line { display: grid; grid-template-columns: 92px minmax(0, 1fr) 140px 40px; gap: 8px; align-items: center; }
.t-line select, .t-line input { width: 100%; height: 44px; padding: 0 12px; border-radius: var(--r-input); background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); font: inherit; font-size: 16px; }
.t-line select:focus, .t-line input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(255 106 43 / .2); }
.t-x { height: 44px; width: 40px; display: grid; place-items: center; border-radius: var(--r-input); border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.t-x:hover { color: var(--text); border-color: var(--line-2); }
.t-lines [data-add-line] { justify-self: start; }

.t-band-h { display: flex; align-items: center; gap: 10px; font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.02em; margin-bottom: 10px; }
.t-band-h .ph { color: var(--accent); }
.t-also { margin-top: 16px; }

@media (max-width: 900px) {
  .tool { grid-template-columns: 1fr; }
  .tool-result { position: static; }
}
@media (max-width: 560px) {
  .t-two { grid-template-columns: 1fr; }
  .t-line { grid-template-columns: 80px minmax(0, 1fr) 40px; }
  .t-line .t-money { grid-column: 2 / 3; }
}

/* printing a notice: only the notice, black on white */
@media print {
  body * { visibility: hidden !important; }
  .t-print, .t-print * { visibility: visible !important; }
  .t-print { position: absolute; left: 0; top: 0; width: 100%; color: #000 !important; background: #fff !important; border: 0 !important; font-size: 10.5pt; padding: 0; }
}
.tool-form [data-panel], .tool-form [data-notified], .tool-form [data-own] { display: grid; gap: 18px; }
