/* ==========================================================================
   TeloMoji — standalone stylesheet (crflow style.css 依存を解消した独自版)
   Brand: 白基調 / ディープティール #0E7268 (信頼) + アンバー #F5B41A (テロップ
   マーカーの軽快さ)。Typography: Zen Kaku Gothic New + Outfit + IBM Plex Mono。
   機能フック (job_progress.js / job_detail.js / result_protect.js /
   upload_overlay.js が参照するクラス・id) は全て旧名のまま維持。
   ========================================================================== */

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #16302c;
  --muted: #5e6f6c;
  --border: #e3e8e5;
  --primary: #0e7268;
  --primary-ink: #0a5750;
  --primary-soft: #e6f2f0;
  --accent: #f5b41a;
  --accent-soft: #fdf0cd;
  --danger: #c44536;
  --danger-soft: #fdeae6;
  --success: #1f8a4c;
  --success-soft: #e7f5ec;
  --radius: 12px;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-latin: "Outfit", "Zen Kaku Gothic New", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --shadow-sm: 0 1px 2px rgba(22, 48, 44, 0.05);
  --shadow-md: 0 6px 24px -8px rgba(14, 114, 104, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.75;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--primary-ink);
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* --- Header ---------------------------------------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  /* ブランドストライプ: ティール→アンバーの細いバー */
  border-top: 4px solid;
  border-image: linear-gradient(90deg, var(--primary) 0 70%, var(--accent) 70% 100%) 1;
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}
.brand__hl {
  color: var(--primary);
  background: linear-gradient(transparent 62%, var(--accent-soft) 62%);
  padding: 0 0.06em;
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.92rem;
}
.user-menu form {
  margin: 0;
}
.user-menu__name {
  font-weight: 600;
  text-decoration: none;
}

/* --- Layout ------------------------------------------------------------------ */
.container {
  max-width: 760px;
  margin: 2.2rem auto;
  padding: 0 1rem;
}
.auth-card {
  max-width: 27rem;
  margin: 3rem auto;
}

/* --- Card ---------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.9rem;
  box-shadow: var(--shadow-sm);
}
.card + .card,
.card + .cta-row,
.cta-row + .card {
  margin-top: 1.25rem;
}
.card h1 {
  margin-top: 0;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.card h2 {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 0.4rem 0 0.8rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--primary);
  line-height: 1.5;
}
.card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.1rem 0 0.45rem;
}

/* キーワードのマーカーハイライト (テロップ・メタファー) */
.mk {
  background: linear-gradient(transparent 58%, var(--accent-soft) 58%);
  font-weight: 700;
  padding: 0 0.1em;
}

.note {
  color: var(--muted);
  font-size: 0.88rem;
}

/* --- Forms ----------------------------------------------------------------------- */
form label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
}
input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
input[type="file"],
select {
  width: 100%;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.field-help {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.consent {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 1.1rem 0 0.4rem;
  font-weight: 400;
  font-size: 0.9rem;
}
.consent input {
  margin-top: 0.3rem;
}
.form-footer {
  margin-top: 1.2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* --- Buttons -------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border-radius: 9px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 0 var(--primary-ink);
}
.btn--primary:hover {
  background: var(--primary-ink);
  color: #fff;
  transform: translateY(-1px);
}
.btn--secondary {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--primary);
}
.btn--secondary:hover {
  background: var(--primary-soft);
}
.btn--sm {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}
.btn--link {
  background: none;
  border: none;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  font-size: 0.92rem;
  cursor: pointer;
}
button[type="submit"]:not([class]),
button:not([class]) {
  /* 素の button (auth 画面等) も主ボタン扱い */
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 0.55rem 1.25rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
button:not([class]):hover {
  background: var(--primary-ink);
}
form .btn--primary,
form button[type="submit"] {
  margin-top: 1.1rem;
}

/* --- Flash ----------------------------------------------------------------------- */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 9px;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
  font-size: 0.92rem;
}
.flash--info {
  background: var(--primary-soft);
  border-color: #c4e0dc;
}
.flash--success {
  background: var(--success-soft);
  border-color: #bfe3cd;
  color: var(--success);
}
.flash--error {
  background: var(--danger-soft);
  border-color: #f0c4ba;
  color: var(--danger);
}
.flash--warning {
  background: var(--accent-soft);
  border-color: #ecd28e;
}

/* --- Tables ------------------------------------------------------------------------ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.75rem 0;
}
th,
td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
thead th {
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 2px solid var(--primary);
}
tbody th {
  font-weight: 700;
  white-space: nowrap;
}
.table-scroll {
  overflow-x: auto;
}

/* --- Video player + progress ----------------------------------------------------- */
.job-video {
  width: 100%;
  max-width: 360px;
  border-radius: 10px;
  background: #000;
  margin-bottom: 1rem;
  display: block;
  box-shadow: var(--shadow-md);
}
#job-progress progress {
  width: 100%;
  max-width: 480px;
  height: 12px;
  accent-color: var(--primary);
}
.seek-btn {
  font-size: 0.85rem;
}

