/* ==========================================================================
   VOYARX — TOOLS (free tools at /tools)
   Loaded only on /tools pages. Uses the site tokens from site.css — no new palette.
   ========================================================================== */

.v-studio_tool .grain { display: none; } /* keep colours true on the tool pages */

/* ---------- landing hero ---------- */
.st-hero { position: relative; isolation: isolate; overflow: hidden; padding-top: calc(var(--hdr-h) + clamp(3rem, 7vw, 7rem)); padding-bottom: clamp(3.5rem, 7vw, 7rem); }
.st-hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.st-hero-bg::before { content: ""; position: absolute; inset: 0; background: radial-gradient(46% 60% at 84% 8%, rgba(201,169,110,.15), transparent 70%); }
[dir="rtl"] .st-hero-bg::before { background: radial-gradient(46% 60% at 16% 8%, rgba(201,169,110,.15), transparent 70%); }
.st-hero-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; background-position: center top; opacity: .55;
  -webkit-mask-image: radial-gradient(70% 80% at 70% 20%, #000 10%, transparent 75%); mask-image: radial-gradient(70% 80% at 70% 20%, #000 10%, transparent 75%); }
[dir="rtl"] .st-hero-grid { -webkit-mask-image: radial-gradient(70% 80% at 30% 20%, #000 10%, transparent 75%); mask-image: radial-gradient(70% 80% at 30% 20%, #000 10%, transparent 75%); }
.st-hero-star { position: absolute; width: clamp(90px, 11vw, 190px); top: calc(var(--hdr-h) + clamp(2rem, 6vw, 6rem)); inset-inline-end: calc(var(--gutter) + 2vw); fill: var(--gold); opacity: .9; animation: st-spin 40s linear infinite; }
@keyframes st-spin { to { rotate: 360deg; } }
.st-hero-in { display: grid; gap: clamp(1.2rem, 2vw, 1.8rem); }
.st-hero-title { font-size: clamp(4rem, 13vw, 13.5rem); line-height: .86; letter-spacing: -.03em; }
:lang(ar) .st-hero-title { font-size: clamp(3.2rem, 10vw, 10rem); line-height: 1.2; letter-spacing: 0; }
.st-hero-tag { font-size: clamp(1.6rem, 3.4vw, 3.4rem); max-width: 22ch; color: var(--bone-2); font-style: italic; }
:lang(ar) .st-hero-tag { font-style: normal; font-weight: 200; }
.st-hero-foot { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); margin-top: clamp(1.2rem, 3vw, 2.8rem); padding-top: clamp(1.4rem, 2.5vw, 2rem); border-top: 1px solid var(--line); align-items: start; }
.st-hero-lead { grid-column: 1 / span 5; font-size: var(--fs-lead); color: var(--bone-2); max-width: 40ch; }
.st-index { grid-column: 7 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.st-index a { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: baseline; gap: .6rem; padding: .95rem .2rem; border-bottom: 1px solid var(--line); transition: color .3s, padding .5s var(--ease); }
.st-index a:nth-child(odd) { border-inline-end: 1px solid var(--line); padding-inline-end: 1.2rem; }
.st-index a:nth-child(even) { padding-inline-start: 1.2rem; }
.st-index a:hover { color: var(--gold); }
.st-index-n { font-size: .75rem; color: var(--gold); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.st-index-t { font: 400 clamp(1.3rem, 1.8vw, 1.7rem)/1.1 var(--f-display); }
.st-index-c { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- categories & cards ---------- */
.st-cat { position: relative; padding-block: clamp(3.5rem, 7vw, 7rem) 0; }
.st-cat:last-of-type { padding-bottom: 0; }
.st-cat-h { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); row-gap: 1rem; align-items: end; margin-bottom: clamp(1.8rem, 3.2vw, 3rem); padding-top: clamp(1.4rem, 2vw, 2rem); border-top: 1px solid var(--line); }
.st-cat-h .eyebrow { grid-column: 1 / -1; }
.st-cat-t { grid-column: 1 / span 6; font-size: var(--fs-h2); }
.st-cat-d { grid-column: 8 / -1; color: var(--muted); max-width: 40ch; justify-self: start; }

.st-cards { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(12px, 1.2vw, 20px); }
.st-cards > li { grid-column: span 3; display: flex; }
.st-cards--5 > li { grid-column: span 4; }
.st-cards--5 > li:nth-child(n+4) { grid-column: span 6; }
.st-cards--3 > li, .st-cards--mini > li { grid-column: span 4; }
.st-card {
  position: relative; display: flex; flex-direction: column; width: 100%;
  border-radius: clamp(16px, 1.4vw, 22px); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden; transition: box-shadow .5s var(--ease), background-color .5s var(--ease), transform .7s var(--ease);
}
.st-card:hover { box-shadow: inset 0 0 0 1px rgba(201,169,110,.45); background: #131315; }
.st-card:focus-visible { outline-offset: 3px; border-radius: clamp(16px, 1.4vw, 22px); }
.st-card-pv { display: block; position: relative; aspect-ratio: 16 / 10; background: var(--ink-3); border-bottom: 1px solid var(--line); overflow: hidden; }
.st-card-pv::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 20px 20px; opacity: .35; pointer-events: none; }
.st-card-pv svg { position: relative; z-index: 1; width: 100%; height: 100%; transition: transform 1.1s var(--ease); }
.st-card:hover .st-card-pv svg { transform: scale(1.045); }
.st-cards--5 > li:nth-child(n+4) .st-card-pv { aspect-ratio: 16 / 7.4; }
.st-card-b { display: grid; gap: .45rem; padding: clamp(1.1rem, 1.6vw, 1.5rem); flex: 1; align-content: start; }
.st-card-n { font-size: .72rem; letter-spacing: .12em; color: var(--gold); font-variant-numeric: tabular-nums; text-transform: uppercase; }
:lang(ar) .st-card-n { letter-spacing: 0; font-size: .82rem; }
.st-card-t { font: 400 clamp(1.4rem, 1.7vw, 1.75rem)/1.1 var(--f-display); letter-spacing: -.01em; }
:lang(ar) .st-card-t { font-weight: 400; line-height: 1.45; font-size: clamp(1.25rem, 1.5vw, 1.5rem); }
.st-card-d { color: var(--muted); font-size: .93rem; line-height: 1.5; max-width: 36ch; }
.st-card-go { display: inline-flex; align-items: center; gap: .5rem; margin-top: auto; padding-top: .9rem; font-size: .85rem; font-weight: 500; color: var(--bone-2); transition: color .3s, gap .5s var(--ease); }
.st-card-go svg { transform: scaleX(var(--dirx)); }
.st-card:hover .st-card-go { color: var(--gold); gap: .8rem; }
/* card micro-motion */
.pv-sw { transition: transform .9s var(--ease); transform-box: fill-box; transform-origin: 50% 100%; }
.st-card:hover .pv-sw { transform: scaleY(1.08); transition-delay: calc(var(--i) * 40ms); }
.pv-col { transition: fill-opacity .6s var(--ease); }
.st-card:hover .pv-col { fill-opacity: .3; transition-delay: calc(var(--i) * 25ms); }
.pv-caret { animation: st-blink 1.1s steps(2) infinite; }
@keyframes st-blink { 50% { opacity: 0; } }

/* ---------- promise ---------- */
.st-promise { padding-block: clamp(4rem, 8vw, 8rem) clamp(2rem, 4vw, 4rem); }
.st-promise-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.st-promise-list li { display: grid; gap: .6rem; align-content: start; padding-top: 1.2rem; border-top: 1px solid var(--line-2); }
.st-promise-n { font-size: .75rem; color: var(--gold); letter-spacing: .1em; }
.st-promise-list h3 { font: 400 clamp(1.4rem, 1.8vw, 1.8rem)/1.15 var(--f-display); }
:lang(ar) .st-promise-list h3 { line-height: 1.5; }
.st-promise-list p { color: var(--muted); max-width: 38ch; }

/* ---------- sign-off (subtle agency link) ---------- */
.st-sign { padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(3rem, 6vw, 6rem); }
.st-sign-in { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.st-sign-by { display: inline-flex; align-items: center; gap: .6rem; color: var(--bone-2); }
.st-sign-by b { font-weight: 500; letter-spacing: .06em; }
.st-sign-mark { width: 22px; height: 22px; flex: none; }
.st-sign-q { flex: 1 1 18rem; }
.st-sign .tlink { font-size: .95rem; }

/* ==========================================================================
   TOOL PAGE
   ========================================================================== */
.st-phero { padding-top: calc(var(--hdr-h) + clamp(2rem, 5vw, 4.5rem)); padding-bottom: clamp(1.8rem, 3.4vw, 3rem); }
.st-phero .phero-in { gap: clamp(1rem, 1.8vw, 1.6rem); }
.st-phero .phero-title { font-size: clamp(2.6rem, 5.4vw, 5.6rem); max-width: 22ch; }
:lang(ar) .st-phero .phero-title { font-size: clamp(2.2rem, 4.4vw, 4.4rem); max-width: 22ch; }
.st-phero .phero-foot { margin-top: clamp(.5rem, 1.6vw, 1.4rem); }
.st-facts { display: flex; flex-wrap: wrap; gap: .5rem; align-content: start; }
.st-facts li { white-space: nowrap; display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem .45rem .65rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: .8rem; color: var(--bone-2); }
.st-facts li svg { color: var(--gold); }

.st-bench-sec { padding-bottom: clamp(3rem, 6vw, 6rem); }
.st-bench { position: relative; border-radius: clamp(18px, 2vw, 28px); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line), 0 40px 120px -40px rgba(0,0,0,.6); overflow: clip; scroll-margin-top: calc(var(--hdr-h) + 12px); }
.st-bar { display: flex; align-items: center; gap: .9rem; min-height: 56px; padding: .55rem .6rem .55rem clamp(1rem, 2vw, 1.6rem); border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
[dir="rtl"] .st-bar { padding: .55rem clamp(1rem, 2vw, 1.6rem) .55rem .6rem; }
.st-bar-n { font-variant-numeric: tabular-nums; letter-spacing: .08em; color: var(--gold); }
.st-bar-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bone-2); }
.st-live { display: inline-flex; align-items: center; gap: .45rem; letter-spacing: .04em; }
.st-live i { width: 6px; height: 6px; border-radius: 50%; background: #7FC8A0; box-shadow: 0 0 0 3px rgba(127,200,160,.15); }
.st-body { position: relative; }
.st-noscript { padding: 2rem; color: var(--gold-2); }

/* ---------- panes ---------- */
.st-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.st-split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.st-split--wide { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.st-pane { padding: clamp(1.25rem, 2.6vw, 2.5rem); min-width: 0; }
.st-pane + .st-pane { border-inline-start: 1px solid var(--line); }
.st-pane--out { background: var(--ink-3); }
.st-pane-h { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.st-pane-t { font: 500 .72rem/1.3 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
:lang(ar) .st-pane-t { font-size: .88rem; letter-spacing: 0; text-transform: none; }
.st-stack { display: grid; gap: 1.15rem; align-content: start; }
.st-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.st-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.st-row4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.st-hr { height: 1px; background: var(--line); border: 0; margin-block: .2rem; }

/* ---------- fields ---------- */
.st-f { display: grid; gap: .45rem; min-width: 0; }
.st-l { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; font: 500 .72rem/1.3 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
:lang(ar) .st-l { font-size: .86rem; letter-spacing: 0; text-transform: none; font-weight: 400; }
.st-l i { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--muted-2); font-weight: 400; }
.st-l output, .st-l b { font: 500 .8rem/1 var(--f-ui); color: var(--bone); letter-spacing: .02em; text-transform: none; font-variant-numeric: tabular-nums; }
.st-in {
  width: 100%; height: 48px; padding-inline: .95rem; border-radius: 12px;
  background: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--bone);
  font: 400 1rem/1 var(--f-ui); font-variant-numeric: tabular-nums; outline: none;
  transition: box-shadow .25s, background-color .25s;
}
.st-in:hover { box-shadow: inset 0 0 0 1px rgba(242,238,230,.28); }
.st-in:focus { box-shadow: inset 0 0 0 1.5px var(--gold); background: #0d0d0f; }
.st-in::placeholder { color: var(--muted-2); }
.st-in.is-err { box-shadow: inset 0 0 0 1.5px #D9776B; }
textarea.st-in { height: auto; min-height: 140px; padding-block: .9rem; line-height: 1.6; resize: vertical; }
select.st-in { appearance: none; -webkit-appearance: none; padding-inline-end: 2.2rem; cursor: pointer;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238C877E' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right .95rem center; }
[dir="rtl"] select.st-in { background-position: left .95rem center; }
[dir="rtl"] select.st-in[dir="ltr"] { background-position: right .95rem center; }
select.st-in option, select.st-in optgroup { background: var(--ink-2); color: var(--bone); }
.st-in--mono, .st-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92rem; letter-spacing: 0; }
.st-num { position: relative; display: block; direction: ltr; }
.st-num .st-in { padding-inline-end: 3rem; }
.st-num--pre .st-in { padding-inline-start: 3.4rem; }
.st-u { position: absolute; inset-block: 0; inset-inline-end: .95rem; display: flex; align-items: center; font-size: .8rem; color: var(--muted); pointer-events: none; }
.st-num--pre .st-u { inset-inline-end: auto; inset-inline-start: .95rem; letter-spacing: .06em; }
.st-msg { min-height: 1.2em; font-size: .82rem; color: var(--muted); }
.st-msg.is-err { color: #E8988D; }
.st-msg.is-warn { color: var(--gold-2); }
.st-msg:empty { display: none; }

/* colour field: swatch (native picker) + HEX */
.st-color { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: .5rem; }
.st-sw { position: relative; width: 48px; height: 48px; border-radius: 12px; background: var(--c, #C9A96E); box-shadow: inset 0 0 0 1px rgba(242,238,230,.2); cursor: pointer; overflow: hidden; }
.st-sw input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.st-sw:focus-within { outline: 1.5px solid var(--gold); outline-offset: 3px; }
.st-color .st-in { text-transform: uppercase; }

/* range */
.st-rg { display: grid; gap: .55rem; }
.st-range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; --p: 50%; }
.st-range::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) var(--p), var(--line-2) var(--p)); }
[dir="rtl"] .st-range::-webkit-slider-runnable-track { background: linear-gradient(-90deg, var(--gold) var(--p), var(--line-2) var(--p)); }
.st-range::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line-2); }
.st-range::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--gold); }
.st-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7.5px; border-radius: 50%; background: var(--bone); box-shadow: 0 0 0 4px rgba(201,169,110,.0), 0 2px 8px rgba(0,0,0,.4); transition: box-shadow .25s, transform .25s; }
.st-range::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--bone); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.st-range:hover::-webkit-slider-thumb, .st-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(201,169,110,.22), 0 2px 8px rgba(0,0,0,.4); }
.st-range:focus-visible { outline: none; }

