@font-face {
  font-family: "Gotham";
  src: url("assets/fonts/Gotham-Book.otf") format("opentype");
  font-weight: 400;
}

@font-face {
  font-family: "Gotham";
  src: url("assets/fonts/Gotham-Bold.otf") format("opentype");
  font-weight: 700;
}

:root {
  --ink: #121212;
  --muted: #62656a;
  --line: #d8dde3;
  --soft: #f5f7f9;
  --brand: #d71920;
  --brand-dark: #91151a;
  --panel: #ffffff;
  --accent: #1b4965;
  --ok: #0f7b45;
  --warn: #a55b00;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f9fafb 0, #eef2f6 100%);
  font-family: "Gotham", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.ghost {
  color: var(--accent);
}

.danger {
  color: var(--bad);
}

.app-header {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px clamp(18px, 4vw, 56px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
}

.brand-logo {
  width: min(220px, 45vw);
  height: auto;
}

.header-copy p,
.step-heading p {
  margin: 0;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 4.2rem);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.4fr);
  gap: 18px;
  padding: 22px clamp(14px, 3vw, 42px);
}

.tools-panel {
  grid-column: 1 / -1;
}

.step-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(18, 18, 18, 0.06);
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.step-heading > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.dropzone {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 34px 20px;
  border: 2px dashed #b7c2cc;
  border-radius: 8px;
  background: var(--soft);
  text-align: center;
}

.dropzone.dragover {
  border-color: var(--brand);
  background: #fff4f4;
}

.dropzone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.message {
  min-height: 26px;
  margin-top: 14px;
  color: var(--muted);
}

.message.ok {
  color: var(--ok);
}

.message.warn {
  color: var(--warn);
}

.message.error {
  color: var(--bad);
}

.file-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  margin: 16px 0;
}

.file-meta dt {
  color: var(--muted);
}

.file-actions,
.transport,
.range-tools,
.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.transport label,
.range-tools label,
.tool label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.time-row {
  display: grid;
  grid-template-columns: 82px 1fr 82px;
  gap: 12px;
  align-items: center;
  margin: 18px 0 12px;
  color: var(--muted);
}

progress {
  width: 100%;
  height: 12px;
  accent-color: var(--brand);
}

#waveform {
  display: block;
  width: 100%;
  height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  cursor: crosshair;
}

.range-tools {
  margin-top: 14px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs button {
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.tabs .active {
  background: var(--ink);
  color: #fff;
}

.tool {
  display: none;
  gap: 16px;
  padding: 20px 0;
}

.tool.active {
  display: grid;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.process,
.results {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.result-item,
.segment-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 10px;
  background: var(--soft);
}

#download-zip {
  margin-top: 10px;
}

.result-item a {
  color: var(--brand-dark);
  font-weight: 700;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  color: var(--muted);
}

footer img {
  width: 110px;
  height: auto;
}

@media (max-width: 860px) {
  .app-header,
  .app-shell,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

  .brand {
    align-items: flex-start;
  }

  .time-row {
    grid-template-columns: 1fr;
  }
}
