:root {
  color-scheme: dark;
  --bg: #050706;
  --panel: rgba(12, 18, 15, 0.92);
  --panel-strong: rgba(18, 29, 22, 0.96);
  --lime: #c7ff3d;
  --lime-soft: rgba(199, 255, 61, 0.18);
  --lime-line: rgba(199, 255, 61, 0.42);
  --text: #efffe7;
  --muted: #8ea18a;
  --danger: #ff5f7a;
  --danger-soft: rgba(255, 95, 122, 0.14);
  --radius: 22px;
  --shadow: 0 0 40px rgba(199, 255, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top, rgba(199, 255, 61, 0.12), transparent 34rem),
    linear-gradient(180deg, #08100b 0%, var(--bg) 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: soft-light;
  opacity: 0.28;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.hero-panel,
.system-panel,
.result-panel,
.error-panel {
  border: 1px solid var(--lime-line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2rem, 11vw, 3.8rem);
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

h2 {
  font-size: 1.25rem;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 18px var(--lime);
}

.system-panel,
.result-panel,
.error-panel {
  padding: 16px;
  margin-bottom: 14px;
}

.panel-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--lime-line);
  border-radius: 999px;
  color: var(--lime);
  background: var(--lime-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.telegram-panel,
.footer-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.telegram-panel {
  padding: 12px;
  margin-bottom: 14px;
  border: 1px dashed rgba(199, 255, 61, 0.28);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.file-dropzone {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 22px;
  border: 1px dashed var(--lime-line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(199, 255, 61, 0.1), transparent),
    rgba(0, 0, 0, 0.22);
  text-align: center;
  cursor: pointer;
}

.file-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-icon {
  display: block;
  color: var(--lime);
  font-size: 2.8rem;
  line-height: 1;
  text-shadow: 0 0 18px var(--lime);
}

.file-title {
  display: block;
  margin-top: 8px;
  font-size: 1.12rem;
  font-weight: 800;
}

.file-hint,
.muted {
  color: var(--muted);
  font-size: 0.84rem;
}

.file-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.file-info div,
.custom-duration {
  padding: 12px;
  border: 1px solid rgba(199, 255, 61, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.file-info strong,
.file-info span {
  display: block;
  overflow-wrap: anywhere;
}

.duration-block {
  margin-top: 16px;
}

.section-title {
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 800;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preset,
.upload-button {
  border: 1px solid var(--lime-line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.preset {
  min-height: 44px;
  border-radius: 14px;
}

.preset.is-active {
  color: #08100b;
  background: var(--lime);
  box-shadow: 0 0 20px rgba(199, 255, 61, 0.2);
}

.custom-duration {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.custom-duration span {
  color: var(--muted);
  font-size: 0.84rem;
}

.custom-duration input {
  width: 100%;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.upload-button {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  border-radius: 18px;
  color: #071007;
  background: var(--lime);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.upload-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.progress-panel {
  margin-top: 14px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  box-shadow: 0 0 16px rgba(199, 255, 61, 0.5);
  transition: width 160ms ease;
}

dl {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

dl div {
  padding: 10px 0;
  border-bottom: 1px solid rgba(199, 255, 61, 0.14);
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.success-note,
.access-note,
.next-version-note {
  padding: 12px;
  margin: 12px 0 0;
  border: 1px solid rgba(199, 255, 61, 0.18);
  border-radius: 16px;
  color: var(--text);
  background: rgba(199, 255, 61, 0.08);
  line-height: 1.45;
}

.access-note {
  color: #08100b;
  background: var(--lime);
  font-weight: 900;
}

.next-version-note {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.debug-details {
  margin-top: 14px;
  border: 1px solid rgba(199, 255, 61, 0.18);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.debug-details summary {
  padding: 12px;
  color: var(--lime);
  cursor: pointer;
  font-weight: 800;
}

.debug-details pre {
  margin: 0 12px 12px;
}

pre {
  max-height: 260px;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(199, 255, 61, 0.18);
  border-radius: 14px;
  color: #dfffc1;
  background: rgba(0, 0, 0, 0.32);
  font-size: 0.78rem;
}

.error-panel {
  border-color: rgba(255, 95, 122, 0.52);
  background: var(--danger-soft);
}

.error-panel .eyebrow {
  color: var(--danger);
}

#errorText {
  white-space: pre-line;
}

.footer-note {
  padding: 6px 2px 24px;
  text-align: center;
}

@media (max-width: 380px) {
  .preset-grid,
  .file-info {
    grid-template-columns: 1fr;
  }
}
