/* Excodex R35 - interface layer: one shared header for every page, phone tab bar and drawer, "how do I" guides,
   and a lighter, finer look. Loaded after styles.css / portal.css / gas.css and builds on their tokens. */

:root {
  --xh-h: 60px;
  --xtabs-h: 0px;
  --line: color-mix(in srgb, var(--rule) 75%, transparent);
  --shadow-1: 0 1px 2px rgba(20, 35, 59, .05), 0 6px 18px -10px rgba(20, 35, 59, .18);
  --shadow-2: 0 18px 44px -18px rgba(20, 35, 59, .32);
  --r-card: 12px;
}
html { scroll-padding-top: calc(var(--xh-h) + 16px); }

/* ============================================================ header */
.xh {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 8px var(--edge);
  background: color-mix(in srgb, var(--film) 86%, transparent);
  backdrop-filter: saturate(1.3) blur(12px); -webkit-backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid var(--line);
}
.xh.ptop { display: block; padding: 0; }
.xh .ptop-row { min-height: 60px; padding: 8px var(--edge); gap: 14px; flex-wrap: nowrap; }
.xh .brand { flex: none; gap: 8px; }
.xh .brand-mark { width: 22px; height: 22px; }
.xh .brand-word { font-size: 1.6rem; }

.xnav { display: flex; align-items: center; gap: 0; flex: 1 1 auto; min-width: 0; margin-inline-start: 10px; white-space: nowrap; overflow: hidden; }
.xnav > a, .xmore-btn {
  position: relative; display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 8px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer;
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .95rem; line-height: 1.2;
}
.xnav > a:hover, .xmore-btn:hover, .xmore-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--film-deep) 80%, transparent); color: var(--ink); }
.xnav > a[aria-current="page"], .xmore.is-current > .xmore-btn { color: var(--ink); }
.xnav > a[aria-current="page"]::after, .xmore.is-current > .xmore-btn::after {
  content: ""; position: absolute; inset-inline: 10px; bottom: -9px; height: 2px; border-radius: 2px; background: var(--amber);
}
.xmore { position: static; flex: none; }
.xmore-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.xmore-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.xmore-menu {
  position: absolute; z-index: 50; margin-top: 8px; min-width: 230px; max-height: calc(100svh - 90px); overflow-y: auto;
  display: grid; padding: 6px; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2);
  animation: xpop .14s ease-out;
}
.xmore-menu a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.xmore-menu a:hover { background: var(--film); }
.xmore-menu a[aria-current="page"] { background: var(--film); box-shadow: inset 3px 0 0 var(--amber); }
.xmore-over { display: grid; }
.xmore-over:not(:empty) { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.xmore-sep { height: 1px; margin: 6px 4px; background: var(--line); }
@keyframes xpop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* right side */
.xh .ptools, .xh .top-actions { flex: none; display: flex; align-items: center; gap: 8px; margin-inline-start: 0; }
.xh .lang-btn { border-width: 1px; border-color: var(--line); padding: 6px 11px 6px 9px; font-size: .9rem; font-weight: 600; background: color-mix(in srgb, var(--sheet) 60%, transparent); }
.xh .lang-btn:hover { border-color: var(--ink); }
.xh .lang-btn svg { width: 17px; height: 17px; }
.xh .text-btn { text-decoration: none; padding: 8px 8px; border-radius: 8px; font-size: .93rem; }
.xh .text-btn:hover { background: color-mix(in srgb, var(--film-deep) 80%, transparent); }
.xh .btn-small { padding: 8px 14px; font-size: .95rem; border-radius: 8px; }
.xh-burger { display: none; }
.xh .icon-link { width: 38px; height: 38px; }
.xh .avatar { width: 34px; height: 34px; }

/* exai question box inside the header */
.xh-ask { flex: 0 1 250px; min-width: 170px; }
.xh .xa-bar { background: none; border: 0; }
.xh .xa-bar-in { position: relative; display: flex; align-items: center; gap: 0; padding: 0; }
.xh .xa-bar-l { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); z-index: 1; pointer-events: none; }
.xh .xa-bar-l span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.xh .xa-bar-i { width: 17px; height: 17px; stroke-width: 2; }
.xh .xa-bar-q {
  width: 100%; height: 40px; padding: 0 64px 0 36px; padding-inline: 36px 64px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--sheet); font-size: .93rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.xh .xa-bar-q:hover { border-color: var(--field-line); }
