/* ---------------------------------------------------- */
/* Modern Reset & Base Variables                        */
/* ---------------------------------------------------- */
/* Tokens + shell (masthead/footer) come from swiss-base.css. Legacy
   variable names are remapped to the Swiss palette so the wizard's
   existing rules inherit the unified look. The stray blue accent and
   the blurred background blobs are dropped. */
:root {
  --primary-color: var(--sw-accent);
  --primary-dark: var(--sw-accent);
  --accent-color: var(--sw-accent);
  --text-main: var(--sw-ink-2);
  --text-light: var(--sw-ink-3);
  --bg-color: #ffffff;
  --white: var(--sw-surface);
  --shadow-sm: 0 1px 3px rgba(21, 24, 27, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(21, 24, 27, 0.1), 0 2px 4px -1px rgba(21, 24, 27, 0.06);
  --shadow-lg: 0 12px 30px -18px rgba(21, 24, 27, 0.2);
  --font-main: var(--sw-font-sans);
  --radius-card: 6px;
  --shadow-card: 0 1px 2px rgba(21, 24, 27, 0.05), 0 12px 30px -18px rgba(21, 24, 27, 0.18);
  --shadow-card-hover: 0 2px 4px rgba(21, 24, 27, 0.06), 0 18px 40px -20px rgba(21, 24, 27, 0.24);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---------------------------------------------------- */
/* Background Decorations                               */
/* ---------------------------------------------------- */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

.bg-shape-1 {
  top: -100px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(10,107,82,0.3) 0%, rgba(255,255,255,0) 70%);
}

.bg-shape-2 {
  bottom: -100px;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(10,107,82,0.2) 0%, rgba(255,255,255,0) 70%);
}

/* ---------------------------------------------------- */
/* Header                                               */
/* ---------------------------------------------------- */
.header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  z-index: 1000;
}

.main-content,
.footer {
  position: relative;
  z-index: 1;
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.85rem 24px 0.8rem;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.7rem;
}

.logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
}

.smart { color: var(--text-main); font-size: 1.7rem; }
.dash { color: var(--text-light); font-size: 1.7rem; margin: 0 2px; }
.cv { color: var(--primary-color); font-size: 1.7rem; }

.subtitle {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
  position: relative;
  padding-left: 0.85rem;
}

.subtitle::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 1px;
  background: #cbd5e1;
}

/* ---------------------------------------------------- */
/* Main Content                                         */
/* ---------------------------------------------------- */
.main-content {
  padding: 2.25rem 24px 2.25rem;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
}

/* ---------------------------------------------------- */
/* Home Hero                                            */
/* ---------------------------------------------------- */
.home-hero {
  position: relative;
  padding: 0.25rem 0 2.1rem;
}

.home-hero::before {
  content: '';
  position: absolute;
  inset: -1.25rem -1rem auto -1rem;
  height: 200px;
  background-image: radial-gradient(rgba(51, 65, 85, 0.09) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 85%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 85%);
  pointer-events: none;
  z-index: -1;
}

.home-hero-eyebrow,
.home-hero-title,
.home-hero-desc {
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  animation: home-fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.home-hero-eyebrow {
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin: 0 0 0.85rem;
  animation-delay: 0.02s;
}

.home-hero-title {
  font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.5rem);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  max-width: 32ch;
  text-wrap: pretty;
  animation-delay: 0.1s;
}

.home-hero-desc {
  font-size: 0.98rem;
  color: var(--text-light);
  max-width: 46ch;
  line-height: 1.75;
  margin: 0;
  animation-delay: 0.2s;
}

@keyframes home-fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------- */
/* Document Grid                                        */
/* ---------------------------------------------------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.doc-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 3 / 2;
  border-radius: 20px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-card);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  animation: home-fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.doc-tile--resume  { animation-delay: 0.24s; }
.doc-tile--career  { animation-delay: 0.3s; }
.doc-tile--auto    { animation-delay: 0.36s; }
.doc-tile--history { animation-delay: 0.42s; }

.doc-tile:hover,
.doc-tile:focus-visible {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover), 0 0 0 2px rgba(12, 153, 89, 0.35);
}

.doc-tile--auto:hover,
.doc-tile--auto:focus-visible,
.doc-tile--history:hover,
.doc-tile--history:focus-visible {
  box-shadow: var(--shadow-card-hover), 0 0 0 2px rgba(12, 153, 89, 0.35);
}

.doc-tile:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

/* Media zone: takes whatever space the footer label doesn't need */
.doc-tile-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #eef2f7;
}

