/* The Ultimate Converter: styles (navy + amber) */
@font-face { font-family: "Inter"; src: url("/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --navy: #16284F;
  --navy-deep: #0F1B36;
  --amber: #F9AE22;
  --amber-deep: #C98100;
  --sky: #A9C3E8;
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --soft: #EAF0FA;
  --ink: #0F1B36;
  --muted: #4A5877;
  --line: #D8E0EE;
  --accent-ink: #7A4B00;
  --ok: #0E7C5A;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(15, 27, 54, 0.09);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --head: "Poppins", "Inter", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1428; --card: #13213F; --soft: #1A2B50; --ink: #EAF0FA; --muted: #A9B7D3; --line: #25385F;
    --accent-ink: #F9AE22; --ok: #34D399; --shadow: 0 10px 30px rgba(0, 0, 0, 0.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1428; --card: #13213F; --soft: #1A2B50; --ink: #EAF0FA; --muted: #A9B7D3; --line: #25385F;
  --accent-ink: #F9AE22; --ok: #34D399; --shadow: 0 10px 30px rgba(0, 0, 0, 0.4); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 3px; text-decoration-color: var(--amber); text-decoration-thickness: 2px; }
:root[data-theme="dark"] a, .dark-links a { color: var(--sky); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a { color: var(--sky); } }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 3.5vw, 1.95rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 50rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--amber); color: var(--navy-deep); padding: .6rem 1rem; border-radius: 10px; z-index: 60; font-weight: 700; }
.skip:focus { top: 1rem; }

