
:root{
  --bg:#f6f3ed;
  --paper:#fffdfa;
  --ink:#171717;
  --muted:#6f6b64;
  --line:#ddd7cd;
  --accent:#d42b20;
  --accent-soft:#fbe8e5;
  --dark:#121212;
  --green:#1ed760;
  --max:1040px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:Inter,"Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif;
  line-height:1.75;
}
a{color:inherit}
.site-header{
  border-bottom:1px solid var(--line);
  background:rgba(246,243,237,.94);
  position:sticky; top:0; z-index:50;
  backdrop-filter:blur(12px);
}
.header-inner{
  max-width:var(--max); margin:auto; padding:13px 22px;
  display:flex; align-items:center; justify-content:space-between; gap:18px;
}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none}
.brand-mark{
  width:35px;height:35px;border-radius:50%;
  background:var(--ink);color:white;display:grid;place-items:center;
  font-weight:800;font-size:13px;letter-spacing:-.06em
}
.brand strong{display:block;font-size:14px;letter-spacing:.06em}
.brand small{display:block;color:var(--muted);font-size:10px;letter-spacing:.18em}
.nav{display:flex;gap:18px;font-size:13px}
.nav a{text-decoration:none;color:var(--muted)}
.nav a:hover{color:var(--ink)}
.shell{max-width:var(--max);margin:auto;padding:54px 22px 90px}
.hero{display:grid;grid-template-columns:1.25fr .75fr;gap:42px;align-items:end;margin-bottom:56px}
.eyebrow{font-size:12px;letter-spacing:.18em;text-transform:uppercase;color:var(--accent);font-weight:800}
h1{font-family:Georgia,"Yu Mincho","Hiragino Mincho ProN",serif;font-size:clamp(42px,7vw,84px);line-height:1.03;margin:10px 0 14px;letter-spacing:-.04em}
.hero p{color:var(--muted);max-width:700px;margin:0}
.hero-note{border-left:2px solid var(--ink);padding-left:18px;color:var(--muted);font-size:14px}
.card{
  background:var(--paper); border:1px solid var(--line); border-radius:22px;
  box-shadow:0 12px 40px rgba(40,32,20,.045);
}
.episode-card{padding:26px}
.episode-kicker{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:6px}
.ep-no{font-weight:800;font-size:12px;letter-spacing:.15em;color:var(--accent)}
.badge{font-size:11px;border:1px solid var(--line);border-radius:999px;padding:5px 9px;color:var(--muted)}
.episode-card h2{font-family:Georgia,"Yu Mincho",serif;font-size:30px;margin:8px 0}
.episode-card p{color:var(--muted);margin:0 0 20px}
.button{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border-radius:999px;padding:11px 17px;text-decoration:none;font-weight:750;font-size:13px;
  border:1px solid var(--ink);background:var(--ink);color:white
}
.button.secondary{background:transparent;color:var(--ink)}
.button.spotify{background:var(--green);border-color:var(--green);color:#0b0b0b}
.site-footer{border-top:1px solid var(--line);padding:26px 22px 50px;color:var(--muted);font-size:12px}
.site-footer-inner{max-width:var(--max);margin:auto;display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}

/* Episode */
.episode-head{margin-bottom:24px}
.episode-head h1{font-size:clamp(34px,5vw,62px);max-width:900px}
.episode-head .en-title{font-family:Georgia,serif;color:var(--muted);font-size:18px}
.player-card{padding:22px;margin:28px 0 20px}
.player-topline{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:13px}
.player-label{font-size:12px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.sync-state{font-size:12px;color:var(--muted)}
.spotify-placeholder{
  min-height:152px;border-radius:14px;background:#171717;color:white;
  display:grid;place-items:center;text-align:center;padding:24px
}
.spotify-placeholder strong{color:var(--green)}
.setup-alert{
  border:1px solid #e6c6a8;background:#fff7ed;border-radius:14px;
  padding:13px 15px;margin-top:12px;font-size:13px;color:#77502d
}
.controls{
  display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:14px
}
.control-btn,.lang-btn{
  border:1px solid var(--line);background:white;border-radius:999px;
  min-height:38px;padding:8px 13px;font-weight:700;cursor:pointer;color:var(--ink)
}
.control-btn:hover,.lang-btn:hover{border-color:#aaa}
.lang-btn.active{background:var(--ink);color:white;border-color:var(--ink)}
.lang-btn:disabled{opacity:.4;cursor:not-allowed}
.timebox{
  margin-left:auto;font-variant-numeric:tabular-nums;font-weight:800;
  font-size:14px;border:1px solid var(--line);padding:7px 12px;border-radius:999px;background:#fff
}
.transcript-card{padding:0;overflow:hidden}
.transcript-toolbar{
  position:sticky;top:62px;z-index:20;background:rgba(255,253,250,.95);
  border-bottom:1px solid var(--line);padding:14px 18px;
  display:flex;gap:10px;align-items:center;flex-wrap:wrap;backdrop-filter:blur(10px)
}
.toolbar-title{font-weight:850;margin-right:8px}
.transcript-status{font-size:12px;color:var(--muted);margin-left:auto}
.transcript{
  height:min(62vh,650px); overflow:auto; padding:28px 26px 90px;
  scroll-behavior:smooth; overscroll-behavior:contain; overflow-anchor:none
}
.cue{margin:0 0 20px;font-size:20px;line-height:2.05}
.cue-time{
  display:block;color:#aaa;font-size:11px;line-height:1.2;margin-bottom:4px;
  font-variant-numeric:tabular-nums
}
.word{
  border-radius:5px;padding:1px 2px;margin:0 1px;cursor:pointer;
  transition:background .12s,color .12s,box-shadow .12s
}
.word:hover{background:#f0ece5}
.word.past{color:#9d5550}
.word.active{
  color:#bf130c;background:var(--accent-soft);font-weight:850;
  box-shadow:inset 0 -2px 0 var(--accent)
}
.word.future{color:var(--ink)}
.empty-en{
  padding:40px;text-align:center;color:var(--muted);border:1px dashed var(--line);
  border-radius:14px;background:#fff
}
.section-note{font-size:12px;color:var(--muted);margin-top:12px}
.future-strip{
  margin-top:26px;border:1px dashed var(--line);border-radius:18px;padding:20px;
  display:grid;grid-template-columns:repeat(4,1fr);gap:10px;color:var(--muted)
}
.future-strip div{background:rgba(255,255,255,.45);border-radius:12px;padding:14px;font-size:12px}
.future-strip strong{display:block;color:var(--ink);font-size:13px;margin-bottom:4px}
.external-row{display:flex;gap:9px;flex-wrap:wrap;margin-top:18px}
.smallprint{font-size:11px;color:#8b867e;margin-top:10px}
@media(max-width:760px){
  .nav{display:none}
  .shell{padding-top:34px}
  .hero{grid-template-columns:1fr;gap:20px}
  .hero-note{display:none}
  .episode-card h2{font-size:25px}
  .player-card{padding:14px}
  .transcript-toolbar{top:60px}
  .transcript{height:58vh;padding:20px 16px 70px}
  .cue{font-size:18px;line-height:2}
  .timebox{margin-left:0}
  .future-strip{grid-template-columns:1fr 1fr}
}

/* Multilingual transcript */
.language-select{
  min-height:38px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  border-radius:999px;
  padding:7px 36px 7px 14px;
  font:inherit;
  font-size:13px;
  font-weight:750;
  cursor:pointer;
}
.select-wrap{display:inline-flex}
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0
}
.translated-cue{
  cursor:pointer;
  border-radius:12px;
  padding:10px 12px;
  margin-left:-12px;
  margin-right:-12px;
  transition:background .15s,box-shadow .15s
}
.translated-cue:hover{background:#f7f2eb}
.translated-cue.active-cue{
  background:var(--accent-soft);
  box-shadow:inset 4px 0 0 var(--accent)
}
.translation-line,.japanese-line{display:block}
.translation-line{font-size:20px;line-height:1.85}
.japanese-line{
  margin-top:8px;
  padding-top:8px;
  border-top:1px dashed var(--line);
  color:#6f6b64;
  font-size:15px;
  line-height:1.8
}
.transcript.rtl{
  direction:rtl;
  text-align:right;
  font-family:Tahoma,Arial,"Noto Sans Arabic",sans-serif
}
.transcript.rtl .cue-time{
  direction:ltr;
  text-align:right
}
.transcript.rtl .japanese-line{
  direction:ltr;
  text-align:left;
  font-family:Inter,"Noto Sans JP","Yu Gothic",system-ui,sans-serif
}
@media(max-width:760px){
  .language-select{max-width:190px}
  .translation-line{font-size:18px}
  .transcript-status{width:100%;margin-left:0}
}

/* 14-language UI */
.site-language-control{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
  margin-right:14px;
}
.site-language-select{
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--ink);
  padding:7px 30px 7px 12px;
  font:inherit;
  font-size:13px;
  font-weight:750;
  cursor:pointer;
}
.globe{font-size:16px}
.site-rtl .site-language-control{margin-left:14px;margin-right:auto}
.site-rtl .top-nav{direction:rtl}
.site-rtl .transcript-toolbar{direction:rtl}
.site-rtl .player-controls{direction:rtl}
@media(max-width:760px){
  .site-language-control{
    order:3;
    width:100%;
    margin:8px 0 0;
    justify-content:flex-end;
  }
  .site-language-select{max-width:210px}
}

/* All-language word-level playback highlight */
.translation-word,.japanese-word{
  display:inline;
  border-radius:5px;
  padding:1px 2px;
  margin:0 -1px;
  transition:color .10s ease, background-color .10s ease, opacity .10s ease;
  cursor:pointer;
}
.translation-word.future,.japanese-word.future{
  color:inherit;
  opacity:1;
}
.translation-word.past,.japanese-word.past{
  color:#8f8a82;
  opacity:.78;
}
.translation-word.active-word,.japanese-word.active-word{
  color:#d92d20;
  background:rgba(217,45,32,.10);
  font-weight:800;
  opacity:1;
}
.translated-cue.active-cue{
  background:rgba(217,45,32,.035);
  box-shadow:inset 3px 0 0 rgba(217,45,32,.28);
}
.transcript.rtl .translated-cue.active-cue{
  box-shadow:inset -3px 0 0 rgba(217,45,32,.28);
}

/* Localized episode overview */
.episode-overview-card{margin-top:28px}
.overview-inner{padding:30px 28px}
.overview-kicker{font-size:11px;font-weight:850;letter-spacing:.16em;color:var(--accent);margin-bottom:10px}
#overview-title{font-size:26px;line-height:1.35;margin:0 0 20px}
#overview-content p{font-size:16px;line-height:1.9;margin:0 0 14px}
.overview-quote{font-size:18px!important;font-weight:800}
.overview-points,.overview-recommended{margin:18px 0 22px;padding-left:1.25em}
.overview-points li,.overview-recommended li{margin:7px 0;line-height:1.65}
.overview-flow{display:grid;gap:7px;justify-items:center;max-width:620px;margin:25px auto}
.flow-box{width:100%;text-align:center;padding:12px 16px;border:1px solid var(--line);border-radius:14px;background:#fff;font-weight:800}
.flow-arrow{font-size:22px;color:var(--accent);font-weight:900}
.overview-closing{font-weight:750}
#overview-content h3{margin:28px 0 12px;font-size:18px}
.overview-chapters{display:grid;gap:8px}
.chapter-row{width:100%;display:grid;grid-template-columns:72px 1fr;gap:12px;align-items:center;text-align:left;border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px 13px;cursor:pointer;font:inherit}
.chapter-row:hover{background:#faf6f1}
.chapter-time{font-variant-numeric:tabular-nums;font-weight:900;color:var(--accent)}
.chapter-label{line-height:1.45}
.overview-topics{color:#68635d;word-break:break-word}
.site-rtl .chapter-row{text-align:right}
.site-rtl .overview-points,.site-rtl .overview-recommended{padding-left:0;padding-right:1.25em}
@media(max-width:760px){.overview-inner{padding:22px 18px}#overview-title{font-size:22px}.chapter-row{grid-template-columns:62px 1fr}}

/* Collapsible episode overview */
.overview-details{
  width:100%;
}
.overview-details > summary{
  list-style:none;
}
.overview-details > summary::-webkit-details-marker{
  display:none;
}
.overview-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:20px 24px;
  cursor:pointer;
  user-select:none;
  border-radius:18px;
  transition:background .15s ease;
}
.overview-summary:hover{
  background:#faf6f1;
}
.overview-summary-left{
  display:flex;
  flex-direction:column;
  gap:7px;
  min-width:0;
}
.overview-summary .overview-kicker{
  margin:0;
}
.overview-summary-title{
  display:block;
  font-size:18px;
  line-height:1.45;
  font-weight:800;
  color:var(--ink);
}
.overview-chevron{
  flex:0 0 auto;
  font-size:26px;
  line-height:1;
  color:var(--accent);
  transform:rotate(0deg);
  transition:transform .18s ease;
}
.overview-details[open] .overview-chevron{
  transform:rotate(180deg);
}
.overview-details[open] .overview-summary{
  border-bottom:1px solid var(--line);
  border-bottom-left-radius:0;
  border-bottom-right-radius:0;
}
.overview-details:not([open]) .overview-inner{
  display:none;
}
.overview-details[open] .overview-inner{
  display:block;
}
@media(max-width:760px){
  .overview-summary{
    padding:17px 18px;
  }
  .overview-summary-title{
    font-size:16px;
  }
}
.site-rtl .overview-summary{
  direction:rtl;
}

/* Playback → transcript synchronization explainer */
.sync-demo{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
  margin:14px 0 16px;
  padding:15px 20px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.58);
  overflow:hidden;
}
.sync-demo-copy{min-width:0;flex:1}
.sync-demo-title{
  font-size:14px;
  line-height:1.45;
  font-weight:850;
  color:var(--ink);
}
.sync-demo-hint{
  margin-top:4px;
  font-size:11px;
  line-height:1.5;
  color:#817b73;
}
.sync-demo-visual{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:14px;
}
.demo-play{
  width:44px;height:44px;border-radius:50%;
  display:grid;place-items:center;
  background:#191919;color:#fff;
  box-shadow:0 0 0 0 rgba(217,45,32,.20);
  animation:demoPlayPulse 4.8s ease-in-out infinite;
}
.demo-play-triangle{
  display:block;
  margin-left:3px;
  font-size:17px;
}
.demo-flow{
  width:88px;height:30px;
  position:relative;
}
.flow-line{
  position:absolute;left:6px;right:8px;top:14px;height:1px;
  background:linear-gradient(90deg,#d7d1c9,#e44b40);
}
.flow-arrowhead{
  position:absolute;right:0;top:1px;
  font-size:26px;line-height:26px;color:#e33b31;
}
.flow-dot{
  position:absolute;top:11px;width:7px;height:7px;border-radius:50%;
  background:#e33b31;opacity:0;
}
.flow-dot.d1{animation:demoSignal 4.8s linear infinite 0s}
.flow-dot.d2{animation:demoSignal 4.8s linear infinite .32s}
.flow-dot.d3{animation:demoSignal 4.8s linear infinite .64s}

.demo-transcript{
  width:210px;
  padding:12px 13px;
  border:1px solid #ded8d0;
  border-radius:13px;
  background:#fff;
  box-shadow:0 8px 25px rgba(37,31,25,.05);
}
.demo-line{
  display:flex;align-items:center;gap:5px;height:12px;
}
.demo-line+.demo-line{margin-top:8px}
.demo-line.short{width:70%}
.demo-word{
  display:block;height:7px;border-radius:5px;
  background:#d8d3cc;
  transition:background .12s, transform .12s;
}
.demo-word:nth-child(1){width:31px}
.demo-word:nth-child(2){width:22px}
.demo-word:nth-child(3){width:38px}
.demo-word:nth-child(4){width:26px}
.demo-word:nth-child(5){width:34px}
.demo-line.short .demo-word:nth-child(1){width:28px}
.demo-line.short .demo-word:nth-child(2){width:35px}
.demo-line.short .demo-word:nth-child(3){width:25px}

.demo-word.w1{animation:demoWord 4.8s infinite .95s}
.demo-word.w2{animation:demoWord 4.8s infinite 1.22s}
.demo-word.w3{animation:demoWord 4.8s infinite 1.49s}
.demo-word.w4{animation:demoWord 4.8s infinite 1.76s}
.demo-word.w5{animation:demoWord 4.8s infinite 2.03s}
.demo-word.w6{animation:demoWord 4.8s infinite 2.30s}
.demo-word.w7{animation:demoWord 4.8s infinite 2.57s}
.demo-word.w8{animation:demoWord 4.8s infinite 2.84s}

@keyframes demoPlayPulse{
  0%,8%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(217,45,32,.12)}
  12%{transform:scale(.92)}
  18%{transform:scale(1.08);box-shadow:0 0 0 9px rgba(217,45,32,.08)}
  28%{transform:scale(1);box-shadow:0 0 0 0 rgba(217,45,32,0)}
}
@keyframes demoSignal{
  0%,12%{left:4px;opacity:0}
  18%{opacity:1}
  38%{left:72px;opacity:1}
  44%,100%{left:72px;opacity:0}
}
@keyframes demoWord{
  0%,18%,100%{background:#d8d3cc;transform:translateY(0)}
  22%,34%{background:#e5392d;transform:translateY(-1px)}
  40%{background:#bfb9b1;transform:translateY(0)}
}
.site-rtl .sync-demo{direction:rtl}
.site-rtl .sync-demo-visual{direction:rtl}
.site-rtl .demo-flow{transform:scaleX(-1)}
@media(max-width:760px){
  .sync-demo{align-items:flex-start;gap:14px;padding:14px 16px}
  .sync-demo-copy{max-width:46%}
  .sync-demo-hint{display:none}
  .sync-demo-visual{gap:8px}
  .demo-flow{width:48px}
  .demo-transcript{width:150px;padding:10px}
  .demo-play{width:38px;height:38px}
}
@media(max-width:520px){
  .sync-demo{display:block}
  .sync-demo-copy{max-width:none;margin-bottom:12px}
  .sync-demo-visual{justify-content:center}
  .demo-transcript{width:180px}
}
@media(prefers-reduced-motion:reduce){
  .demo-play,.flow-dot,.demo-word{animation:none!important}
  .demo-word.w3{background:#e5392d}
}

/* v10 actual video explainer */
.sync-demo-video{
  display:grid;
  grid-template-columns:minmax(220px,1fr) minmax(360px,1.45fr);
  align-items:center;
  gap:22px;
}
.sync-video-wrap{
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
}
.sync-explainer-video{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:1280/260;
  object-fit:cover;
}
@media(max-width:760px){
  .sync-demo-video{
    grid-template-columns:1fr;
  }
  .sync-video-wrap{
    width:100%;
  }
  .sync-demo-hint{
    display:block;
  }
}
@media(prefers-reduced-motion:reduce){
  .sync-explainer-video{
    display:none;
  }
  .sync-video-wrap::after{
    content:"▶  →  ▰ ▰ ▰";
    display:grid;
    place-items:center;
    min-height:90px;
    font-weight:800;
    color:var(--accent);
  }
}

/* v12: make the real UI tutorial unmistakably visible */
.sync-demo-video{
  grid-template-columns:minmax(180px,.55fr) minmax(520px,2fr);
}
.sync-video-wrap{
  min-height:190px;
}
.sync-explainer-video{
  width:100%;
  min-height:190px;
  object-fit:cover;
}
@media(max-width:900px){
  .sync-demo-video{
    grid-template-columns:1fr;
  }
  .sync-video-wrap,
  .sync-explainer-video{
    min-height:0;
  }
}


/* v13 — Tutorial is a primary UI onboarding element.
   Give it the full content width and make it easy to read on phones. */
.sync-demo.sync-demo-video{
  display:block;
  padding:18px;
}
.sync-demo-video .sync-demo-copy{
  max-width:none;
  width:100%;
  margin:0 0 14px 0;
}
.sync-demo-video .sync-demo-title{
  font-size:clamp(17px,2vw,23px);
  line-height:1.35;
}
.sync-demo-video .sync-demo-hint{
  display:block;
  margin-top:5px;
  font-size:clamp(12px,1.35vw,15px);
  line-height:1.55;
}
.sync-demo-video .sync-video-wrap{
  width:100%;
  min-height:0;
  border-radius:16px;
}
.sync-demo-video .sync-explainer-video{
  display:block;
  width:100%;
  height:auto;
  min-height:0;
  aspect-ratio:1280/260;
  object-fit:cover;
}

@media(max-width:760px){
  .sync-demo.sync-demo-video{
    padding:14px 12px;
  }
  .sync-demo-video .sync-demo-copy{
    margin-bottom:12px;
  }
  .sync-demo-video .sync-video-wrap{
    /* Make the tutorial visually dominant on mobile instead of a thin strip. */
    aspect-ratio:16/7;
  }
  .sync-demo-video .sync-explainer-video{
    width:100%;
    height:100%;
    aspect-ratio:auto;
    object-fit:cover;
  }
}

/* v15 — localized static onboarding guide (14 languages). */
.sync-demo.sync-demo-image{
  display:block;
  width:100%;
  padding:0;
  overflow:hidden;
  background:#fbf8f2;
  border:1px solid #ded6ca;
  border-radius:18px;
}
.sync-guide-image{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:1648/926;
  object-fit:contain;
  background:#fbf8f2;
}
@media(max-width:760px){
  .sync-demo.sync-demo-image{border-radius:16px;}
  .sync-guide-image{width:100%;height:auto;aspect-ratio:1648/926;object-fit:contain;}
}


/* v16 — mobile readability: stack the 3 tutorial steps vertically at full phone width. */
.sync-guide-image-mobile{display:none;}
@media(max-width:760px){
  .sync-demo.sync-demo-image{
    width:calc(100vw - 24px); max-width:none;
    margin-left:calc(50% - 50vw + 12px);
    margin-right:calc(50% - 50vw + 12px);
    border-radius:18px; overflow:hidden;
  }
  .sync-guide-desktop{display:none;}
  .sync-guide-image-mobile{display:block;width:100%;height:auto;max-width:none;background:#fbf8f2;}
}

/* v17: only the tutorial heading is localized; the instructional image stays Japanese */
.sync-demo-header-only-localized{
  display:block;
  padding:0;
  overflow:hidden;
}
.sync-guide-copy{
  padding:20px 24px 12px;
}
.sync-guide-title{
  margin:0;
  font-size:clamp(20px,2.4vw,34px);
  line-height:1.3;
  font-weight:850;
  color:var(--ink);
}
.sync-guide-hint{
  margin:7px 0 0;
  font-size:clamp(12px,1.35vw,16px);
  line-height:1.55;
  color:#77716a;
}
.sync-demo-header-only-localized .sync-guide-image,
.sync-demo-header-only-localized .sync-guide-image-mobile{
  width:100%;
  height:auto;
  margin:0;
  border:0;
  border-radius:0 0 16px 16px;
}
@media(max-width:760px){
  .sync-guide-copy{
    padding:16px 16px 10px;
  }
  .sync-guide-title{
    font-size:21px;
  }
  .sync-guide-hint{
    font-size:13px;
  }
}

/* v18: first-time-visitor onboarding must be obvious and readable */
.sync-guide-copy{
  padding:24px 28px 18px !important;
}
.sync-guide-label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0 0 11px;
  padding:8px 13px;
  border-radius:999px;
  background:rgba(217,45,32,.10);
  color:#d92d20;
  font-size:14px;
  line-height:1;
  font-weight:900;
  letter-spacing:.04em;
}
.sync-guide-label::before{
  content:"?";
  display:grid;
  place-items:center;
  width:21px;
  height:21px;
  border-radius:50%;
  background:#d92d20;
  color:#fff;
  font-size:14px;
  font-weight:900;
}
.sync-guide-title{
  margin:0 !important;
  font-size:clamp(28px,3.2vw,44px) !important;
  line-height:1.22 !important;
  font-weight:900 !important;
  letter-spacing:-.02em;
}
.sync-guide-hint{
  margin:10px 0 0 !important;
  font-size:clamp(16px,1.6vw,20px) !important;
  line-height:1.65 !important;
  font-weight:650 !important;
  color:#5f5a54 !important;
}
@media(max-width:760px){
  .sync-guide-copy{
    padding:22px 18px 18px !important;
  }
  .sync-guide-label{
    font-size:15px;
    padding:9px 14px;
    margin-bottom:13px;
  }
  .sync-guide-title{
    font-size:28px !important;
    line-height:1.28 !important;
  }
  .sync-guide-hint{
    font-size:17px !important;
    line-height:1.6 !important;
  }
}

/* v21 — two-step Japanese-fixed onboarding artwork based on the approved guide */
.sync-guide-two-steps{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  padding:0 18px 20px;
  background:#fbf8f2;
}
.sync-guide-step-card{
  display:block;
  width:100%;
  height:auto;
  border-radius:16px;
}
@media(max-width:760px){
  .sync-guide-two-steps{
    grid-template-columns:1fr;
    gap:14px;
    padding:0 10px 14px;
  }
  .sync-guide-step-card{border-radius:14px;}
}


/* v22 — step headings follow the global site language.
   The screenshots beneath them remain fixed Japanese images. */
.sync-guide-step{
  min-width:0;
  overflow:hidden;
  border-radius:16px;
  background:#fff;
  border:1px solid rgba(28,25,22,.08);
}
.sync-guide-step-heading{
  display:flex;
  align-items:center;
  gap:14px;
  min-height:78px;
  padding:14px 18px;
  background:#fff;
}
.sync-guide-step-number{
  flex:0 0 auto;
  width:54px;
  height:54px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#e31b23;
  color:#fff;
  font-size:30px;
  line-height:1;
  font-weight:800;
}
.sync-guide-step-heading-text{
  min-width:0;
  color:#151515;
  font-size:clamp(18px,1.75vw,30px);
  line-height:1.25;
  font-weight:800;
  overflow-wrap:anywhere;
}
.sync-guide-step .sync-guide-step-card{
  width:100%;
  display:block;
  border-radius:0;
}
@media(max-width:760px){
  .sync-guide-step{border-radius:14px;}
  .sync-guide-step-heading{
    min-height:72px;
    gap:12px;
    padding:12px 14px;
  }
  .sync-guide-step-number{
    width:50px;
    height:50px;
    font-size:28px;
  }
  .sync-guide-step-heading-text{
    font-size:clamp(20px,5.4vw,27px);
  }
}


/* v23 — "How to use this site" collapsible, closed by default */
.sync-demo-toggle{
  width:100%;
  margin-top:14px;
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid rgba(28,25,22,.12);
  border-radius:14px;
  background:#fff;
  color:#171717;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
.sync-demo-toggle:hover{background:rgba(255,255,255,.72)}
.sync-demo-toggle-icon{
  flex:0 0 auto;
  font-size:24px;
  line-height:1;
  transition:transform .2s ease;
}
.sync-demo-toggle[aria-expanded="true"] .sync-demo-toggle-icon{
  transform:rotate(180deg);
}
.sync-demo-collapsible{
  margin-top:16px;
}
.sync-demo-collapsible[hidden]{
  display:none !important;
}
@media(max-width:760px){
  .sync-demo-toggle{
    padding:15px 16px;
    border-radius:12px;
    font-size:16px;
  }
}


/* v24 — How-to popup shown only once per browser tab/session */
.sync-demo-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
}
.sync-demo-modal.is-open{display:block}
.sync-demo-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(20,18,16,.58);
  backdrop-filter:blur(2px);
}
.sync-demo-modal-dialog{
  position:relative;
  z-index:1;
  width:min(1080px,calc(100vw - 32px));
  max-height:calc(100vh - 32px);
  margin:16px auto;
  background:#f7f3ec;
  border-radius:20px;
  box-shadow:0 24px 80px rgba(0,0,0,.28);
  overflow:hidden;
}
.sync-demo-modal-scroll{
  max-height:calc(100vh - 32px);
  overflow:auto;
  padding:26px;
}
.sync-demo-in-modal{margin:0}
.sync-demo-modal-close{
  position:absolute;
  top:12px;
  right:14px;
  z-index:2;
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  background:#fff;
  color:#171717;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.12);
}
.sync-demo-modal-actions{
  display:flex;
  justify-content:center;
  padding-top:18px;
}
.sync-demo-modal-done{
  min-width:180px;
  border:0;
  border-radius:999px;
  padding:14px 24px;
  background:#171717;
  color:#fff;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
body.sync-demo-modal-open{overflow:hidden}
@media(max-width:760px){
  .sync-demo-modal-dialog{
    width:calc(100vw - 16px);
    max-height:calc(100vh - 16px);
    margin:8px auto;
    border-radius:16px;
  }
  .sync-demo-modal-scroll{
    max-height:calc(100vh - 16px);
    padding:18px 14px 22px;
  }
  .sync-demo-modal-close{
    top:8px;
    right:8px;
    width:38px;
    height:38px;
    font-size:26px;
  }
}


/* v25 — Persistent How-to card under episode title, closed by default */
.sync-inline-card{
  margin:18px 0 20px;
  border:1px solid rgba(28,25,22,.14);
  border-radius:16px;
  background:#fffdf9;
  overflow:hidden;
}
.sync-inline-toggle{
  width:100%;
  border:0;
  background:transparent;
  padding:17px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  text-align:left;
  cursor:pointer;
  color:#171717;
}
.sync-inline-toggle-texts{min-width:0}
.sync-inline-kicker{
  margin-bottom:6px;
  color:#e33a2f;
  font-size:12px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:.12em;
}
.sync-inline-summary{
  font-size:18px;
  line-height:1.35;
  font-weight:800;
}
.sync-inline-chevron{
  flex:0 0 auto;
  color:#e33a2f;
  font-size:24px;
  line-height:1;
  transition:transform .2s ease;
}
.sync-inline-toggle[aria-expanded="true"] .sync-inline-chevron{
  transform:rotate(180deg);
}
.sync-inline-panel{
  border-top:1px solid rgba(28,25,22,.10);
  padding:18px;
  background:#f7f3ec;
}
.sync-inline-panel[hidden]{display:none !important}
.sync-demo-inline-content{margin:0}
@media(max-width:760px){
  .sync-inline-card{
    margin:14px 0 16px;
    border-radius:14px;
  }
  .sync-inline-toggle{padding:15px 16px}
  .sync-inline-summary{font-size:17px}
  .sync-inline-panel{padding:12px}
}


/* v29 — Make popup's vertical scrollbar visibly available on mobile too */
.sync-demo-modal-scroll{
  overflow-y:scroll !important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
  scrollbar-width:auto;
}

/* Chromium / Android / desktop WebKit scrollbar styling */
.sync-demo-modal-scroll::-webkit-scrollbar{
  width:12px;
}
.sync-demo-modal-scroll::-webkit-scrollbar-track{
  background:rgba(30,28,25,.06);
  border-radius:999px;
}
.sync-demo-modal-scroll::-webkit-scrollbar-thumb{
  background:rgba(30,28,25,.42);
  border-radius:999px;
  border:3px solid transparent;
  background-clip:content-box;
}
.sync-demo-modal-scroll::-webkit-scrollbar-thumb:hover{
  background:rgba(30,28,25,.58);
  background-clip:content-box;
}

@media(max-width:760px){
  .sync-demo-modal-dialog{
    padding-right:2px;
  }
  .sync-demo-modal-scroll{
    overflow-y:scroll !important;
    scrollbar-gutter:stable;
  }
  .sync-demo-modal-scroll::-webkit-scrollbar{
    width:10px;
  }
  .sync-demo-modal-scroll::-webkit-scrollbar-track{
    background:rgba(30,28,25,.07);
  }
  .sync-demo-modal-scroll::-webkit-scrollbar-thumb{
    background:rgba(30,28,25,.48);
    border:2px solid transparent;
    background-clip:content-box;
  }
}

/* v1.0 Frozen Architecture — user-driven synchronization */
.frozen-sync-card{margin:18px 0;padding:18px}.frozen-sync-head{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:14px}.frozen-sync-head h2{margin:2px 0 0}.sync-clock{font-variant-numeric:tabular-nums;font-size:28px;font-weight:800}.sync-primary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.sync-method{border:1px solid var(--line,#ddd);border-radius:14px;padding:14px}.sync-method p{margin:7px 0 10px;color:var(--muted)}.sound-cues{font-size:20px;font-weight:800;letter-spacing:.04em;margin:8px 0 12px}.sync-main-btn{min-height:44px;padding:9px 14px;border-radius:10px;cursor:pointer}.sync-main-btn:disabled{cursor:not-allowed;opacity:.55}.current-time-form{display:flex;gap:8px;flex-wrap:wrap}.current-time-form input{min-height:44px;min-width:100px;flex:1;padding:8px 10px;border:1px solid var(--line,#ccc);border-radius:10px;font:inherit}.verify-card{margin-top:14px;padding:16px;border:1px solid var(--line,#ddd);border-radius:14px;text-align:center}.verify-pulse{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;margin:0 auto 10px;font-size:32px;transition:transform .08s ease,filter .08s ease,background .08s ease}.verify-pulse.flash{transform:scale(1.28);filter:brightness(2.2);background:currentColor}.verify-actions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:12px}.verify-actions button,.sync-controls button,.sync-controls select{min-height:40px;padding:7px 10px}.sync-advanced{margin-top:14px}.sync-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding-top:10px}.sync-status{margin-top:12px;font-size:13px;color:var(--muted)}@media(max-width:800px){.sync-primary-grid{grid-template-columns:1fr}.frozen-sync-card{padding:14px}.sync-clock{font-size:24px}}

.sync-provider-label{display:flex;gap:7px;align-items:center;font-size:12px;color:var(--muted)}.sync-provider-label select{min-height:34px;max-width:180px}.frozen-sync-head>div:last-child{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end}

/* Phase 4 fallback UI primitives */
.phase4-retry{padding:12px;border:1px solid var(--line,#ddd);border-radius:12px}
.phase4-retry[hidden]{display:none}
