/* =====================================================================
   The Tools pages (unit converter, steel calculators, date converter) and
   the newer Info reference pages (statistics, Incoterms, HS codes, mill
   certificates, glossary). They open on the shared photo band (.ed-hero,
   editorial.css) and share this one sheet: white cards with the darker
   edge and soft shadow of the weight calculator, brand blue #1F3F8F, navy
   #0F1F4A. Mobile-first; every grid and flex child that can hold long
   content carries min-width:0, and wide tables scroll inside their card.
   ===================================================================== */
.tp-wrap{--tp-edge:#AEB8CA;--tp-edge-hi:#8C98B0;
  --tp-rest:0 1px 2px rgba(15,31,74,.10),0 2px 6px rgba(15,31,74,.08);
  --tp-lift:0 2px 4px rgba(15,31,74,.12),0 4px 10px rgba(15,31,74,.10);
  padding-top:20px;padding-bottom:64px}
.tp-wrap .crumbs{margin:0 0 4px}

.tp-card{margin-top:18px;padding:22px;min-width:0;background:#fff;border:1px solid var(--tp-edge);
  border-radius:16px;box-shadow:var(--tp-rest);scroll-margin-top:84px}
.tp-card h2{font-size:21px;line-height:1.25;margin:0 0 12px;color:var(--navy,#0F1F4A)}
.tp-card h3{font-size:16px;margin:20px 0 8px;color:var(--ink)}
.tp-card p,.tp-card li,.tp-card dd{font-size:15px;line-height:1.6;color:#334155}
.tp-card p{margin:0 0 10px}
.tp-card ul,.tp-card ol{margin:0 0 10px;padding-left:20px}
.tp-card a{color:var(--blue,#1F3F8F)}
.tp-lede{font-size:16px;line-height:1.6;color:#334155;margin:6px 0 0;max-width:780px}
.tp-note{font-size:13.5px;line-height:1.5;color:var(--mute);margin:10px 0 0}
.tp-warn{margin:0 0 12px;padding:10px 14px;border-radius:10px;background:#FFF7E6;border:1px solid #F5D9A6;color:#7A4B00;font-size:14px;line-height:1.5}
.tp-src{font-size:13px;color:var(--mute);margin:8px 0 0}
.tp-src a{color:var(--blue,#1F3F8F)}

/* Jump links, as on the standards page. */
.tp-jump{display:flex;align-items:center;gap:10px 14px;margin:16px 0 0;padding:10px 14px;background:#fff;
  border:1px solid var(--tp-edge);border-radius:14px;box-shadow:var(--tp-rest);min-width:0}
.tp-jump-h{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--mute);flex:none}
.tp-jump ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px;min-width:0}
.tp-jump a{display:inline-block;padding:6px 10px;border-radius:999px;background:var(--blue-10,#E8EEFA);color:var(--blue,#1F3F8F);
  font-size:13.5px;font-weight:600;text-decoration:none;white-space:nowrap}
.tp-jump a:hover{background:#D5E0F5}
.tp-jump a:focus-visible{outline:2px solid var(--navy);outline-offset:2px}
@media (max-width:1023px){
  .tp-jump{flex-direction:column;align-items:stretch}
  .tp-jump ul{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin;padding-bottom:4px}
}

/* Tables */
.tp-scroll{overflow-x:auto;max-width:100%;border:1px solid var(--line);border-radius:12px;position:relative}
/* position:relative so an absolutely placed .sr-only label in a header cell stays inside the scroll box instead of widening the page. */
.tp-scroll:focus-visible{outline:2px solid var(--navy);outline-offset:2px}
.tp-tbl{border-collapse:collapse;width:100%;font-size:14px}
.tp-tbl th,.tp-tbl td{border-bottom:1px solid var(--line);padding:9px 12px;text-align:left;vertical-align:top}
.tp-tbl tbody tr:last-child > *{border-bottom:0}
.tp-tbl thead th{background:#F3F6FB;color:var(--navy,#0F1F4A);font-weight:700;font-size:13px;white-space:nowrap}
.tp-tbl tbody tr:nth-child(even){background:#FAFBFD}
.tp-tbl tbody th{font-weight:600;color:var(--ink)}
.tp-tbl .r{text-align:right}
.tp-tbl .num{font-variant-numeric:tabular-nums;white-space:nowrap}
.tp-tbl .c{text-align:center}
.tp-tbl code,.tp-card code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.92em;background:#F3F6FB;padding:1px 5px;border-radius:5px;color:var(--navy,#0F1F4A)}
.tp-tbl tr.grp th{background:#E8EEFA;color:var(--blue,#1F3F8F);font-size:13px;letter-spacing:.04em;text-transform:uppercase}

/* Fields */
.tp-fld{display:flex;flex-direction:column;gap:6px;min-width:0}
.tp-fld > span{font-size:13px;font-weight:600;color:var(--ink)}
.tp-fld input,.tp-fld select{width:100%;min-width:0;box-sizing:border-box;height:44px;padding:0 12px;border:1px solid var(--tp-edge);
  border-radius:10px;background:#fff;font:inherit;font-size:16px;color:var(--ink);box-shadow:0 1px 2px rgba(15,31,74,.10)}
.tp-fld input:focus,.tp-fld select:focus{border-color:var(--blue,#1F3F8F);box-shadow:0 0 0 3px rgba(31,63,143,.18);
  outline:2px solid transparent;outline-offset:1px}
.tp-fld input.bad{border-color:#B42318}
.tp-fld small{font-size:12.5px;color:var(--mute)}

/* Category chips (unit converter) */
.tp-card .uc-chips{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.uc-chip{display:inline-flex;align-items:center;min-height:38px;padding:0 14px;border-radius:999px;border:1px solid var(--tp-edge);
  background:#fff;color:var(--ink);font:inherit;font-size:14px;font-weight:600;cursor:pointer;box-shadow:0 1px 2px rgba(15,31,74,.08);
  text-decoration:none;transition:border-color .15s,background-color .15s,color .15s}
.uc-chip.on{background:var(--blue-10,#E8EEFA);border-color:var(--blue,#1F3F8F);color:var(--blue,#1F3F8F)}
.uc-chips .uc-chip:hover,.uc-chips .uc-chip:active{transform:none}
@media (hover:hover){ .uc-chip:not(.on):hover{border-color:var(--tp-edge-hi);color:var(--blue,#1F3F8F)} }
.uc-chip:focus-visible{outline:2px solid var(--navy);outline-offset:2px}
.uc-chip-link::after{content:" ↗";font-weight:400}

/* The two boxes and the swap button */
.uc-row{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:14px;align-items:end;margin-top:18px}
.uc-side{display:grid;gap:8px;min-width:0}
.uc-swap{width:44px;height:44px;border-radius:50%;border:1px solid var(--tp-edge);background:#fff;color:var(--blue,#1F3F8F);
  display:grid;place-items:center;cursor:pointer;box-shadow:var(--tp-rest);margin-bottom:0}
.uc-row .uc-swap:hover,.uc-row .uc-swap:active{transform:none}
.uc-swap:hover{border-color:var(--tp-edge-hi)}
.uc-swap:focus-visible{outline:2px solid var(--navy);outline-offset:2px}
.uc-out{margin:16px 0 0;padding:12px 14px;border-radius:12px;background:#F3F6FB;font-size:17px;font-weight:700;color:var(--navy,#0F1F4A);
  font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-height:24px}
.uc-out small{display:block;font-size:13px;font-weight:500;color:var(--mute);margin-top:2px}
@media (max-width:639px){
  .uc-row{grid-template-columns:minmax(0,1fr)}
  .uc-swap{justify-self:center;transform:rotate(90deg)}
  .uc-row .uc-swap:hover,.uc-row .uc-swap:active{transform:rotate(90deg)}
}
.uc-grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin-top:16px}
.tp-card .uc-res{list-style:none;margin:16px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.uc-res li{border:1px solid var(--line);border-radius:12px;padding:10px 12px;min-width:0;background:#FAFBFD}
.uc-res b{display:block;font-size:22px;color:var(--navy,#0F1F4A);font-variant-numeric:tabular-nums}
.uc-res span{font-size:12.5px;color:var(--mute)}

/* Calculator cards */
.sc-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;margin-top:18px}
@media (min-width:1024px){ .sc-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
.sc-grid > .tp-card{margin-top:0;display:flex;flex-direction:column}
.sc-inputs{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px;margin-top:6px}
.sc-result{margin-top:14px;padding:12px 14px;border-radius:12px;background:#F3F6FB;min-width:0}
.sc-result b{font-size:24px;color:var(--navy,#0F1F4A);font-variant-numeric:tabular-nums}
.sc-result p{margin:4px 0 0;font-size:14px}
.sc-band{display:inline-block;margin-left:8px;padding:2px 10px;border-radius:999px;font-size:13px;font-weight:700;vertical-align:middle}
.sc-band.ok{background:#DCFCE7;color:#065F46}
.sc-band.mid{background:#FEF3C7;color:#92400E}
.sc-band.hi{background:#FEE2E2;color:#991B1B}
.sc-formula{margin:12px 0 0;font-size:13.5px;color:#334155}
.sc-formula code{white-space:normal}
.sc-meta{margin-top:auto;padding-top:10px;font-size:12.5px;color:var(--mute)}

/* Date converter */
.dc-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;margin-top:18px}
@media (min-width:900px){ .dc-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
.dc-grid > .tp-card{margin-top:0}
.dc-hijri{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.4fr) minmax(0,1fr);gap:10px}

/* Incoterms risk diagram */
.ic-risk{display:grid;gap:6px;margin-top:8px}
.ic-risk-row{display:grid;grid-template-columns:64px minmax(0,1fr);gap:10px;align-items:center}
.ic-risk-row b{font-size:14px;color:var(--navy,#0F1F4A)}
.ic-track{position:relative;display:block;height:26px;border-radius:8px;overflow:hidden;border:1px solid var(--line)}
.ic-track i{position:absolute;top:-3px;bottom:-3px;width:3px;background:var(--navy,#0F1F4A);border-radius:2px}
.ic-axis{display:grid;grid-template-columns:64px repeat(6,minmax(0,1fr));gap:0 0;font-size:11.5px;color:var(--mute);margin-top:4px}
.ic-axis span{text-align:center;padding:0 2px;overflow-wrap:anywhere}
.ic-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:13px;color:#334155;margin-top:10px}
.ic-legend i{display:inline-block;width:14px;height:14px;border-radius:4px;vertical-align:-2px;margin-right:6px;border:1px solid var(--line)}

/* Glossary */
.tp-jump .gl-letters{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none}
.gl-letters a{display:inline-grid;place-items:center;min-width:34px;height:34px;border-radius:8px;background:var(--blue-10,#E8EEFA);
  color:var(--blue,#1F3F8F);font-weight:700;text-decoration:none}
.gl-letters a:focus-visible{outline:2px solid var(--navy);outline-offset:2px}
.gl-list{margin:0;display:grid;gap:0}
.gl-list > div{display:grid;grid-template-columns:minmax(110px,180px) minmax(0,1fr);gap:4px 16px;padding:10px 0;border-bottom:1px solid var(--line)}
.gl-list dt{font-weight:700;color:var(--navy,#0F1F4A);overflow-wrap:anywhere}
.gl-list dd{margin:0}
@media (max-width:639px){ .gl-list > div{grid-template-columns:minmax(0,1fr)} }

/* Statistics bars */
.st-bar{display:grid;grid-template-columns:minmax(90px,180px) minmax(0,1fr) auto;gap:10px;align-items:center;font-size:14px;padding:4px 0}
.st-bar > span:first-child{overflow-wrap:anywhere}
.st-bar .t{height:12px;border-radius:6px;background:var(--blue,#1F3F8F);min-width:2px}
.st-bar .v{font-variant-numeric:tabular-nums;color:var(--navy,#0F1F4A);font-weight:600}

/* Related pages strip */
.tp-more{display:flex;flex-wrap:wrap;gap:8px 16px;margin-top:22px;font-size:14.5px}
.tp-more a{color:var(--blue,#1F3F8F);font-weight:600}
.tp-disclaimer{font-size:12.5px;color:var(--mute);margin:16px 0 0;max-width:820px}

/* The unit converter's non-linear panels start below the chips. On a phone the
   23 chips are smaller, so they take fewer rows above the converter. */
.uc-panel{margin-top:16px}
@media (max-width:639px){
  .tp-card .uc-chips{gap:6px}
  .uc-chip{min-height:34px;padding:0 11px;font-size:13px}
}
.ic-axis b{font-weight:400}
.ic-short{display:none}
@media (max-width:639px){
  .ic-long{display:none}
  .ic-short{display:inline}
  .ic-axis{font-size:10.5px}
}
