.word-video-page {
  min-height: 0;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 240, 239, 0.72), rgba(247, 245, 243, 0.96)),
    var(--page);
  font-size: 16px;
}

html.is-embedded .word-video-topbar {
  display: none;
}

.word-video-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  min-height: 64px;
  padding: 0 max(20px, calc((100vw - 1440px) / 2));
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(207, 75, 69, 0.16);
  backdrop-filter: blur(12px);
}

.word-video-back,
.word-video-topbar span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  text-decoration: none;
}

.word-video-topbar span {
  color: var(--muted);
  font-size: 16px;
}

.word-video-shell {
  width: min(1440px, calc(100% - 32px));
  min-height: 0;
  margin: 0 auto;
  padding: 24px 0 18px;
}

html.is-embedded .word-video-shell {
  padding: 10px 0;
}

.word-video-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.word-video-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 550;
  line-height: 1.22;
}

.word-video-heading p,
.word-video-status,
.word-video-card-title span,
.word-video-preview-toolbar span {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.word-video-actions .g_button {
  min-width: 0;
  height: var(--control-height);
}

.word-video-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(480px, 1fr);
  gap: 16px;
  align-items: start;
}

.word-video-panel {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.word-video-preview-card {
  min-width: 0;
}

.word-video-card,
.word-video-preview-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(207, 75, 69, 0.15);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(75, 55, 48, 0.08);
}

.word-video-card {
  padding: 16px;
}

.word-video-card-title,
.word-video-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.word-video-card-title {
  margin-bottom: 12px;
}

.word-video-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 550;
}

.word-video-card-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.word-video-word-list {
  min-height: 238px;
  line-height: 1.55;
}

.word-video-file {
  max-width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 11px 14px;
  overflow: hidden;
  color: var(--ink);
  background: #fffaf8;
  border: 1px solid rgba(207, 75, 69, 0.14);
  border-radius: var(--control-radius);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-video-file-button {
  cursor: pointer;
}

.word-video-folder-button {
  position: relative;
  cursor: pointer;
}

.word-video-folder-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.word-video-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.word-video-actions.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.word-video-actions .g_button {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.word-video-actions .g_button {
  overflow: hidden;
  text-overflow: ellipsis;
}

.word-video-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
}

.word-video-parameter-sections {
  display: grid;
  gap: 0;
}

.word-video-parameter-group {
  min-width: 0;
  padding: 18px 0;
  border-top: 1px solid rgba(207, 75, 69, 0.12);
}

.word-video-parameter-group:first-child {
  padding-top: 4px;
  border-top: 0;
}

.word-video-parameter-group:last-child {
  padding-bottom: 0;
}

.word-video-parameter-title {
  margin-bottom: 14px;
}

.word-video-parameter-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 550;
  line-height: 1.35;
}

.word-video-parameter-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.word-video-watermark-group {
  padding: 18px 14px 14px;
  background: #fffaf8;
  border: 1px solid rgba(207, 75, 69, 0.14);
  border-radius: 12px;
}

.word-video-field {
  gap: 7px;
}

.word-video-label {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.word-video-check {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(207, 75, 69, 0.18);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  line-height: 1.35;
}

.word-video-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.word-video-match-list {
  display: flex;
  max-height: 86px;
  margin-top: 12px;
  gap: 6px;
  flex-wrap: wrap;
  overflow: auto;
}

.word-video-match-list span {
  max-width: 100%;
  padding: 5px 8px;
  overflow: hidden;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-video-match-list .is-ok {
  color: var(--success);
  background: #eef7f0;
}

.word-video-match-list .is-missing {
  color: var(--warning);
  background: #fff6e8;
}

.word-video-missing-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.word-video-missing-actions .g_button {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.word-video-background-picker {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(207, 75, 69, 0.12);
}

.word-video-background-title {
  margin-bottom: 8px;
}

.word-video-progress {
  height: 8px;
  overflow: hidden;
  background: #f2e7e2;
  border-radius: 999px;
}

.word-video-progress div {
  width: 0;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
  transition: width .18s ease;
}

.word-video-preview-card {
  padding: 16px;
}

.word-video-preview-toolbar {
  margin-bottom: 14px;
}

.word-video-preview-subbar {
  display: flex;
  min-height: 44px;
  margin: -4px 0 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.word-video-preview-nav {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.word-video-preview-nav .g_button {
  width: auto;
  min-width: 86px;
  height: 40px;
  padding-inline: 12px;
}

.word-video-preview-nav span {
  min-width: 48px;
  text-align: center;
}

.word-video-preview-toolbar strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 550;
}

.word-video-canvas-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(207, 75, 69, 0.08), transparent 36%),
    #fffaf8;
  border-radius: 16px;
}

#previewCanvas,
#resultVideo {
  display: block;
  width: min(100%, 390px);
  aspect-ratio: 9 / 16;
  height: auto;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 22px 48px rgba(75, 55, 48, 0.14);
}

#resultVideo {
  margin: 16px auto 0;
}

.word-video-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 16px;
  color: #fff;
  background: rgba(51, 57, 66, 0.94);
  border-radius: 12px;
  transform: translateX(-50%);
  box-shadow: 0 12px 32px rgba(75, 55, 48, 0.18);
}

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

  #previewCanvas,
  #resultVideo {
    width: min(100%, 430px);
  }
}

@media (max-width: 720px) {
  .word-video-shell {
    width: min(100% - 20px, 1440px);
  }

  .word-video-heading {
    display: grid;
  }

  .word-video-preview-subbar {
    display: grid;
  }

  .word-video-preview-nav {
    justify-content: stretch;
  }

  .word-video-preview-nav .g_button {
    flex: 1 1 0;
    min-width: 0;
  }

  .word-video-grid,
  .word-video-actions,
  .word-video-actions.two {
    grid-template-columns: 1fr;
    display: grid;
  }

  .word-video-heading h1 {
    font-size: 24px;
  }
}

.word-video-table-button {
  height: var(--control-height);
  padding-inline: 12px;
  flex-shrink: 0;
}

.word-video-card-title .word-video-table-button {
  margin-left: auto;
}

.word-video-export-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
