:root {
  --bg: #f7faff;
  --panel: #ffffff;
  --text: #1c2a44;
  --muted: #64748b;
  --line: #dbe6f7;
  --accent: #5b8cff;
  --accent-dark: #3f6feb;
  --accent-soft: #eaf2ff;
  --coral: #ff7d82;
  --coral-dark: #ef5d64;
  --orange: #ffb340;
  --orange-soft: #fff4dc;
  --ink: #23314f;
  --ink-2: #324566;
  --paper: #ffffff;
  --danger: #d74444;
  --success: #27a769;
  --shadow: 0 18px 46px rgba(68, 100, 160, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(91, 140, 255, 0.12) 0 1px, transparent 1px 34px),
    linear-gradient(160deg, #ffffff 0%, #f4f8ff 42%, #fff7ef 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-rendering {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

.app-shell {
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 26px 28px;
  border: 1px solid rgba(91, 140, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(234, 242, 255, 0.92) 58%, rgba(255, 244, 220, 0.92)),
    #ffffff;
  color: var(--text);
  box-shadow: 0 18px 48px rgba(78, 111, 171, 0.13);
}

.brand-lockup {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.brand-wordmark {
  width: min(430px, 82vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 22px rgba(91, 140, 255, 0.16));
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 66px);
  line-height: 0.95;
  letter-spacing: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-subtitle {
  margin: 0;
  color: #52637e;
  font-size: clamp(14px, 1.7vw, 18px);
  font-weight: 800;
  line-height: 1.4;
}

.output-link,
.primary-button,
.secondary-button,
.ghost-button,
.render-button,
.download-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.output-link,
.primary-button {
  background: linear-gradient(135deg, var(--accent), #7f8cff);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(91, 140, 255, 0.28);
}

.output-link:hover,
.primary-button:hover {
  background: linear-gradient(135deg, var(--accent-dark), #6a79f8);
}

.render-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  padding: 16px 24px;
  border: 0;
  background: linear-gradient(135deg, #ff7d82 0%, #ff9f43 52%, #ffbf4d 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 18px 38px rgba(255, 125, 130, 0.34), 0 8px 18px rgba(255, 179, 64, 0.22);
  transform: translateY(0);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.render-button:hover {
  filter: saturate(1.08);
  transform: translateY(-2px);
  box-shadow: 0 24px 48px rgba(255, 125, 130, 0.38), 0 10px 22px rgba(255, 179, 64, 0.26);
}

.render-button:active {
  transform: translateY(0);
}

.render-button-large {
  min-width: 260px;
}

.render-button-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
}

.secondary-button {
  background: #ffffff;
  border: 1px solid rgba(91, 140, 255, 0.32);
  color: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(91, 140, 255, 0.12);
}

.secondary-button:hover {
  background: var(--accent-soft);
}

.thumbnail-download-button,
.thumbnail-create-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #9ac7b1;
  background: #f2fbf6;
  color: #167249;
}

.thumbnail-download-button:hover,
.thumbnail-create-button:hover {
  border-color: #59a47d;
  background: #e6f7ed;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  box-shadow: none;
}

.settings-submit .secondary-button,
.import-panel .secondary-button {
  background: linear-gradient(135deg, var(--accent), #7f8cff);
  color: #ffffff;
  border: 0;
}

.settings-submit .secondary-button:hover,
.import-panel .secondary-button:hover {
  background: linear-gradient(135deg, var(--accent-dark), #6a79f8);
}

.ghost-button {
  background: transparent;
  color: var(--danger);
  border: 1px solid #f0c8c3;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.notice {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.notice a {
  color: inherit;
  font-weight: 800;
}

.notice-error {
  border-left: 5px solid var(--danger);
  color: var(--danger);
}

.notice-success {
  border-left: 5px solid var(--success);
  color: var(--success);
}

.result-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  align-items: center;
  gap: 22px;
  padding: 22px;
  background: linear-gradient(135deg, #f0fff7, #f6fbff 62%, #fff7e7);
  border-left: 0;
  border: 1px solid rgba(39, 167, 105, 0.24);
  color: var(--text);
  box-shadow: 0 18px 42px rgba(68, 100, 160, 0.12);
}

.result-copy {
  display: grid;
  gap: 8px;
}

.result-panel h2,
.result-panel p {
  margin: 0;
}

.result-panel h2 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.2;
}

.result-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.result-kicker {
  color: var(--success) !important;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 250px;
  min-height: 58px;
  background: linear-gradient(135deg, var(--success), #38c985);
  color: #ffffff !important;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(39, 167, 105, 0.26);
}

.download-button:hover {
  filter: saturate(1.08);
}

.video-preview-box {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 14px;
  border: 1px solid rgba(91, 140, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(91, 140, 255, 0.08), rgba(255, 179, 64, 0.08)),
    #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.result-video {
  display: block;
  width: min(100%, 420px);
  max-height: 520px;
  border-radius: 8px;
  background: #0f172a;
  box-shadow: 0 18px 42px rgba(35, 49, 79, 0.18);
}

.result-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.result-actions a {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.result-actions a.is-download-pressed {
  animation: download-button-confirm 0.72s ease-out;
}

.result-actions a.is-download-pressed::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 26px;
  height: 26px;
  border: 4px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  animation: download-button-ripple 0.72s ease-out forwards;
}

.thumbnail-download-button.is-download-pressed::after {
  border-color: rgba(22, 114, 73, 0.9);
}

@keyframes download-button-confirm {
  0% {
    transform: scale(1);
  }
  22% {
    transform: scale(0.96);
    filter: brightness(0.9);
  }
  55% {
    transform: scale(1.025);
    filter: brightness(1.12);
    box-shadow: 0 0 0 7px rgba(39, 167, 105, 0.2), 0 18px 38px rgba(39, 167, 105, 0.3);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes download-button-ripple {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-actions a.is-download-pressed,
  .result-actions a.is-download-pressed::after {
    animation-duration: 0.01ms;
  }
}

.result-save-help {
  grid-column: 1 / -1;
  margin: 0;
  text-align: right;
}

.editor {
  display: grid;
  gap: 18px;
}

.import-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(91, 140, 255, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.project-import-form {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.check-field {
  grid-column: span 2;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.check-field input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.workflow-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.step-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
  padding: 20px 18px;
  border: 1px solid rgba(91, 140, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 255, 0.94)),
    #ffffff;
  box-shadow: 0 18px 42px rgba(78, 111, 171, 0.14);
}

.step-progress {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-progress-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  min-height: 86px;
  color: #91a0b8;
  cursor: pointer;
  user-select: none;
}

.step-progress-item:hover,
.step-progress-item:focus-visible {
  color: var(--text);
}

.step-progress-item:focus-visible {
  outline: 3px solid rgba(91, 140, 255, 0.3);
  outline-offset: 6px;
  border-radius: 8px;
}

.step-progress-item:hover span {
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 5px rgba(91, 140, 255, 0.1);
}

.step-progress-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 44px;
  width: 2px;
  height: calc(100% - 40px);
  background: #dbe6f7;
}

.step-progress-item span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid #dbe6f7;
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

.step-progress-item div {
  display: grid;
  align-content: start;
  gap: 4px;
  padding-top: 3px;
}

.step-progress-item strong {
  font-size: 15px;
}

.step-progress-item small {
  color: #9aa8bd;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.step-progress-item.is-active {
  color: var(--text);
}

.step-progress-item.is-active span {
  border-color: rgba(91, 140, 255, 0.7);
  background: linear-gradient(135deg, var(--accent), #86a8ff);
  color: #ffffff;
  box-shadow: 0 0 0 6px rgba(91, 140, 255, 0.14);
}

.step-progress-item.is-active small {
  color: var(--accent-dark);
}

.start-clear-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.danger-light-button {
  border-color: rgba(239, 68, 68, 0.28);
  color: #dc2626;
}

.danger-light-button:hover,
.danger-light-button:focus-visible {
  border-color: rgba(239, 68, 68, 0.5);
  background: #fff5f5;
  color: #b91c1c;
}

.workspace-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(91, 140, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.step-panel[hidden] {
  display: none;
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.choice-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  gap: 16px;
  min-height: 270px;
  padding: 30px;
  border: 2px solid #dbe6f7;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(91, 140, 255, 0.1), transparent 48%),
    #ffffff;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(68, 100, 160, 0.1);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.choice-card:hover {
  border-color: var(--accent);
  box-shadow: 0 22px 44px rgba(91, 140, 255, 0.2);
  transform: translateY(-2px);
}

.choice-card strong {
  font-size: clamp(26px, 3.3vw, 40px);
  line-height: 1.2;
}

.choice-card small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.choice-card-primary {
  border-color: rgba(91, 140, 255, 0.75);
  background:
    linear-gradient(135deg, rgba(91, 140, 255, 0.18), transparent 46%),
    linear-gradient(160deg, #ffffff 0%, #f2f7ff 60%, #fff4dc 100%);
  color: var(--text);
  box-shadow: 0 22px 56px rgba(91, 140, 255, 0.22);
}

.choice-card-saved {
  border-color: rgba(255, 179, 64, 0.55);
  background:
    linear-gradient(135deg, rgba(255, 179, 64, 0.18), transparent 48%),
    linear-gradient(160deg, #ffffff 0%, #fff8e8 58%, #f4f8ff 100%);
}

.choice-card-saved:hover {
  border-color: var(--orange);
  box-shadow: 0 24px 54px rgba(255, 179, 64, 0.22);
}

.choice-card-saved .choice-badge {
  background: linear-gradient(135deg, var(--orange), #ffe08a);
  color: #4a3200;
}

.choice-card-saved .choice-action {
  background: linear-gradient(135deg, var(--orange), #ffca68);
  color: #4a3200;
  box-shadow: 0 14px 26px rgba(255, 179, 64, 0.22);
}

.choice-card-ai {
  border-color: rgba(38, 187, 129, 0.58);
  background:
    radial-gradient(circle at 12% 16%, rgba(38, 187, 129, 0.2), transparent 30%),
    linear-gradient(160deg, #ffffff 0%, #f0fff8 58%, #eef4ff 100%);
  box-shadow: 0 22px 56px rgba(38, 187, 129, 0.18);
}

.choice-card-ai:hover {
  border-color: var(--success);
  box-shadow: 0 28px 70px rgba(38, 187, 129, 0.24);
}

.choice-card-ai .choice-badge {
  background: linear-gradient(135deg, #20c997, #b7f7d2);
  color: #063c2b;
}

.choice-card-ai .choice-action {
  background: linear-gradient(135deg, #16a56c, #5b8cff);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(38, 187, 129, 0.22);
}

.choice-card-primary:hover {
  border-color: var(--accent);
  box-shadow: 0 28px 70px rgba(91, 140, 255, 0.28);
}

.choice-card-primary small {
  color: #52637e;
}

.choice-card-locked {
  cursor: help;
  background:
    repeating-linear-gradient(135deg, rgba(91, 140, 255, 0.06) 0 12px, rgba(91, 140, 255, 0.06) 12px, transparent 12px, transparent 24px),
    #fbfdff;
}

.choice-card-locked strong,
.choice-card-locked small {
  color: #7b8798;
}

.choice-card-locked:hover {
  border-color: #d5e0f1;
  box-shadow: 0 14px 30px rgba(68, 100, 160, 0.1);
  transform: none;
}

.choice-badge {
  justify-self: start;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.choice-card-primary .choice-badge {
  background: linear-gradient(135deg, var(--orange), #ffd76b);
  color: #4a3200;
}

.choice-action {
  align-self: end;
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin-top: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7899ff);
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0;
}

.choice-card-primary .choice-action {
  background: linear-gradient(135deg, var(--accent), #7899ff 62%, var(--coral));
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(91, 140, 255, 0.26);
}

.choice-card-locked .choice-action {
  background: #eef3fb;
  color: #7b8798;
}

.step-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--accent-dark);
  font-weight: 800;
}

.ai-import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.ai-import-heading {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid rgba(91, 140, 255, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 6%, rgba(255, 179, 64, 0.18), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #f3f7ff 58%, #fff8ec 100%);
}

.ai-flow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.ai-flow-strip span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(91, 140, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 900;
}

.ai-flow-strip b {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
}

.ai-prompt-card,
.ai-import-card,
.ai-post-prompt-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(68, 100, 160, 0.12);
}

.ai-prompt-card {
  border-color: rgba(91, 140, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(91, 140, 255, 0.08), transparent 42%),
    #ffffff;
}

.ai-import-card {
  border-color: rgba(255, 179, 64, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 179, 64, 0.12), transparent 42%),
    #ffffff;
}

.ai-post-prompt-card {
  margin-top: 20px;
  border-color: rgba(39, 167, 105, 0.32);
  background:
    radial-gradient(circle at 96% 4%, rgba(39, 167, 105, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(39, 167, 105, 0.08), transparent 44%),
    #ffffff;
}

.ai-prompt-card::before,
.ai-import-card::before,
.ai-post-prompt-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
}

.ai-prompt-card::before {
  background: linear-gradient(90deg, var(--accent), #83b5ff);
}

.ai-import-card::before {
  background: linear-gradient(90deg, var(--orange), var(--coral));
}

.ai-post-prompt-card::before {
  background: linear-gradient(90deg, var(--success), #68d6aa);
}

.ai-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.ai-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
}

.ai-card-head p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.ai-step-number {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 1000;
  box-shadow: 0 12px 24px rgba(68, 100, 160, 0.18);
}

.ai-card-head-prompt .ai-step-number {
  background: linear-gradient(135deg, var(--accent), #83b5ff);
}

.ai-card-head-paste .ai-step-number {
  background: linear-gradient(135deg, var(--orange), var(--coral));
}

.ai-card-head-post .ai-step-number {
  background: linear-gradient(135deg, var(--success), #68d6aa);
}

.ai-prompt-controls {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.ai-post-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.field-full {
  grid-column: 1 / -1;
}

.ai-small-textarea {
  min-height: 86px;
  resize: vertical;
}

.ai-textarea-shell {
  overflow: hidden;
  border: 2px solid rgba(91, 140, 255, 0.18);
  border-radius: 8px;
  background: #ffffff;
}

.ai-textarea-shell-prompt {
  border-color: rgba(91, 140, 255, 0.26);
  box-shadow: inset 0 0 0 1px rgba(91, 140, 255, 0.08);
}

.ai-textarea-shell-paste {
  border-color: rgba(255, 179, 64, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 179, 64, 0.06), transparent 34%),
    #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 179, 64, 0.08);
}

.ai-textarea-shell-post {
  border-color: rgba(39, 167, 105, 0.28);
  box-shadow: inset 0 0 0 1px rgba(39, 167, 105, 0.08);
}

.ai-textarea-label {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 1000;
}

.ai-textarea-shell-prompt .ai-textarea-label {
  background: linear-gradient(90deg, var(--accent), #83b5ff);
}

.ai-textarea-shell-paste .ai-textarea-label {
  background: linear-gradient(90deg, var(--orange), var(--coral));
}

.ai-textarea-shell-post .ai-textarea-label {
  background: linear-gradient(90deg, var(--success), #68d6aa);
}

.ai-prompt-text,
.ai-tsv-input,
.ai-post-prompt-text {
  display: block;
  min-height: 290px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.ai-prompt-text:focus,
.ai-tsv-input:focus,
.ai-post-prompt-text:focus {
  outline: none;
  border-color: transparent;
}

.ai-post-prompt-text {
  min-height: 250px;
}

.ai-tsv-input::placeholder {
  color: #7d8798;
  font-weight: 700;
}

.ai-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.ai-main-button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(68, 100, 160, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ai-main-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(68, 100, 160, 0.2);
}

.ai-main-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.ai-main-button.is-copy-success {
  background: linear-gradient(135deg, #079669, #2dcf91);
  box-shadow: 0 0 0 5px rgba(7, 150, 105, 0.2), 0 16px 34px rgba(7, 150, 105, 0.28);
  animation: copy-confirm 0.42s ease-out;
}

.ai-main-button.is-copy-error {
  background: linear-gradient(135deg, #dc2626, #f87171);
  box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.16);
}

@keyframes copy-confirm {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.985);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-main-button.is-copy-success {
    animation: none;
  }
}

.ai-copy-button {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #7899ff);
}

.ai-check-button {
  background: linear-gradient(135deg, var(--orange), #ffca68);
  color: #4a3200;
}

.ai-apply-button {
  flex: 1 1 230px;
  background: linear-gradient(135deg, #26bb81, #5b8cff);
}

.ai-post-copy-button {
  width: 100%;
  background: linear-gradient(135deg, var(--success), #68d6aa);
}

.ai-file-field {
  margin-top: 12px;
}

.ai-file-drop {
  padding: 14px;
  border: 2px dashed rgba(255, 179, 64, 0.5);
  border-radius: 8px;
  background: #fffaf0;
}

.ai-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe6f7;
  border-radius: 8px;
  background: #ffffff;
}

.ai-preview-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-weight: 800;
}

.ai-preview p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.settings-panel,
.actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}

.settings-panel .field {
  max-width: none;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 16px;
}

.settings-submit {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: end;
}

.utility-field {
  align-self: end;
}

.settings-help,
.save-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.field-help {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.55;
  margin-top: 8px;
}

.settings-help-line {
  display: block;
}

.settings-help-line + .settings-help-line {
  margin-top: 4px;
}

.save-status {
  color: var(--success);
  font-weight: 800;
  min-height: 20px;
}

.project-actions-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(91, 140, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(91, 140, 255, 0.08), rgba(255, 179, 64, 0.08)),
    #ffffff;
  box-shadow: 0 14px 32px rgba(68, 100, 160, 0.1);
}

.project-actions-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.project-actions-head h3,
.project-actions-head p {
  margin: 0;
}

.project-actions-head h3 {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}

.project-actions-head > p {
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.project-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.project-actions-panel .settings-help,
.project-actions-panel .save-status {
  grid-column: 1 / -1;
}

.project-file-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.project-save-context {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.project-save-context strong {
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.project-actions-panel .project-save-context,
.project-actions-panel .project-file-status {
  grid-column: 1 / -1;
  text-align: right;
}

.rank-list {
  display: grid;
  gap: 26px;
  padding: 18px;
  border: 1px solid #dbe5f2;
  border-radius: 18px;
  background: #f3f6fb;
}

.rank-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #c8d5e8;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(45, 70, 115, 0.1);
  padding: 0 22px 22px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.rank-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #4f7cff 0%, #7068f4 100%);
}

.rank-card:hover {
  border-color: #9fb6dc;
  box-shadow: 0 16px 38px rgba(45, 70, 115, 0.15);
  transform: translateY(-1px);
}

.rank-card.is-incomplete {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 76, 70, 0.14), 0 14px 32px rgba(68, 100, 160, 0.12);
}

.rank-card.is-incomplete::before {
  background: var(--danger);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 -22px 22px;
  padding: 16px 20px 16px 26px;
  border-bottom: 1px solid #dbe5f2;
  background: linear-gradient(135deg, #f7f9ff 0%, #edf3ff 100%);
}

.rank-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-heading > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.card-head h2 {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 9px 15px;
  border-radius: 11px;
  background: linear-gradient(135deg, #315fda 0%, #5b67e8 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 7px 18px rgba(49, 95, 218, 0.24);
}

.card-head h2::before {
  content: "RANK";
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.rank-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.rank-action-button {
  min-height: 40px;
  border: 1px solid #c5d3e8;
  border-radius: 10px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, 0.92);
  color: #315fda;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 9px rgba(45, 70, 115, 0.06);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.rank-action-button:hover:not(:disabled) {
  border-color: #8eabe0;
  background: #ffffff;
  transform: translateY(-1px);
}

.rank-insert-button {
  border-style: dashed;
}

.rank-delete-button {
  border-color: #efc5c1;
  background: #fffafa;
  color: var(--danger);
}

.rank-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.compact-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.compact-grid .rank-title-field {
  grid-column: 1 / -1;
  grid-row: 1;
}

.rank-content-layout {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.rank-details-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.rank-data-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr);
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field-wide {
  grid-column: span 2;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.rank-card .field > span {
  color: #34445f;
  font-size: 13px;
  font-weight: 800;
}

.rank-card .rank-image-field,
.rank-card .rank-subtext-field {
  padding: 14px;
  border: 1px solid #dce5f2;
  border-radius: 12px;
  background: #f8fafc;
}

.rank-card input:not([type="file"]),
.rank-card textarea {
  border-color: #cbd7e7;
  background: #ffffff;
}

.rank-card .rank-title-field input {
  font-weight: 700;
}

.rank-card .rank-main-data-field input {
  color: #17233b;
  font-size: 17px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--text);
  font: inherit;
  padding: 12px 13px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(91, 140, 255, 0.18);
}

input[readonly] {
  background: #f1f5f9;
  color: #334155;
  cursor: default;
}

.field-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  align-items: center;
}

.swatch {
  position: relative;
  display: block;
  width: 50px;
  height: 50px;
  cursor: pointer;
}

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

.swatch span {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid #cbd5d9;
  border-radius: 8px;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(68, 100, 160, 0.12);
}

.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.actions {
  margin-top: 18px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(72, 95, 135, 0.32);
  backdrop-filter: blur(10px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(68, 100, 160, 0.24);
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 30px;
}

.modal-lead {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.bgm-toolbar {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.compact-field {
  max-width: 260px;
}

.bgm-library {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

.bgm-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bgm-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(68, 100, 160, 0.08);
}

.bgm-card h4 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
}

.bgm-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.bgm-card-actions {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.bgm-preview-button {
  color: var(--accent-dark);
  border-color: rgba(91, 140, 255, 0.32);
}

.swatch input:checked + span {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.22), inset 0 0 0 2px #ffffff;
}

.swatch input:checked + span::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 8px;
  width: 13px;
  height: 7px;
  border-left: 3px solid var(--accent-dark);
  border-bottom: 3px solid var(--accent-dark);
  transform: rotate(-45deg);
}

input[type="color"] {
  padding: 4px;
}

input[type="file"] {
  padding: 8px;
}

.image-drop-zone {
  display: grid;
  gap: 10px;
  min-height: 148px;
  border: 2px dashed rgba(91, 140, 255, 0.42);
  border-radius: 10px;
  padding: 14px;
  background: #f8faff;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.image-drop-zone:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}

.image-drop-zone.is-dragover {
  border-color: var(--accent-dark);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(91, 140, 255, 0.14);
}

.image-drop-message {
  color: #405578;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.image-paste-button {
  min-height: 42px;
  border: 1px solid #9db6e5;
  border-radius: 9px;
  padding: 9px 14px;
  background: #ffffff;
  color: #315fda;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(49, 95, 218, 0.1);
}

.image-paste-button:hover {
  border-color: #668ddb;
  background: #edf3ff;
}

.image-input-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.image-drop-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.image-drop-status.is-error {
  color: var(--danger);
}

textarea {
  resize: vertical;
}

textarea[name="sub_text[]"] {
  min-height: 112px;
}

.rank-subtext-field textarea[name="sub_text[]"] {
  height: 160px;
  min-height: 160px;
  resize: none;
}

.saved-file {
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(72, 95, 135, 0.55);
  backdrop-filter: blur(10px);
}

.loading-overlay[hidden] {
  display: none;
}

.loading-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 28px 90px rgba(68, 100, 160, 0.24);
  padding: 22px;
}

.render-ad {
  position: relative;
}

.render-ad-label {
  margin: 0 0 7px;
  color: #7b879b;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.render-ad-slot {
  display: grid;
  place-content: center;
  min-height: 360px;
  border: 1px solid #d8dee9;
  background: #f7f8fa;
  color: #667085;
  text-align: center;
}

.render-ad-slot strong {
  font-size: 25px;
}

.render-ad-slot span {
  margin-top: 8px;
  font-size: 13px;
}

.render-ad-link {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.render-ad-link img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.render-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 74px;
  padding-top: 18px;
  text-align: left;
}

.render-mark {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.render-mark span {
  width: 7px;
  height: 28px;
  background: var(--accent);
  animation: renderPulse 0.9s ease-in-out infinite;
}

.render-mark span:nth-child(2) {
  animation-delay: 0.12s;
}

.render-mark span:nth-child(3) {
  animation-delay: 0.24s;
}

.loading-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.loading-text,
.loading-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.render-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}

.render-progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 6px;
  background: #dfe5e2;
}

.render-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.render-progress-value {
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.loading-note {
  border-top: 1px solid #e6eaf0;
  padding-top: 12px;
  font-size: 13px;
  text-align: center;
}

.render-form-error {
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 1px solid #ef4444;
  border-radius: 6px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.6;
}

.loading-error-title {
  margin: 0 0 12px;
  color: #b91c1c;
  font-size: 28px;
  letter-spacing: 0;
}

.loading-cancel {
  display: none;
  margin: 18px auto 0;
  min-width: 140px;
}

.loading-overlay.is-error .loading-panel {
  width: min(600px, 100%);
  overflow: visible;
  border: 2px solid #ef4444;
  padding: 32px;
  text-align: center;
}

.loading-overlay.is-error .render-ad,
.loading-overlay.is-error .render-progress,
.loading-overlay.is-error .render-mark,
.loading-overlay.is-error .loading-kicker {
  display: none;
}

.loading-overlay.is-error .render-status {
  display: block;
  min-height: 0;
  padding: 0;
  text-align: center;
}

.loading-overlay.is-error .loading-error-title,
.loading-overlay.is-error .loading-cancel {
  display: block;
}

.loading-overlay.is-error .loading-text {
  color: #b91c1c;
  font-size: 18px;
  font-weight: 900;
}

.loading-overlay.is-error .loading-note {
  margin-top: 18px;
  border-top-color: #fecaca;
  color: #7f1d1d;
}

@keyframes renderPulse {
  0%,
  100% {
    transform: scaleY(0.55);
    opacity: 0.55;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes progressSweep {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  .page-header,
  .import-panel,
  .settings-panel,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
    gap: 12px;
  }

  .brand-wordmark {
    width: min(320px, 82vw);
  }

  .workflow-shell {
    grid-template-columns: 1fr;
  }

  .step-sidebar {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .step-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .step-progress-item {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    min-height: auto;
  }

  .step-progress-item:not(:last-child)::after {
    display: none;
  }

  .step-progress-item div {
    justify-items: center;
    padding-top: 0;
  }

  .step-progress-item small {
    display: none;
  }

  .workspace-panel {
    padding: 16px;
  }

  .ai-import-heading {
    padding: 16px;
  }

  .ai-flow-strip {
    grid-template-columns: 1fr;
  }

  .choice-grid,
  .ai-import-grid,
  .ai-prompt-controls,
  .ai-post-controls,
  .project-actions-panel,
  .settings-grid,
  .bgm-toolbar,
  .bgm-card-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .bgm-card {
    grid-template-columns: 1fr;
  }

  .bgm-card-actions {
    min-width: 0;
  }

  .field-wide {
    grid-column: auto;
  }

  .compact-grid .rank-position-field,
  .compact-grid .rank-title-field,
  .compact-grid .rank-image-field,
  .compact-grid .rank-subtext-field {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .rank-content-layout {
    grid-template-columns: 1fr;
  }

  .rank-data-row .rank-main-data-field,
  .rank-data-row .rank-unit-field {
    grid-column: auto;
    grid-row: auto;
  }

  .rank-subtext-field textarea[name="sub_text[]"] {
    min-height: 160px;
  }

  .ai-card-head {
    grid-template-columns: 1fr;
  }

  .ai-step-number {
    width: 46px;
    height: 46px;
  }

  .ai-button-row,
  .ai-main-button {
    width: 100%;
  }

  .check-field {
    grid-column: auto;
  }

  .project-actions-head,
  .project-action-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .rank-list {
    gap: 18px;
    padding: 10px;
    border-radius: 14px;
  }

  .rank-card {
    padding: 0 14px 16px;
    border-radius: 14px;
  }

  .rank-card:hover {
    transform: none;
  }

  .rank-card .card-head {
    margin: 0 -14px 18px;
    padding: 14px 14px 14px 20px;
  }

  .rank-heading {
    justify-content: space-between;
  }

  .rank-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-actions,
  .settings-submit {
    flex-direction: column;
  }

  .result-panel {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .result-actions {
    justify-content: stretch;
  }

  .result-video {
    width: 100%;
    max-height: 520px;
  }

  .output-link,
  .primary-button,
  .secondary-button,
  .ghost-button,
  .render-button,
  .download-button,
  .project-action-buttons .secondary-button {
    width: 100%;
  }

  .render-button-large,
  .download-button {
    min-width: 0;
  }

  .icon-button {
    width: 42px;
    align-self: flex-end;
  }

  .loading-overlay {
    padding: 12px;
  }

  .loading-panel {
    padding: 14px;
  }

  .render-ad-slot {
    min-height: 250px;
  }

  .render-ad-slot strong {
    font-size: 20px;
  }
}