/* --- Filmstrip (テロップタイムライン) --------------------------------------------- */
/* フィルムの送り穴 (perforation) を上下に敷いた帯 — ブランドシグネチャ */
.frame-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.9rem 0.4rem;
}
.frame-strip--timeline {
  align-items: flex-start; /* 開いたテロップパネルが自シーンだけ下に伸びる */
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 22px) top / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 22px) bottom / 100% 5px no-repeat,
    #f3f5f2;
  border-radius: 8px;
  padding: 1rem 0.6rem;
}
.frame-thumb {
  margin: 0;
  flex: 0 0 auto;
  text-align: center;
  max-width: 170px;
}
.frame-thumb img {
  display: block;
  height: 250px;
  width: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: #000;
  transition: transform 0.12s, box-shadow 0.15s;
}
.frame-thumb img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.frame-thumb figcaption {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.tc-label,
.scene-range {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
}
.scene-range {
  color: var(--muted);
}
.scene-count {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
}

/* シーン別テロップ開閉 (job_detail.js §4 が .js-telop-toggle を処理) */
.telop-toggle {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.18rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
}
.telop-toggle[aria-expanded="true"] {
  background: var(--primary);
  color: #fff;
}
.telop-toggle--empty {
  color: var(--muted);
  font-weight: 400;
  cursor: default;
}
.telop-panel {
  list-style: none;
  width: 100%;
  margin: 0.25rem 0 0;
  padding: 0.35rem 0.45rem;
  text-align: left;
  font-size: 0.74rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.telop-panel li {
  padding: 0.14rem 0;
  border-bottom: 1px dashed var(--border);
  word-break: break-word;
}
.telop-panel li:last-child {
  border-bottom: none;
}

/* --- 匿名結果の保護コンテナ --------------------------------------------------------- */
.protected {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* --- アップロード中オーバーレイ ------------------------------------------------------ */
.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 48, 44, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.upload-overlay__box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
}
.upload-overlay__spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: telomoji-spin 0.9s linear infinite;
}
@keyframes telomoji-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- 進捗ページの紹介枠 -------------------------------------------------------------- */
.promo {
  margin-top: 1.6rem;
  border-top: 1px dashed var(--border);
  padding-top: 1rem;
}
#usage-tip {
  min-height: 1.6em;
  font-weight: 500;
  color: var(--primary-ink);
}

/* --- フッター ------------------------------------------------------------------------ */
.site-footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.4rem 1rem 1.6rem;
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-size: 0.85rem;
}
.site-footer__nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer__nav a:hover {
  color: var(--primary);
}
.site-footer__operator {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ==========================================================================
   トップ LP
   ========================================================================== */

/* ロード時の staggered フェードアップ (トップのカード列) */
.lp .card,
.lp .cta-row {
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.lp .card:nth-child(2) { animation-delay: 0.07s; }
.lp .card:nth-child(3) { animation-delay: 0.14s; }
.lp .card:nth-child(4) { animation-delay: 0.2s; }
.lp .card:nth-child(5) { animation-delay: 0.26s; }
.lp .cta-row { animation-delay: 0.32s; }
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lp .card,
  .lp .cta-row {
    animation: none;
  }
}

/* ヒーロー: コピー + 結果モック SVG の2カラム */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.8rem;
  align-items: center;
}
.hero h1 {
  font-size: 1.85rem;
  letter-spacing: 0.005em;
}
.hero-visual svg {
  width: 100%;
  height: auto;
  display: block;
}