.doc-tile-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* Corner-fold: a physical-paper cue, reserved for the two real document previews.
   Defined by its own drop shadow, not the fill color, so it still reads on a
   near-white document scan. */
.doc-tile--resume .doc-tile-fold,
.doc-tile--career .doc-tile-fold {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  z-index: 1;
  background: linear-gradient(135deg, #f8fafc 50%, #dbe3ee 50%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  box-shadow: 2px 2px 6px rgba(15, 23, 42, 0.22);
}

.doc-tile-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-tile--auto .doc-tile-visual {
  background:
    linear-gradient(135deg, rgba(12, 153, 89, 0.2), rgba(12, 153, 89, 0.26)),
    #eef6ff;
}

.doc-tile--history .doc-tile-visual {
  background:
    linear-gradient(135deg, rgba(12, 153, 89, 0.2), rgba(12, 153, 89, 0.26)),
    #eef6ff;
}

/* Footer: a plain, solid label band — the title never has to fight an image for contrast */
.doc-tile-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 14px 18px 16px;
  background: var(--white);
}

.doc-tile--resume .doc-tile-footer,
.doc-tile--career .doc-tile-footer {
  background: rgba(12, 153, 89, 0.05);
}

.doc-tile--auto .doc-tile-footer {
  background: rgba(12, 153, 89, 0.05);
}

.doc-tile--history .doc-tile-footer {
  background: rgba(12, 153, 89, 0.05);
}

/* Kicker: one real fact about the document (format or source), not decoration */
.doc-tile-kicker {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ffffff;
  /* Darker than --primary-dark for AA text contrast; same teal hue family */
  color: #0f7a61;
}

.doc-tile--auto .doc-tile-kicker {
  color: var(--sw-accent);
}

.doc-tile--history .doc-tile-kicker {
  color: var(--sw-accent);
}

.doc-tile-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

/* Waveform: a literal audio cue for the record-to-document flow, scaled to fill
   the media zone with confidence instead of floating in a mostly-empty tint */
.auto-generate-visual {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 68%;
  max-height: 130px;
}

.auto-generate-visual span {
  display: block;
  width: 9px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
  transform-origin: center;
  animation: waveform-pulse 1.6s ease-in-out infinite;
}

.auto-generate-visual span:nth-child(1) { height: 32%; animation-delay: 0s; }
.auto-generate-visual span:nth-child(2) { height: 62%; animation-delay: 0.08s; }
.auto-generate-visual span:nth-child(3) { height: 45%; animation-delay: 0.16s; }
.auto-generate-visual span:nth-child(4) { height: 90%; animation-delay: 0.24s; }
.auto-generate-visual span:nth-child(5) { height: 55%; animation-delay: 0.32s; }
.auto-generate-visual span:nth-child(6) { height: 100%; animation-delay: 0.4s; }
.auto-generate-visual span:nth-child(7) { height: 50%; animation-delay: 0.48s; }
.auto-generate-visual span:nth-child(8) { height: 78%; animation-delay: 0.56s; }
.auto-generate-visual span:nth-child(9) { height: 38%; animation-delay: 0.64s; }

@keyframes waveform-pulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.6); }
}

/* 3D wordmark for the saved-history tile (replaces the old paper stack).
   Gradient face (teal→blue) + offset extrusion + perspective tilt =
   a refined, floating 3D "MyPage". */