.xh .xa-bar-q:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(227, 155, 11, .35); }
.xh .xa-bar-b {
  position: absolute; inset-inline-end: 4px; top: 4px; height: 32px; padding: 0 13px; border-radius: 999px;
  font-size: .86rem; font-weight: 700;
}
.xh-askbtn { display: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; cursor: pointer; place-items: center; color: var(--ink); }
.xh-askbtn:hover { background: color-mix(in srgb, var(--film-deep) 80%, transparent); }
.xh-askbtn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.xh-askbtn[aria-expanded="true"] { background: var(--ink); color: var(--film); }

/* the old separate bar (R32) is gone; hide any leftover markup outside the header */
body > .xa-bar { display: none !important; }
.xa-bar ~ main > .qc:first-child { min-height: 0; }

@media (max-width: 1240px) {
  .xh-ask { position: absolute; inset-inline: 0; top: 100%; display: none; padding: 10px var(--edge) 12px; background: var(--film); border-bottom: 1px solid var(--line); box-shadow: 0 16px 24px -20px rgba(20, 35, 59, .5); }
  .xh.xh-ask-open .xh-ask { display: block; }
  .xh .xa-bar-q { height: 44px; font-size: 1rem; }
  .xh .xa-bar-b { height: 36px; }
  .xh-askbtn { display: inline-grid; }
  .xh.ptop { position: sticky; }
  .xh .ptop-row { position: relative; }
  .xh.ptop .xh-ask { position: absolute; }
}
.xh.ptop .ptop-row { position: relative; }
@media (max-width: 1240px) { .xh.ptop .xh-ask { top: 100%; } }

