:root {
  --unite-bg-glass: rgba(255, 255, 255, 0.15);
  --unite-bg-deep: rgba(0, 0, 0, 0.38);
  --unite-border: rgba(255, 255, 255, 0.2);
  --unite-text: #ffffff;
  --unite-muted: rgba(255, 255, 255, 0.72);
  --unite-accent: #00bcd4;
  --unite-warm: #f19408;
  --unite-danger: #ff6b6b;
  --unite-radius: 16px;
}

body {
  min-height: 100vh;
  color: var(--unite-text);
}

.tool-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 48px auto 72px;
}

.tool-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  color: var(--unite-text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
}

.tool-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tool-icon {
  width: 58px;
  height: 58px;
  padding: 10px;
  border: 1px solid var(--unite-border);
  border-radius: 14px;
  background: var(--unite-bg-glass);
  backdrop-filter: blur(10px);
}

.tool-kicker {
  color: var(--unite-muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tool-hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

.tool-description {
  max-width: 420px;
  color: var(--unite-muted);
  text-align: right;
}

.converter-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--unite-border);
  border-radius: var(--unite-radius);
  background: var(--unite-bg-glass);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px) saturate(170%);
}

.drop-zone {
  display: grid;
  min-height: 360px;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  border: 2px dashed rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--unite-text);
  cursor: pointer;
  text-align: center;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragging {
  border-color: var(--unite-accent);
  background: rgba(0, 188, 212, 0.12);
  outline: none;
  transform: translateY(-3px);
}

.drop-icon {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 18px;
  background: #ffffff;
  color: #111111;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.drop-zone h2 {
  font-size: 1.35rem;
}

.drop-zone p,
.file-info dt,
.tool-description {
  font-size: 0.95rem;
}

.drop-zone p,
.file-info dt {
  color: var(--unite-muted);
}

.preview-panel {
  display: grid;
  gap: 16px;
}

.preview-frame {
  display: grid;
  min-height: 250px;
  max-height: 360px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--unite-border);
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.08) 75%);
  background-color: rgba(0, 0, 0, 0.24);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
}

.file-info {
  display: grid;
  gap: 10px;
}

.file-info div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: var(--unite-bg-deep);
}

.file-info dd {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.converter-controls {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
  padding-top: 4px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--unite-muted);
  font-weight: 700;
}

.field strong {
  color: var(--unite-text);
}

.field select,
.field input[type="range"] {
  width: 100%;
}

.field select {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--unite-border);
  border-radius: 10px;
  color: var(--unite-text);
  background: rgba(0, 0, 0, 0.48);
  font: inherit;
}

.field input[type="range"] {
  accent-color: var(--unite-accent);
}

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

.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.primary-action {
  background: #ffffff;
  color: #111111;
}

.primary-action:hover:not(:disabled) {
  background: var(--unite-warm);
  transform: translateY(-2px);
}

.secondary-action {
  background: var(--unite-accent);
  color: #061315;
}

.ghost-action {
  border: 1px solid var(--unite-border);
  background: rgba(0, 0, 0, 0.26);
  color: var(--unite-text);
}

.primary-action:disabled,
.ghost-action:disabled,
.secondary-action.is-disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.55;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 16px;
  border: 1px solid var(--unite-border);
  border-radius: 12px;
  color: var(--unite-text);
  background: rgba(17, 17, 17, 0.9);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ffdada;
}

@media (max-width: 860px) {
  .tool-shell {
    width: min(100% - 24px, 680px);
    margin-top: 28px;
  }

  .tool-hero,
  .converter-panel {
    grid-template-columns: 1fr;
  }

  .tool-hero {
    display: grid;
    align-items: start;
  }

  .tool-description {
    text-align: left;
  }

  .drop-zone {
    min-height: 280px;
  }

  .actions > * {
    flex: 1 1 150px;
  }
}

@media (max-width: 520px) {
  .converter-panel {
    padding: 16px;
  }

  .tool-title-group {
    align-items: flex-start;
  }

  .file-info div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
