/* DS suite v2 — shared redesign layer for DS Desk, DS Biro and DS Studio (identical file in all three).
   Loaded after each app's own stylesheet. Same "Puls koda" language as dsdesign.digital
   (dark editorial, gold, offset shadows, mono labels), rebuilt with modern CSS:
   @property, color-mix(), container queries, :has(), @starting-style, View Transitions,
   scroll-driven animations and text-wrap. Everything degrades gracefully. */

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --accent: #ff9f1c;
  --r-lg: 18px;
  --r-xl: 24px;
  --glass: color-mix(in srgb, var(--bg-2) 78%, transparent);
  --card: color-mix(in srgb, var(--bg-2) 92%, var(--fg) 2%);
  --ring: color-mix(in srgb, var(--gold) 55%, transparent);
  --dock: 0px;
}
html[data-app="biro"] { --accent: #3ddc84; }
html[data-app="studio"] { --accent: #ff4d8d; }
html[data-theme="light"] { --card: #fffdf7; --glass: color-mix(in srgb, #fffdf7 82%, transparent); }

/* ---------- type: nicer rag, no orphans, no overflow ---------- */
h1, h2, h3 { text-wrap: balance; }
p, li, small, figcaption { text-wrap: pretty; }
.hero-lead, .page-head p, .sec-head p, .tool p { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
:where(h1, h2, h3, p, strong, span, a) { overflow-wrap: break-word; }
html { scroll-padding-top: calc(var(--header) + 64px); }
body { background: var(--bg); }

/* page-wide ambient light, fixed behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax -10vmax auto auto;
  width: 70vmax;
  height: 70vmax;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%);
  filter: blur(10px);
  opacity: .9;
}
html[data-theme="light"] body::before { opacity: .55; }

/* ---------- header ---------- */
#nav-root { background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom-color: color-mix(in srgb, var(--fg) 8%, transparent); }
#nav-root::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 60%, transparent), transparent); opacity: .6; }
.bar { gap: .75rem; }
.bar-left { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.brand-tag { display: none !important; }
.nav-links { gap: 1.25rem; }
/* header items never shrink, wrap or overlap; shell.js adds .fit-N classes until everything fits */
.bar { flex-wrap: nowrap; }
.bar > * { flex: none; }
.bar-left, .nav-tools { flex: none; }
.nav-links { gap: 1.1rem; }
.bar.fit-1 .find-txt { display: none !important; }
.bar.fit-2 .suite-tag { display: none !important; }
.bar.fit-2 .suite-btn { width: 30px; justify-content: center; padding: 0; }
.bar.fit-3 .nav-link b { display: none; }
.bar.fit-3 .nav-links { gap: .8rem; }
.bar.fit-4 .nav-links { display: none !important; }
.bar.fit-5 .find-btn kbd { display: none; }
.bar.fit-5 .find-btn { width: 40px; padding: 0; justify-content: center; }
.bar.fit-6 .nav-home { display: none !important; }
.bar.fit-7 .suite { display: none; }
.bar.fit-8 .brand img { display: none; }
.bar.fit-8 .lang-btn { min-width: 30px; }
/* no wrapping text anywhere in controls: buttons and chips stay on one line */
.status { flex-wrap: nowrap; white-space: nowrap; max-width: 100%; }
.status span { white-space: nowrap; }
.status .st-more { margin-left: .3rem; }
@media (max-width: 759px) { .status .st-more:nth-of-type(n + 3) { display: none; } }
@media (max-width: 479px) { .status .st-more { display: none; } }
.btn, .seg button, .chip, .mini, .rail-link, .nav-link, .lang-btn, .find-btn, .suite-btn, .dock-btn span, .tool-ext, .tool-new, kbd, .shelf-chip, .sec-kicker, .panel-title, .opt > span, .stat-label { white-space: nowrap; }
.btn, .seg button, .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; } /* last resort; shell.js first shrinks the font */
.sec-kicker, .panel-title { min-width: 0; }
.opt > span, .stat-label { overflow: hidden; text-overflow: ellipsis; }

.suite { position: relative; }
.suite-btn { display: inline-flex; align-items: center; gap: .3rem; height: 30px; padding: 0 .45rem 0 .55rem; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--muted); font: 600 .62rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: border-color .2s, color .2s; }
.suite-btn svg { width: 13px; height: 13px; transition: transform .25s var(--ease); }
.suite-btn:hover, .suite.is-open .suite-btn { border-color: var(--gold); color: var(--fg); }
.suite.is-open .suite-btn svg { transform: rotate(180deg); }
.suite-tag { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 519px) { .suite-tag { display: none; } .suite-btn { width: 30px; justify-content: center; padding: 0; } }
.suite-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: -60px;
  z-index: 60;
  width: min(330px, calc(100vw - 2rem));
  padding: .55rem;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  box-shadow: 8px 8px 0 var(--gold), 0 30px 60px -20px rgba(0, 0, 0, .55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transform-origin: top left;
  transition: opacity .18s, transform .22s var(--ease), visibility 0s .22s;
}
@media (max-width: 519px) { .suite-menu { left: -110px; } }
.suite.is-open .suite-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .22s var(--ease); }
.suite-head { padding: .45rem .6rem .55rem; font: 600 .64rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); }
.suite-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .6rem; border-radius: 12px; text-decoration: none; transition: background .15s; }
.suite-item:hover, .suite-item.is-on { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.suite-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--gold); color: var(--ink); border: 2px solid var(--ink); }
.suite-ico svg { width: 20px; height: 20px; }
.suite-item strong { display: block; font: 700 .95rem/1.15 var(--f-display); letter-spacing: -.02em; }
.suite-item strong b { color: var(--gold-text); font-weight: inherit; }
.suite-item small { display: block; font: 500 .74rem/1.35 var(--f-mono); color: var(--muted); }
.suite-go { font: 700 .8rem/1 var(--f-mono); color: var(--muted); }
.suite-item.is-on .suite-go { color: var(--ok); font-size: .6rem; }
.suite-site { display: block; margin-top: .35rem; padding: .6rem; border-top: 1px solid var(--line); font: 600 .72rem/1 var(--f-mono); color: var(--muted); text-decoration: none; text-align: center; }
.suite-site:hover { color: var(--gold-text); }

