:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #526170;
  --line: #d8e0e8;
  --navy: #18324a;
  --green: #0f766e;
  --gold: #f2a900;
  --button-text: #ffffff;
  --shadow: 0 12px 32px rgba(24, 50, 74, 0.12);
}

body.dark {
  color-scheme: dark;
  --bg: #101820;
  --panel: #17212b;
  --ink: #edf3f8;
  --muted: #b3c0cb;
  --line: #2a3948;
  --navy: #8bb8e8;
  --green: #5eead4;
  --gold: #ffd166;
  --button-text: #071018;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

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

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

.brand p,
.file-label,
.status,
.label {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  gap: 18px;
}

.preview-panel,
.controls-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.preview-box {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d1620;
  border-radius: 8px;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #ffffff;
  text-align: center;
}

.player-controls,
.action-row,
.export-row,
.cut-values {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-controls {
  margin-top: 12px;
}

.action-row,
.export-row {
  margin-top: 14px;
}

.cut-values {
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: var(--button-text);
  cursor: pointer;
}

.file-button,
.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
}

.file-button,
.primary {
  border: 0;
  background: var(--green);
  color: var(--button-text);
}

.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

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

.file-button input {
  display: none;
}

.file-label,
.status {
  margin-top: 10px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.controls-panel {
  display: grid;
  gap: 18px;
}

.control-group {
  display: grid;
  gap: 8px;
}

.range,
.dual-range input {
  width: 100%;
  accent-color: var(--green);
}

.dual-range {
  position: relative;
  height: 42px;
}

.dual-range::before,
.cut-fill {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}

.cut-fill {
  right: auto;
  background: var(--green);
}

.dual-range input {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
  background: transparent;
  appearance: none;
}

.dual-range input::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--panel);
  background: var(--gold);
  pointer-events: auto;
  appearance: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dual-range input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--panel);
  background: var(--gold);
  pointer-events: auto;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.text-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.text-field input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
}

.progress {
  width: 100%;
}

.download-link {
  color: var(--green);
  font-weight: 700;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-row,
  .export-row {
    align-items: stretch;
    flex-direction: column;
  }
}
