/* The converter pages: the web converter (converter.js), the live phone beside it, the App card,
   the content of category and conversion pages, and the phone layout where the app's own screen
   (phone.js in .h5 mode) is the converter. Tokens come from style.css. */

.tool {
  --c-start: #13B5A6; --c-end: #6FD6A8; --c-deep: #0B7A70;
  --fill: rgba(0, 0, 0, .05); --card: rgba(255, 255, 255, .66);
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  .tool { --fill: rgba(255, 255, 255, .07); --card: rgba(34, 35, 42, .7); }
}
.tool svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tool svg.i.glyph { fill: currentColor; stroke: none; }

/* ---------- Page head ---------- */
.tool-page { padding: 24px 0 8px; }
.crumb { font-size: 13px; color: var(--ink-3); margin: 0 0 6px; }
.crumb a { text-decoration: none; color: inherit; }
.crumb a:hover { color: var(--ink); }
.tool-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0 0 16px; }
.tool-head h1 { margin: 0; font-size: clamp(26px, 3.4vw, 34px); line-height: 1.2; letter-spacing: -.015em; font-weight: 900; }
.tool-head h1 .sym { color: var(--ink-3); font-weight: 700; font-size: .6em; margin-left: 6px; letter-spacing: 0; white-space: nowrap; }
.tool-head p { margin: 0; color: var(--ink-2); font-size: 15px; }
.tool-head .answer { flex-basis: 100%; font-size: 16.5px; }
.tool-head .answer b { color: var(--ink); font-family: var(--round); font-weight: 800; }