.find-btn { display: inline-flex; align-items: center; gap: .55rem; height: 40px; padding: 0 .55rem 0 .75rem; border: 1.5px solid var(--line-2); border-radius: var(--r); background: color-mix(in srgb, var(--bg-2) 70%, transparent); color: var(--muted); font: 500 .8rem/1 var(--f-mono); cursor: pointer; transition: border-color .2s, color .2s; }
.find-btn svg { width: 17px; height: 17px; }
.find-btn:hover { border-color: var(--gold); color: var(--fg); }
.find-btn kbd, .search-kbd, .pal-top kbd, .pal-foot kbd { padding: .2rem .4rem; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; font: 600 .62rem/1 var(--f-mono); color: var(--muted); background: var(--bg); }
.find-txt { display: inline; white-space: nowrap; }
@media (max-width: 759px) { .find-btn { width: 40px; padding: 0; justify-content: center; } .find-btn kbd { display: none; } }
@media (max-width: 759px) { html:not(.is-desktop) .nav-tools .icon-btn { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: 2.6rem 2.4rem; }
@media (min-width: 1024px) { .hero { padding-block: 4.6rem 3.6rem; } }
.aurora {
  position: absolute;
  inset: -30% -10% auto 30%;
  height: 120%;
  z-index: -1;
  pointer-events: none;
  background:
    conic-gradient(from var(--spin) at 60% 40%, transparent 0 20%, color-mix(in srgb, var(--gold) 22%, transparent) 30%, transparent 45%, color-mix(in srgb, var(--accent) 22%, transparent) 65%, transparent 80%);
  filter: blur(60px);
  opacity: .75;
  animation: aurora 26s linear infinite;
}
html[data-theme="light"] .aurora { opacity: .55; }
@keyframes aurora { to { --spin: 360deg; } }
.hero h1 { margin: 1.2rem 0 1rem; font-size: clamp(2.05rem, 1rem + 4.9vw, 5.1rem); line-height: 1; }
.hero h1 .h1-a { display: block; }
.hero h1 .h1-b { display: block; color: transparent; background: linear-gradient(100deg, var(--gold) 10%, var(--accent) 55%, var(--gold) 90%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; animation: shine 9s ease-in-out infinite; }
html[data-theme="light"] .hero h1 .h1-b { background-image: linear-gradient(100deg, #8f6200 10%, color-mix(in srgb, var(--accent) 70%, #121212) 55%, #8f6200 90%); }
@keyframes shine { 50% { background-position: 100% 0; } }
.hero-lead { font-size: clamp(.98rem, .92rem + .3vw, 1.1rem); max-width: 38rem; }
.hero-copy { min-width: 0; animation: rise .6s var(--ease) both; }
.hero-art { animation: rise .8s .1s var(--ease) both; }

.search { display: flex; align-items: center; gap: .2rem; max-width: 38rem; margin-top: 1.7rem; border: 2px solid var(--line-2); border-radius: 14px; background: var(--card); padding-inline: 1rem .6rem; transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease); }
.search > svg { width: 20px; height: 20px; flex: none; color: var(--gold-text); }
.search input { flex: 1; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 1rem .7rem !important; min-height: 58px; font-size: 16px !important; }
.search:focus-within { border-color: var(--gold); box-shadow: 6px 6px 0 var(--gold); transform: translate(-2px, -2px); }
.search > span { display: none; }
@media (pointer: coarse) { .search-kbd { display: none; } }

.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; max-width: 38rem; margin-top: 1.4rem; }
.hero-stats span { display: grid; gap: .25rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.hero-stats b { margin: 0; font: 800 clamp(1.05rem, .9rem + .7vw, 1.45rem)/1 var(--f-display); letter-spacing: -.03em; color: var(--fg); }
.hero-stats small { font: 500 .68rem/1.3 var(--f-mono); color: var(--muted); }
.cat-chips { display: none !important; }

/* ---------- favourites & recents shelf ---------- */
.shelf { display: grid; gap: .9rem; padding-block: 1.2rem .4rem; }
.shelf-row { display: grid; gap: .55rem; }
.shelf-k { display: flex; align-items: center; gap: .45rem; font: 600 .68rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.shelf-k svg { width: 14px; height: 14px; color: var(--gold-text); }
.shelf-list { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 8px; }
.shelf-list::-webkit-scrollbar { display: none; }
.shelf-chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: .55rem; min-height: 46px; padding: .4rem .9rem .4rem .45rem; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--card); text-decoration: none; font-weight: 700; font-size: .88rem; white-space: nowrap; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.shelf-chip:hover { transform: translate(-2px, -2px); border-color: var(--gold); box-shadow: 4px 4px 0 var(--gold); }
.shelf-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold-text); }
.shelf-ico svg { width: 17px; height: 17px; }

/* ---------- sticky category rail with scroll-spy ---------- */
.cat-rail { position: sticky; top: var(--header); z-index: 40; margin-top: 1rem; background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-block: 1px solid var(--line); }
.rail-in { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; padding-block: .55rem; scroll-behavior: smooth; }
.rail-in::-webkit-scrollbar { display: none; }
.rail-link { flex: none; display: inline-flex; align-items: center; gap: .45rem; min-height: 38px; padding: .4rem .8rem; border: 1.5px solid transparent; border-radius: 999px; font: 600 .76rem/1 var(--f-mono); color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .15s, border-color .15s, background .15s; }
.rail-link b { color: var(--gold-text); font-weight: 600; font-size: .66rem; }
.rail-link i { font-style: normal; min-width: 22px; padding: .18rem .35rem; border-radius: 999px; background: var(--bg-3); color: var(--muted); font-size: .64rem; text-align: center; }
.rail-link:hover { color: var(--fg); border-color: var(--line-2); }
.rail-link.is-on { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.rail-link.is-on b, .rail-link.is-on i { color: var(--ink); background: transparent; }
.sec + .sec, .cat-rail + .results > .sec:first-child { border-top: 1px solid var(--line); }
.results > .sec:first-child { border-top: 0; }

/* ---------- section heads ---------- */
.sec-head h2 span { color: var(--gold-text); }
.sec-head p { font-size: .98rem; line-height: 1.6; }

/* ---------- tool cards ---------- */
.tools { gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.tool {
  container-type: inline-size;
  isolation: isolate;
  overflow: hidden;
  gap: .6rem;
  min-height: 0;
  padding: 1.15rem 1.15rem 1rem;
  border-radius: var(--r-lg);
  background: var(--card);
  animation: card-in .5s calc(var(--i, 0) * 35ms) var(--ease) both;
}
.tool::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%);
  transition: opacity .3s;
}
.tool:hover::before { opacity: 1; }
.tool:hover { background: var(--card); }
.tool h3 { font-size: clamp(1rem, .96rem + .2vw, 1.08rem); line-height: 1.22; padding-right: 1.6rem; }
.tool p { font-size: .88rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tool-meta { display: flex; gap: .35rem; align-items: center; margin-right: 2rem; }
.tool-ico { transition: transform .35s var(--ease), background .2s; }
.tool:hover .tool-ico { transform: rotate(-8deg) scale(1.06); background: var(--gold); color: var(--ink); border-color: var(--ink); }
.tool-foot { display: flex; align-items: center; gap: .35rem; margin-top: auto; padding-top: .35rem; font: 600 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); opacity: .0; transform: translateX(-6px); transition: opacity .2s, transform .25s var(--ease); }
.tool-foot svg { width: 14px; height: 14px; }
.tool:hover .tool-foot, .tool:focus-visible .tool-foot { opacity: 1; transform: none; }
@media (pointer: coarse) { .tool-foot { display: none; } }
.fav-btn { position: absolute; top: .85rem; right: .85rem; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid transparent; border-radius: 9px; background: transparent; color: var(--dim); cursor: pointer; transition: color .15s, border-color .15s, transform .2s var(--ease), background .15s; }
.fav-btn svg { width: 17px; height: 17px; }
.fav-btn:hover { color: var(--gold-text); border-color: var(--line-2); }
.fav-btn.is-on { color: var(--gold); }
.fav-btn.is-on svg { fill: currentColor; }
.fav-btn:active { transform: scale(.85); }
.tool .tool-ext { margin-right: 0; }
.tool-new { top: auto; bottom: .9rem; right: .9rem; }
@container (max-width: 230px) { .tool p { -webkit-line-clamp: 2; line-clamp: 2; } }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- tool page ---------- */
.page-head { padding-block: 1.8rem 1.6rem; }
@media (min-width: 1024px) { .page-head { padding-block: 2.4rem 2rem; } }
.page-head .aurora { inset: -60% -20% auto 40%; opacity: .5; }
.page-head-in { animation: rise .45s var(--ease) both; }
.crumb a { text-decoration: none; }
.ph-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem 1.2rem; align-items: start; margin-top: 1rem; }
.ph-ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: var(--gold); color: var(--ink); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--shadow-c); view-transition-name: ph-ico; }
.ph-ico svg { width: 30px; height: 30px; }
@media (max-width: 559px) { .ph-row { grid-template-columns: minmax(0, 1fr); } .ph-ico { width: 52px; height: 52px; border-radius: 14px; } .ph-ico svg { width: 24px; height: 24px; } }
.ph-txt h1 { margin: 0 0 .5rem; font: 800 clamp(1.75rem, 1.15rem + 2.6vw, 3.1rem)/1.04 var(--f-display); letter-spacing: -.04em; view-transition-name: ph-title; }
.ph-txt p { max-width: 46rem; color: var(--muted); font-size: clamp(.95rem, .9rem + .2vw, 1.05rem); line-height: 1.6; }
.ph-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.2rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 32px; padding: .3rem .7rem; border: 1px solid var(--line-2); border-radius: 999px; background: color-mix(in srgb, var(--bg-2) 70%, transparent); font: 600 .7rem/1 var(--f-mono); color: var(--muted); white-space: nowrap; }
.chip-gold { background: var(--gold); color: var(--ink); border-color: var(--gold); letter-spacing: .06em; }
.chip-dim { opacity: .75; }
.chip-btn { cursor: pointer; }
.chip-btn:hover { border-color: var(--gold); color: var(--fg); }
.ph-fav { position: static; width: 32px; height: 32px; border-color: var(--line-2); border-radius: 999px; }
.work { padding-block: 1.6rem 3.5rem; }