.mypage-3d {
  position: relative;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: transparent;
  background-image: linear-gradient(120deg, var(--sw-accent) 0%, #0f8a68 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: perspective(600px) rotateX(12deg) rotateY(-18deg);
  transform-style: preserve-3d;
  filter: drop-shadow(0 10px 16px rgba(12, 153, 89, 0.28));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 押し出し(奥行き)= 面の背面に濃いブルーの複製を段階的にずらして重ねる */
.mypage-3d::before {
  content: "MyPage";
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  color: var(--sw-accent);
  text-shadow:
    1px 1px 0 #1c49c0,
    2px 2px 0 #1a42b6,
    3px 3px 0 #193bad,
    4px 5px 8px rgba(15, 23, 42, 0.32);
}

/* ホバー/フォーカスで正面へ少し起き上がる(上品な立体レスポンス) */
.doc-tile--history:hover .mypage-3d,
.doc-tile--history:focus-visible .mypage-3d {
  transform: perspective(600px) rotateX(6deg) rotateY(-9deg) translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .mypage-3d { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-eyebrow,
  .home-hero-title,
  .home-hero-desc,
  .doc-tile {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .auto-generate-visual span {
    animation: none;
  }
}

.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.smartcv-home-header {
  align-items: center;
}

.smartcv-home-account {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.smartcv-account-muted,
.smartcv-account-email {
  color: var(--text-light);
  font-size: 0.84rem;
  white-space: nowrap;
}

.smartcv-account-email {
  max-width: min(34vw, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.smartcv-account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(12, 153, 89, 0.45);
  border-radius: 999px;
  background: rgba(12, 153, 89, 0.1);
  color: var(--primary-dark);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.smartcv-account-button:hover {
  background: rgba(12, 153, 89, 0.18);
}

.smartcv-account-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auto-generate-main {
  padding-top: 1.5rem;
}

.auto-generate-panel {
  width: min(920px, calc(100vw - 40px));
  margin: 0 auto;
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 36px;
}

.auto-generate-header h1 {
  margin: 0 0 10px;
  font-size: 1.8rem;
  color: var(--text-main);
}

.auto-generate-header p {
  color: var(--text-light);
  margin: 0;
}

.vtt-generate-form {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.doc-type-fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 0;
  padding: 0;
  margin: 0;
}

.doc-type-fieldset legend {
  width: 100%;
  font-weight: 700;
  margin-bottom: 4px;
}

.doc-type-fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.vtt-upload-box {
  display: grid;
  gap: 8px;
  padding: 28px;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
}

.vtt-upload-title {
  font-weight: 700;
  color: var(--text-main);
}

.vtt-upload-note {
  color: var(--text-light);
}

.vtt-upload-box input {
  margin-top: 8px;
}

.vtt-notes-field {
  display: grid;
  gap: 8px;
}

.vtt-notes-title {
  font-weight: 700;
  color: var(--text-main);
}

.vtt-notes-note {
  color: var(--text-light);
  font-size: 0.9rem;
}

.vtt-notes-field textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  line-height: 1.65;
  color: var(--text-main);
  background: #ffffff;
}

.vtt-notes-field textarea:focus {
  outline: 2px solid rgba(72, 209, 178, 0.24);
  border-color: var(--primary-color);
}

.vtt-primary-btn,
.vtt-secondary-btn {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.vtt-primary-btn {
  justify-self: start;
  padding: 12px 22px;
  color: #ffffff;
  background: var(--primary-color);
}

.vtt-primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.vtt-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  color: var(--text-main);
}

.vtt-loading[hidden] {
  display: none !important;
}

.vtt-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(12, 153, 89, 0.25);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: vtt-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .vtt-spinner {
    animation-duration: 1.6s;
  }
}

@keyframes vtt-spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------- */
/* History Panel                                        */
/* ---------------------------------------------------- */
.history-panel {
  display: none;
  margin: 4rem auto 0;
  max-width: calc(800px + 3rem); /* Aligns perfectly with the two 400px cards and 3rem gap */
  background: var(--white);
  border-radius: 20px;
  padding: 3rem 3.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.history-panel:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.history-panel {
  display: none !important;
}

.history-panel-text {
  flex: 1;
  position: relative;
  z-index: 1;
}

.history-title {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.history-description {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
  line-height: 1.6;
}

.history-page-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 999px;
  background: var(--primary-color);
  color: #fff;
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 6px rgba(12, 153, 89, 0.2);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.history-page-link:hover {
  transform: translateY(-2px);
  background: var(--primary-dark);
  box-shadow: 0 6px 12px rgba(12, 153, 89, 0.3);
}

.arrow-icon {
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.3s ease;
}

.history-page-link:hover .arrow-icon {
  transform: translateX(6px);
}

.history-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.history-group h4 {
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

.history-list {
  min-height: 42px;
}

.history-empty {
  font-size: 0.88rem;
  color: var(--text-light);
}

.history-item {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
}

.history-item + .history-item {
  margin-top: 0.55rem;
}

.history-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.history-item-meta {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-light);
}

.history-open-btn {
  margin-top: 0.45rem;
  border: none;
  border-radius: 7px;
  background: #e8eef7;
  color: #1f2937;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.history-open-btn:hover {
  background: #d6e2f2;
}

/* ---------------------------------------------------- */
/* Bottom Section                                       */
/* ---------------------------------------------------- */
.bottom-section {
  background: linear-gradient(135deg, #e0f2fe 0%, #dcfce7 100%);
  padding: 4rem 20px;
  margin-top: 4rem;
  border-top: 1px solid rgba(255,255,255,0.5);
}

.features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.feature-item {
  background: rgba(255,255,255,0.6);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,0.8);
}

.problem {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.95rem;
}

.solution-box {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.solution-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.emphasis {
  color: #ef4444; /* Red accent for urgency */
  background: linear-gradient(180deg, rgba(255,255,255,0) 60%, rgba(239,68,68,0.2) 60%);
  padding: 0 5px;
}

.cta-text {
  font-size: 1.1rem;
  color: var(--text-main);
  opacity: 0.9;
}

.sp-only {
  display: none;
}

/* ---------------------------------------------------- */
/* Footer                                               */
/* ---------------------------------------------------- */
.footer {
  text-align: center;
  padding: 2rem;
  background: var(--white);
  color: var(--text-light);
  font-size: 0.8rem;
  border-top: 1px solid #f1f5f9;
}

/* ---------------------------------------------------- */
/* Responsive                                           */
/* ---------------------------------------------------- */
/* ---------------------------------------------------- */
/* Auto-Generate: Page Intro                            */
/* ---------------------------------------------------- */
.ag-intro {
  text-align: center;
  margin-bottom: 40px;
}

/* Reuse the standalone editor's bright action-green throughout this flow. */
.auto-generate-main {
  --primary-color: #2cddb4;
  --primary-dark: #20b2aa;
}

.ag-intro-eyebrow {
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin: 0 0 0.65rem;
}

.ag-intro-title {
  font-family: var(--sw-font-serif);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
  font-weight: 600;
  color: var(--sw-ink);
  letter-spacing: 0.01em;
  margin: 0 0 10px;
}

.ag-intro-desc {
  color: var(--text-light);
  font-size: 1rem;
  margin: 0;
}

.ag-intro-eyebrow,
.ag-intro-title,
.ag-intro-desc {
  opacity: 0;
  transform: translateY(10px);
  animation: home-fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ag-intro-eyebrow { animation-delay: 0.02s; }
.ag-intro-title   { animation-delay: 0.1s; }
.ag-intro-desc    { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .ag-intro-eyebrow,
  .ag-intro-title,
  .ag-intro-desc {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------- */
/* Wizard Form                                          */
/* ---------------------------------------------------- */
.wizard-form {
  max-width: 680px;
  margin: 0 auto;
}

.wizard-form.is-busy .wizard-container {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.wizard-container {
  display: flex;
  flex-direction: column;
}

/* ---- Step row ---- */
.wizard-step {
  display: flex;
  gap: 20px;
}

/* ---- Track: circle + connector ---- */
.wizard-step-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 40px;
}

.wizard-step-node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  position: relative;
  transition: background 0.25s, box-shadow 0.25s;
}

.wizard-step-num { line-height: 1; }

.wizard-check-icon {
  display: none;
  position: absolute;
}

/* State: upcoming */
.wizard-step.is-upcoming .wizard-step-node {
  background: #e2e8f0;
  color: #94a3b8;
}

/* State: active/done — back to the moderate brand green, not the
   fluorescent fill. This badge is persistent chrome (visible on every
   step, not something you press), so it should read as calm status,
   not compete with the actual "次へ" / "生成する" button for
   attention — that button is the one fluorescent moment on this page. */
.wizard-step.is-active .wizard-step-node {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(44, 221, 180, 0.18);
}

/* State: done */
.wizard-step.is-done .wizard-step-node {
  background: var(--primary-dark);
  color: #fff;
}
.wizard-step.is-done .wizard-step-num { display: none; }
.wizard-step.is-done .wizard-check-icon { display: block; }

/* Connector line */
.wizard-connector {
  width: 2px;
  flex: 1;
  min-height: 20px;
  margin: 5px 0;
  background: #e2e8f0;
  transition: background 0.3s;
}
.wizard-step.is-done .wizard-connector { background: var(--primary-dark); }

/* ---- Content area ---- */
.wizard-step-content {
  flex: 1;
  min-width: 0;
}

.wizard-step:not(.wizard-step--last):not(.is-upcoming) .wizard-step-content {
  padding-bottom: 24px;
}

.wizard-step.is-upcoming .wizard-step-content {
  padding-bottom: 4px;
}

/* ---- Collapsed button (done state) ---- */
.wizard-collapsed-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 13px 18px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  margin-bottom: 4px;
}
.wizard-collapsed-btn:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-card), 0 0 0 3px rgba(44, 221, 180, 0.14);
  transform: translateY(-1px);
}

.wizard-collapsed-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
  white-space: nowrap;
}

.wizard-collapsed-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
  animation: wizard-card-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wizard-card-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Step-state-driven visibility (CSS controls all show/hide) ---- */

/* Cards: visible only in active state */
.wizard-step.is-active .wizard-card   { display: block; }
.wizard-step.is-done .wizard-card     { display: none;  }
.wizard-step.is-upcoming .wizard-card { display: none;  }

/* Collapsed buttons: hidden only in active state */
.wizard-step.is-active .wizard-collapsed-btn   { display: none; }
.wizard-step.is-done .wizard-collapsed-btn     { display: flex; }
.wizard-step.is-upcoming .wizard-collapsed-btn { display: flex; pointer-events: none; }

.wizard-card-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-card-desc {
  font-size: 0.86rem;
  color: var(--text-light);
  margin: -12px 0 18px;
}

.wizard-card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ---- Doc type pills (Step 1) ---- */
.wizard-doc-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.wizard-doc-legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.doc-type-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.doc-option { position: relative; }

.doc-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.doc-option-pill {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 100px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-light);
  transition: border-color 0.25s, background 0.25s, color 0.25s, transform 0.25s;
  user-select: none;
  white-space: nowrap;
}

.doc-option input:checked + .doc-option-pill {
  border-color: var(--primary-color);
  background: rgba(44, 221, 180, 0.1);
  color: var(--primary-dark);
  font-weight: 700;
}

.doc-option-pill:hover { border-color: #94a3b8; transform: translateY(-1px); }

.doc-option input:focus-visible + .doc-option-pill {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ---- Upload zone (Steps 2 & 3) ---- */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
  overflow: hidden;
}

.upload-zone:hover {
  border-color: var(--primary-color);
  background: rgba(44, 221, 180, 0.05);
}

.upload-zone.has-file {
  border-style: solid;
  border-color: var(--primary-color);
  background: rgba(44, 221, 180, 0.06);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-zone-icon {
  width: 44px;
  height: 44px;
  color: #94a3b8;
  margin-bottom: 12px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.upload-zone:hover .upload-zone-icon,
.upload-zone.has-file .upload-zone-icon {
  color: var(--primary-color);
}

.upload-zone-title {
  display: block;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.upload-zone-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--text-light);
  transition: color 0.2s, font-weight 0.2s;
  word-break: break-all;
}

.upload-zone.has-file .upload-zone-hint {
  color: var(--primary-dark);
  font-weight: 600;
}

.upload-error {
  font-size: 0.82rem;
  color: #ef4444;
  margin-top: 6px;
  display: none;
}

/* ---- Next button ---- */
.wizard-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 24px;
  background: #2cddb4;
  color: #fff;
  border: none;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(44, 221, 180, 0.28);
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
}

.wizard-next-btn:hover {
  background: #20b2aa;
  transform: translateX(3px);
  box-shadow: 0 6px 16px rgba(32, 178, 170, 0.4);
}

/* ---- Textarea (Step 4) ---- */
.wizard-textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-main);
  background: #fff;
}

.wizard-textarea:focus {
  outline: 2px solid rgba(72, 209, 178, 0.24);
  border-color: var(--primary-color);
}

/* ---- Optional badge ---- */
.badge-optional {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 8px;
  vertical-align: middle;
  letter-spacing: 0.01em;
}

/* ---- Submit button ---- */
.wizard-submit-footer { margin-top: 24px; }

.wizard-submit-btn {
  width: 100%;
  padding: 15px;
  background: #2cddb4;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(44, 221, 180, 0.3);
}

.wizard-submit-btn:hover {
  background: #20b2aa;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(32, 178, 170, 0.4);
}

.wizard-submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

/* ---- Loading / Result below wizard ---- */
.auto-generate-main > .vtt-loading {
  max-width: 680px;
  margin: 28px auto 0;
}

/* ---------------------------------------------------- */
/* Responsive                                           */
/* ---------------------------------------------------- */
@media (max-width: 640px) {
  .header-inner {
    padding: 0.85rem 20px;
  }

  .smart, .dash, .cv { font-size: 1.7rem; }

  .main-content {
    padding: 1.75rem 20px 2rem;
  }

  .home-hero {
    padding: 0.15rem 0 1.5rem;
  }

  .home-hero-title,
  .home-hero-desc {
    max-width: none;
  }

  .doc-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .doc-tile {
    aspect-ratio: 16 / 10;
  }

  .solution-text {
    font-size: 1.4rem;
  }

  .history-panel {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }

  .history-groups {
    grid-template-columns: 1fr;
  }

  .sp-only {
    display: block;
  }
}