/* ---------- Converter + side column ---------- */
.tool-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.tool-grid > * { min-width: 0; }
@media (min-width: 900px) { .tool-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (min-width: 1200px) {
  .tool-page .wrap, .tool-hero .wrap { max-width: 1240px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; }
}
.tool-side { position: sticky; top: 76px; }
.phone-col { display: none; }
@media (min-width: 1200px) {
  .phone-col { display: block; }
  .phone-col ~ .app-card { display: none; }
}

/* ---------- Web converter ---------- */
.hc { container-type: inline-size; position: relative; }
.hc-shell { position: relative; border-radius: 28px; padding: 14px;
  background: radial-gradient(110% 80% at 0% 0%, color-mix(in srgb, var(--c-start) 22%, transparent), transparent 62%),
              radial-gradient(80% 70% at 100% 0%, color-mix(in srgb, var(--c-end) 22%, transparent), transparent 60%), var(--surface-solid);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.hc button { font: inherit; color: inherit; }
.hc-catbar { display: flex; gap: 8px; align-items: flex-start; }
.hc-cats { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 12px;
  -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
.hc-cats::-webkit-scrollbar { display: none; }
.hc-cat { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px 0 5px; border-radius: 19px; border: 0; background: var(--fill);
  font-size: 14px; font-weight: 500; white-space: nowrap; flex: none; cursor: pointer; text-decoration: none; color: var(--ink); }
.hc-cat:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.hc-cat.sel { font-weight: 700; background: color-mix(in srgb, var(--c-start) 16%, var(--surface-solid)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c-start) 60%, transparent); }
.hc-cat.all { padding: 0 14px; gap: 6px; }
.hc-tile { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 16px; flex: none; }
.hc-card { border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.hc-input { padding: 14px 16px 12px 18px; }
.hc-in-top { display: flex; align-items: center; gap: 8px; }
.hc-unit { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 0; background: var(--fill);
  font-size: 14.5px; font-weight: 500; cursor: pointer; max-width: 100%; }
.hc-unit span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-unit b { color: var(--c-deep); font-weight: 700; white-space: nowrap; }
.hc-unit svg { font-size: 11px; stroke-width: 3; }
.hc-hint { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.hc-hint kbd { font: 600 11px var(--font); padding: 1px 6px; border-radius: 5px; background: var(--fill); box-shadow: inset 0 -1px 0 var(--line); }
.hc-in-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.hc-num { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); caret-color: var(--c-start); padding: 0;
  font: 800 46px/1.2 var(--round); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hc-num::placeholder { color: var(--ink-3); opacity: .5; }
.hc-mag { display: inline-block; font: 700 11px/1.35 var(--font); padding: 1px 7px; border-radius: 8px; color: var(--c-deep);
  background: color-mix(in srgb, var(--c-start) 13%, transparent); vertical-align: middle; font-style: normal; }
.hc-mag[hidden] { display: none; }
.hc-clear { width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: var(--ink-3); font-size: 22px; display: grid; place-items: center; cursor: pointer; }
.hc-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.hc-formula { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 17px; border: 0; cursor: pointer; max-width: 100%;
  color: var(--c-deep); background: color-mix(in srgb, var(--c-start) 14%, transparent); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.hc-formula span { overflow: hidden; text-overflow: ellipsis; }
.hc-btns { display: flex; gap: 8px; margin-left: auto; }
.hc-btn { height: 34px; min-width: 42px; padding: 0 12px; border-radius: 17px; border: 0; background: var(--fill); font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.hc-btn.swap { color: var(--c-deep); background: color-mix(in srgb, var(--c-start) 14%, transparent); font-size: 13px; }
.hc-explain { margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: var(--fill); font-size: 13.5px; color: var(--ink-2); }
.hc-explain b { display: block; color: var(--ink); margin-top: 4px; }
.hc-explain .fx { font: 700 15px var(--round); color: var(--c-deep); margin: 2px 0; }
.hc-explain p { margin: 8px 0 0; }
.hc-res { margin-top: 10px; padding: 6px; }
.hc-rows { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 6px; row-gap: 2px; }
@container (min-width: 600px) { .hc-rows { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.hc-row { display: flex; align-items: center; gap: 6px; min-height: 58px; padding: 4px 6px 4px 2px; border-radius: 16px; cursor: pointer; position: relative; }
.hc-row:hover, .hc-row:focus-visible { background: var(--fill); outline: none; }
.hc-star { width: 34px; height: 40px; border: 0; background: none; color: var(--ink-3); font-size: 17px; cursor: pointer; display: grid; place-items: center; flex: none; }
.hc-star.on { color: #F5A623; }
.hc-name { flex: 1; min-width: 0; line-height: 1.25; }
.hc-name b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-name small { font-size: 12px; font-weight: 700; color: var(--c-deep); }
.hc-val { text-align: right; white-space: nowrap; }
.hc-val span { font: 700 22px/1.2 var(--round); font-variant-numeric: tabular-nums; }
.hc-val .hc-mag { margin-right: 6px; }
.hc-copy { width: 34px; height: 34px; border-radius: 10px; border: 0; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; font-size: 16px; opacity: 0; flex: none; }
.hc-row:hover .hc-copy, .hc-row:focus-within .hc-copy { opacity: 1; }
.hc-copy:hover { background: var(--fill); color: var(--ink); }
@media (hover: none) { .hc-copy { opacity: .7; } }
@container (max-width: 480px) { .hc-copy { opacity: .7; } .hc-num { font-size: 38px; } .hc-hint { display: none; } }
.hc-row.ans { grid-column: 1 / -1; min-height: 76px; margin-bottom: 4px; padding-left: 14px;
  background: color-mix(in srgb, var(--c-start) 11%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c-start) 45%, transparent); }
.hc-row.ans .hc-val span { font-size: 34px; font-weight: 800; color: var(--c-deep); }
.hc-row.ans .hc-name b { font-size: 17px; }
.hc-row.ans .tag { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--c-start); padding: 0 7px; border-radius: 7px; margin-right: 6px; vertical-align: 1px; }
.hc-more { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 0; background: none; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; border-top: 1px solid var(--line); margin-top: 4px; }
.hc-more svg { transition: transform .2s; }
.hc-more.open svg { transform: rotate(180deg); }
.hc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 4px 0; font-size: 12.5px; color: var(--ink-3); }
.hc-seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--fill); }
.hc-seg button { border: 0; background: none; padding: 3px 10px; border-radius: 8px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.hc-seg button.on { background: var(--surface-solid); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.hc-pop { position: absolute; z-index: 20; background: var(--surface-solid); border-radius: 18px; padding: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .22), inset 0 0 0 1px var(--line); }
.hc-pop.units { width: min(340px, calc(100% - 16px)); max-height: 400px; display: flex; flex-direction: column; }
.hc-pop input { height: 38px; border-radius: 11px; border: 0; background: var(--fill); padding: 0 12px; font: 15px var(--font); color: var(--ink); outline: none; margin-bottom: 6px; }
.hc-pop .list { overflow-y: auto; }
.hc-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left;
  font-size: 14.5px; text-decoration: none; color: var(--ink); }
.hc-opt[hidden] { display: none; }
.hc-opt:hover { background: var(--fill); }
.hc-opt b { color: var(--c-deep); min-width: 64px; }
.hc-opt small { color: var(--ink-3); margin-left: auto; font-size: 12px; }
.hc-opt.sel { font-weight: 700; }
.hc-opt.off, .hc-cat.off { opacity: .45; cursor: default; }
.hc-pop.cats { left: 8px; right: 8px; top: 56px; padding: 14px; max-height: 460px; overflow-y: auto; }
.hc-pop.cats h4 { margin: 4px 4px 8px; font-size: 13px; color: var(--ink-3); }
.hc-pop.cats .g { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; margin-bottom: 10px; }
.hc-pop.cats .hc-opt { font-size: 14px; padding: 6px 8px; }
.hc-toast { position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 10px); opacity: 0; z-index: 30; pointer-events: none;
  background: var(--ink); color: var(--canvas); padding: 8px 16px; border-radius: 18px; font-size: 13.5px; font-weight: 600; transition: all .25s; white-space: nowrap; }
.hc-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- The live phone beside the converter (wide screens) ---------- */
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.pc-tag { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 13px; font-weight: 700;
  color: var(--c-deep); background: color-mix(in srgb, var(--c-start) 14%, transparent); }
.pc-sync { font-size: 12.5px; font-weight: 700; color: var(--cur); opacity: 0; transition: opacity .3s; }
.phone-col.synced .pc-sync { opacity: 1; }
.phone-col .pa-frame { margin: 0 auto; transition: box-shadow .35s; }
.phone-col.synced .pa-frame { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c-start) 55%, transparent), 0 40px 80px -24px rgba(20, 20, 30, .45), inset 0 0 0 1.5px rgba(255, 255, 255, .1), inset 0 0 0 5px #000; }
.pc-cap { font-size: 13.5px; color: var(--ink-2); margin: 14px 2px 12px; line-height: 1.55; }
.pc-cap b { color: var(--ink); }

/* ---------- App card ---------- */
.app-card { border-radius: 26px; padding: 20px; background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.app-head { display: flex; gap: 12px; align-items: center; }
.app-head img { width: 54px; height: 54px; border-radius: 14px; }
.app-head b { display: block; font-size: 17px; font-weight: 800; }
.app-head small { color: var(--ink-3); font-size: 12.5px; }
.app-card h3 { font-size: 19px; line-height: 1.35; font-weight: 800; margin: 16px 0 12px; }
.mw { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #13B5A6, #6FD6A8);
  box-shadow: 0 10px 24px -10px rgba(19, 181, 166, .7); }
.mw .in { font: 800 26px/1.1 var(--round); }
.mw .in small { font-size: 13px; font-weight: 700; opacity: .85; }
.mw ul { list-style: none; margin: 8px 0 0; padding: 0; font: 600 12.5px/1.75 var(--round); }
.mw ul span { opacity: .8; font-weight: 500; }
.mw .kp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mw .kp i { height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .24); font: 700 11.5px/22px var(--round); text-align: center; font-style: normal; }
.mw-cap { font-size: 12px; color: var(--ink-3); text-align: center; margin: 6px 0 0; }
.app-card ul.pts { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.app-card ul.pts li { display: flex; gap: 8px; }
.app-card ul.pts li::before { content: "✓"; color: var(--cur); font-weight: 800; }
.app-card ul.pts b { color: var(--ink); font-weight: 600; }
.stores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stores .btn { padding: 10px 8px; font-size: 14px; border-radius: 13px; gap: 7px; min-width: 0; }
.stores .btn svg { width: 18px; height: 18px; }
.stores .btn .dl { display: none; }
.qr { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.qr svg { width: 84px; height: 84px; border-radius: 8px; background: #fff; padding: 5px; flex: none; }
.qr b { display: block; color: var(--ink); font-size: 13.5px; }

/* ---------- Page content ---------- */
.tool-body { max-width: 860px; }
.blk { margin-top: 36px; }
.blk h2 { font-size: 21px; font-weight: 800; margin: 0 0 12px; letter-spacing: -.01em; }
.blk p { margin: 0 0 10px; color: var(--ink-2); }
.fxbox { padding: 14px 18px; border-radius: 16px; background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line); }
.fxbox .fx { font: 800 19px var(--round); color: var(--c-deep); margin: 0 0 4px; }
.fxbox p { margin: 6px 0 0; font-size: 15px; }
.tbls { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .tbls { grid-template-columns: 1fr 1fr; } }
table.conv-table, table.unit-table { width: 100%; border-collapse: collapse; border-radius: 16px; overflow: hidden; background: var(--surface-solid);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.conv-table th, .unit-table th { text-align: left; font-size: 12.5px; color: var(--ink-3); font-weight: 600; padding: 9px 14px; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.conv-table td, .unit-table td { padding: 7px 14px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.conv-table td { font-family: var(--round); }
.conv-table td:last-child, .conv-table th:last-child { text-align: right; }
.conv-table tr.hl td { background: color-mix(in srgb, var(--c-start) 12%, transparent); font-weight: 700; }
.unit-table td:nth-child(2) { color: var(--c-deep); font-weight: 700; white-space: nowrap; }
.unit-table td:last-child { font-family: var(--round); }
.unit-table a { color: inherit; }
.intro { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .intro { grid-template-columns: 1fr 1fr; } }
.intro div { padding: 14px 16px; border-radius: 16px; background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line); font-size: 14.5px; color: var(--ink-2); }
.intro b { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 2px; }
details.faq { border-radius: 14px; background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 8px; }
details.faq summary { padding: 12px 16px; font-weight: 600; cursor: pointer; }
details.faq p { padding: 0 16px 12px; margin: 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { padding: 7px 13px; border-radius: 16px; background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; text-decoration: none; }
.links a:hover { box-shadow: inset 0 0 0 1.5px var(--c-start); }
.links a .hc-tile { width: 22px; height: 22px; border-radius: 6px; font-size: 13px; display: inline-grid; vertical-align: -6px; margin-right: 6px; }

/* Common conversions on the home page */
.pop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pop { padding: 16px; border-radius: 18px; background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line); }
.pop h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; }
.pop h3 a { text-decoration: none; }
.pop > a { display: block; font-size: 14.5px; padding: 3px 0; text-decoration: none; color: var(--ink-2); }
.pop > a:hover { color: var(--ink); text-decoration: underline; }

/* The home page's top section */
.tool-hero { padding: 28px 0 24px; }
.tool-hero + section { padding-top: 40px; }
.app-intro .cta-row { justify-content: center; }
.app-intro .pledges { justify-content: center; }

/* Language suggestion */
.lang-hint { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; font-size: 14px; background: color-mix(in srgb, var(--wt) 12%, var(--canvas)); }
.lang-hint[hidden] { display: none; }
.lang-hint a { font-weight: 700; color: var(--wt); }
.lang-hint button { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink-3); }

/* ---------- Phones: the app's own screen is the converter; download bar at the bottom ---------- */
.dlbar { display: none; }
@media (max-width: 699px) {
  .tool-page { padding-top: 12px; }
  .tool-head { margin-bottom: 8px; }
  .tool-head h1 { font-size: 23px; }
  .tool-head p, .tool-head .answer { font-size: 14px; }
  .tool-main, .tool-side .app-card, .phone-col .pc-head, .phone-col .pc-cap, .phone-col .stores, .phone-col .qr { display: none; }
  .tool-grid { margin: 0 -16px; }
  .tool-side { position: static; }
  .phone-col { display: block; }
  .phone-col .pa-frame { width: auto; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .phone-col .pa-viewport { border-radius: 0; background: transparent; aspect-ratio: auto; }
  .tool-hero { padding: 12px 0 8px; }
  .dlbar { display: flex; position: sticky; bottom: 0; z-index: 30; align-items: center; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface-solid) 90%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-top: 1px solid var(--line); font-size: 13px; }
  .dlbar img { width: 38px; height: 38px; border-radius: 10px; }
  .dlbar div { flex: 1; min-width: 0; line-height: 1.35; color: var(--ink-3); }
  .dlbar b { display: block; color: var(--ink); font-size: 14px; }
  .dlbar a { height: 38px; padding: 0 18px; border-radius: 19px; background: var(--ink); color: var(--on-ink); font-weight: 700; display: inline-flex; align-items: center;
    text-decoration: none; white-space: nowrap; }
  footer { margin-top: 40px; }
}
