/* Task-first refresh. Shared by the language gateway, catalogs and workspaces. */
:root {
  --ink: #162b40; --muted: #53677c; --line: #dbe3eb;
  --paper: #ffffff; --canvas: #f5f7fa; --accent: #0069c2;
  --tint: #eaf3fc; --radius: 16px; --tool-page-width: 1120px;
}
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
body h1 { letter-spacing: -.055em; line-height: 1.25; }
body h1 span { color: var(--accent); }
body :is(button, a, input, select, textarea) { -webkit-tap-highlight-color: transparent; }
body :is(input, select, textarea) { accent-color: var(--accent); }
body :is(input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea) {
  border-color: #bdcad8; border-radius: 9px; color: var(--ink); background-color: #fff;
}
body :is(input, select, textarea):focus-visible { outline: 3px solid #93c5fd !important; outline-offset: 2px; }
body button { cursor: pointer; }
body :is(.btn-calc, .btn-generate, .btn-primary, .btn-merge, .btn-convert, .btn-process) {
  border-radius: 10px; min-height: 48px; font-size: 15px; font-weight: 700;
}
body :is(.card, .info-box) { border-color: var(--line); border-radius: var(--radius); box-shadow: 0 3px 14px #162b4005; }
body .card-title { color: #364d65; font-size: 14px; letter-spacing: 0; text-transform: none; }
body .info-box { padding: clamp(20px, 4vw, 36px); }
body .info-block { scroll-margin-top: 24px; }
body .info-block + .info-block { margin-top: 24px; padding-top: 24px; border-color: var(--line); }
body .info-block h2 { font-size: 18px; line-height: 1.5; letter-spacing: -.025em; color: var(--ink); }
body .info-block :is(p, ul, ol) { font-size: 15px; line-height: 1.85; color: #465c72; max-width: none; }
body .info-block a { color: #005da8; text-underline-offset: 3px; }
body .intro-context { color: var(--muted); font-size: 15px; }
body :is(pre, code) { overflow-wrap: anywhere; }
body .related-link { border-radius: 8px; background: #fff; border-color: var(--line); color: #274964; line-height: 1.5; }
body .related-link:hover { background: var(--tint); border-color: #9ac1e4; }
body .drop-zone { border: 2px dashed #a9bfd3; border-radius: 12px; background: #f7fbff; padding: 32px 16px; }
body .drop-zone:is(:hover, :focus-visible) { background: #edf6ff; border-color: var(--accent); }
body .drop-note { line-height: 1.65; }
body .site-header { border-bottom: 1px solid var(--line); background: #fff; margin-bottom: 32px; }
body .site-header-inner, body.workspace-wide .site-header-inner { max-width: var(--tool-page-width); min-height: 76px; padding: 14px 0; gap: 16px; }
body .brand { color: var(--ink); font-size: 16px; letter-spacing: -.025em; }
body .brand img { width: 28px; height: 28px; }
.header-actions button, .language-menu summary { border-radius: 9px; color: #304c67; background: #fff; }
.language-menu summary { border-color: transparent; }
body .container, body.workspace-wide .container { max-width: var(--tool-page-width); gap: 22px; min-width: 0; }
body .container > h1 { font-size: clamp(28px, 4vw, 40px); }
body .card-row { display: flex; width: 100%; margin: 0; gap: 0; }
body .main-col, body.workspace-wide .main-col { max-width: none; width: 100%; flex: 1 1 auto; min-width: 0; gap: 22px; }
body .side-ad { display: none; }
body .lead { color: var(--muted); font-size: 17px; line-height: 1.8; padding: 0; border: 0; background: transparent; max-width: none; }
body .main-col > .card, body .tool-workspace > .card { padding: clamp(20px, 3vw, 28px); }
.tool-workspace { display: flex; flex-direction: column; gap: 22px; width: 100%; max-width: 960px; min-width: 0; margin-inline: auto; }
body.workspace-wide .tool-workspace { max-width: none; }
body .result-box { border-radius: 12px; }
body .result-main { font-variant-numeric: tabular-nums; }
.tool-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #64778a; font-size: 13px; line-height: 1.65; }
.tool-breadcrumb a { color: #526b82; text-decoration: none; }
.tool-breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.tool-contents { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 0 4px; }
.tool-contents a { font-size: 13px; color: #405f7a; background: #fff; border: 1px solid var(--line); padding: 8px 12px; border-radius: 7px; text-decoration: none; line-height: 1.5; }
.tool-contents a:hover { border-color: #7ba9d1; color: #005da8; }
.tool-guide-menu { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.tool-guide-menu > summary { width: fit-content; cursor: pointer; color: #405f7a; font-size: 13px; padding: 5px 0; }
.tool-guide-menu[open] > summary { margin-bottom: 12px; }
.practical-guide { padding: clamp(22px, 4vw, 32px); background: #edf4fb; border: 1px solid #d3e2ef; border-radius: var(--radius); scroll-margin-top: 24px; }
.guide-kicker, .catalog-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; color: #376b98; }
.practical-guide h2 { font-size: 22px; line-height: 1.5; letter-spacing: -.035em; margin: 8px 0 18px; }
.practical-guide > p { font-size: 15px; line-height: 1.8; color: #405a73; max-width: none; }
.guide-example { margin: 20px 0; padding: 18px 20px; background: #fff; border: 1px solid #d3e2ef; border-radius: 10px; }
.guide-example h3, .guide-note h3 { font-size: 13px; margin-bottom: 8px; color: #244b6e; }
.guide-example pre { color: #163653; font: 14px/1.85 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-note p { font-size: 14px; line-height: 1.85; color: #405a73; max-width: none; }
.try-example { margin-top: 14px; padding: 9px 14px; border-radius: 7px; border: 1px solid #a2bfd7; background: #fff; color: #005da8; font-weight: 700; }
.try-example:hover { background: var(--tint); }
.catalog-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 0 24px; border-bottom: 1px solid var(--line); }
.catalog-brand { display: inline-flex; align-items: center; gap: 10px; text-align: left; text-decoration: none; color: var(--ink); }
.catalog-brand img { width: 32px; height: 32px; }
.catalog-brand strong { font-size: 15px; letter-spacing: -.035em; }
.catalog-brand small { display: block; font-size: 10px; color: #678096; letter-spacing: .13em; margin-top: 2px; }
body:has(.sections) { padding: 20px 32px 32px; background: #f7f9fc; }
body:has(.sections) > header { max-width: 1160px; margin-bottom: 0; text-align: left; }
body:has(.sections) > header .header-actions { margin-bottom: 0; }
.catalog-intro { padding: 56px 0 28px; max-width: 820px; }
body:has(.sections) header h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.23; letter-spacing: -.06em; margin: 14px 0 18px; }
body:has(.sections) .catalog-intro p { font-size: 17px; line-height: 1.85; color: var(--muted); max-width: 660px; }
.catalog-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 20px 0 0; padding: 0; list-style: none; color: #4c6479; font-size: 12px; line-height: 1.7; }
.catalog-facts li { display: flex; align-items: center; gap: 7px; }
.catalog-facts li::before { content: ''; width: 5px; height: 5px; background: #4b88b9; border-radius: 50%; }
body:has(.sections) .catalog-search { max-width: 1160px; margin: 0 auto 14px; }
body:has(.sections) .catalog-search label { color: #536a80; font-size: 13px; font-weight: 500; }
body:has(.sections) #catalog-search { max-width: 720px; min-height: 58px; padding: 16px 20px; border-radius: 12px; border-color: #b6c8d9; box-shadow: 0 4px 20px #193a5b06; }
body:has(.sections) .search-count { max-width: 720px; color: #637b91; margin: 8px 0 0; }
body:has(.sections) .category-links { width: 100%; max-width: 1160px; justify-content: flex-start; gap: 8px; margin: 0 auto 34px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
body:has(.sections) .category-links a { border: 1px solid #d5e0eb; background: transparent; color: #435f79; border-radius: 7px; font-weight: 500; }
body:has(.sections) .category-links a:hover { background: #e8f1fa; border-color: #90b5d5; }
body:has(.sections) .sections { max-width: 1160px; gap: 38px; }
body:has(.sections) .section-title { display: flex; align-items: center; gap: 12px; font-size: 20px; letter-spacing: -.035em; color: #233d55; padding: 0; border: 0; margin-bottom: 16px; }
body:has(.sections) .section-title::after { content: ''; height: 1px; background: #e2e8ef; flex: 1; margin-left: 8px; }
body:has(.sections) .grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 12px; }
body:has(.sections) a.card { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; min-height: 178px; padding: 22px; background: #fff; border: 1px solid #dce5ee; border-radius: 12px; box-shadow: none; position: relative; }
body:has(.sections) a.card::after { content: '↗'; position: absolute; top: 22px; right: 20px; font-size: 18px; color: #a8b7c6; transition: color .15s; }
body:has(.sections) a.card:hover { transform: translateY(-3px); border-color: #7aa9d2; box-shadow: 0 8px 24px #193d6010; }
body:has(.sections) a.card:hover::after { color: var(--accent); }
body:has(.sections) .card-title { font-size: 16px; color: #203b54; line-height: 1.6; padding-right: 8px; }
body:has(.sections) .card-desc { font-size: 13px; line-height: 1.75; color: #60758a; margin-top: 5px; }
body:has(.sections) .card-icon { width: 40px; height: 40px; background: #edf4fb; border: 1px solid #e0eaf5; border-radius: 10px; color: #26618e; font-size: 21px; }
body:has(.sections) .card-icon svg { width: 22px; height: 22px; }
body:has(.sections) .section:nth-child(3n+2) .card-icon { background: #eef7f4; border-color: #dfede8; }
body:has(.sections) .section:nth-child(3n) .card-icon { background: #f4f0fa; border-color: #e9e1f4; }
body:has(.sections) .site-about { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; max-width: 1160px; padding: 22px 0 10px; margin-top: 28px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 14px; line-height: 1.9; }
body:has(.sections) .site-about h2 { grid-column: 1 / -1; font-size: 17px; color: var(--ink); margin: 0; }
body:has(.sections) .site-about p { max-width: none; margin: 0; }
body:has(.sections) > footer { width: 100%; max-width: 1160px; margin: 12px auto 0 !important; padding-top: 12px; border-top: 1px solid var(--line); }
body footer { line-height: 1.8; }
body.document-page { display: block; padding: 32px 20px; background: var(--canvas); }
body.document-page .wrap { max-width: 960px; margin: 0 auto; padding: clamp(22px, 4vw, 40px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
body.document-page h1 { font-size: clamp(27px, 4vw, 36px); color: var(--ink); }
body.document-page h2 { color: var(--ink); line-height: 1.6; }
body.document-page p, body.document-page li { color: #465c72; overflow-wrap: anywhere; }
body.document-page .updated { color: #60758a; }
/* A single ad follows the full workspace instead of squeezing it between rails. */
body .side-ad-left { display: none !important; }
body .side-ad-right { display: block; align-self: center; width: min(100%, 728px); height: auto; min-height: 0; margin: 10px 0; }
body .card-row { flex-direction: column; }
body .side-ad-right:has(.ad-placeholder) { display: none; }
body .ad-placeholder { display: none; }
body:has(.langs) .wrap { max-width: 1000px; }
body:has(.langs) .wrap > h1 { font-size: clamp(30px, 5vw, 48px); }
.gateway-kicker { text-align: center; color: #5c7893; font-size: 11px; font-weight: 700; letter-spacing: .14em; margin-bottom: 18px; }
body:has(.langs) .lang-card { min-height: 120px; border-color: var(--line); box-shadow: none; border-radius: 12px; }
body:has(.langs) .site-about { padding: 28px; border-color: var(--line); }
@media (min-width: 900px) {
  body .main-col > .practical-guide { padding: 30px 36px; }
  body .code-workspace.has-output { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  body:has(.sections) .grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 760px) {
  body:has(.sections) .site-about { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 24px; padding-top: 20px; }
  body:has(.sections) .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body:has(.sections) { padding: 16px 20px 28px; }
  .catalog-intro { padding: 36px 0 24px; }
  body:has(.sections) .catalog-intro p { font-size: 15px; }
  body:has(.sections) a.card { padding: 18px; min-height: 168px; }
  body .site-header-inner { min-height: 68px; }
  body .lead { font-size: 15px; }
}
@media (max-width: 480px) {
  body .check-grid { grid-template-columns: minmax(0, 1fr); }
  body:has(.sections) { padding: 12px 16px 24px; }
  body:has(.sections) header h1 { font-size: 36px; }
  .catalog-topbar { padding: 8px 0 16px; gap: 8px; }
  body:has(.sections) .grid { grid-template-columns: minmax(0, 1fr) !important; }
  body:has(.sections) a.card { min-height: 108px; flex-direction: row; gap: 16px; align-items: center; padding: 20px 36px 20px 18px; }
  body:has(.sections) a.card::after { top: 21px; right: 14px; }
  body:has(.sections) .card-icon { flex: 0 0 40px; }
  body:has(.sections) .sections { gap: 30px; }
  body:has(.sections) .section-title { font-size: 19px; }
  body .container { gap: 18px; }
  body .container > h1 { font-size: 30px; }
  body .main-col { gap: 18px; }
  .tool-workspace { gap: 18px; }
  .practical-guide h2 { font-size: 20px; }
  .guide-example { padding: 14px; }
  .tool-contents a { padding: 7px 10px; }
  .tool-contents { gap: 6px; }
  .tool-contents a { font-size: 12px; }
  .catalog-facts { font-size: 11px; gap: 6px 14px; }
  body .site-header-inner .header-actions { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body:has(.sections) a.card:hover { transform: none; }
}
