/* Sunset glass: quiet surfaces, color at the edges, no animation needed to use it. */
:root {
  color-scheme: dark;
  --ink:#fff5fc; --muted:#e7cfe8; --accent:#f4c4fa; --focus:#ffd3a9;
  --deep:#150f27; --field:#24172f; --well:#281a37;
  --rim:rgba(245,198,255,.30);
  --glass:linear-gradient(145deg,rgba(49,31,72,.95),rgba(40,25,57,.90) 52%,rgba(65,30,56,.93));
  font:16px/1.53 Inter,"Segoe UI",system-ui,sans-serif;
  font-synthesis:none;
}
* { box-sizing:border-box }
[hidden] { display:none!important }
body {
  margin:0; color:var(--ink); background:var(--deep);
  min-height:100vh; min-height:100dvh;
  background:
    radial-gradient(ellipse at 9% 9%,#592d83 0%,transparent 42%),
    radial-gradient(ellipse at 95% 16%,#793155 0%,transparent 34%),
    radial-gradient(ellipse at 81% 72%,#522143 0%,transparent 40%),
    linear-gradient(149deg,#1b122d 0%,#241430 42%,#170e24 100%);
}
main {
  width:min(100%,42rem); margin-inline:auto; min-width:0;
  padding:max(17px,env(safe-area-inset-top)) 16px max(35px,env(safe-area-inset-bottom));
}
.hero,section {
  position:relative; isolation:isolate; min-width:0;
  border:1px solid var(--rim); border-radius:24px;
  box-shadow:inset 0 1px 0 rgba(255,235,255,.16),0 12px 28px rgba(13,7,23,.32);
  background:var(--glass);
}
.hero {
  overflow:hidden; padding:22px clamp(16px,5vw,27px) 20px;
  background:
    radial-gradient(ellipse at 105% -35%,#9a4c65bb 0%,transparent 60%),
    radial-gradient(ellipse at -25% -10%,#7341a999 0%,transparent 65%),var(--glass);
}
.hero::before,section::before {
  content:""; position:absolute; pointer-events:none; top:0; left:22px; right:22px; height:1px; border-radius:50%;
  background:linear-gradient(90deg,transparent,#c593fa 20%,#f298cb 51%,#ffb28e 78%,transparent);
  opacity:.75;
}
.brand {
  display:flex; align-items:center; gap:9px; margin:0;
  font-size:.69rem; letter-spacing:.12em; font-weight:750; color:var(--accent);
}
.brand::before {
  content:""; flex:none; width:15px; height:15px; border-radius:6px; transform:rotate(-12deg);
  background:linear-gradient(140deg,#d9a2ff 8%,#f286c7 53%,#ffd1a0);
  box-shadow:0 0 14px #f098ca65,inset 0 1px 0 #ffffffbf;
}
h1,h2,h3 { overflow-wrap:anywhere; text-wrap:balance }
h1 {
  font-size:clamp(1.64rem,6.6vw,2.4rem); line-height:1.10; font-weight:780; letter-spacing:-.043em;
  margin:13px 0 10px;
}
h2 { font-size:clamp(1.26rem,5.2vw,1.48rem); line-height:1.18; letter-spacing:-.026em; margin:0 0 10px }
h3 { font-size:1.06rem; font-weight:730; margin:23px 0 8px; letter-spacing:-.018em }
p { overflow-wrap:anywhere; color:var(--muted); margin:0 0 10px }
#status { font-size:.875rem; margin:0; min-height:1.2em; color:#f1d8ee }
section { margin-top:13px; padding:18px clamp(15px,4.7vw,23px) }
article {
  border-radius:16px; border:1px solid #edc0ff35; background:var(--well);
  padding:13px; margin:8px 0; min-width:0; overflow-wrap:anywhere;
}
label { display:grid; gap:5px; margin:12px 0; color:#f3d9f1; font-size:.87rem; font-weight:650 }
input,select,button {
  font:inherit; font-size:1rem; border:1px solid #af85b6; border-radius:12px;
  min-height:44px; padding:9px 13px;
}
input,select {
  width:100%; min-width:0; background:var(--field); color:var(--ink);
  box-shadow:inset 0 1px 3px #10091b70; accent-color:var(--accent);
}
input::placeholder { color:#d5b5d6; opacity:1 }
button {
  cursor:pointer; font-weight:720; font-size:.875rem;
  color:var(--ink); margin:7px 6px 0 0;
  background:linear-gradient(145deg,#54355e,#3b274c);
  box-shadow:inset 0 1px 0 #ffffff22; transition:transform 150ms ease,box-shadow 180ms ease;
}
#new-draft button[type=submit],#request button {
  position:relative; overflow:hidden;
  color:#291631; border-color:#ffd1ef; width:100%; margin-right:0;
  background:linear-gradient(112deg,#dab6ff 0%,#f1aedb 53%,#ffc39e 100%);
  box-shadow:inset 0 1px 0 #fff8,0 6px 18px #ee9aba35;
}
@media (hover:hover) { button:not(:disabled):hover { box-shadow:inset 0 1px 0 #ffffff44,0 0 14px #dc9bf451 } }
button:not(:disabled):active { transform:translateY(1px) }
button:disabled { opacity:.64; cursor:progress }
button:focus-visible,input:focus-visible,select:focus-visible { outline:2px solid var(--focus); outline-offset:3px }
#quote-warning {
  color:#ffe2b7; background:#392537; border:1px solid #ffbd865e;
  border-radius:12px; padding:10px 12px; font-size:.87rem; margin-top:12px;
}
@media (min-width:560px) { main { padding-inline:23px } }
@media (prefers-reduced-motion:reduce) { button { transition:none } }
@media (forced-colors:active) { .brand::before { border:1px solid CanvasText } }
.hero::after {
  content:""; position:absolute; z-index:-1; pointer-events:none; inset:0;
  background:radial-gradient(ellipse at 86% 85%,#ffb48e3d 0%,#ed78be20 28%,transparent 62%);
  opacity:.65;
}
@supports (backdrop-filter:blur(8px)) {
  .hero,section { backdrop-filter:blur(10px) saturate(115%) }
}
@media (prefers-reduced-motion:no-preference) {
  .hero::after { animation:glass-glow 9s ease-in-out infinite alternate }
  @keyframes glass-glow { to { opacity:.95 } }
}

.catalog-group { border:1px solid var(--rim); border-radius:15px; background:#2b1b3a; margin:9px 0; }
.catalog-group summary { position:relative; min-height:46px; padding:11px 12px; cursor:pointer; font-weight:730; }
.catalog-group summary small { float:right; color:var(--muted); margin-inline-start:8px; }
.catalog-group summary:focus-visible { outline:2px solid var(--focus); outline-offset:2px; border-radius:12px; }
.catalog-group>div { padding:0 8px 8px; }
.offer-pick { width:100%; display:flex; justify-content:space-between; align-items:center; gap:7px; margin:5px 0 0; text-align:start; overflow-wrap:anywhere; }
.offer-pick>span:last-child { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.offer-pick small { color:var(--muted); }
.offer-count { background:#e9b4ee; color:#291631; border-radius:20px; text-align:center; min-width:1.55em; padding:0 .24em; }
section.basket { margin-top:12px; padding:12px; border-radius:16px; backdrop-filter:none; }
.basket h3 { margin:0 0 5px; }
.basket-line { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:5px; border-bottom:1px solid var(--rim); }
.basket-line>div { display:flex;align-items:center;gap:6px; }
.basket-line button { margin:3px 0; padding:0; min-width:44px; }
#basket-total { font-weight:730; margin:8px 0 0; }
#basket-total:empty { display:none; }
#draft-status { margin-top:10px; }
.copy-status { font-size:.85rem; margin:7px 0 0; }
.copy-status:empty { display:none; }
.copy-text { display:block; margin-top:8px; width:100%; max-width:100%; resize:vertical; padding:10px; background:var(--field); color:var(--ink); border:1px solid var(--rim); border-radius:12px; font:inherit; }
.copy-text:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.draft-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.copy-icon {
  display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px;
  margin:0; padding:0; border:none; border-radius:11px; color:var(--accent);
  background:transparent; box-shadow:none;
}
.copy-glyph { display:block; position:relative; width:21px; height:21px; }
.copy-glyph::before,.copy-glyph::after {
  content:""; position:absolute; width:12px; height:13px; border:1.5px solid currentColor; border-radius:3px;
}
.copy-glyph::before { top:1px; left:1px; opacity:.58; }
.copy-glyph::after { right:1px; bottom:0; background:var(--well); }
#guide .brand { margin-bottom:7px; }
#guide-step { font-size:.8rem; color:var(--accent); }
#guide-heading { margin:5px 0; }
#guide-controls { display:flex; flex-wrap:wrap; }
#guide-next { background:linear-gradient(112deg,#dab6ff,#f1aedb 56%,#ffc39e); color:#291631; }
#guide-open { background:transparent; color:var(--accent); margin-top:12px; }

/* Slow moving light under real translucent surfaces; controls stay opaque enough to read. */
body { isolation:isolate; background:#160e25; }
.ambient-light { position:fixed; inset:0; z-index:-1; overflow:hidden; pointer-events:none;
  background:linear-gradient(146deg,#1b102b,#261530 56%,#160e25); }
.ambient-light::before,.ambient-light::after {
  content:""; position:absolute; inset:-20%; pointer-events:none;
  background-repeat:no-repeat;
}
.ambient-light::before {
  background:radial-gradient(ellipse at 28% 39%,#914ce1ba 0%,#732bb57d 24%,transparent 53%),
             radial-gradient(ellipse at 72% 70%,#9950b55c 0%,transparent 48%);
  transform:translate3d(-5vw,-5vh,0);
}
.ambient-light::after {
  background:radial-gradient(ellipse at 71% 33%,#f2888dbe 0%,#c6568f84 21%,transparent 51%),
             radial-gradient(ellipse at 30% 76%,#bf5fbb8a 0%,transparent 52%);
  transform:translate3d(9vw,-3vh,0);
}
@media (prefers-reduced-motion:no-preference) {
  body:not(.ambient-off) .ambient-light::before { animation:ambient-lilac 16s ease-in-out infinite alternate; }
  body:not(.ambient-off) .ambient-light::after { animation:ambient-coral 21s ease-in-out infinite alternate; }
  @keyframes ambient-lilac { 60% { transform:translate3d(8vw,5vh,0) } to { transform:translate3d(13vw,11vh,0) } }
  @keyframes ambient-coral { 55% { transform:translate3d(-3vw,9vh,0) } to { transform:translate3d(-11vw,13vh,0) } }
}
body.ambient-off .hero::after { animation:none; }
.hero,main>section {
  background:linear-gradient(144deg,rgba(39,24,59,.78),rgba(38,24,54,.68) 55%,rgba(53,27,52,.74));
}
.hero { background:linear-gradient(145deg,rgba(54,29,75,.69),rgba(38,24,54,.75) 55%,rgba(69,30,57,.62)); }
article,.catalog-group,section.basket { background:linear-gradient(145deg,rgba(44,27,64,.70),rgba(37,24,54,.60)); }
@supports ((backdrop-filter:blur(8px)) or (-webkit-backdrop-filter:blur(8px))) {
  .hero,main>section { backdrop-filter:blur(8px) saturate(115%); -webkit-backdrop-filter:blur(8px) saturate(115%); }
  main section.basket { backdrop-filter:none; -webkit-backdrop-filter:none; }
}
.appearance { display:flex; justify-content:center; padding-top:10px; }
#ambient-toggle { color:var(--muted); background:#24172f95; font-size:.78rem; margin:0; }
#ambient-toggle[aria-pressed="true"] { color:var(--accent); }
#ambient-toggle::after { content:" · выкл"; }
#ambient-toggle[aria-pressed="true"]::after { content:" · вкл"; }
@media (prefers-reduced-motion:reduce) { #ambient-toggle { display:none; } }
#catalog-import-panel {
  margin:16px 0 0; border:1px solid var(--rim); border-radius:16px;
  background:linear-gradient(145deg,rgba(44,27,64,.70),rgba(37,24,54,.60));
  overflow:hidden;
}
#catalog-import-panel > summary { padding:11px 14px; min-height:44px; cursor:pointer; font-weight:730 }
#catalog-import-panel > summary:focus-visible { outline:2px solid var(--focus); outline-offset:-3px }
#catalog-import-panel > section { margin:0; border-radius:0; border-inline:0; border-bottom:0; padding-inline:13px }
#import-file { padding-inline:8px; }
#import-file::file-selector-button { font:inherit; margin-inline-end:7px; }
#catalog-next,#basket-refresh { width:100%; margin-inline:0 }

/* The mark appears only when a real launch is waiting; the successful path has no minimum delay. */
#startup {
 display:grid; place-items:center; min-height:100vh; min-height:100dvh;
 padding:max(22px,env(safe-area-inset-top)) 20px max(22px,env(safe-area-inset-bottom));
}
.startup-card { display:grid; justify-items:center; width:min(100%,23rem); text-align:center; }
.startup-mark {
 width:clamp(96px,30vw,134px); aspect-ratio:1; position:relative; isolation:isolate; overflow:hidden;
 display:grid; place-items:center; border-radius:33%; border:1px solid #f1c6eeaf;
 background:linear-gradient(144deg,#f8bcdf70,#a173d965 49%,#f490b469 70%,#ffd3a34a),#392154;
 box-shadow:0 18px 54px #110a2690,0 0 44px #f299cf35,inset 0 0 30px #ffd3f252,inset 0 1px 0 #fff9;
}
.startup-mark::after {
 content:""; position:absolute; pointer-events:none; z-index:-1; inset:0;
 background:radial-gradient(ellipse at 15% 12%,#fff9,transparent 56%),linear-gradient(124deg,transparent 28%,#ffd0e04d 45%,transparent 64%);
}
#startup[data-state="waiting"] .startup-mark::after { animation:startup-shimmer 2.6s ease-in-out infinite; }
@keyframes startup-shimmer { 0%,100%{opacity:.43} 52%{opacity:1} }
.startup-mark span { font-size:clamp(54px,17vw,78px); font-weight:740; line-height:1; color:#fff2fd; text-shadow:0 5px 18px #48275b,0 0 24px #ffcaff88; }
.startup-brand { margin:27px 0 9px; color:var(--ink); font-size:1.16rem; font-weight:790; letter-spacing:.18em; }
#startup-status { max-width:23rem; min-height:1.5em; line-height:1.45; }
#startup-retry { min-width:9rem; margin-inline:0; }
.ambient-off #startup .startup-mark::after { animation:none; }
@media(prefers-reduced-motion:reduce) { #startup[data-state="waiting"] .startup-mark::after { animation:none; } }
#inventory-panel { margin-top:19px; border:1px solid var(--rim); border-radius:16px; background:#39224b90; }
#inventory-panel>summary { padding:11px 14px; min-height:44px; cursor:pointer; font-weight:730; }
#inventory-panel>summary:focus-visible { outline:2px solid var(--focus); outline-offset:-3px; }
.inventory-card { padding:0 13px 13px; }
#inventory-count fieldset { min-width:0; margin:12px 0; border:1px solid var(--rim); border-radius:13px; padding:10px; }
#inventory-count legend { color:var(--accent); padding-inline:5px; font-weight:700; }
#inventory-count label { margin:4px 0 8px; }
.inventory-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 10px; }
#inventory-lines output { display:block; color:#ffd6a6; font-size:.9rem; margin-top:6px; }
#inventory-summary { margin-top:10px; }
#inventory-save { width:100%; margin-inline:0; }