/* segmented control + chips */
.st-seg { display: inline-flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 3px; padding: 3px; border-radius: 999px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); max-width: 100%; }
.st-seg::-webkit-scrollbar { display: none; }
.st-seg button { flex: none; height: 36px; padding-inline: .95rem; border-radius: 999px; font-size: .84rem; color: var(--muted); white-space: nowrap; transition: background-color .3s, color .3s; }
.st-seg button:hover { color: var(--bone); }
.st-seg button[aria-pressed="true"] { background: var(--bone); color: var(--ink); }
.st-seg--block { display: flex; }
.st-seg--block button { flex: 1 0 auto; }
.st-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.st-chip { height: 34px; padding-inline: .85rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: .82rem; color: var(--bone-2); font-variant-numeric: tabular-nums; white-space: nowrap; transition: background-color .3s, color .3s, box-shadow .3s; }
.st-chip:hover { box-shadow: inset 0 0 0 1px var(--gold); color: var(--bone); }
.st-chip[aria-pressed="true"] { background: var(--gold); color: var(--ink); box-shadow: none; }
.st-chip small { color: inherit; opacity: .6; margin-inline-start: .3rem; }

/* buttons */
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 44px; padding-inline: 1.1rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font: 500 .88rem/1 var(--f-ui); color: var(--bone); white-space: nowrap; transition: background-color .3s, color .3s, box-shadow .3s; }
:lang(ar) .st-btn { font-size: .95rem; }
.st-btn:hover { box-shadow: inset 0 0 0 1px var(--bone); }
.st-btn--solid { background: var(--bone); color: var(--ink); box-shadow: none; }
.st-btn--solid:hover { background: var(--gold); box-shadow: none; }
.st-btn--gold { background: var(--gold); color: var(--ink); box-shadow: none; }
.st-btn--gold:hover { background: var(--gold-2); box-shadow: none; }
.st-btn--ghost { box-shadow: none; color: var(--muted); }
.st-btn--ghost:hover { color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); }
.st-btn--sm { height: 36px; padding-inline: .85rem; font-size: .82rem; }
.st-btn.is-done { color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.st-btn--solid.is-done, .st-btn--gold.is-done { background: var(--gold-2); color: var(--ink); }
.st-btn[disabled] { opacity: .4; pointer-events: none; }
.st-btn kbd { font: 500 .7rem/1 var(--f-ui); padding: .25rem .4rem; border-radius: 5px; box-shadow: inset 0 0 0 1px currentColor; opacity: .6; }
.st-ib { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); transition: color .3s, background-color .3s, box-shadow .3s; flex: none; }
.st-ib:hover { color: var(--bone); box-shadow: inset 0 0 0 1px var(--bone); }
.st-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- results ---------- */
.st-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1em .3em; font-family: var(--f-display); line-height: .9; color: var(--bone); font-variant-numeric: tabular-nums; }
.st-big-v { font-size: clamp(3.4rem, 7.5vw, 7rem); letter-spacing: -.03em; }
.st-big-u { font-size: clamp(1.4rem, 2.6vw, 2.4rem); color: var(--muted); }
:lang(ar) .st-big { font-family: var(--f-display); line-height: 1.1; }
:lang(ar) .st-big-v { font-weight: 300; letter-spacing: 0; }
.st-big-l { font-size: .8rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
:lang(ar) .st-big-l { letter-spacing: 0; text-transform: none; font-size: .9rem; }
.st-big.is-neg .st-big-v { color: #E8988D; }
.st-big.is-pos .st-big-v { color: var(--bone); }
.st-big.is-empty .st-big-v { color: var(--muted-2); }
.st-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line); }
.st-stat { display: grid; gap: .35rem; padding: 1rem .2rem 1rem 0; border-bottom: 1px solid var(--line); }
.st-stat + .st-stat { padding-inline-start: 1rem; border-inline-start: 1px solid var(--line); }
.st-stat-l { font-size: .75rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
:lang(ar) .st-stat-l { letter-spacing: 0; text-transform: none; font-size: .86rem; }
.st-stat-v { font: 400 clamp(1.5rem, 2.2vw, 2.1rem)/1.1 var(--f-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.st-kvs { display: grid; border-top: 1px solid var(--line); }
.st-kv { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; align-items: center; gap: .8rem; min-height: 58px; padding-block: .4rem; border-bottom: 1px solid var(--line); }
.st-kv-k { font-size: .74rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
:lang(ar) .st-kv-k { letter-spacing: .04em; }
.st-kv-v { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .95rem; color: var(--bone); overflow-wrap: anywhere; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.st-badge { display: inline-flex; align-items: center; gap: .35rem; height: 28px; padding-inline: .6rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 500; letter-spacing: .04em; }
.st-badge.is-pass { background: rgba(201,169,110,.14); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(201,169,110,.45); }
.st-badge.is-fail { background: rgba(217,119,107,.1); color: #E8988D; box-shadow: inset 0 0 0 1px rgba(217,119,107,.4); }
.st-badge.is-idle { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }

/* code output */
.st-code { position: relative; border-radius: 14px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.st-code pre { margin: 0; padding: 1rem 1.1rem; padding-inline-end: 9.5rem; overflow-x: auto; font: 400 .88rem/1.65 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--bone-2); white-space: pre-wrap; word-break: break-all; direction: ltr; text-align: left; tab-size: 2; }
.st-code .st-btn { position: absolute; top: .55rem; right: .55rem; }
.st-code .tk-p { color: var(--gold-2); }
.st-code .tk-v { color: var(--bone); }
.st-code .tk-m { color: var(--muted); }
.st-formula { display: grid; gap: .4rem; padding: 1rem 1.1rem; border-radius: 14px; background: rgba(242,238,230,.03); box-shadow: inset 0 0 0 1px var(--line); font-size: .9rem; color: var(--bone-2); }
.st-formula b { font-weight: 500; color: var(--bone); }
.st-formula code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .86rem; color: var(--gold-2); direction: ltr; unicode-bidi: isolate; }
.st-hint { font-size: .82rem; color: var(--muted); }
.st-hint kbd { font: 500 .72rem/1 var(--f-ui); padding: .2rem .4rem; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--bone-2); }

/* ---------- how it works / more ---------- */
.st-how { padding-block: clamp(2rem, 4vw, 4rem) clamp(3rem, 6vw, 6rem); }
.st-how-in { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); padding-top: clamp(1.6rem, 2.4vw, 2.4rem); border-top: 1px solid var(--line); }
.st-how-h { grid-column: 1 / span 5; display: grid; gap: 1rem; align-content: start; }
.st-how-h h2 { font-size: clamp(2.2rem, 4vw, 3.8rem); }
.st-how-b { grid-column: 7 / -1; display: grid; gap: 1rem; color: var(--bone-2); font-size: var(--fs-lead); line-height: 1.6; max-width: 58ch; }
:lang(ar) .st-how-b { line-height: 1.9; }
.st-how-priv { display: flex; gap: .6rem; align-items: flex-start; margin-top: .4rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); }
.st-how-priv svg { flex: none; margin-top: .25em; color: var(--gold); }
.st-more { padding-bottom: clamp(1rem, 2vw, 2rem); }
.st-more-h { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.st-more-t { font: 400 clamp(1.8rem, 3vw, 2.8rem)/1.1 var(--f-display); }
.st-card--mini .st-card-pv { aspect-ratio: 16 / 8; }
.st-card--mini .st-card-b { gap: .3rem; }

/* ==========================================================================
   RESPONSIVE (base)
   ========================================================================== */
@media (max-width: 1180px) {
  .st-cards > li { grid-column: span 6; }
  .st-cards--5 > li, .st-cards--5 > li:nth-child(n+4) { grid-column: span 6; }
  .st-cards--5 > li:nth-child(5) { grid-column: 1 / -1; }
  .st-cards--3 > li, .st-cards--mini > li { grid-column: span 4; }
  .st-cards--5 > li:nth-child(n+4) .st-card-pv { aspect-ratio: 16 / 10; }
  .st-cards--5 > li:nth-child(5) .st-card-pv { aspect-ratio: 16 / 6.5; }
}
@media (max-width: 1024px) {
  .st-hero-lead, .st-index { grid-column: 1 / -1; }
  .st-cat-t { grid-column: 1 / -1; }
  .st-cat-d { grid-column: 1 / -1; }
  .st-split, .st-split--even, .st-split--wide { grid-template-columns: minmax(0, 1fr); }
  .st-pane + .st-pane { border-inline-start: 0; border-top: 1px solid var(--line); }
  .st-how-h, .st-how-b { grid-column: 1 / -1; }
  .st-cards--mini > li { grid-column: span 6; }
  .st-cards--mini > li:nth-child(3) { display: none; }
}
@media (max-width: 760px) {
  .st-code pre { padding: 3.4rem 1.1rem 1rem; }
  .st-hero-star { width: 64px; top: calc(var(--hdr-h) + 1.5rem); }
  .st-index { grid-template-columns: minmax(0, 1fr); }
  .st-index a:nth-child(odd) { border-inline-end: 0; padding-inline-end: .2rem; }
  .st-index a:nth-child(even) { padding-inline-start: .2rem; }
  .st-cards > li, .st-cards--5 > li, .st-cards--5 > li:nth-child(n+4), .st-cards--3 > li, .st-cards--mini > li { grid-column: 1 / -1; }
  .st-cards--mini > li:nth-child(3) { display: flex; }
  .st-cards--5 > li:nth-child(5) .st-card-pv { aspect-ratio: 16 / 10; }
  .st-card-pv { aspect-ratio: 16 / 9; }
  .st-promise-list { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .st-bar { gap: .6rem; }
  .st-bar-t { display: none; }
  .st-bar-n { flex: 1; }
  .st-row3, .st-row4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-kv { grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: .6rem; }
  .st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-stat + .st-stat { padding-inline-start: .8rem; }
  .st-stats .st-stat:nth-child(odd) { padding-inline-start: 0; border-inline-start: 0; }
  .gr-mini.st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-sign-in { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .st-hero-star, .pv-caret { animation: none; }
}

/* ==========================================================================
   TOOLS — BRAND
   ========================================================================== */
/* ---------- palette ---------- */
.pal-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; padding: clamp(1.1rem, 2vw, 1.6rem) clamp(1.1rem, 2.2vw, 2rem); }
.pal-moods { max-width: 100%; }
.pal-sw { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: clamp(320px, 50vh, 500px); }
.pal-c { position: relative; background: var(--c); color: var(--t, #fff); transition: background-color .7s var(--ease) calc(var(--i) * 45ms), color .5s; min-width: 0; }
.pal-copy { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; cursor: pointer; }
.pal-hover { display: inline-flex; align-items: center; height: 38px; padding-inline: 1rem; border-radius: 999px; font: 500 .74rem/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: inherit; box-shadow: inset 0 0 0 1px currentColor; opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .5s var(--ease), background-color .3s; }
:lang(ar) .pal-hover { letter-spacing: .02em; font-size: .85rem; }
.pal-copy:hover .pal-hover, .pal-copy:focus-visible .pal-hover, .pal-c.is-copied .pal-hover { opacity: 1; transform: none; }
.pal-c.is-copied .pal-hover { background: var(--t); color: var(--c); box-shadow: none; }
.pal-copy:focus-visible { outline: 2px solid var(--t); outline-offset: -8px; border-radius: 6px; }
.pal-lock { position: absolute; top: .9rem; inset-inline-end: .9rem; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--t); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 35%, transparent); opacity: 0; transition: opacity .3s, background-color .3s, box-shadow .3s; }
.pal-c:hover .pal-lock, .pal-lock:focus-visible, .pal-c.is-locked .pal-lock { opacity: 1; }
.pal-c.is-locked .pal-lock { background: var(--t); color: var(--c); box-shadow: none; }
.pal-lk-on { display: none; } .pal-c.is-locked .pal-lk-on { display: block; } .pal-c.is-locked .pal-lk-off { display: none; }
.pal-meta { position: absolute; inset-inline: 1.1rem; bottom: 1rem; display: grid; gap: .2rem; pointer-events: none; font: 400 .74rem/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; text-align: left; }
.pal-meta span { opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-hex { font: 500 clamp(1rem, 1.5vw, 1.35rem)/1.2 var(--f-ui); letter-spacing: .04em; }
.pal-foot { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); border-top: 1px solid var(--line); }
.pal-use { padding: clamp(1.1rem, 2.2vw, 2rem); border-inline-end: 1px solid var(--line); }
.pu-card { position: relative; overflow: hidden; display: grid; gap: .7rem; align-content: start; min-height: 100%; padding: clamp(1.2rem, 2.2vw, 2rem); border-radius: 16px; background: var(--u4); color: var(--u1); transition: background-color .6s var(--ease), color .6s; }
.pu-orb { position: absolute; width: 150px; height: 150px; border-radius: 50%; background: var(--u3); inset-inline-end: -40px; top: -40px; transition: background-color .6s; }
.pu-orb--2 { width: 46px; height: 46px; background: var(--ua); inset-inline-end: 26px; top: 26px; }
.pu-eb { position: relative; font: 500 .68rem/1 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--ua); filter: saturate(1.1); }
.pu-h { position: relative; font: 400 clamp(1.6rem, 2.4vw, 2.3rem)/1.02 var(--f-display); color: var(--u0); max-width: 12ch; }
:lang(ar) .pu-h { line-height: 1.35; }
.pu-p { position: relative; font-size: .88rem; line-height: 1.55; max-width: 32ch; }
.pu-row { display: flex; align-items: center; gap: 1rem; margin-top: .4rem; }
.pu-btn { display: inline-flex; align-items: center; height: 38px; padding-inline: 1.1rem; border-radius: 999px; background: var(--u0); color: var(--u0t); font-size: .82rem; font-weight: 500; }
.pu-link { font-size: .82rem; color: var(--u0); border-bottom: 1px solid var(--ua); }
.pal-export { padding: clamp(1.1rem, 2.2vw, 2rem); align-content: start; }
.pal-export .st-pane-h { margin-bottom: 0; flex-wrap: wrap; }

/* ---------- contrast ---------- */
.cc-swap { justify-self: start; margin-block: -.35rem; }
.cc-pair { display: inline-flex; align-items: center; gap: .15rem; padding-inline: .5rem .8rem; }
.cc-pair i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(242,238,230,.25); }
.cc-pair i + i { margin-inline: -5px .4rem; }
.cc-fix { display: grid; gap: .6rem; padding: 1rem; border-radius: 14px; background: rgba(201,169,110,.07); box-shadow: inset 0 0 0 1px rgba(201,169,110,.3); }
.cc-fix[hidden] { display: none; }
.cc-fix-t { font-size: .82rem; color: var(--gold-2); }
.cc-fix-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.cc-fix-sw { width: 28px; height: 28px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(242,238,230,.2); }
.cc-fix-r { font-size: .82rem; color: var(--muted); margin-inline-end: auto; }
.cc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cc-head .st-big-l { margin-bottom: .5rem; }
.cc-verdict { font: 400 clamp(1.2rem, 1.8vw, 1.6rem)/1.2 var(--f-display); font-style: italic; padding-bottom: .6rem; }
:lang(ar) .cc-verdict { font-style: normal; }
.cc-verdict.is-good { color: var(--gold-2); } .cc-verdict.is-mid { color: var(--bone-2); } .cc-verdict.is-bad { color: #E8988D; }
.cc-res { display: grid; border-top: 1px solid var(--line); }
.cc-res li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 54px; border-bottom: 1px solid var(--line); font-size: .92rem; color: var(--bone-2); }
.cc-res b { font-weight: 500; color: var(--bone); }
.cc-res small { margin-inline-start: .7rem; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.cc-prev { display: grid; gap: .8rem; padding: clamp(1.3rem, 2.6vw, 2.2rem); border-radius: 16px; background: var(--bg, #F2EEE6); color: var(--fg, #0A0A0B); box-shadow: inset 0 0 0 1px rgba(242,238,230,.08); transition: background-color .3s, color .3s; }
.cc-prev-h { font: 400 clamp(1.8rem, 3vw, 2.6rem)/1.05 var(--f-display); letter-spacing: -.01em; }
:lang(ar) .cc-prev-h { line-height: 1.4; }
.cc-prev-p { font-size: 1.02rem; line-height: 1.6; max-width: 56ch; }
.cc-prev-s { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .875rem; }
.cc-prev-ui { display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding-inline: .9rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--fg, #0A0A0B); font-weight: 500; }

/* ---------- font pairing ---------- */
.fp-spec { --fh: "Instrument Serif", serif; --fb: "Instrument Sans", sans-serif; --fw: 400; --hs: 64px; --bs: 17px; --lh: 1.6; --ls: -.01em;
  display: grid; gap: 1.1rem; padding: clamp(1.4rem, 3vw, 2.6rem); border-radius: 16px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); color: var(--bone); transition: background-color .4s, color .4s, opacity .3s; min-height: 420px; }
.fp-spec.is-light { background: #F7F4EE; color: #141414; }
.fp-spec.is-loading { opacity: .75; }
.fp-spec [contenteditable] { outline: none; border-radius: 4px; }
.fp-spec [contenteditable]:focus { box-shadow: 0 0 0 1px var(--gold); }
.fp-eb { font: 500 .72rem/1.2 var(--fb); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.fp-spec[lang="ar"] .fp-eb { letter-spacing: 0; font-size: .85rem; }
.fp-spec.is-light .fp-eb { color: #8E7444; }
.fp-h { font-family: var(--fh); font-weight: var(--fw); font-size: var(--hs); line-height: 1.05; letter-spacing: var(--ls); overflow-wrap: anywhere; }
.fp-spec[lang="ar"] .fp-h { line-height: 1.4; }
.fp-lead { font-family: var(--fb); font-size: calc(var(--bs) * 1.25); line-height: calc(var(--lh) * .92); opacity: .82; max-width: 44ch; }
.fp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.fp-p { font-family: var(--fb); font-size: var(--bs); line-height: var(--lh); opacity: .78; }
.fp-sig { margin-top: .4rem; padding-top: .9rem; border-top: 1px solid currentColor; border-top-color: color-mix(in srgb, currentColor 15%, transparent); font: 400 .8rem/1.3 var(--f-ui); opacity: .6; direction: ltr; text-align: start; }
.fp-sig em { font-style: normal; color: var(--gold); }
.fp-edit { display: flex; justify-content: space-between; gap: 1rem; }
.fp-load { color: var(--gold-2); }
.fp .st-pane-h { margin-bottom: 0; }
.fp .st-code pre { max-height: 260px; }

/* ---------- colour converter ---------- */
.cv-swatch { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: clamp(200px, 28vh, 300px); padding: 1.2rem 1.3rem; border-radius: 18px; background: var(--c); color: var(--t, #0A0A0B); box-shadow: inset 0 0 0 1px rgba(242,238,230,.1); transition: background-color .35s, color .35s; }
.cv-sw-hex { font: 400 clamp(2.2rem, 4vw, 3.6rem)/1 var(--f-display); letter-spacing: -.01em; align-self: flex-start; }
.cv-sw-on { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .8rem; opacity: .8; font-variant-numeric: tabular-nums; }
.cv-scale { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.cv-cell { display: grid; place-items: end start; height: 54px; padding: .4rem .45rem; border-radius: 8px; background: var(--c); color: var(--t); font: 500 .66rem/1 var(--f-ui); box-shadow: inset 0 0 0 1px rgba(242,238,230,.06); transition: transform .35s var(--ease); }
.cv-cell:hover { transform: translateY(-3px); }
.cv-cell.is-copied { box-shadow: inset 0 0 0 2px var(--t); }

@media (max-width: 1024px) {
  .pal-foot { grid-template-columns: minmax(0, 1fr); }
  .pal-use { border-inline-end: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .pal-sw { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(5, 92px); height: auto; }
  .pal-hover { display: none; }
  .pal-lock { opacity: 1; top: 50%; translate: 0 -50%; }
  .pal-meta { bottom: auto; top: 50%; translate: 0 -50%; inset-inline-end: 4.5rem; grid-template-columns: auto 1fr; column-gap: .9rem; align-items: baseline; }
  .pal-meta span[data-v="hsl"] { display: none; }
  .pal-gen { width: 100%; }
  .hide-touch { display: none; }
  .fp-cols { grid-template-columns: minmax(0, 1fr); }
  .fp-spec { min-height: 0; }
  .cv-scale { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
  .cv-cell { height: 44px; font-size: .6rem; padding: .3rem; }
}
@media (hover: none) { .pal-lock { opacity: 1; } .hide-touch { display: none; } }
.fp .st-code pre { overflow: auto; }

/* ==========================================================================
   TOOLS — DIGITAL
   ========================================================================== */
/* aspect ratio */
.ar-calc { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: .8rem; }
.ar-eq { height: 48px; display: grid; place-items: center; color: var(--gold); transform: scaleX(var(--dirx)); }
.ar-out, .gr-out { display: flex; align-items: center; height: 48px; padding-inline: .95rem; border-radius: 12px; background: rgba(201,169,110,.08); box-shadow: inset 0 0 0 1px rgba(201,169,110,.28); font-variant-numeric: tabular-nums; color: var(--gold-2); }
.ar-near { min-height: 1.4em; margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.ar-stage { --ih: 248px; display: grid; place-items: center; height: calc(var(--ih) + 2rem); padding: 1rem; border-radius: 16px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; background-position: center; }
.ar-frame { --r: 1.7778; position: relative; width: min(100%, calc(var(--ih) * var(--r))); display: grid; place-items: center; border-radius: 6px; background: rgba(201,169,110,.1); box-shadow: inset 0 0 0 1.5px var(--gold); transition: aspect-ratio .5s var(--ease); }
.ar-frame span { font-size: .8rem; color: var(--gold-2); font-variant-numeric: tabular-nums; padding: .3rem .6rem; background: var(--ink); border-radius: 999px; }
.ar-css { font-size: .82rem; color: var(--muted); }

/* image size */
.is-stage { position: relative; width: 100%; max-height: 300px; margin-inline: auto; border-radius: 12px; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 20px 20px; }
.is-orig, .is-new { position: absolute; top: 0; left: 0; border-radius: 6px; transition: width .5s var(--ease), height .5s var(--ease); }
.is-orig { box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(242,238,230,.03); }
.is-new { box-shadow: inset 0 0 0 1.5px var(--gold); background: rgba(201,169,110,.12); }
.is-orig span, .is-new span { position: absolute; font-size: .74rem; font-variant-numeric: tabular-nums; padding: .25rem .5rem; border-radius: 999px; background: var(--ink); white-space: nowrap; }
.is-orig span { bottom: .5rem; right: .5rem; color: var(--muted); }
.is-new span { top: .5rem; left: .5rem; color: var(--gold-2); }
[data-pct-wrap][hidden] { display: none; }

/* grid */
.gr-unit { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.gr-unit .st-num { width: 110px; }
.gr-scale { display: grid; gap: .3rem; }
.gr-tok { display: grid; grid-template-columns: 1fr 6.5rem 4.5rem; align-items: center; gap: .6rem; font-size: .78rem; }
.gr-tok i { height: 8px; border-radius: 3px; background: linear-gradient(90deg, var(--gold-3), var(--gold)); min-width: 3px; }
.gr-tok b { font: 400 .78rem/1 ui-monospace, Menlo, Consolas, monospace; color: var(--bone-2); }
.gr-tok em { font-style: normal; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.gr-scale .st-btn { justify-self: start; margin-top: .5rem; }
.gr-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; }
.gr-mini { min-width: 260px; border-top: 0; }
.gr-mini .st-stat { border-bottom: 0; padding-bottom: .2rem; }
.gr-stage { padding: 14px; border-radius: 16px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.gr-box { --mp: 5%; position: relative; aspect-ratio: 16 / 7; padding-inline: var(--mp); border-radius: 8px; background: repeating-linear-gradient(135deg, rgba(242,238,230,.04) 0 6px, transparent 6px 12px); box-shadow: inset 0 0 0 1px var(--line-2); }
.gr-cols { display: grid; height: 100%; }
.gr-cols span { display: flex; align-items: flex-end; justify-content: center; padding-bottom: .4rem; background: rgba(201,169,110,.16); box-shadow: inset 0 0 0 1px rgba(201,169,110,.35); font-size: .62rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.gr-spans { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 4px; }
.gr-span { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; height: 38px; padding-inline: .7rem; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--bone-2); transition: box-shadow .25s, color .25s; }
.gr-span b { color: var(--gold); font-weight: 500; }
.gr-span:hover { box-shadow: inset 0 0 0 1px var(--gold); }
.gr-span.is-done { color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--gold); }

/* shadow */
.sh-stage { display: grid; place-items: center; min-height: clamp(260px, 30vw, 380px); border-radius: 16px; background: #17171A; box-shadow: inset 0 0 0 1px var(--line); transition: background-color .4s; }
.sh-stage.is-light { background: #EDE9E1; }
.sh-box { display: grid; gap: .6rem; align-content: end; width: min(62%, 300px); aspect-ratio: 4 / 3; padding: 1.4rem; border-radius: 22px; background: #26262B; transition: background-color .4s; }
.sh-stage.is-light .sh-box { background: #FFFFFF; }
.sh-box span { display: block; height: 8px; border-radius: 4px; background: rgba(242,238,230,.18); }
.sh-stage.is-light .sh-box span { background: rgba(10,10,11,.12); }
.sh-box .sh-l1 { width: 45%; height: 12px; background: rgba(242,238,230,.5); }
.sh-stage.is-light .sh-box .sh-l1 { background: rgba(10,10,11,.7); }
.sh-box .sh-l2 { width: 80%; } .sh-box .sh-l3 { width: 64%; }
.sh-row { align-items: start; }

/* gradient */
.gd-angle { display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; gap: .9rem; }
.gd-dial { position: relative; width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); }
.gd-dial i { position: absolute; left: 50%; top: 4px; bottom: 50%; width: 2px; margin-left: -1px; background: var(--gold); border-radius: 2px; transform-origin: 50% 100%; }
.gd-pos { display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; }
.gd-pos button { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color .25s, box-shadow .25s; }
.gd-pos button i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.gd-pos button[aria-pressed="true"] { background: var(--gold); box-shadow: none; }
.gd-pos button[aria-pressed="true"] i { background: var(--ink); }
[data-radonly][hidden], [data-linonly][hidden] { display: none; }
.gd-bar { position: relative; height: 22px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); margin-inline: 9px; }
.gd-bar i { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bone), 0 2px 8px rgba(0,0,0,.5); }
.gd-stops { display: grid; gap: .6rem; }
.gd-stop { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 36px; gap: .7rem; align-items: center; }
.gd-stop-p { display: grid; grid-template-columns: minmax(0, 1fr) 2.8rem; align-items: center; gap: .5rem; }
.gd-stop-p output { font-size: .8rem; color: var(--bone-2); text-align: end; font-variant-numeric: tabular-nums; }
.gd-stop .st-ib[disabled] { opacity: .3; pointer-events: none; }
.gd-prev { aspect-ratio: 16 / 10; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.st-btn[disabled] { opacity: .35; }

@media (max-width: 760px) {
  .ar-stage { --ih: 180px; }
  .ar-calc { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .5rem; }
  .gr-tok { grid-template-columns: 1fr 5.8rem 3.8rem; }
  .gd-stop { grid-template-columns: minmax(0, 1fr) 36px; }
  .gd-stop-p { grid-column: 1; grid-row: 2; }
  .gd-stop .st-ib { grid-column: 2; grid-row: 1; }
  .gr-mini { min-width: 0; width: 100%; }
}

/* ==========================================================================
   TOOLS — MARKETING
   ========================================================================== */
.utm-lc { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .2rem .7rem; cursor: pointer; font-size: .9rem; color: var(--bone-2); }
.utm-lc input { width: 18px; height: 18px; accent-color: var(--gold); }
.utm-lc i { grid-column: 2; font-style: normal; font-size: .78rem; color: var(--muted); }
.utm-out { min-height: 120px; padding: 1.1rem 1.2rem; border-radius: 14px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); font: 400 .95rem/1.7 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; word-break: break-all; text-align: left; }
.utm-ph { font-family: var(--f-ui); color: var(--muted); word-break: normal; }
[dir="rtl"] .utm-ph { display: block; direction: rtl; text-align: right; }
.utm-b { color: var(--bone); } .utm-s { color: var(--muted); } .utm-k { color: var(--gold); } .utm-v { color: var(--bone-2); }
.utm-params .st-kv { grid-template-columns: 5.5rem minmax(0, 1.4fr) minmax(0, 1fr); }
.utm-dec { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: end; }
a.st-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }

.mk-bars { display: grid; gap: .9rem; padding-top: .4rem; }
.mk-bars[hidden] { display: none; }
.mk-bar { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; gap: .9rem; font-size: .85rem; color: var(--muted); }
.mk-bar-t { height: 10px; border-radius: 99px; background: rgba(242,238,230,.06); overflow: hidden; }
.mk-bar-t i { display: block; height: 100%; border-radius: inherit; background: var(--bone-2); transition: width .7s var(--ease); }
.mk-bar.is-acc .mk-bar-t i { background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); }
[dir="rtl"] .mk-bar.is-acc .mk-bar-t i { background: linear-gradient(-90deg, var(--gold-3), var(--gold-2)); }
.mk-bar b { font-weight: 500; color: var(--bone); font-variant-numeric: tabular-nums; }
.st-stat-v.is-good { color: var(--gold-2); } .st-stat-v.is-bad { color: #E8988D; }

.cr-res { padding-top: .2rem; }
.cr-one { margin-top: .5rem; font-size: .88rem; color: var(--muted); min-height: 1.3em; }
.cr-funnel { display: grid; gap: 6px; }
.cr-funnel span { display: block; height: 10px; width: var(--w); min-width: 0; border-radius: 99px; background: rgba(242,238,230,.1); transition: width .6s var(--ease); }
.cr-funnel span + span { background: var(--gold); }
.cr-what { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.cr-w { display: grid; gap: .2rem; padding: .6rem .7rem; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
.cr-w b { font-size: .75rem; font-weight: 500; color: var(--muted); }
.cr-w em { font-style: normal; font-size: .95rem; color: var(--bone); }
.cr-w.is-on { box-shadow: inset 0 0 0 1px var(--gold); } .cr-w.is-on b { color: var(--gold); }

.be-exact { margin-top: .5rem; font-size: .85rem; color: var(--muted); min-height: 1.3em; text-align: start; }
[dir="rtl"] .be-exact { direction: rtl; }
.be-chart { border-radius: 14px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); padding: .6rem; }
.be-chart svg { width: 100%; height: auto; }
.be-ax { stroke: var(--line-2); }
.be-cost { stroke: var(--bone-2); stroke-width: 1.6; fill: none; }
.be-rev { stroke: var(--gold); stroke-width: 2.2; fill: none; }
.be-loss { fill: rgba(217,119,107,.1); }
.be-profit { fill: rgba(201,169,110,.13); }
.be-drop { stroke: var(--gold); stroke-dasharray: 3 5; }
.be-pt { fill: var(--ink); stroke: var(--gold); stroke-width: 2.4; }
.be-t { font: 500 11px var(--f-ui); fill: var(--muted); letter-spacing: .04em; }
.be-t--rev { fill: var(--gold-2); } .be-t--loss { fill: #E8988D; } .be-t--profit { fill: var(--gold-2); } .be-t--x { font-size: 10.5px; }
.st-big .st-big-u[data-cur] { font-size: clamp(1.1rem, 2vw, 1.8rem); align-self: flex-start; margin-top: .5em; letter-spacing: .06em; font-family: var(--f-ui); }
@media (max-width: 760px) {
  .cr-what { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .utm-params .st-kv { grid-template-columns: 4.2rem minmax(0, 1fr); }
  .utm-dec { display: none; }
  .mk-bar { grid-template-columns: 5rem minmax(0, 1fr) auto; }
}

/* ==========================================================================
   TOOLS — UTILITY
   ========================================================================== */
/* QR */
.qr-stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; max-width: 460px; width: 100%; margin-inline: auto; padding: clamp(1rem, 2.4vw, 1.8rem); border-radius: 20px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.qr-stage canvas { width: 100%; height: auto; border-radius: 10px; image-rendering: pixelated; box-shadow: 0 20px 50px -20px rgba(0,0,0,.7); }
.qr-stage canvas[hidden] { display: none; }
.qr-empty { color: var(--muted); font-size: .9rem; text-align: center; }
.qr-empty[hidden] { display: none; }
.qr-meta { text-align: center; font-size: .75rem; letter-spacing: .06em; color: var(--muted); min-height: 1.2em; font-variant-numeric: tabular-nums; }
.qr-acts { justify-content: center; }
[data-urlf][hidden], [data-textf][hidden] { display: none; }
.st-seg button .st-ic { display: inline-block; vertical-align: -3px; }
.st-hint .st-ic { display: inline-block; vertical-align: -2px; color: var(--gold); }

/* word counter */
.wc-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.wc-stat { display: grid; gap: .35rem; align-content: start; padding: clamp(1rem, 1.8vw, 1.5rem) clamp(.9rem, 1.4vw, 1.3rem); border-inline-end: 1px solid var(--line); min-width: 0; }
.wc-stat:last-child { border-inline-end: 0; }
.wc-v { font: 400 clamp(1.5rem, 2.4vw, 2.4rem)/1.05 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: start; }
[dir="rtl"] .wc-v { direction: rtl; }
.wc-stat.is-main .wc-v { color: var(--gold-2); }
.wc-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.wc-in { width: 100%; min-height: clamp(320px, 46vh, 520px); padding: clamp(1.2rem, 2.4vw, 2.2rem); background: transparent; color: var(--bone); font: 400 1.08rem/1.75 var(--f-ui); resize: vertical; outline: none; border: 0; }
.wc-in::placeholder { color: var(--muted-2); }
.wc-in:focus { background: rgba(242,238,230,.015); }
.wc-side { display: grid; gap: 1rem; align-content: start; padding: clamp(1.2rem, 2vw, 1.8rem); border-inline-start: 1px solid var(--line); background: var(--ink-3); }
.wc-lim { display: grid; gap: .45rem; }
.wc-lim-t { display: flex; justify-content: space-between; gap: .6rem; font-size: .82rem; color: var(--bone-2); }
.wc-lim-t b { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.wc-lim-bar { height: 4px; border-radius: 4px; background: rgba(242,238,230,.08); overflow: hidden; }
.wc-lim-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s; }
.wc-lim.is-over .wc-lim-bar i { background: #D9776B; }
.wc-lim.is-over b { color: #E8988D; }

/* text case */
.tc { display: grid; }
.tc-in-wrap { display: grid; gap: .5rem; padding: clamp(1.2rem, 2.4vw, 2rem); border-bottom: 1px solid var(--line); }
.tc-in { min-height: 120px; font-size: 1.05rem; }
.tc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tc-card { display: grid; grid-template-rows: auto 1fr; gap: .5rem; min-width: 0; padding: 1rem 1.1rem 1.2rem; border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tc-card:nth-child(4n) { border-inline-end: 0; }
.tc-card:nth-last-child(-n+4) { border-bottom: 0; }
.tc-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tc-name { font: 500 .78rem/1 ui-monospace, Menlo, Consolas, monospace; color: var(--gold); }
.tc-out { max-height: 180px; overflow: auto; font: 400 .95rem/1.55 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--bone); overflow-wrap: anywhere; white-space: pre-wrap; }
.tc-out.is-empty::before { content: "—"; color: var(--muted-2); }

@media (max-width: 1180px) {
  .wc-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wc-stat:nth-child(4) { border-inline-end: 0; }
  .wc-stat:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .tc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-card:nth-child(4n) { border-inline-end: 1px solid var(--line); }
  .tc-card:nth-child(2n) { border-inline-end: 0; }
  .tc-card:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .tc-card:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 1024px) {
  .wc-body { grid-template-columns: minmax(0, 1fr); }
  .wc-side { border-inline-start: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .wc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wc-stat { border-bottom: 1px solid var(--line); }
  .wc-stat:nth-child(2n) { border-inline-end: 0; }
  .wc-stat:nth-child(4) { border-inline-end: 0; }
  .wc-stat.is-main { grid-column: 1 / -1; border-inline-end: 0; }
  .wc-stat:nth-child(odd):not(.is-main) { border-inline-end: 1px solid var(--line); }
  .wc-stat:nth-child(even) { border-inline-end: 1px solid var(--line); }
  .wc-stat:nth-child(odd):not(.is-main):last-child { border-inline-end: 0; }
  .wc-in { min-height: 240px; }
  .tc-grid { grid-template-columns: minmax(0, 1fr); }
  .tc-card, .tc-card:nth-child(2n), .tc-card:nth-child(4n) { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .tc-card:last-child { border-bottom: 0; }
}
