*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F0F9FF; --panel: #FFFFFF; --panel2: #E0F2FE;
  --border: #BAE6FD; --text: #0C4A6E; --text-muted: #64748B;
  --brand: #0EA5E9; --brand-dark: #0284C7; --brand-light: #E0F2FE;
  --green: #059669; --radius: 10px; --shadow: 0 2px 8px rgba(14,165,233,.12);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; min-height: 100vh; line-height: 1.5; }
.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; }

/* HEADER */
.site-header { background: var(--panel); border-bottom: 2px solid var(--brand); box-shadow: var(--shadow); }
.header-inner { max-width: 900px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--brand); }
.header-badges { display: flex; gap: 6px; }
.badge { background: var(--brand-light); color: var(--brand); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }

/* MAIN */
.app-main { max-width: 900px; margin: 0 auto; padding: 20px; }

/* CATEGORY TABS */
.cat-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.cat { padding: 8px 14px; border: 2px solid var(--border); border-radius: 24px; background: var(--panel); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--text-muted); transition: all .15s; white-space: nowrap; }
.cat.active { background: var(--brand); border-color: var(--brand); color: white; box-shadow: 0 2px 8px rgba(14,165,233,.3); }
.cat:hover:not(.active) { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

/* CONVERTER BOX */
.converter-box { background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.conv-row { display: grid; grid-template-columns: 1fr 48px 1fr; gap: 12px; align-items: end; }
@media (max-width: 600px) { .conv-row { grid-template-columns: 1fr; } .swap-btn { transform: rotate(90deg); justify-self: center; } }
.conv-half { display: flex; flex-direction: column; gap: 8px; }
.conv-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.val-input { padding: 12px 14px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 22px; font-weight: 700; color: var(--text); background: var(--bg); outline: none; transition: border .15s; width: 100%; }
.val-input:focus { border-color: var(--brand); background: white; }
.val-input[readonly] { background: var(--brand-light); color: var(--brand-dark); cursor: default; }
.unit-sel { padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 14px; font-weight: 600; color: var(--text); background: white; cursor: pointer; font-family: inherit; outline: none; width: 100%; }
.unit-sel:focus { border-color: var(--brand); }
.swap-btn { align-self: center; width: 44px; height: 44px; border: 2px solid var(--border); border-radius: 50%; background: white; font-size: 18px; cursor: pointer; color: var(--brand); transition: all .15s; display: flex; align-items: center; justify-content: center; }
.swap-btn:hover { background: var(--brand); color: white; border-color: var(--brand); }

.formula-row { margin-top: 14px; padding: 10px 14px; background: var(--brand-light); border-radius: 6px; font-size: 13px; color: var(--text-muted); min-height: 36px; }

/* RESULTS */
.results-section { background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.results-title { font-size: 16px; font-weight: 700; color: var(--text); }
.btn-copy-all { padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px; background: none; color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .12s; }
.btn-copy-all:hover { border-color: var(--brand); color: var(--brand); }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.result-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: all .12s; }
.result-card:hover { border-color: var(--brand); box-shadow: 0 2px 6px rgba(14,165,233,.15); }
.result-card.highlight { border-color: var(--brand); background: var(--brand-light); }
.result-val { font-size: 17px; font-weight: 800; color: var(--text); word-break: break-all; }
.result-unit { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.result-abbr { font-size: 11px; color: var(--brand); font-weight: 600; }

/* INFO */
.info-section { margin-bottom: 20px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.info-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.info-card h3 { font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.info-card p { font-size: 12px; color: var(--text-muted); line-height: 1.55; }

/* FOOTER */
.site-footer { border-top: 1px solid var(--border); text-align: center; padding: 16px; color: var(--text-muted); font-size: 13px; }
