:root {
  color-scheme: dark;
  --bg: #0a1224;
  --panel: rgba(14, 23, 45, 0.72);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #eef4ff;
  --muted: #9eabc7;
  --accent: #7ee0ff;
  --accent-2: #7c8dff;
  --accent-3: #7ff0c7;
  --danger: #ff8a98;
  --success: #7ff0c7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(126, 224, 255, 0.18), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(124, 141, 255, 0.18), transparent 28%),
    radial-gradient(circle at 50% 90%, rgba(127, 240, 199, 0.08), transparent 22%),
    linear-gradient(180deg, #07101f 0%, #0c152a 45%, #09101f 100%);
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.hero {
  padding: 40px 32px;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
    radial-gradient(circle at top right, rgba(126, 224, 255, 0.12), transparent 32%);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.75rem);
  line-height: 0.95;
}

.lead {
  margin: 18px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  margin-top: 20px;
  padding: 24px 28px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}

.card h2 {
  margin: 0 0 10px;
}

.card p {
  color: var(--muted);
  line-height: 1.6;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-bottom: 6px;
}

.tool-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.92rem;
  color: var(--muted);
}

.form-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.form-hint code {
  color: var(--accent);
}

.field input,
.field select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(6, 11, 24, 0.78);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(126, 224, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(126, 224, 255, 0.12);
}

.grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-block;
  border: 0;
  padding: 12px 18px;
  border-radius: 999px;
  color: #08111f;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  box-shadow: 0 10px 30px rgba(124, 141, 255, 0.25);
}

.button:hover {
  transform: translateY(-1px);
}

.button-secondary {
  color: #07101f;
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
}

.button-ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(126, 224, 255, 0.3);
  box-shadow: none;
}

.result-shell {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(4, 9, 20, 0.55);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.result-head h3 {
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.status-pill.is-loading {
  color: var(--accent);
  border-color: rgba(126, 224, 255, 0.35);
}

.status-pill.is-ok {
  color: var(--success);
  border-color: rgba(127, 240, 199, 0.35);
}

.status-pill.is-error {
  color: var(--danger);
  border-color: rgba(255, 138, 152, 0.35);
}

.result-output {
  min-height: 180px;
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  color: #dfe8ff;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(2, 6, 16, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.preview-shell {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(4, 9, 20, 0.62);
}

.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.preview-head h3 {
  margin: 0 0 6px;
}

.preview-head p {
  margin: 0;
  color: var(--muted);
}

.preview-frame {
  display: grid;
  gap: 14px;
}

.media-preview {
  width: 100%;
  max-height: 70vh;
  border-radius: 18px;
  background: #020814;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.image-preview {
  object-fit: contain;
  background: linear-gradient(180deg, rgba(8, 15, 28, 0.95), rgba(3, 8, 18, 0.95));
}

.file-preview {
  display: grid;
  gap: 12px;
  place-items: start;
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.03);
}

.file-preview p {
  margin: 0;
  color: var(--muted);
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
  .shell { padding-inline: 14px; }
  .hero, .card { padding: 20px; border-radius: 20px; }
  .grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; }
  .preview-head { flex-direction: column; align-items: stretch; }
  .actions { flex-direction: column; }
  .button { width: 100%; text-align: center; }
}
