:root {
  color-scheme: light;
  --bg: #eef2f0;
  --ink: #17201c;
  --muted: #607069;
  --panel: #ffffff;
  --line: #ccd8d2;
  --accent: #247fc7;
  --accent-dark: #14527f;
  --warn: #a15c12;
  --shadow: 0 18px 55px rgba(30, 45, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(135deg, #e8f5ff 0%, #f5fbff 100%);
  color: var(--ink);
}

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

.workspace {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 18px;
  align-items: stretch;
}

.panel {
  background: #f1f8ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-panel {
  grid-row: span 2;
  padding: 26px;
  position: relative;
}

.title-row {
  display: block;
  margin-bottom: 28px;
  text-align: center;
}

.brand-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
}

.brand-title p {
  grid-column: 1 / -1;
  margin-top: 10px;
  max-width: 22em;
  justify-self: center;
  text-align: center;
}

h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Times New Roman", serif;
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  color: #111d2a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.status-pill {
  position: static;
  display: inline-block;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.video-mark {
  justify-self: end;
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
  transform: translateX(6px);
}

.brand-balance {
  width: 58px;
  height: 1px;
}

.status-pill.ready {
  border-color: rgba(36, 127, 199, 0.35);
  color: var(--accent-dark);
  background: rgba(36, 127, 199, 0.08);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 370px;
  border: 2px dashed #9eb4aa;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--accent);
  background: rgba(36, 127, 199, 0.06);
}

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

.drop-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 36px;
  line-height: 1;
}

.drop-zone strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 22px;
}

.drop-zone span:last-child {
  margin-top: 8px;
  color: var(--muted);
}

.settings-panel,
.progress-panel {
  padding: 22px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.tool-link {
  display: grid;
  place-items: center;
  min-height: 42px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f0;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 800;
}

label {
  font-weight: 700;
}

select,
input,
button {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  font: inherit;
}

select,
input {
  border: 1px solid var(--line);
  background: #fbfcfb;
  color: var(--ink);
  padding: 0 12px;
}

.path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
}

.browse-button {
  border: 1px solid var(--line);
  background: #eef2f0;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.browse-button:disabled {
  cursor: wait;
  color: var(--muted);
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #aebbb5;
}

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

#progressText {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dde7e2;
}

#progressBar {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.download-link {
  display: grid;
  place-items: center;
  min-height: 46px;
  margin-top: 16px;
  border-radius: 8px;
  background: #17201c;
  color: white;
  text-decoration: none;
  font-weight: 800;
}

.hidden {
  display: none;
}

.hidden-field {
  display: none;
}

.tool-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.tool-info > div {
  padding: 18px;
  border: 1px solid rgba(20, 82, 127, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 34px rgba(20, 82, 127, 0.08);
}

.tool-info h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.4;
}

.tool-info p {
  font-size: 14px;
  line-height: 1.8;
}

.tool-footer {
  display: grid;
  justify-items: center;
  margin-top: 18px;
  padding: 16px 0 0;
}

.tool-footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-footer a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid rgba(20, 82, 127, 0.18);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.tool-footer a:hover,
.tool-footer a:focus-visible {
  border-color: rgba(20, 82, 127, 0.34);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 620px);
    padding: 20px 0;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    grid-row: auto;
  }

  .title-row {
    display: grid;
    justify-items: center;
    padding-top: 0;
  }

  .status-pill {
    position: static;
    margin-top: 14px;
  }

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

  .tool-info {
    grid-template-columns: 1fr;
  }

  .tool-footer a {
    font-size: 12px;
    padding: 5px 10px;
  }
}
