* {
  box-sizing: border-box;
}

.badge-free-pill {
  display: inline-flex;
  align-items: center;
  background: #1D9E75;
  color: #E1F5EE;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.badge-free-outline {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: #1D9E75;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1.5px solid #1D9E75;
  letter-spacing: 0.03em;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
  color: #f8fafc;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.16), transparent 32%),
    linear-gradient(180deg, #020617 0%, #0f172a 100%);
  min-height: 100vh;
}

.page {
  width: 100%;
  min-height: 100vh;
  padding: 26px 18px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.tool-card {
  width: min(1080px, 100%);
  padding: 34px 42px;
  border-radius: 28px;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(148, 163, 184, 0.18), rgba(15, 23, 42, 0.78)),
    rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(226, 232, 240, 0.2);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 8px;
  color: #93c5fd;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.1;
  font-weight: 900;
}

.brand {
  margin: 10px 0 18px;
  color: #c4b5fd;
  font-size: 14px;
  font-weight: 700;
}

.lead {
  margin: 0 auto 22px;
  max-width: 760px;
  color: #cbd5e1;
  line-height: 1.9;
  font-size: 15px;
}

.upload-box {
  margin: 0 auto 22px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px dashed rgba(148, 163, 184, 0.42);
}

.file-label {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 180px;
  min-height: 48px;
  border-radius: 999px;
  cursor: pointer;
  color: #020617;
  background: linear-gradient(135deg, #67e8f9, #a78bfa);
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(103, 232, 249, 0.22);
}

#videoInput {
  display: none;
}

.file-name {
  margin: 14px 0 0;
  color: #94a3b8;
  font-size: 13px;
}

.video-area {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto 26px;
  overflow: hidden;
  border-radius: 24px;
  background: #020617;
  border: 1px solid rgba(226, 232, 240, 0.16);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.8);
}

video {
  display: block;
  width: 100%;
  max-height: 430px;
  background: #020617;
}

.caption-overlay {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  width: 90%;
  padding: 8px 12px;
  color: #ffffff;
  font-size: clamp(20px, 4vw, 38px);
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  text-shadow:
    3px 3px 0 #000,
    -3px 3px 0 #000,
    3px -3px 0 #000,
    -3px -3px 0 #000,
    0 4px 18px rgba(0, 0, 0, 0.7);
}

.sheet-area {
  margin-top: 22px;
  text-align: left;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.sheet-header h2 {
  margin: 0;
  font-size: 20px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.16);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: rgba(2, 6, 23, 0.48);
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.12);
  color: #e2e8f0;
  font-size: 13px;
}

th {
  color: #93c5fd;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.82);
}

td input,
td select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  padding: 8px 10px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.9);
  outline: none;
  font-family: inherit;
}

td input:focus,
td select:focus {
  border-color: #67e8f9;
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.16);
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 26px 0 18px;
}

.main-button,
.ghost-button,
.sub-button,
.delete-btn {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
}

.main-button {
  color: #020617;
  background: linear-gradient(135deg, #67e8f9, #a78bfa);
}

.ghost-button,
.sub-button {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(226, 232, 240, 0.18);
}

.delete-btn {
  min-height: 34px;
  padding: 0 12px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.24);
}

.note {
  margin: 18px auto;
  max-width: 760px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.8;
}

.softmotion-link {
  display: inline-block;
  margin-top: 8px;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 900;
}

.softmotion-link:hover {
  color: #67e8f9;
}

.caption-top {
  top: 8%;
  bottom: auto;
}

.caption-center {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
}

.caption-bottom {
  bottom: 8%;
}

.style-outline {
  color: #ffffff;
}

.style-yellow {
  color: #fde047;
}

.style-bar {
  width: 100%;
  bottom: 0;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 0;
  text-shadow: none;
}

@media (max-width: 640px) {
  .page {
    padding: 20px 12px;
  }

  .tool-card {
    padding: 26px 18px;
    border-radius: 24px;
  }

  .lead {
    font-size: 14px;
  }

  .sheet-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row {
    gap: 10px;
  }

  .main-button,
  .ghost-button {
    width: 100%;
  }
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px auto 26px;
}

.tab-button {
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 999px;
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.14);
}

.tab-button.active {
  color: #020617;
  background: linear-gradient(135deg, #67e8f9, #a78bfa);
  box-shadow: 0 14px 34px rgba(103, 232, 249, 0.18);
}

.tab-panel {
  display: none;
  margin-top: 10px;
}

.tab-panel.active {
  display: block;
}

.section-title {
  margin: 0 auto 18px;
  text-align: center;
}

.section-title h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
}

.section-title p {
  margin: 0;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.8;
}

.slide-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  width: min(620px, 100%);
  margin: 0 auto 22px;
  text-align: left;
}

.slide-settings label {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 900;
}

.slide-settings input,
.slide-settings select {
  min-height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  padding: 8px 12px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.9);
  outline: none;
  font-family: inherit;
}

.image-preview {
  width: min(760px, 100%);
  min-height: 170px;
  margin: 0 auto 24px;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: flex-start;
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(226, 232, 240, 0.14);
}

.image-preview p {
  width: 100%;
  margin: 0;
  color: #94a3b8;
  text-align: center;
  font-size: 13px;
}

.image-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.16);
}

#audioPreview {
  width: min(620px, 100%);
  margin: 0 auto 18px;
  display: block;
}

.small-note {
  margin: 12px auto 0;
  max-width: 620px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.8;
}

@media (max-width: 640px) {
  .tabs {
    gap: 8px;
  }

  .tab-button {
    width: 100%;
  }

  .slide-settings {
    grid-template-columns: 1fr;
  }
}

.next-area {
  width: min(620px, 100%);
  margin: 22px auto 0;
  padding: 18px;
  border-radius: 18px;
  text-align: center;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(226, 232, 240, 0.14);
}

.next-area p {
  margin: 0 0 12px;
  color: #94a3b8;
  font-size: 13px;
}

.next-button {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 22px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  color: #020617;
  background: linear-gradient(135deg, #67e8f9, #a78bfa);
}
/* 写真プレビューを横並びに固定 */
#imagePreview {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

#imagePreview .image-thumb {
  width: 120px !important;
  height: 120px !important;
  flex: 0 0 120px !important;
  object-fit: cover !important;
  display: block !important;
}
#slideCanvas {
  display: block;
  width: 100%;
  max-height: 430px;
  background: #020617;
  border-radius: 24px;
}
/* スライドプレビューを縦横比そのまま表示 */
#slideCanvas {
  display: block !important;
  width: auto !important;
  height: min(520px, 70vh) !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  background: #020617 !important;
  border-radius: 24px !important;
}