/* ============================================================ phone */
.xtabs { display: none; }
.xdrawer {
  margin: 0; margin-inline-start: auto; inset-inline-end: 0; inset-inline-start: auto; top: 0; bottom: 0;
  width: min(380px, 92vw); max-width: none; height: 100dvh; max-height: none; padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  border: 0; border-inline-start: 1px solid var(--line); background: var(--film); color: var(--ink); overflow-y: auto;
  box-shadow: -20px 0 50px -30px rgba(20, 35, 59, .6);
}
.xdrawer[open] { animation: xslide .2s ease-out; display: flex; flex-direction: column; }
.xdrawer::backdrop { background: rgba(20, 35, 59, .42); backdrop-filter: blur(2px); }
[dir="rtl"] .xdrawer { box-shadow: 20px 0 50px -30px rgba(20, 35, 59, .6); }
@keyframes xslide { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
[dir="rtl"] .xdrawer[open] { animation-name: xslide-r; }
@keyframes xslide-r { from { transform: translateX(-24px); opacity: .4; } to { transform: none; opacity: 1; } }
.xdrawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; }
.xdrawer-head .brand-word { font-size: 1.55rem; }
.xdrawer-head .brand-mark { width: 22px; height: 22px; }
.xdrawer-h { margin: 16px 0 8px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.xdrawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xdrawer-grid a {
  display: grid; gap: 8px; align-content: start; padding: 12px; min-height: 84px;
  background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .95rem; line-height: 1.2;
}
.xdrawer-grid a svg { width: 24px; height: 24px; fill: none; stroke: var(--amber-deep); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.xdrawer-grid a[aria-current="page"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.xdrawer-grid a:last-child:nth-child(odd) { grid-column: span 2; }   /* R36: five tools, the last one takes the full row */
.xdrawer-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.xdrawer-list a { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.xdrawer-list a::after { content: ""; width: 7px; height: 7px; border-top: 1.6px solid var(--field-line); border-inline-end: 1.6px solid var(--field-line); transform: rotate(45deg); }
[dir="rtl"] .xdrawer-list a::after { transform: rotate(-45deg); }
.xdrawer-list a[aria-current="page"] { color: var(--ink); box-shadow: inset 3px 0 0 var(--amber); padding-inline-start: 12px; }
.xdrawer-foot { margin-top: auto; padding-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.xdrawer-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); cursor: pointer; font-weight: 600; color: var(--ink); }
.xdrawer-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; }
.xdrawer-foot .btn { margin-inline-start: auto; }

@media (max-width: 900px) {
  :root { --xtabs-h: calc(60px + env(safe-area-inset-bottom)); }
  .xnav { display: none; }
  .xh, .xh .ptop-row { min-height: 56px; gap: 6px; }
  .xh .ptools, .xh .top-actions { margin-inline-start: auto; gap: 4px; }
  .xh .lang-btn span { display: none; }
  .xh .lang-btn { width: 40px; height: 40px; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .xh .guest-tools .btn, .xh #joinTop { display: none; }
  .xh #signinBtn, .xh .guest-tools .text-btn { display: inline; }
  .xtabs {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, 1fr);
    height: var(--xtabs-h); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--sheet) 92%, transparent); backdrop-filter: saturate(1.3) blur(14px); -webkit-backdrop-filter: saturate(1.3) blur(14px);
    border-top: 1px solid var(--line);
  }
  .xtabs a, .xtabs button {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; min-width: 0; padding: 6px 2px 4px;
    border: 0; background: none; cursor: pointer; text-decoration: none; color: var(--graphite); font: inherit; font-size: .7rem; font-weight: 700; line-height: 1.1;
  }
  .xtabs span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 2px; }
  .xtabs svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .xtabs a[aria-current="page"] { color: var(--ink); }
  .xtabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--amber); }
  .xtabs a[aria-current="page"] svg { stroke: var(--ink); stroke-width: 2; }
  body { padding-bottom: var(--xtabs-h); }
  body.portal { min-height: calc(100svh - var(--xtabs-h)); }
  .toast { bottom: calc(var(--xtabs-h) + 14px) !important; }
  .ws-bar { bottom: calc(var(--xtabs-h) + 10px); }
}
@media (max-width: 420px) {
  .xh .brand-word { font-size: 1.45rem; }
  .xh .xh-askbtn, .xh .lang-btn { width: 38px; height: 38px; }
}
@media print { .xtabs, .xdrawer, .xh-askbtn, .xmore { display: none !important; } body { padding-bottom: 0; } }

/* ============================================================ finer look */
.btn { font-weight: 700; font-size: 1.05rem; padding: 12px 20px; border-radius: 8px; letter-spacing: .005em; }
.btn-small { padding: 8px 14px; font-size: .95rem; }
.card-block { border-color: var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-1); }
.pwrap h1 { letter-spacing: -.012em; }
.tag { border-radius: 999px; }

/* gas card: light key-value tiles instead of heavy dark blocks */
.gl-key { background: var(--sheet); color: var(--ink); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow-1); }
.gl-key .gl-key-l { color: var(--graphite); opacity: 1; font-size: .72rem; }
.gl-key .gl-key-s { color: var(--graphite); opacity: 1; }
.gl-key.is-wide { border-top-color: var(--rule); }
.gl-keys .gl-key:nth-child(-n+2) { border-top-color: var(--amber); }

