main { max-width: 1150px; margin: auto; padding: clamp(24px, 5vw, 60px) 22px; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
p { margin: .75rem 0 1.25rem; }
.tools-intro { margin-bottom: 2.5rem; }
.categories, .actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: 1.25rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 1rem; }
.card, .panel { padding: clamp(16px, 3vw, 24px); background: var(--panel); border: 1px solid var(--line); }
.card { display: block; text-decoration: none; }
.card:hover { border-color: var(--gold); }
.card h3 { margin-top: .5rem; font-size: 1.85rem; color: var(--ivory); }
.tag, .open-tool { font-size: .85rem; color: var(--gold); font-weight: 700; }
.muted, .note, .back, .result small { color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
label { display: block; font-size: .875rem; margin-bottom: .25rem; }
input { width: 100%; background: var(--navy); color: var(--ivory); padding: .65rem; border: 1px solid var(--line); }
input, button { font: inherit; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button { background: var(--gold); color: var(--navy); border: 1px solid var(--gold); padding: .55rem .9rem; cursor: pointer; }
button.secondary, .chip:not(.active) { background: var(--navy); color: var(--ivory); border-color: var(--line); }
button:disabled { opacity: .5; cursor: default; }
.result { border-block: 1px solid var(--gold); padding: .75rem 0; margin-top: 1rem; }
.result small { display: block; }
.result strong { font-size: 2rem; overflow-wrap: anywhere; }
.detail { display: flex; justify-content: space-between; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.detail b { text-align: right; }
.back { display: inline-block; margin-bottom: 1rem; }
.note { font-size: .875rem; }
#error { color: #ffb4ad; }
#error:empty { display: none; }
footer { text-align: center; padding-inline: 1rem; }
@media (max-width: 750px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .fields { grid-template-columns: 1fr; }
}
@media print {
  header, footer, .actions, .back, .categories { display: none; }
  body, .panel, input { color: black; background: white; }
  .layout { display: block; }
  .panel { break-inside: avoid; margin-bottom: 1rem; }
  .note, .result small { color: #222; }
}