/* Header */
.site-header { background: var(--navy-deep); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(169, 195, 232, .15); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.logo { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff !important; font-family: var(--head); font-weight: 800; font-size: 1.1rem; }
.logo svg { width: 2.1rem; height: 2.1rem; flex: none; }
.logo b { color: var(--amber); }
.nav { display: flex; gap: .2rem; align-items: center; }
.nav a { display: none; text-decoration: none; color: #D6E1F3 !important; font-weight: 600; font-size: .93rem; padding: .45rem .7rem; border-radius: 999px; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff !important; }
.theme-btn { border: 1px solid rgba(169, 195, 232, .35); background: transparent; color: #fff; width: 2.5rem; height: 2.5rem; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.theme-btn svg { width: 1.15rem; height: 1.15rem; }
@media (min-width: 900px) { .nav a { display: inline-block; } }

/* Hero + quick search */
.hero { background: linear-gradient(180deg, var(--navy-deep), var(--navy)); color: #fff; padding: 2.5rem 0 3.2rem; text-align: center; }
.hero h1 { color: #fff; }
.hero h1 span { color: var(--amber); }
.hero p.lead { color: #D6E1F3; max-width: 42rem; margin: 0 auto 1.6rem; font-size: 1.1rem; }
.search { max-width: 44rem; margin: 0 auto; position: relative; }
.search input { width: 100%; min-height: 3.6rem; border-radius: 999px; border: 3px solid var(--amber); background: #fff; color: #0F1B36; font: inherit; font-size: 1.15rem; padding: .7rem 3.6rem .7rem 1.4rem; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }
.search input::placeholder { color: #6B7896; }
.search button { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 0; background: var(--amber); color: var(--navy-deep); cursor: pointer; display: grid; place-items: center; }
.search button svg { width: 1.3rem; height: 1.3rem; }
.answer { max-width: 44rem; margin: 1.1rem auto 0; background: #fff; color: #0F1B36; border-radius: var(--radius); padding: 1rem 1.25rem; text-align: left; display: none; box-shadow: 0 12px 30px rgba(0, 0, 0, .2); }
.answer.show { display: block; }
.answer .res { font-family: var(--head); font-weight: 800; font-size: clamp(1.4rem, 4.5vw, 2rem); line-height: 1.2; word-break: break-word; }
.answer .res em { font-style: normal; color: var(--amber-deep); }
.answer .how { color: #4A5877; font-size: .92rem; margin-top: .3rem; }
.answer .err { color: #9A3412; font-weight: 600; }
.answer .row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.try { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; }
.try button { border: 1px solid rgba(169, 195, 232, .45); background: rgba(255, 255, 255, .06); color: #E7EEF9; border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .88rem; cursor: pointer; }
.try button:hover { background: rgba(249, 174, 34, .2); border-color: var(--amber); }
.promise { margin-top: 1.4rem; display: inline-flex; align-items: center; gap: .5rem; color: #D6E1F3; font-size: .95rem; }
.promise svg { width: 1.3rem; height: 1.3rem; color: var(--amber); }

/* Category jump bar */
.jump { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 4rem; z-index: 40; }
.jump .wrap { display: flex; gap: .4rem; overflow-x: auto; padding-top: .55rem; padding-bottom: .55rem; scrollbar-width: thin; }
.jump a { flex: none; text-decoration: none; color: var(--ink) !important; font-weight: 600; font-size: .88rem; padding: .38rem .8rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.jump a:hover, .jump a.active { background: var(--amber); color: var(--navy-deep) !important; border-color: var(--amber); }

/* Sections and tools */
.section { padding: 2.4rem 0 .6rem; }
.sec-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.sec-icon { width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--navy); color: var(--amber); display: grid; place-items: center; flex: none; }
.sec-icon svg { width: 1.4rem; height: 1.4rem; }
.sec-head h2 { margin: 0; }
.sec-intro { color: var(--muted); max-width: 52rem; }
.tools { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); margin-top: 1rem; }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.2rem; }
.tool h3 { display: flex; align-items: center; gap: .45rem; }
.tool h3::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--amber); flex: none; }
.tool .note { font-size: .84rem; color: var(--muted); margin: .5rem 0 0; }
.conv { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: end; }
.conv .swap { width: 2.6rem; height: 2.9rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--soft); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.conv .swap svg { width: 1.1rem; height: 1.1rem; }
.field label, .lbl { display: block; font-weight: 600; font-size: .84rem; color: var(--muted); margin-bottom: .25rem; }
input[type="number"], input[type="text"].plain, select { width: 100%; min-height: 2.9rem; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: var(--radius-sm); padding: .5rem .7rem; font: inherit; font-size: 1rem; }
select { padding-right: 1.6rem; }
input:focus, select:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px rgba(249, 174, 34, .3); }
.stack { display: grid; gap: .45rem; }
.out { margin-top: .75rem; background: var(--soft); border-radius: var(--radius-sm); padding: .65rem .85rem; font-variant-numeric: tabular-nums; }
.out .big { font-family: var(--head); font-weight: 800; font-size: 1.35rem; word-break: break-word; }
.out .sub { font-size: .86rem; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }
.seg { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.seg button { border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: .3rem .75rem; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--navy-deep); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--navy-deep); } }

/* Tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 1rem; background: var(--card); }
table.ref { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.ref th, .ref td { padding: .5rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
.ref th { background: var(--soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ref tr:last-child td { border-bottom: 0; }
details.more { margin-top: .9rem; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.6rem; padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--navy); background: var(--navy); color: #fff !important; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-deep); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: var(--navy-deep) !important; }
.btn.ghost { background: transparent; color: var(--ink) !important; border-color: var(--line); }
.crosslink { display: grid; gap: .8rem; align-items: center; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1rem; }
.crosslink p { margin: 0; }
@media (min-width: 700px) { .crosslink { grid-template-columns: 1fr auto; } }
.warnbox { border-left: 4px solid var(--amber); background: var(--soft); padding: .7rem .9rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .9rem; margin-top: 1rem; }

/* Ads */
.ad-slot { margin: 1.8rem auto; min-height: 100px; display: none; text-align: center; }
.ad-slot.on { display: block; }
.ad-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .2rem; }

/* Content */
.content { padding: 2rem 0 1rem; }
.content section { margin-bottom: 2.2rem; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: .55rem; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: .6rem 0 0; color: var(--muted); }
.disclaimer { font-size: .88rem; color: var(--muted); border-left: 4px solid var(--amber); padding: .4rem 0 .4rem .9rem; }

/* Footer */
.site-footer { background: var(--navy-deep); color: #B9C7E2; padding: 2rem 0 1.5rem; margin-top: 2rem; font-size: .92rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: .8rem; }
.site-footer a { color: #D6E1F3 !important; }
.site-footer p { margin: 0 0 .4rem; }

/* Simple pages */
.page { padding: 2rem 0; }
.page h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }

@media (max-width: 520px) {
  .conv { grid-template-columns: 1fr; }
  .conv .swap { justify-self: center; transform: rotate(90deg); }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media print { .site-header, .jump, .ad-slot, .site-footer, .hero .try { display: none !important; } }
