.convert-page {
  background:
    radial-gradient(circle at 78% 3%, rgba(147, 202, 178, .3), transparent 26rem),
    radial-gradient(circle at 8% 43%, rgba(247, 189, 125, .2), transparent 25rem),
    #f4f1ea;
}
.back-home { justify-self: end; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 750; }
.back-home span { color: var(--coral); margin-left: 4px; }
.convert-main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 72px 0 110px; }
.convert-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; margin-bottom: 48px; }
.convert-hero h1 { margin: 24px 0 17px; font-size: clamp(48px, 6vw, 76px); line-height: 1.02; letter-spacing: -.065em; }
.convert-hero h1 em { color: #2f8a68; font-family: Georgia, "Songti SC", serif; font-weight: 500; }
.convert-hero > div > p { max-width: 650px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.conversion-preview { min-width: 330px; display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 11px; padding: 20px; border: 1px solid rgba(99, 92, 82, .16); border-radius: 18px; background: rgba(255, 254, 250, .7); box-shadow: 0 18px 50px rgba(54, 47, 37, .07); }
.conversion-preview > span { font: 700 28px Georgia, serif; }
.conversion-preview .preview-result { color: #2c8060; }
.conversion-preview > div { display: grid; gap: 2px; }
.conversion-preview strong { font-size: 12px; }
.conversion-preview small { color: #948e85; font-size: 9px; }
.conversion-preview i { color: #a29b92; text-align: center; font-style: normal; }

.convert-workbench { padding: 26px; border: 1px solid rgba(110, 101, 90, .2); border-radius: 28px; background: rgba(255, 254, 250, .84); box-shadow: 0 28px 75px rgba(54, 47, 37, .1), inset 0 1px #fff; backdrop-filter: blur(14px); }
.convert-workbench-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 4px 3px 21px; }
.convert-workbench-title > div:first-child { display: grid; gap: 5px; }
.convert-workbench-title > div:first-child > span { color: #2f8a68; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.convert-workbench-title h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.local-note { display: inline-flex; align-items: center; gap: 7px; color: #8c867e; font-size: 10px; }
.local-note i { width: 6px; height: 6px; border-radius: 50%; background: #4da57e; }
.category-tabs { display: grid; grid-template-columns: repeat(9, 1fr); gap: 7px; padding: 8px; border-radius: 16px; background: #eeebe5; }
.category-tab { min-width: 0; height: 62px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 11px; color: #777169; background: transparent; cursor: pointer; transition: color .18s, background .18s, box-shadow .18s; }
.category-tab span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; color: #6f6960; background: rgba(255,255,255,.55); font: 750 10px Georgia, serif; }
.category-tab strong { font-size: 11px; }
.category-tab:hover { color: #2b7458; }
.category-tab.active { color: #24694f; background: #fffefa; box-shadow: 0 5px 16px rgba(55, 50, 43, .08); }
.category-tab.active span { color: #fff; background: #3b8e6d; }
.converter-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-top: 14px; }
.converter-card, .quick-reference { border: 1px solid #e2ddd4; border-radius: 20px; background: #fffefa; }
.converter-card { padding: 23px; }
.converter-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.converter-heading > div { display: flex; align-items: center; gap: 12px; }
.converter-heading > div > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #173e30; background: #9dcbb7; font: 750 16px Georgia, serif; transform: rotate(-2deg); }
.converter-heading h3, .reference-heading h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.025em; }
.converter-heading p { margin: 0; color: #8a847b; font-size: 10px; }
.precision-select { display: grid; gap: 5px; }
.precision-select span { color: #8c867e; font-size: 9px; }
.precision-select select { height: 32px; border: 1px solid #d8d2c8; border-radius: 8px; outline: 0; padding: 0 26px 0 9px; color: #5e5952; background: #f7f4ee; font-size: 10px; }
.conversion-fields { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 11px; margin-top: 25px; }
.conversion-field { display: grid; gap: 8px; min-width: 0; }
.conversion-field > span { color: #777169; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.conversion-field select { width: 100%; height: 42px; border: 1px solid #d8d2c8; border-radius: 10px; outline: 0; padding: 0 12px; color: #5d5851; background: #f8f6f1; font-size: 11px; }
.value-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-width: 0; height: 82px; padding: 0 17px; border: 1px solid #d8d2c8; border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.value-input:focus-within { border-color: #3a906e; box-shadow: 0 0 0 4px rgba(58,144,110,.09); }
.value-input input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 0; color: #282623; background: transparent; font: 700 clamp(24px, 3.2vw, 38px) Georgia, serif; font-variant-numeric: tabular-nums; }
.value-input b { max-width: 70px; overflow: hidden; padding-left: 8px; color: #8a847c; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.target-field .value-input { background: #eef7f2; border-color: #d5e6dd; }
.unit-swap-button { width: 42px; height: 42px; margin-top: 46px; border: 1px solid #cddbd4; border-radius: 50%; color: #2e7c5e; background: #f3faf6; font-size: 18px; cursor: pointer; transition: transform .2s, background .2s; }
.unit-swap-button:hover { transform: rotate(180deg); background: #e4f3eb; }
.converter-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 13px; }
.value-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.value-presets button { border: 0; border-radius: 7px; padding: 6px 9px; color: #716b63; background: #f0ede7; font-size: 9px; font-weight: 750; cursor: pointer; }
.value-presets button:hover { color: #276e53; background: #e7f1eb; }
#copyConversionButton { border: 0; border-radius: 8px; padding: 8px 11px; color: #fff; background: #292725; font-size: 9px; font-weight: 800; cursor: pointer; }
.convert-error { min-height: 15px; margin: 7px 0 0; color: #c74d3b; font-size: 9px; }
.conversion-formula { min-height: 44px; display: flex; align-items: center; margin-top: 2px; padding: 11px 13px; border-radius: 10px; color: #4e695c; background: #edf5f0; font: 650 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.category-note { margin: 9px 2px 0; padding-left: 11px; border-left: 2px solid #e39b53; color: #7e6b58; font-size: 9px; line-height: 1.55; }
.category-note[hidden] { display: none; }
.quick-reference { overflow: hidden; }
.reference-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; padding: 22px 20px 15px; }
.reference-heading > div > span { display: block; margin-bottom: 6px; color: #d18150; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.reference-heading small { color: #9c958d; font-size: 8px; }
.reference-list { max-height: 400px; overflow-y: auto; border-top: 1px solid #e6e1d8; scrollbar-width: thin; }
.reference-item { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 0; border-top: 1px solid #eeeae3; padding: 9px 20px; color: #4e4a44; background: transparent; text-align: left; cursor: pointer; }
.reference-item:first-child { border-top: 0; }
.reference-item:hover { background: #f6f3ed; }
.reference-item.source { background: #edf5f0; }
.reference-item span { display: grid; gap: 2px; }
.reference-item strong { font-size: 10px; }
.reference-item small { color: #9b958d; font-size: 8px; }
.reference-item b { min-width: 0; overflow: hidden; color: #3f664f; font: 700 11px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.convert-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.convert-benefits article { min-height: 154px; padding: 21px; border: 1px solid rgba(111, 103, 92, .17); border-radius: 17px; background: rgba(255, 254, 250, .48); }
.convert-benefits span { color: #3d9472; font: italic 11px Georgia, serif; }
.convert-benefits strong { display: block; margin: 23px 0 7px; font-size: 14px; }
.convert-benefits p { margin: 0; color: #7f7970; font-size: 11px; line-height: 1.65; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 30; padding: 11px 15px; border-radius: 10px; color: #fff; background: #242220; box-shadow: 0 12px 36px rgba(0,0,0,.2); font-size: 11px; font-weight: 750; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .convert-hero { grid-template-columns: 1fr; align-items: start; }
  .conversion-preview { width: max-content; }
  .category-tabs { grid-template-columns: repeat(3, 1fr); }
  .converter-layout { grid-template-columns: 1fr; }
  .reference-list { display: grid; grid-template-columns: 1fr 1fr; max-height: none; }
  .reference-item:nth-child(2) { border-top: 0; }
}
@media (max-width: 700px) {
  .convert-main { width: calc(100% - 24px); padding: 48px 0 76px; }
  .convert-hero { gap: 28px; margin-bottom: 30px; }
  .convert-hero h1 { font-size: clamp(43px, 13vw, 61px); }
  .convert-hero > div > p { font-size: 14px; }
  .conversion-preview { width: 100%; min-width: 0; }
  .convert-workbench { padding: 13px; border-radius: 21px; }
  .convert-workbench-title { padding: 8px 4px 17px; }
  .category-tabs { grid-template-columns: repeat(3, 1fr); }
  .converter-card { padding: 17px; }
  .conversion-fields { grid-template-columns: 1fr auto; }
  .target-field { grid-column: 1 / -1; }
  .unit-swap-button { grid-column: 2; grid-row: 1; margin-top: 72px; }
  .converter-actions { align-items: flex-start; flex-direction: column; }
  .reference-list { grid-template-columns: 1fr; }
  .reference-item:nth-child(2) { border-top: 1px solid #eeeae3; }
  .convert-benefits { grid-template-columns: 1fr; }
  .convert-benefits article { min-height: 130px; }
}
@media (max-width: 440px) {
  .back-home { font-size: 11px; }
  .converter-heading { flex-direction: column; }
  .precision-select { grid-template-columns: auto auto; align-items: center; }
  .value-input { height: 70px; }
}