/* gas card: the section menu stays on one line under the header and scrolls sideways */
.gl-toc {
  top: var(--xh-h); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 10px 0; margin-inline: calc(-1 * 4px); padding-inline: 4px;
  background: color-mix(in srgb, var(--film) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 28px), transparent);
}
[dir="rtl"] .gl-toc { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 10px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, transparent 0, #000 10px, #000 calc(100% - 28px), transparent); }
.gl-toc::-webkit-scrollbar { display: none; }
.gl-toc a { font-weight: 600; background: var(--sheet); }
.gl-toc a.is-on { background: var(--ink); border-color: var(--ink); color: var(--film); }
.gl-sec { scroll-margin-top: calc(var(--xh-h) + 64px); }

/* gas library list: more space, finer lines, "show more" */
.gl-list li { border-bottom-color: var(--line); }
.gl-more { display: flex; justify-content: center; margin-top: 18px; }
.gl-az button { border-color: var(--line); font-weight: 600; border-radius: 8px; }
.gl-az button.is-on { font-weight: 700; }
.gl-search-row { border-width: 1.5px; border-radius: 14px; box-shadow: var(--shadow-1); }

/* back to top */
.xtop {
  position: fixed; inset-inline-end: 18px; bottom: calc(var(--xtabs-h) + 18px); z-index: 35;
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line);
  background: var(--sheet); box-shadow: var(--shadow-1); cursor: pointer; color: var(--ink); opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.xtop.is-on { opacity: 1; transform: none; pointer-events: auto; }
.xtop svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================ "how do I" guides */
.hw-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 7px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--sheet); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-1); transition: border-color .15s ease, transform .15s ease;
}
.hw-btn:hover { border-color: var(--ink); }
.hw-btn .hw-play { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); }
.hw-btn .hw-play svg { width: 10px; height: 10px; fill: var(--ink); margin-inline-start: 2px; }
[dir="rtl"] .hw-btn .hw-play svg { transform: scaleX(-1); margin-inline: 0 2px; }
.hw-slot { display: block; margin: 12px 0 0; }
.hw-slot.is-inline { display: inline-block; margin: 0 0 0 8px; vertical-align: middle; }

