:root {
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --soft: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --panel: rgba(3, 5, 9, 0.84);
  --panel-strong: rgba(2, 4, 8, 0.92);
  --panel-soft: rgba(5, 8, 14, 0.82);
  --button: rgba(6, 9, 15, 0.84);
  --button-strong: rgba(4, 7, 12, 0.92);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shell-width: min(1720px, calc(100% - 14px));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020408;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("./assets/background.png") center center / cover no-repeat;
  transform: translateZ(0);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
}

.site-shell {
  width: var(--shell-width);
  margin: 0 auto;
  padding: 12px 0 24px;
}

.glass-panel {
  background:
    linear-gradient(180deg, rgba(8, 12, 20, 0.82), rgba(2, 4, 8, 0.92)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 35%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.02);
  -webkit-backdrop-filter: blur(18px) saturate(1.02);
}

.site-header {
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  position: sticky;
  top: 10px;
  z-index: 20;
}

.brand-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.brand-copy-block {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.brand-logo {
  width: clamp(72px, 8vw, 92px);
  height: clamp(72px, 8vw, 92px);
  object-fit: contain;
  border-radius: 24px;
  flex: 0 0 auto;
  padding: 8px;
  background: linear-gradient(180deg, rgba(6, 9, 15, 0.9), rgba(1, 3, 7, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.kicker {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(0.68rem, 1.3vw, 0.8rem);
  line-height: 1.2;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.brand-copy,
.hero-strip p,
.muted,
.tiny-note,
.queue-stats,
.archive-name,
.activity-meta,
.result-meta,
.panel-subcopy {
  color: var(--muted);
}

.brand-copy {
  margin: 0;
  max-width: 1100px;
  line-height: 1.5;
  font-size: clamp(0.95rem, 1.7vw, 1.1rem);
}

.header-actions,
.stack-buttons,
.panel-head,
.card-head,
.result-actions,
.archive-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.header-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.header-actions > * {
  min-width: 0;
}

.btn,
select,
input[type="number"],
input[type="range"] {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  background: linear-gradient(180deg, rgba(7, 10, 16, 0.78), rgba(2, 4, 8, 0.96));
  font: inherit;
}

.btn {
  min-height: 46px;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(14, 18, 28, 0.82), rgba(4, 7, 12, 0.98));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.btn.primary {
  background: linear-gradient(180deg, rgba(15, 20, 31, 0.88), rgba(4, 7, 12, 0.98));
  border-color: rgba(255, 255, 255, 0.24);
}

.btn.small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.hero-strip {
  margin-top: 14px;
  border-radius: var(--radius-xl);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.hero-message,
.hero-note-box {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(6, 9, 15, 0.9), rgba(2, 4, 8, 0.96));
  padding: 16px 18px;
}

.hero-message h2 {
  margin: 10px 0 10px;
  font-size: clamp(1.28rem, 2.5vw, 2rem);
  line-height: 1.08;
}

.hero-strip p {
  margin-bottom: 0;
  line-height: 1.58;
}

.hero-note-box {
  display: grid;
  gap: 10px;
  line-height: 1.55;
}

.rail-shell {
  position: relative;
  margin-top: 14px;
}

.tool-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(360px, 33vw, 480px);
  gap: 14px;
  overflow-x: auto;
  padding: 0 56px 8px 12px;
  scroll-padding-inline: 12px;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
}

.tool-rail::-webkit-scrollbar,
.result-grid::-webkit-scrollbar,
.archive-list::-webkit-scrollbar,
.activity-log::-webkit-scrollbar,
.panel-content::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.tool-rail::-webkit-scrollbar-thumb,
.result-grid::-webkit-scrollbar-thumb,
.archive-list::-webkit-scrollbar-thumb,
.activity-log::-webkit-scrollbar-thumb,
.panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.tool-card {
  min-height: 100%;
  border-radius: var(--radius-xl);
  padding: 16px 16px 15px;
  scroll-snap-align: start;
}

.card-head,
.panel-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-head h3,
.panel-head h2,
.panel-title-wrap h2 {
  margin: 0;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(14, 17, 24, 0.82), rgba(3, 5, 9, 0.94));
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.84rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.95rem;
}

select,
input[type="number"],
input[type="text"],
textarea {
  min-height: 46px;
  padding: 0 14px;
  font-size: 16px;
  color: #050505;
  border-color: rgba(0, 0, 0, 0.14);
  background: linear-gradient(180deg, rgba(216, 216, 216, 0.96), rgba(180, 180, 180, 0.98));
}

input[type="range"] {
  width: 100%;
  padding: 0;
}

select option {
  background: #efefef;
  color: #000000;
}

input[type="number"]::placeholder,
input[type="text"]::placeholder,
textarea::placeholder {
  color: rgba(0, 0, 0, 0.58);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.split-options {
  display: grid;
  gap: 10px;
}

.queue-stats,
.drop-hint,
.log-entry,
.archive-item,
.result-card,
.result-preview {
  background: linear-gradient(180deg, rgba(6, 9, 15, 0.84), rgba(1, 3, 7, 0.96));
}

.queue-stats,
.drop-hint {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px;
  line-height: 1.55;
}

.queue-stats.compact {
  margin-top: 12px;
  font-size: 0.92rem;
}

.tool-card .queue-stats + .queue-stats {
  margin-top: 10px;
}

.field select:disabled,
.btn:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.drop-hint {
  margin-top: 14px;
}

.rail-scroll {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(6, 9, 15, 0.92), rgba(1, 3, 7, 0.98));
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  opacity: 0.9;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.rail-scroll:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.03);
  background: linear-gradient(180deg, rgba(14, 18, 28, 0.94), rgba(3, 5, 9, 1));
}

.rail-scroll:disabled {
  cursor: default;
  transform: translateY(-50%);
}

.rail-scroll.left {
  left: 2px;
}

.rail-scroll.right {
  right: 2px;
}

.rail-scroll span {
  font-size: 1.35rem;
  line-height: 1;
}

.rail-shell::before,
.rail-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 8px;
  width: 40px;
  pointer-events: none;
  z-index: 3;
}

.rail-shell::before {
  left: 0;
  background: linear-gradient(90deg, rgba(2, 4, 8, 0.9), rgba(2, 4, 8, 0));
}

.rail-shell::after {
  right: 0;
  background: linear-gradient(270deg, rgba(2, 4, 8, 0.9), rgba(2, 4, 8, 0));
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.workspace-panel {
  border-radius: var(--radius-xl);
  padding: 16px;
}

.collapsible-panel {
  overflow: hidden;
}

.panel-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.panel-toggle-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(13, 17, 25, 0.82), rgba(2, 4, 8, 0.96));
  font-size: 1.5rem;
  flex: 0 0 auto;
  transition: transform 0.2s ease, background 0.2s ease;
}