/* panels: soft glass, gradient hairline and a pointer spotlight */
.panel {
  position: relative;
  isolation: isolate;
  border-radius: var(--r-lg);
  background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(160deg, color-mix(in srgb, var(--fg) 26%, transparent), color-mix(in srgb, var(--fg) 8%, transparent) 40%, color-mix(in srgb, var(--gold) 30%, transparent)) border-box;
  border: 1.5px solid transparent;
}
.panel::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--gold) 6%, transparent), transparent 60%); transition: opacity .4s; }
.panel:hover::before { opacity: 1; }
.panel-title { font-size: .72rem; }
.panel-title b { width: 24px; height: 24px; box-shadow: 2px 2px 0 var(--shadow-c); border: 1.5px solid var(--ink); }
.panel:has(.drop:not(.is-compact)) { padding: .8rem; }
@media (min-width: 768px) { .panel:has(.drop:not(.is-compact)) { padding: 1rem; } }
.panel:has(.drop:not(.is-compact)) > .panel-title { margin: .4rem .4rem .9rem; }

/* drop zone with an animated conic edge while dragging */
.drop { border-radius: var(--r-lg); min-height: 230px; }
.drop::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; background: conic-gradient(from var(--spin), var(--gold), var(--accent), transparent 40%, var(--gold)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); opacity: 0; transition: opacity .25s; pointer-events: none; animation: aurora 3s linear infinite; }
.drop.is-over::after, .drop:hover::after { opacity: 1; }
.drop:hover .drop-ico { transform: translateY(-3px) rotate(-4deg); }
.drop-ico { transition: transform .3s var(--ease); }
.drop small { max-width: 34rem; }