/* 比較ビジュアル: 音声のみ vs テロップ+音声 のミニ図解 */
.cmp-visual {
  display: flex;
  gap: 1rem;
  margin: 1rem 0 1.2rem;
  flex-wrap: wrap;
}
.cmp-box {
  flex: 1 1 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem 1rem;
  background: var(--bg);
}
.cmp-box--telomoji {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.cmp-box h3 {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
}
.cmp-box--telomoji h3 {
  color: var(--primary);
}
.cmp-line {
  height: 10px;
  border-radius: 5px;
  margin: 0.45rem 0;
  background: #d6ddd9;
}
.cmp-line--voice {
  background: var(--primary-soft);
  border: 1px solid #bcded9;
}
.cmp-line--telop {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.cmp-line--missing {
  background: repeating-linear-gradient(45deg, #eceeec 0 6px, #f7f8f6 6px 12px);
  border: 1px dashed #cfd6d1;
}
.cmp-legend {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
.cmp-legend i {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border-radius: 3px;
  margin-right: 0.3em;
  vertical-align: -0.08em;
}

/* 結果ミニ再現 (デモ) — フィルム風帯 + 字幕チップ */
.demo-result h3 {
  margin: 1.1rem 0 0.45rem;
}
.demo-result h3 .note {
  font-weight: 400;
  margin-left: 0.4rem;
}
.demo-scenes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.9rem 0.7rem;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 22px) top / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 22px) bottom / 100% 5px no-repeat,
    #f3f5f2;
}
.demo-scene {
  flex: 1 1 185px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  font-size: 0.85rem;
}
.demo-scene ul {
  margin: 0.25rem 0 0;
  padding-left: 0;
  list-style: none;
}
.demo-scene li {
  display: inline-block;
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin: 0.12rem 0.15rem 0.12rem 0;
  font-weight: 500;
}
.demo-narration {
  font-size: 0.9rem;
  padding-left: 0;
  list-style: none;
}
.demo-narration li {
  padding: 0.18rem 0;
  border-bottom: 1px dashed var(--border);
}
.demo-narration li:last-child {
  border-bottom: none;
}

/* 3ステップ */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 0.9rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-latin);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FAQ */
.faq dt {
  font-weight: 700;
  margin-top: 1rem;
  padding-left: 1.3rem;
  position: relative;
}
.faq dt::before {
  content: "Q";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-latin);
  font-weight: 800;
}
.faq dd {
  margin: 0.25rem 0 0.8rem;
  color: var(--muted);
}

/* CTA */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.cta-card {
  flex: 1 1 280px;
}
.cta-card .btn {
  margin-right: 0.5rem;
  margin-top: 0.3rem;
}
.cta-card--primary {
  border-top: 4px solid var(--primary);
}
.cta-card--biz {
  border-top: 4px solid var(--accent);
}

/* ==========================================================================
   レスポンシブ (スマホ)
   ========================================================================== */
@media (max-width: 680px) {
  body {
    font-size: 15px;
  }
  .container {
    margin: 1.2rem auto;
  }
  .card {
    padding: 1.25rem;
  }
  .card h1 {
    font-size: 1.3rem;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .hero h1 {
    font-size: 1.45rem;
  }
  .frame-thumb img {
    height: 190px;
  }
  .job-video {
    max-width: 100%;
  }
  .user-menu {
    font-size: 0.85rem;
    gap: 0.6rem;
  }
  .auth-card {
    margin: 1.5rem auto;
  }
}
