:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #f4f1f3;
  background: #101013;
  --ink: #f4f1f3;
  --muted: #bcb8bf;
  --border: #b9b4c53b;
  --accent: #ffab91;
  --glass: linear-gradient(132deg, #3e3a41b5, #211f25e6 48%, #18171de8 77%, #302c34c9);
  --edge: inset 0 1px #ffffff1f, 0 12px 27px #0006;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: default; }
:focus-visible { outline: 2px solid #ffb39b; outline-offset: 3px; }

.dashboard {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding: 18px;
  background:
    radial-gradient(ellipse at 87% 0%, #403c47 0, transparent 41%),
    radial-gradient(ellipse at 4% 96%, #302b34 0, transparent 47%),
    linear-gradient(142deg, #19181e, #100f13 55%, #17151b);
}
.dashboard::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(140deg, transparent 12%, #cbc4ce25 12.2%, #0d0d11 12.5% 17%, transparent 17.2%),
    linear-gradient(151deg, transparent 34%, #0005 34.2% 39.5%, #e6e0eb21 39.7%, transparent 40% 78%, #bcb5c215 78.2%, #0f0e12 78.4% 84%, transparent 84.3%),
    linear-gradient(29deg, #0005 9%, #e7ddeb1f 9.25%, transparent 9.45% 53%, #09090e9c 53.3% 56%, #a29cad21 56.3%, transparent 56.5% 91%, #09090eb0 91.3%),
    linear-gradient(113deg, #0004 8%, transparent 8.2% 66%, #0303055c 66.2% 74%, #d0c9d31c 74.2%, transparent 74.5%);
}

.rail, .topbar {
  border: 1px solid var(--border);
  color: var(--ink);
  background: var(--glass);
  box-shadow: var(--edge);
  backdrop-filter: blur(16px);
}
.rail {
  position: sticky;
  top: 18px;
  min-height: calc(100dvh - 36px);
  border-radius: 23px;
  padding: 15px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 3px; font-weight: 760; font-size: .94rem; }
.brand small { display: block; color: var(--muted); font-size: .71rem; font-weight: 500; margin-top: 2px; }
.brand-mark {
  width: 35px; height: 35px;
  display: grid; place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid #f6a28b61;
  color: #fff1ec;
  background: linear-gradient(145deg, #b75b45, #773b36);
  box-shadow: 0 3px 12px #db6a473d;
  font-size: .7rem;
  letter-spacing: .06em;
}
.rail nav { display: grid; gap: 4px; margin-top: 26px; }
.rail nav a { display: flex; align-items: center; gap: 9px; min-height: 41px; padding: 8px 10px; border-radius: 11px; font-size: .84rem; color: var(--muted); }
.rail nav a span { width: 16px; color: #c5bfc7; text-align: center; }
.rail nav a:hover { background: #ffffff13; color: var(--ink); }
.rail nav .nav-primary { background: linear-gradient(100deg, #7a53464d, #ffffff0e); color: var(--ink); box-shadow: inset 0 0 0 1px #ffffff25; font-weight: 700; }
.rail nav .nav-primary span { color: var(--accent); }
.main-shell { min-width: 0; width: 100%; max-width: 1500px; justify-self: center; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 16px; padding: 10px 18px; min-height: 48px; font-size: .83rem; color: var(--muted); }
.topbar strong { color: var(--ink); font-weight: 650; }
.topbar-divider { margin: 0 5px; opacity: .7; }
.topbar a { color: var(--ink); font-weight: 650; white-space: nowrap; }
.topbar a:hover { text-decoration: underline; }
.topbar a span { color: var(--accent); margin-left: 3px; }

.main-panel {
  margin-top: 14px;
  padding: clamp(18px, 2.6vw, 37px);
  border-radius: 26px;
  border: 1px solid #cbc3d427;
  background: linear-gradient(138deg, #29262d9e 0%, #141319bd 48%, #222027a8 100%);
  box-shadow: 0 20px 64px #0007, inset 0 1px #ffffff13;
}
.hero { margin: 0 0 25px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.5vw, 3.1rem); line-height: 1.04; letter-spacing: -.056em; font-weight: 800; }
h2 { font-size: 1.24rem; letter-spacing: -.028em; }
h3 { font-size: 1rem; letter-spacing: -.016em; }
.hero p { margin-top: 9px; color: var(--muted); font-size: .94rem; line-height: 1.55; }
.workspace { display: grid; grid-template-columns: minmax(265px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: var(--edge);
  backdrop-filter: blur(13px);
}
.parameters { padding: 20px; }
form { display: grid; gap: 13px; margin-top: 17px; }
.form-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px; }
label { display: grid; gap: 6px; color: #e4dfe7; font-size: .82rem; font-weight: 680; }
label small { margin-left: 4px; color: var(--muted); font-size: .73rem; font-weight: 500; }
input, select, textarea {
  color: var(--ink); width: 100%; min-width: 0;
  padding: 8px 10px; min-height: 40px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #1110159e; font-size: .88rem; font-weight: 500;
}
select option { color: var(--ink); background: #222026; }
input:hover, select:hover, textarea:hover { border-color: #aaa1ad86; }
input:disabled, select:disabled, textarea:disabled { opacity: .72; }
textarea { min-height: 74px; resize: vertical; line-height: 1.4; }
textarea::placeholder { color: #aaa4b0; }
.hint { margin: 5px 0 0 1px; color: var(--accent); font-size: .75rem; line-height: 1.35; }
.primary, .secondary, .copy {
  border: 1px solid transparent;
  min-height: 39px;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: .84rem;
  transition: background .16s ease, box-shadow .16s ease;
}
.primary { color: #fff6f1; background: linear-gradient(125deg, #a64837, #863a33); border-color: #e799825c; box-shadow: 0 5px 16px #b0443140, inset 0 1px #ffd7cb20; }
.primary:not(:disabled):hover { background: linear-gradient(125deg, #b24d3b, #974237); box-shadow: 0 5px 18px #b0443160, inset 0 1px #ffd7cb28; }
form .primary { min-height: 43px; margin-top: 2px; }
.secondary, .copy { background: #ffffff0d; color: #efebf2; border-color: var(--border); }
.secondary:not(:disabled):hover, .copy:hover { background: #ffffff19; border-color: #b9b4c572; }

.activity { padding: 15px 17px; }
.status { display: flex; align-items: flex-start; gap: 10px; }
.status-dot { flex: 0 0 8px; height: 8px; border-radius: 50%; background: #88c6a2; box-shadow: 0 0 0 4px #88c6a229; margin-top: 6px; }
.status[data-kind="busy"] .status-dot { background: #f2ad82; box-shadow: 0 0 0 4px #f2ad8234; }
.status[data-kind="error"] .status-dot { background: #ff907e; box-shadow: 0 0 0 4px #ff907e34; }
.status strong { font-size: .91rem; }
.status p { margin-top: 3px; color: var(--muted); font-size: .81rem; line-height: 1.45; }
.preparation { display: flex; align-items: center; gap: 13px; margin-top: 12px; }
.progress-wrap { flex: 1; min-width: 0; }
.progress-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; justify-content: space-between; color: var(--muted); font-size: .73rem; }
progress { display: block; appearance: none; width: 100%; height: 5px; margin-top: 6px; overflow: hidden; border: 0; border-radius: 99px; background: #49434f; }
progress::-webkit-progress-bar { background: #49434f; border-radius: 99px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #aa796e, #e49a7f); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, #aa796e, #e49a7f); border-radius: 99px; }
progress:indeterminate { background: linear-gradient(100deg, #49434f 28%, #c48e78 50%, #49434f 72%); background-size: 220% 100%; animation: progress-slide 1.7s ease-in-out infinite; }
progress:indeterminate::-webkit-progress-bar { background: transparent; }
@keyframes progress-slide { to { background-position: -220% 0; } }

.output { min-width: 0; }
.output-heading { margin: 17px 0 10px; }
.empty { min-height: 265px; padding: 25px 15px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty p { margin-top: 6px; color: var(--muted); font-size: .85rem; }
.empty-illustration { display: flex; gap: 6px; margin-bottom: 13px; transform: rotate(-5deg); }
.empty-illustration div { display: grid; align-content: start; gap: 5px; width: 44px; height: 53px; padding: 9px 7px; border: 1px solid #c8bdca68; border-radius: 8px; background: linear-gradient(150deg, #5c555f, #2c2930); box-shadow: 0 6px 12px #0005; }
.empty-illustration div + div { transform: translateY(6px); background: linear-gradient(150deg, #59433f, #2b2529); }
.empty-illustration i { height: 2px; border-radius: 3px; background: #aba1ae; }
.empty-illustration i:first-child { width: 55%; background: var(--accent); }
.empty-illustration i:last-child { width: 70%; }
.result-banner { display: flex; justify-content: space-between; align-items: center; gap: 13px; padding: 14px 16px; margin-bottom: 10px; }
.result-banner:has(#result-banner-title[data-kind="error"]) { border-color: #cf897c; background: linear-gradient(135deg, #4d292b, #2a1d23); }
.result-banner p { margin-top: 3px; color: var(--muted); font-size: .81rem; line-height: 1.45; }
#result-meta { display: block; margin-top: 3px; font-size: .74rem; color: var(--muted); }
#results, #parameters, #output, #about { scroll-margin-top: 15px; }
#cards { display: grid; gap: 10px; }
.review-card { padding: 16px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; margin-bottom: 11px; }
.card-head .overline { color: var(--accent); font-size: .74rem; font-weight: 750; white-space: nowrap; }
.card-head h3 { margin: 0; }
.columns, .card-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.columns section { min-width: 0; border-radius: 11px; padding: 11px; background: #100f148c; border: 1px solid #c1b9c72e; }
.columns h4 { margin: 0 0 6px; color: #d2c9d5; font-size: .74rem; font-weight: 760; }
.columns p { font-size: .87rem; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.card-foot { margin-top: 8px; }
.copy { justify-self: start; font-size: .74rem; min-height: 34px; padding: 6px 10px; }
.mode-note { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #ffffff09; color: var(--muted); }
.mode-note h2 { color: var(--ink); }
.mode-note h2 { font-size: .9rem; }
.mode-note p { margin-top: 4px; font-size: .81rem; line-height: 1.55; }

@media (max-width: 1030px) {
  .dashboard { grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 13px; }
  .rail { top: 13px; min-height: calc(100dvh - 26px); }
  .workspace { grid-template-columns: minmax(235px, 290px) minmax(0, 1fr); gap: 12px; }
  .main-panel { padding: 18px; }
  .parameters { padding: 16px; }
}
@media (max-width: 780px) {
  .dashboard { grid-template-columns: 1fr; }
  .rail { position: static; min-height: 0; border-radius: 17px; padding: 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
  .rail nav { display: flex; flex-wrap: wrap; justify-content: end; margin: 0; gap: 2px; }
  .rail nav a { min-height: 33px; padding: 5px 8px; gap: 4px; }
  .topbar { display: none; }
  .main-panel { margin-top: 0; }
}
@media (max-width: 660px) {
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 590px) {
  .dashboard { padding: 9px; gap: 9px; }
  .main-panel { padding: 12px; border-radius: 19px; }
  .hero { margin: 6px 0 15px; }
  .hero p { font-size: .84rem; }
  .rail nav a { font-size: .72rem; }
  .rail nav a span, .brand small { display: none; }
  .brand { font-size: .81rem; white-space: nowrap; gap: 5px; }
  .brand-mark { width: 26px; height: 26px; border-radius: 8px; font-size: .55rem; }
  .result-banner { flex-wrap: wrap; }
  .empty { min-height: 170px; }
  .columns, .card-foot { gap: 6px; }
  .columns section { padding: 7px; }
  .columns p { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