.opt > span { font-size: .68rem; }
.opt input[type="text"], .opt input[type="number"], .opt input[type="password"], .opt input[type="date"], .opt input[type="email"], .opt input[type="time"], .opt input[type="month"], .opt input[type="url"], .opt input[type="tel"], .opt select, .opt textarea { border-radius: 10px; background: var(--bg); transition: border-color .2s, box-shadow .2s; }
.opt input:focus, .opt select:focus, .opt textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); }
.opt input[type="range"] { height: 26px; }
.seg button { border-radius: 9px; transition: border-color .15s, background .15s, transform .15s; }
.seg button:active { transform: scale(.96); }
.result { border-radius: var(--r-lg); animation: pop .4s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
.progress { height: 12px; background: var(--bg); }
.progress span { background-size: 22px 22px; animation: stripes .8s linear infinite; }
@keyframes stripes { to { background-position: 22px 0; } }

/* ---------- command palette ---------- */
.palette { width: min(640px, calc(100vw - 1.5rem)); max-height: min(70vh, 640px); margin: 12vh auto auto; padding: 0; border: 0; background: transparent; color: var(--fg); overflow: visible; }
.palette::backdrop { background: rgba(5, 5, 6, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.palette[open] { animation: pal-in .22s var(--ease); }
@starting-style { .palette[open] { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes pal-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.pal-box { display: flex; flex-direction: column; max-height: min(70vh, 640px); border: 2px solid var(--ink); border-radius: var(--r-xl); background: var(--bg-2); box-shadow: 10px 10px 0 var(--gold), 0 40px 80px -20px rgba(0, 0, 0, .6); overflow: hidden; }
html[data-theme="light"] .pal-box { border-color: #121212; }
.pal-top { display: flex; align-items: center; gap: .7rem; padding: .4rem 1rem; border-bottom: 1px solid var(--line); }
.pal-top svg { width: 20px; height: 20px; color: var(--gold-text); flex: none; }
.pal-top input { flex: 1; min-width: 0; min-height: 58px; border: 0; background: transparent; outline: none; font: 500 1.05rem/1.2 var(--f-body); font-size: 16px; }
.pal-top input::-webkit-search-cancel-button { display: none; }
.pal-list { overflow-y: auto; padding: .4rem; overscroll-behavior: contain; }
.pal-group { padding: .7rem .7rem .35rem; font: 600 .62rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.pal-item { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .55rem .65rem; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.pal-item.is-sel { background: color-mix(in srgb, var(--gold) 13%, transparent); }
.pal-item.is-sel .pal-ico { background: var(--gold); color: var(--ink); }
.pal-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--bg-3); color: var(--gold-text); transition: background .15s, color .15s; }
.pal-ico svg { width: 18px; height: 18px; }
.pal-txt { min-width: 0; }
.pal-txt strong { display: block; font-size: .92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-txt small { display: block; font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-right { font: 600 .62rem/1 var(--f-mono); color: var(--dim); letter-spacing: .05em; }
.pal-empty { padding: 2rem 1rem; text-align: center; font: 500 .85rem/1.5 var(--f-mono); color: var(--muted); }
.pal-foot { display: flex; gap: 1.1rem; padding: .6rem 1rem; border-top: 1px solid var(--line); font: 500 .68rem/1 var(--f-mono); color: var(--dim); }
@media (pointer: coarse) { .pal-foot { display: none; } .palette { margin-top: 5vh; } }

/* ---------- phone dock ---------- */
.dock { display: none; }
@media (max-width: 759px) {
  :root { --dock: 74px; }
  body { padding-bottom: calc(var(--dock) + env(safe-area-inset-bottom)); }
  .dock { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 70; display: grid; grid-template-columns: repeat(4, 1fr); gap: .2rem; width: min(420px, calc(100vw - 20px)); padding: .35rem; transform: translateX(-50%); border: 1.5px solid var(--line-2); border-radius: 20px; background: color-mix(in srgb, var(--bg-2) 86%, transparent); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55); }
  .dock-btn { display: grid; justify-items: center; gap: .2rem; min-height: 52px; padding: .4rem .2rem; border: 0; border-radius: 14px; background: transparent; color: var(--muted); text-decoration: none; font: 600 .6rem/1 var(--f-mono); letter-spacing: .04em; cursor: pointer; }
  .dock-btn svg { width: 21px; height: 21px; }
  .dock-btn.is-on { background: var(--gold); color: var(--ink); }
  .dock-btn:active { transform: scale(.94); }
  .toast { bottom: calc(var(--dock) + 18px + env(safe-area-inset-bottom)); }
  .nav-home { display: none !important; }
}

/* ---------- footer ---------- */
.foot { position: relative; background: color-mix(in srgb, var(--bg-2) 50%, transparent); }
.foot-grid { display: grid; gap: 2rem; padding-block: 2.6rem 1.8rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .foot-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; } }
.foot-brand p { max-width: 26rem; margin-top: .9rem; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.foot-col { display: grid; align-content: start; gap: .5rem; }
.foot-h { font: 600 .64rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); margin-bottom: .3rem; }
.foot-col a { font-size: .9rem; color: var(--fg); text-decoration: none; width: fit-content; }
.foot-col a b { color: var(--gold-text); font: 600 .7rem/1 var(--f-mono); }
.foot-col a:hover { color: var(--gold-text); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1.5rem; padding-block: 1.1rem 1.4rem; border-top: 1px solid var(--line); font: 500 .72rem/1.5 var(--f-mono); color: var(--muted); }
.foot-base a { color: var(--fg); text-decoration: none; }
.foot-base a:hover { color: var(--gold-text); }

/* ---------- desktop-only notice & 404 ---------- */
.desk-only-box { display: grid; justify-items: start; gap: .9rem; max-width: 640px; padding: 2rem 1.4rem; margin-bottom: 2.5rem; border: 2px solid var(--gold); border-radius: var(--r-xl); background: color-mix(in srgb, var(--gold) 6%, var(--bg-2)); box-shadow: 8px 8px 0 var(--gold); }
.desk-only-box h1 { font: 800 clamp(1.6rem, 1.2rem + 2vw, 2.4rem)/1.08 var(--f-display); letter-spacing: -.04em; }
.big-404 { font: 800 clamp(4rem, 3rem + 6vw, 8rem)/.9 var(--f-display); letter-spacing: -.06em; color: var(--gold-text); }

/* ---------- View Transitions (route changes and the theme switch) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(root) { animation-name: vt-out; }
::view-transition-new(root) { animation-name: vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.vt-theme::view-transition-old(root), .vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
#nav-root { view-transition-name: nav; }
#dock { view-transition-name: dock; }

/* ---------- scroll-driven reveals where supported ---------- */
@supports (animation-timeline: view()) {
  .sec-head, .privacy, .related .tools { animation: sd-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
  @keyframes sd-rise { from { opacity: 0; transform: translateY(24px); } }
}

/* ---------- phones: tidy text and spacing ---------- */
@media (max-width: 559px) {
  .hero h1 { font-size: clamp(1.9rem, 1.2rem + 5.5vw, 2.6rem); }
  .hero-stats { gap: .4rem; }
  .hero-stats span { padding: .55rem .6rem; }
  .sec { padding-block: 2.6rem; }
  .sec-head { margin-bottom: 1.4rem; }
  .sec-head h2 { font-size: clamp(1.45rem, 1.1rem + 2.4vw, 1.9rem); }
  .panel { padding: 1rem; border-radius: 16px; }
  .actions { gap: .6rem; }
  .actions .btn { flex: 1 1 auto; }
  .tool { padding: 1rem; }
  .btn { min-height: 46px; }
}

/* reduced motion (also Android battery saver): keep the decorative animations, drop only page slides */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media print { .dock, .palette, .cat-rail, .shelf { display: none !important; } }

/* header fit: category links only on wide screens, nothing wraps */
.nav-links { display: flex !important; }
.nav-link, .find-btn, .find-btn kbd, .nav-home, .lang-btn { white-space: nowrap; }
.hero h1 .h1-a { color: var(--fg); }
@media (max-width: 559px) { .status { font-size: .62rem; padding: .35rem .65rem; letter-spacing: .04em; } .dock-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.opt { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.opt > span { min-width: 0; display: block; }
.mini { max-width: 100%; }
