/* Free tools in /tools/. Loads after style.css and pages.css and reuses their tokens. */
.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; }

.tool { margin-top: 28px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 1px 2px oklch(0.2 0.05 262 / .05); padding: clamp(18px, 3.4vw, 32px); }
.tool-form { display: grid; gap: 18px; }
.tool-row { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.tool-field { display: grid; gap: 6px; align-content: start; min-width: 0; flex: 1 1 180px; }
.tool-field.grow { flex: 3 1 280px; }
.tool-field:has(select) { flex: 1 1 15rem; }
.tool-field label, .tool-legend { font-size: 14px; font-weight: 600; color: var(--ink); }
.tool-field .help { font-size: 13px; line-height: 1.45; color: var(--muted); }
.tool input[type="text"], .tool input[type="number"], .tool input[type="password"], .tool select, .tool textarea {
  font: inherit; font-size: 16px; width: 100%; min-width: 0; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.tool textarea { font-family: var(--mono); font-size: 14px; line-height: 1.55; resize: vertical; }
.tool select { appearance: none; padding-right: 38px; background: var(--bg) 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='%23596173' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.tool input::placeholder, .tool textarea::placeholder { color: var(--muted); }
.tool :is(input, select, textarea):focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.tool [aria-invalid="true"] { border-color: var(--red); }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.tool-try { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.tool-try .inline-link { font-size: 14px; }
.tool .inline-link:focus-visible, .tool button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.tool-out { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.tool-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.tool-privacy { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 62ch; }
.tool-next { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.5; color: var(--ink); }
.tool-next a { color: var(--blue); font-weight: 500; text-underline-offset: 3px; margin-left: 4px; white-space: nowrap; }
#rf-out[hidden] + .tool-next { display: none; }

/* RSS finder */
.rf-platform, .rf-msg { margin: 0; font-size: 16px; line-height: 1.55; }
.rf-msg { margin-top: 6px; color: var(--muted); }
.rf-msg.bad, .rf-live.bad { color: var(--red); }
.rf-feeds { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.rf-feed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.rf-feed-main { display: grid; gap: 2px; min-width: 0; }
.rf-url, .rf-live code { font-family: var(--mono); font-size: 14px; color: var(--blue-ink); overflow-wrap: anywhere; }
.rf-note { font-size: 13px; color: var(--muted); }
.rf-feed-act { display: flex; gap: 8px; }
.rf-live-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 18px; }
.rf-live-hint { font-size: 13px; color: var(--muted); }
.rf-live { margin: 12px 0 0; font-size: 15px; line-height: 1.55; min-height: 1.5em; }
.rf-live.ok { padding: 12px 14px; border-radius: 12px; background: var(--green-soft); color: oklch(0.36 0.1 160); }
.rf-live.ok::before { content: "Confirmed. "; font-weight: 600; }

/* overload calculator */
.oc-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 16px; }
.oc-results { margin: 0; display: grid; }
.oc-results > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.oc-results > div:first-child { padding-top: 0; }
.oc-results > div:last-child { border-bottom: 0; padding-bottom: 0; }
.oc-results dt { font-size: 16px; font-weight: 600; }
.oc-results dd { margin: 0; }
.oc-results .oc-v { font-variant-numeric: tabular-nums; font-size: clamp(22px, 3vw, 28px); font-weight: 600; letter-spacing: -0.02em; color: var(--blue-deep); grid-row: span 2; align-self: center; }
.oc-results .oc-f { grid-column: 1; font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--muted); }
.oc-results .oc-total .oc-v { color: var(--red); }
.oc-error { margin: 0 0 12px; color: var(--red); font-size: 15px; }

/* AGENTS.md generator */
.am-grid { display: grid; gap: 18px; }
.am-choice { display: flex; flex-wrap: wrap; gap: 8px 18px; border: 0; margin: 0; padding: 0; }
.am-choice legend { padding: 0; margin-bottom: 8px; }
.am-choice label { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.am-choice input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }
.am-checks { display: grid; gap: 8px; }
.am-out { margin-top: 22px; border-radius: 16px; background: var(--dark); color: oklch(0.93 0.02 262); overflow: hidden; }
.am-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 18px; border-bottom: 1px solid oklch(1 0 0 / .1); }
.am-name { font-family: var(--mono); font-size: 14px; color: #fff; }
.am-bar .btn-ghost { background: transparent; color: #fff; border-color: oklch(1 0 0 / .3); }
.am-bar .btn-ghost:hover { border-color: #fff; }
.am-bar .btn:focus-visible { outline-color: #fff; }
.am-bar-act { display: flex; gap: 8px; }
.am-text { margin: 0; padding: 18px; max-height: 520px; overflow: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.am-text:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

/* notes scan */
.ns-token { margin-top: 2px; }
.ns-token summary { cursor: pointer; color: var(--blue-deep); font-size: 15px; font-weight: 500; width: fit-content; }
.ns-token .tool-field { margin-top: 10px; }
.ns-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tool .topics h3, .tool-out > h3 { font-size: 18px; letter-spacing: -0.01em; margin: 22px 0 8px; }
.tool .topics h3 { margin-top: 12px; }
.tool .meta { margin-top: 0; }
.tool-out h3:focus { outline: none; }

/* how it works */
.tool-how { margin-top: 48px; }
.tool-how .formula { font-family: var(--mono); font-size: 14px; line-height: 1.7; padding: 16px 18px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .tool { border-radius: 16px; }
  .tool-actions .btn-blue { width: 100%; }
  .rf-feed-act { width: 100%; }
  .rf-feed-act .btn { flex: 1; }
  .ns-actions .btn { width: 100%; white-space: normal; }
  .oc-results > div { grid-template-columns: 1fr; }
  .oc-results .oc-v { grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .tool * { transition: none !important; }
}