.collapsible-panel.is-open .toggle-icon {
  transform: rotate(45deg);
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.88), rgba(4, 7, 12, 1));
}

.panel-content {
  margin-top: 16px;
}

.content-head {
  margin-bottom: 12px;
}

.activity-log {
  display: grid;
  gap: 12px;
  max-height: 720px;
  overflow: auto;
  padding-right: 6px;
}

.log-entry {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.log-entry strong {
  display: block;
  margin-bottom: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 14px;
  max-height: 720px;
  overflow: auto;
  padding-right: 6px;
}

.result-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.result-preview {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-preview img,
.result-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-preview .file-fallback {
  padding: 18px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}

.result-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.result-title {
  margin: 0;
  font-size: 1rem;
  word-break: break-word;
}

.result-meta {
  font-size: 0.9rem;
  line-height: 1.55;
}

.archive-list {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow: auto;
  margin-top: 12px;
}

.archive-item {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.archive-name {
  margin-bottom: 10px;
  line-height: 1.45;
  word-break: break-word;
}

.site-footer {
  background: #ffffff;
  color: #000000;
  text-align: center;
  font-size: 0.92rem;
  padding: 10px 12px;
  letter-spacing: 0.02em;
}

.dragging .site-header,
.dragging .tool-card,
.dragging .workspace-panel,
.dragging .hero-strip {
  border-color: rgba(255, 255, 255, 0.28);
}

@media (max-width: 1280px) {
  .tool-rail {
    grid-auto-columns: clamp(340px, 42vw, 460px);
  }
}

@media (max-width: 1080px) {
  .hero-strip,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .tool-rail {
    grid-auto-columns: minmax(320px, 62vw);
    padding-inline: 12px 52px;
  }

  .header-actions {
    gap: 8px;
  }

  .btn {
    padding-inline: 14px;
  }
}

@media (max-width: 760px) {
  :root {
    --shell-width: min(100% - 10px, 1720px);
  }

  .site-shell {
    padding-top: 8px;
  }

  .site-header,
  .hero-strip,
  .tool-card,
  .workspace-panel {
    padding: 14px;
  }

  .brand-wrap {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .brand-copy-block {
    gap: 8px;
  }

  h1 {
    font-size: clamp(1.52rem, 6vw, 2.1rem);
  }

  .brand-copy {
    font-size: 0.96rem;
    line-height: 1.42;
  }

  .header-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .header-actions .btn {
    min-height: 42px;
    padding: 0 8px;
    font-size: clamp(0.7rem, 2.7vw, 0.86rem);
    letter-spacing: -0.01em;
  }

  .tool-rail {
    grid-auto-columns: calc(100% - 74px);
    padding-inline: 10px 46px;
    gap: 12px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .rail-scroll {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 520px) {
  .brand-wrap {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }

  .brand-logo {
    width: 64px;
    height: 64px;
    padding: 6px;
    border-radius: 18px;
  }

  .kicker {
    font-size: 0.61rem;
    letter-spacing: 0.14em;
  }

  h1 {
    font-size: clamp(1.34rem, 6vw, 1.72rem);
  }

  .brand-copy {
    font-size: 0.88rem;
  }

  .header-actions .btn {
    min-height: 40px;
    font-size: clamp(0.62rem, 2.65vw, 0.77rem);
    padding-inline: 5px;
    border-radius: 16px;
  }

  .hero-message h2 {
    font-size: 1.2rem;
  }

  .tool-rail {
    grid-auto-columns: calc(100% - 68px);
    padding-inline: 10px 42px;
  }
}

@media (max-width: 390px) {
  .site-shell {
    width: min(100% - 8px, 1720px);
  }

  .site-header,
  .hero-strip,
  .tool-card,
  .workspace-panel {
    padding: 12px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .btn {
    font-size: 0.58rem;
    padding-inline: 4px;
  }

  .brand-copy {
    font-size: 0.83rem;
  }

  .tool-rail {
    grid-auto-columns: calc(100% - 62px);
    gap: 10px;
    padding-inline: 8px 38px;
  }
}


.archive-route {
  margin-top: 8px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
}

.tool-card .muted,
.tool-card .tiny-note,
.tool-card .queue-stats,
.tool-card .drop-hint,
.tool-card .archive-name {
  line-height: 1.45;
}

.tool-card .stack-buttons {
  margin-top: 2px;
}