.hw-dlg { width: min(880px, calc(100vw - 24px)); max-width: none; padding: 0; border: 0; border-radius: 16px; background: var(--film); color: var(--ink); box-shadow: 0 40px 90px -30px rgba(20, 35, 59, .6); overflow: hidden; }
.hw-dlg::backdrop { background: rgba(20, 35, 59, .5); backdrop-filter: blur(3px); }
.hw-dlg[open] { animation: xpop .18s ease-out; }
.hw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 6px; }
.hw-head h2 { font-size: 1.35rem; font-weight: 800; }
.hw-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; padding: 10px 20px 20px; }
.hw-stage {
  position: relative; min-height: 300px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background-color: var(--sheet);
  background-image: linear-gradient(to right, rgba(20, 35, 59, .045) 1px, transparent 1px), linear-gradient(to bottom, rgba(20, 35, 59, .045) 1px, transparent 1px);
  background-size: 20px 20px;
}
.hw-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; counter-reset: hw; }
.hw-steps li { counter-increment: hw; }
.hw-steps button {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; width: 100%; text-align: start; padding: 10px 12px; border-radius: 10px;
  border: 1px solid transparent; background: none; cursor: pointer; font: inherit; color: var(--ink-2); line-height: 1.4;
}
.hw-steps button::before {
  content: counter(hw); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--field-line); font-weight: 800; font-size: .85rem; color: var(--graphite); background: var(--sheet);
}
.hw-steps button:hover { background: color-mix(in srgb, var(--sheet) 70%, transparent); }
.hw-steps li.is-on button { background: var(--sheet); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-1); }
.hw-steps li.is-on button::before { background: var(--ink); border-color: var(--ink); color: var(--film); }
.hw-steps li.is-done button::before { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.hw-bar { height: 3px; border-radius: 3px; background: var(--film-deep); margin-top: 6px; overflow: hidden; grid-column: 2; }
.hw-bar i { display: block; height: 100%; width: 0; background: var(--amber); }
.hw-steps li.is-on .hw-bar i { animation: hwbar var(--hw-dur, 3600ms) linear forwards; }
.hw-dlg.is-paused .hw-steps li.is-on .hw-bar i { animation-play-state: paused; }
@keyframes hwbar { to { width: 100%; } }
.hw-ctrl { display: flex; align-items: center; gap: 10px; padding: 0 20px 18px; flex-wrap: wrap; }
.hw-ctrl .text-btn { font-size: .9rem; }
.hw-ctrl .hw-go { margin-inline-start: auto; }

/* stage scenes (mini screens) */
.hw-scene { position: absolute; inset: 0; padding: 22px; display: grid; align-content: center; gap: 12px; opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; pointer-events: none; }
.hw-scene.is-on { opacity: 1; transform: none; }
.hw-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow-1); }
.hw-lbl { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); margin-bottom: 6px; }
.hw-input { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1rem; letter-spacing: .04em; color: var(--ink); direction: ltr; }
.hw-input svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.hw-type { white-space: pre; overflow: hidden; }
.hw-caret { display: inline-block; width: 2px; height: 1.1em; background: var(--amber-deep); animation: hwblink 1s steps(1) infinite; vertical-align: -2px; }
@keyframes hwblink { 50% { opacity: 0; } }
.hw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hw-chip { min-width: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--sheet); font-weight: 700; font-size: .9rem; text-align: center; transition: background .25s ease, color .25s ease, transform .25s ease; direction: ltr; }
.hw-chip.is-on { background: var(--ink); color: var(--film); border-color: var(--ink); transform: translateY(-1px); }
.hw-cursor { position: absolute; z-index: 3; width: 22px; height: 22px; pointer-events: none; transition: left .7s cubic-bezier(.5, 0, .2, 1), top .7s cubic-bezier(.5, 0, .2, 1); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.hw-cursor path { fill: #fff; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.hw-cursor.is-click::after { content: ""; position: absolute; left: -8px; top: -8px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--amber); animation: hwring .5s ease-out forwards; }
@keyframes hwring { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.hw-go-btn { justify-self: start; padding: 9px 16px; border-radius: 8px; background: var(--ink); color: var(--film); font-weight: 700; font-size: .95rem; transition: transform .15s ease; }
.hw-go-btn.is-press { transform: scale(.96); background: #24395B; }
.hw-result { display: grid; gap: 8px; }
.hw-verdict { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 6px 12px; border-radius: 999px; background: #DDEFE6; color: var(--ok); font-weight: 800; }
.hw-verdict svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hw-why { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; direction: ltr; }
.hw-why li { display: flex; gap: 8px; align-items: center; opacity: 0; transform: translateX(-6px); transition: opacity .3s ease, transform .3s ease; }
.hw-why li.is-on { opacity: 1; transform: none; }
.hw-why b { min-width: 7ch; font-family: ui-monospace, Menlo, monospace; }
.hw-why i { font-style: normal; color: var(--ok); font-weight: 800; }
.hw-sug { display: grid; gap: 4px; }
.hw-sug div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: .92rem; opacity: 0; transition: opacity .3s ease, background .3s ease; }
.hw-sug div.is-on { opacity: 1; }
.hw-sug div.is-hl { background: var(--film); }
.hw-sug span { color: var(--graphite); font-weight: 500; font-size: .82rem; direction: ltr; }
.hw-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hw-tile { padding: 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--amber); opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .3s ease; }
.hw-tile.is-on { opacity: 1; transform: none; }
.hw-tile small { display: block; font-size: .68rem; font-weight: 700; color: var(--graphite); letter-spacing: .05em; text-transform: uppercase; }
.hw-tile b { font-family: var(--f-xcond); font-size: 1.6rem; line-height: 1.1; direction: ltr; display: inline-block; }
.hw-doc { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--field-line); border-radius: 12px; background: #fff; transition: border-color .3s ease, background .3s ease; }
.hw-doc.is-over { border-color: var(--amber); background: #FFF8E8; }
.hw-doc svg { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--ink); stroke-width: 1.5; }
.hw-file { position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--film); font-weight: 700; font-size: .85rem; box-shadow: var(--shadow-2); transition: left .8s cubic-bezier(.5, 0, .2, 1), top .8s cubic-bezier(.5, 0, .2, 1), opacity .3s ease; direction: ltr; }
.hw-rows { display: grid; gap: 6px; }
.hw-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-size: .86rem; opacity: 0; transition: opacity .3s ease; }
.hw-row.is-on { opacity: 1; }
.hw-row code { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; direction: ltr; }
.hw-pill { padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 800; background: #DDEFE6; color: var(--ok); }
.hw-pill.is-bad { background: #F6DEDC; color: var(--red); }
.hw-answer { display: grid; gap: 8px; }
.hw-answer .hw-row { grid-template-columns: auto 1fr; }
.hw-kind { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--amber-deep); }
.hw-q { padding: 10px 12px; border-radius: 12px 12px 4px 12px; background: var(--ink); color: var(--film); font-weight: 600; justify-self: end; max-width: 92%; }
[dir="rtl"] .hw-q { border-radius: 12px 12px 12px 4px; }

@media (max-width: 760px) {
  .hw-dlg { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .hw-dlg[open] { display: flex; flex-direction: column; }
  .hw-body { grid-template-columns: 1fr; gap: 12px; overflow-y: auto; padding-bottom: 8px; }
  .hw-stage { min-height: 270px; }
  .hw-steps button { padding: 8px 10px; }
  .hw-ctrl { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .hw-scene, .hw-why li, .hw-tile, .hw-sug div, .hw-row, .hw-file, .hw-cursor { transition: none !important; }
  .hw-caret { animation: none; }
}

/* ============================================================ landing page: what is on the site */
.xtools { padding: clamp(36px, 6vw, 72px) var(--gutter) clamp(30px, 5vw, 56px); border-top: 1px solid var(--line); }
.xtools-in { max-width: var(--wrap); margin-inline: auto; }
.xtools h2 { font-weight: 800; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.xtools-lead { margin-top: 6px; color: var(--ink-2); max-width: 64ch; }
.xtools-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.xtool {
  position: relative; display: flex; flex-direction: column; gap: 8px; grid-column: span 2; padding: 18px 18px 16px;
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-1);
  text-decoration: none; color: var(--ink); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.xtool.is-big { grid-column: span 2; }   /* R36: three tools with a box (gas library, exai, OSH) on the first row */
a.xtool:hover, .xtool:focus-within { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.xtool-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--film); border: 1px solid var(--line); }
.xtool-ic svg { width: 22px; height: 22px; fill: none; stroke: var(--amber-deep); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.xtool h3 { font-size: 1.3rem; font-weight: 800; }
.xtool p { color: var(--ink-2); font-size: .97rem; line-height: 1.5; }
.xtool-go { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: .92rem; display: inline-flex; align-items: center; gap: 6px; }
.xtool-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .xtool-go svg { transform: scaleX(-1); }
.xtool-form { display: flex; gap: 6px; margin-top: 4px; }
.xtool-form input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 10px; background: #fff; font: inherit; font-size: 1rem; }
.xtool-form input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(227, 155, 11, .35); }
.xtool-form .btn { padding: 0 16px; height: 42px; font-size: .95rem; }
.xtool .hw-btn { align-self: flex-start; margin-top: 4px; }
@media (max-width: 980px) { .xtools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .xtool, .xtool.is-big { grid-column: span 1; } }
@media (max-width: 600px) { .xtools-grid { grid-template-columns: 1fr; } }

/* landing: no blank strip under the last band, quieter hero spacing */
.hero { padding-top: clamp(48px, 7vw, 88px); }

/* gas card on a phone: the search box takes the whole line */
@media (max-width: 640px) {
  .gl-topbar { gap: 10px; }
  .gl-top-search { flex-basis: 100%; }
  .gl-top-search .gl-search.is-compact { max-width: none; width: 100%; }
}

/* lighter headings and the guest strip of the portal: no heavy dark blocks */
.pwrap h1 { font-weight: 750; }
.gl-hero h1, .gl-sub h1 { font-weight: 750; }
.qc h1, .hero h1, .hero .hero-title { font-weight: 750; }
.joinstrip { background: var(--sheet); color: var(--ink); border: 1px solid var(--line); border-inline-start: 4px solid var(--amber); box-shadow: var(--shadow-1); }
.joinstrip p { color: var(--ink-2); }
.joinstrip .btn { background: var(--ink); color: var(--film); }
.xh .me #meName { text-decoration: none; color: var(--ink); font-weight: 700; }
.xh .me #meName:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 900px) { .xh .me #signoutBtn { display: none; } }
.xh .xa-bar-q { flex: 1 1 auto; max-width: none; }
.xh .xa-bar-in { max-width: 820px; }
