/**
 * イチ円動画 — 独立サイト用（すべて .iev- プレフィクス）
 * YouTube 風: ダークトップバー + ライト本文エリア。Social9 本体 CSS と衝突しない。
 */
:root {
    --iev-bg: #0f0f0f;
    --iev-bg-elev: #212121;
    --iev-text: #f1f5f9;
    --iev-text-soft: #94a3b8;
    --iev-accent: #e11d48;
    --iev-accent-hover: #be123c;
    --iev-page-bg: #fafafa;
    --iev-page-text: #0f172a;
    --iev-border: #334155;
    --iev-radius: 10px;
    --iev-font: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

.iev-body {
    margin: 0;
    font-family: var(--iev-font);
    background: var(--iev-page-bg);
    color: var(--iev-page-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.iev-skip {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.iev-skip:focus {
    left: 12px;
    top: 12px;
    width: auto;
    height: auto;
    padding: 8px 14px;
    background: #fff;
    color: #000;
    z-index: 9999;
    border-radius: 6px;
}

.iev-topbar {
    background: var(--iev-bg);
    color: var(--iev-text);
    border-bottom: 1px solid var(--iev-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.iev-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.iev-topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 1 auto;
}
.iev-topbar-center {
    flex: 1 1 200px;
    min-width: 0;
}
.iev-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.iev-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--iev-text);
    font-weight: 800;
    letter-spacing: 0.02em;
}
.iev-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e11d48, #f97316);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
}
.iev-logo-text { font-size: 15px; }

.iev-topnav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.iev-topnav a {
    color: var(--iev-text-soft);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
}
.iev-topnav a:hover { color: #fff; background: var(--iev-bg-elev); }
.iev-topnav a.is-active { color: #fff; background: var(--iev-bg-elev); }

.iev-search {
    display: flex;
    align-items: stretch;
    max-width: 560px;
    margin: 0 auto;
    border: 1px solid var(--iev-border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--iev-bg-elev);
}
.iev-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--iev-text);
    padding: 8px 16px;
    font-size: 14px;
    min-width: 0;
}
.iev-search-input:disabled { opacity: 0.5; cursor: not-allowed; }
.iev-search-btn {
    border: none;
    background: var(--iev-bg-elev);
    color: var(--iev-text-soft);
    padding: 0 14px;
    cursor: not-allowed;
}

.iev-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}
.iev-btn--ghost {
    background: transparent;
    color: var(--iev-text);
    border-color: var(--iev-border);
}
.iev-btn--ghost:hover { background: var(--iev-bg-elev); color: #fff; }
.iev-btn--primary {
    background: var(--iev-accent);
    border-color: var(--iev-accent);
    color: #fff;
}
.iev-btn--primary:hover { background: var(--iev-accent-hover); border-color: var(--iev-accent-hover); }

.iev-main { flex: 1; }

.iev-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

.iev-hero {
    padding: 40px 0 32px;
    background: linear-gradient(180deg, #1e1e1e 0%, #0f0f0f 100%);
    color: #f8fafc;
}
.iev-hero .iev-container { max-width: 900px; text-align: center; }
.iev-hero-title {
    margin: 0 0 16px;
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 800;
    line-height: 1.35;
}
.iev-hero-lead {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.75;
    color: #cbd5e1;
}
.iev-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.iev-section { padding: 36px 0; }
.iev-section--muted { background: #fff; border-block: 1px solid #e2e8f0; }
.iev-pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.iev-pillar {
    border: 1px solid #e2e8f0;
    border-radius: var(--iev-radius);
    padding: 20px;
    background: #fafafa;
}
.iev-pillar-title { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.iev-pillar-desc { margin: 0; font-size: 14px; color: #475569; line-height: 1.65; }

.iev-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    padding: 28px 16px 48px;
}
@media (max-width: 960px) {
    .iev-layout { grid-template-columns: 1fr; }
}

.iev-section-title {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 700;
}

.iev-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.iev-video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.iev-video-thumb {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1e293b, #334155);
}
.iev-video-meta {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.iev-video-title-line {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
}
.iev-video-subline {
    font-size: 12px;
    color: #64748b;
}

.iev-sidebar {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    align-self: start;
}
.iev-trend-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    font-size: 13px;
    color: #475569;
}
.iev-trend-list li {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.iev-trend-list li:last-child { border-bottom: none; }
.iev-trend-rank {
    font-weight: 800;
    color: #94a3b8;
    min-width: 1.2em;
}

.iev-page-head {
    padding: 32px 0 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}
.iev-page-title { margin: 0 0 12px; font-size: 26px; font-weight: 800; }
.iev-page-lead { margin: 0; font-size: 15px; color: #475569; line-height: 1.7; max-width: 720px; }

.iev-prose {
    max-width: 720px;
    padding-bottom: 48px;
}
.iev-prose h2 {
    margin: 28px 0 10px;
    font-size: 18px;
    font-weight: 700;
}
.iev-prose h2:first-child { margin-top: 0; }
.iev-prose p {
    margin: 0 0 14px;
    line-height: 1.75;
    color: #334155;
}

.iev-footer {
    background: #0f0f0f;
    color: #94a3b8;
    padding: 32px 16px;
    margin-top: auto;
}
.iev-footer-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    font-size: 13px;
    line-height: 1.65;
}
.iev-footer-brand { margin: 0 0 8px; font-weight: 700; color: #e2e8f0; }
.iev-footer-tag { margin: 0 0 12px; }
.iev-footer-meta { margin: 0; }
.iev-footer a { color: #f87171; text-decoration: none; }
.iev-footer a:hover { text-decoration: underline; }

/* --- ボタン拡張（ホーム CTA） --- */
.iev-btn--outline {
    background: transparent;
    color: var(--iev-text);
    border: 2px solid rgba(248, 250, 252, 0.35);
}
.iev-btn--outline:hover {
    border-color: rgba(248, 250, 252, 0.6);
    background: rgba(255, 255, 255, 0.06);
}

/* --- フィードカードをリンクに --- */
a.iev-video-card--link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.iev-video-card--link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
a.iev-video-card--link:focus-visible {
    outline: 3px solid var(--iev-accent);
    outline-offset: 2px;
}

.iev-trend-list a {
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
}
.iev-trend-list a:hover { text-decoration: underline; }

/* --- クリエイター向けフォーム・一覧 --- */
.iev-studio-section { padding-bottom: 48px; }
.iev-studio-narrow { max-width: 640px; }
.iev-studio-headrow {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.iev-form { margin-top: 8px; }
.iev-field { margin-bottom: 20px; }
.iev-field--inline { border: 0; padding: 0; margin-bottom: 16px; }
.iev-field--inline .iev-radio { margin-right: 16px; font-size: 14px; }
.iev-label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    color: #0f172a;
}
.iev-input,
.iev-textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: #0f172a;
}
.iev-textarea { resize: vertical; min-height: 120px; }
.iev-input:hover,
.iev-textarea:hover { background: #eef2ff; }
.iev-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}
.iev-muted { color: #64748b; font-size: 14px; }
.iev-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}
.iev-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 16px;
}
.iev-alert--error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}
.iev-alert--warn {
    background: #fffbeb;
    border: 2px solid #fde68a;
    color: #92400e;
}
.iev-alert--ok {
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    color: #065f46;
}
.iev-parent-prefs-intro {
    margin: 0 0 20px;
    line-height: 1.7;
    color: #334155;
    font-size: 15px;
}
.iev-parent-prefs-curator-note {
    margin: -8px 0 20px;
    line-height: 1.65;
    color: #475569;
    font-size: 14px;
}
.iev-field--checkbox .iev-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
    color: #0f172a;
    cursor: pointer;
}
.iev-field--checkbox .iev-check input {
    margin-top: 4px;
    flex-shrink: 0;
}
.iev-slug-line {
    font-size: 14px;
    margin-bottom: 20px;
    word-break: break-all;
}
.iev-slug-line code {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.iev-table-wrap { overflow-x: auto; }
.iev-studio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.iev-studio-table th,
.iev-studio-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.iev-studio-table th {
    background: #f8fafc;
    font-weight: 700;
}
.iev-studio-table tr:last-child td { border-bottom: none; }
.iev-studio-actions a {
    color: #e11d48;
    font-weight: 600;
    text-decoration: none;
}
.iev-studio-actions a:hover { text-decoration: underline; }

/* --- 視聴ページ --- */
.iev-watch-hero {
    padding: 28px 0 24px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}
.iev-watch-title {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.35;
    color: #0f172a;
}
.iev-youtube-player {
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    margin: 0 0 14px;
    overflow: hidden;
    border-radius: 18px;
    background: #020617;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
}
.iev-youtube-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
/* YouTube ロゴ・終了画面の関連動画クリックを抑止（イチ円動画内ループ用） */
.iev-youtube-logo-shield {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 2;
    width: 96px;
    height: 52px;
    pointer-events: auto;
    background: transparent;
}
.iev-youtube-end-shield {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: auto;
    background: rgba(2, 6, 23, 0.02);
    cursor: default;
}
.iev-youtube-end-shield[hidden] {
    display: none;
}
.iev-watch-ext { margin: 0 0 8px; }
.iev-watch-ai-cta { margin: 14px 0 0; }
.iev-synopsis-body { line-height: 1.75; color: #334155; }

/* --- 動画教育AI --- */
.iev-eduai-head { background: linear-gradient(135deg, #fff 0%, #eef2ff 100%); }
.iev-eduai-kicker {
    margin: 0 0 8px;
    color: #e11d48;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.iev-eduai-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}
.iev-eduai-panel,
.iev-eduai-side-card,
.iev-eduai-pref-card {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}
.iev-eduai-panel { padding: 18px; }
.iev-eduai-chat {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 520px;
    overflow-y: auto;
    padding: 4px 4px 18px;
}
.iev-eduai-msg {
    max-width: 86%;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.7;
}
.iev-eduai-msg--assistant {
    align-self: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.iev-eduai-msg--user {
    align-self: flex-end;
    background: #fee2e2;
    border: 1px solid #fecdd3;
}
.iev-eduai-msg-name {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
}
.iev-eduai-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
.iev-eduai-input { min-height: 112px; }
.iev-eduai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.iev-eduai-pref-card {
    margin-top: 16px;
    padding: 16px;
}
.iev-eduai-pref-card h2,
.iev-eduai-side-card h2 {
    margin: 0 0 12px;
    font-size: 17px;
}
.iev-eduai-pref-card dl {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0 0 12px;
}
.iev-eduai-pref-card dt {
    font-weight: 800;
    color: #475569;
}
.iev-eduai-pref-card dd { margin: 0; color: #0f172a; }
.iev-eduai-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.iev-eduai-side-card {
    padding: 16px;
    color: #334155;
}
.iev-eduai-side-card ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}
.iev-parent-prefs-ai-cta { margin: 14px 0 18px; }

@media (max-width: 880px) {
    .iev-eduai-layout { grid-template-columns: 1fr; }
    .iev-eduai-msg { max-width: 94%; }
}

/* --- Kids feed (kids.php / parent-prefs presets) --- */
.iev-kids-title {
    color: #0f172a;
}
.iev-kids-lead {
    color: #475569;
    max-width: 720px;
    line-height: 1.7;
}
.iev-kids-tabs {
    display: inline-flex;
    gap: 4px;
    margin: 16px 0 0;
    padding: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
}
.iev-kids-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.iev-kids-tab:hover {
    background: rgba(99,102,241,0.08);
    color: #4f46e5;
}
.iev-kids-tab.is-active {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 1px 3px rgba(16,24,40,0.08);
}
.iev-kids-section-title {
    margin: 8px 0 0;
}
.iev-kids-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 8px 0 16px;
}
.iev-kids-total {
    margin: 0;
    font-size: 13px;
    color: #475569;
    font-variant-numeric: tabular-nums;
}
.iev-kids-total strong {
    font-size: 15px;
    color: #0f172a;
    font-weight: 800;
    margin: 0 2px;
}
.iev-kids-total-sub {
    color: #94a3b8;
    margin-left: 6px;
    font-size: 12px;
}
.iev-kids-tab-count {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 700;
    color: inherit;
    opacity: 0.72;
    font-variant-numeric: tabular-nums;
}
.iev-kids-tab.is-active .iev-kids-tab-count {
    opacity: 1;
}
.iev-kids-grid {
    margin-top: 8px;
}
.iev-kids-empty {
    margin: 12px 0;
}
.iev-kids-thumb {
    background-color: #f1f5f9;
}
.iev-kids-subline {
    color: #64748b;
    font-size: 12px;
    text-transform: lowercase;
}

/* --- Parent prefs presets buttons --- */
.iev-parent-prefs-presets {
    margin: 18px 0 24px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.iev-parent-prefs-presets__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}
.iev-parent-prefs-presets__desc {
    margin: 0 0 10px;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}
.iev-parent-prefs-presets__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.iev-parent-prefs-presets__btn {
    padding: 8px 14px;
    border: 1px solid #cbd5f5;
    border-radius: 10px;
    background: #fff;
    color: #4338ca;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.iev-parent-prefs-presets__btn:hover {
    background: #eef2ff;
    border-color: rgba(99,102,241,0.5);
    color: #4f46e5;
}
.iev-parent-prefs-presets__btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}

/* =====================================================================
 * 動画カード v2（共通カード：iev_render_video_card）
 *   - サムネ（YouTube hqdefault を background-image で）
 *   - 右下に動画長バッジ
 *   - 中央に ▶ オーバーレイ
 *   - 下部に audience / language チップ
 *   - 視聴済み ✓ / 進捗バー（続きから）
 *   - レイアウト: grid / rail / compact
 * ===================================================================== */
.iev-video-card-v2 {
    display: block;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.iev-video-card-v2:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.28), 0 6px 18px rgba(15, 23, 42, 0.12);
    border-color: var(--iev-accent);
}
.iev-video-card-v2:hover {
    transform: translateY(-3px);
    border-color: #cbd5f5;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
}

.iev-video-thumb-v2 {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: #0f172a;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}
.iev-video-card-v2--no-thumb .iev-video-thumb-v2 {
    background-image: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}
.iev-video-card-v2--no-thumb .iev-video-thumb-v2::before {
    content: '¥';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.22);
    font-size: 64px;
    font-weight: 900;
}

.iev-video-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 15, 0.78);
    color: #fff;
    font-size: 22px;
    border-radius: 999px;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
    pointer-events: none;
    backdrop-filter: blur(2px);
}
.iev-video-card-v2:hover .iev-video-thumb-play,
.iev-video-card-v2:focus-visible .iev-video-thumb-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    background: var(--iev-accent);
}

.iev-video-duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.iev-video-watched {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.95);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    border-radius: 999px;
    pointer-events: none;
}

.iev-video-card-v2.is-watched .iev-video-thumb-v2::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.iev-video-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.22);
    pointer-events: none;
}
.iev-video-progress-bar {
    display: block;
    height: 100%;
    background: var(--iev-accent);
    width: 0;
}

.iev-video-card-v2 .iev-video-meta {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.iev-video-card-v2 .iev-video-title-line {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.45;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.iev-video-card-v2 .iev-video-subline {
    font-size: 12px;
    color: #64748b;
}

.iev-video-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 0;
}
.iev-video-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.02em;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}
.iev-video-chip--audience {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}
.iev-video-chip--lang {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}

/* --- レール（横スクロール） --- */
.iev-video-card-v2--rail {
    flex: 0 0 240px;
    width: 240px;
}
.iev-video-card-v2--rail .iev-video-meta {
    padding: 10px 12px 12px;
}
.iev-video-card-v2--rail .iev-video-title-line {
    font-size: 13px;
    -webkit-line-clamp: 3;
}

/* --- コンパクト（横長 list 用） --- */
/* --- compact (Up Next / 視聴履歴用 行レイアウト): YouTube 風 ---
 *  左: 固定幅 168px の 16:9 サムネ
 *  右: タイトル + チップ
 *  カード装飾は最小限（背景透明・枠線無し・角丸少し）。ホバー時のみ薄いグレー背景。
 */
.iev-video-card-v2--compact {
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 10px;
    align-items: start;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 10px;
    padding: 6px;
    overflow: visible;
}
.iev-video-card-v2--compact:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
    background: #f1f5f9;
}
.iev-video-card-v2--compact:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.28);
    background: #f1f5f9;
}
.iev-video-card-v2--compact .iev-video-thumb-v2 {
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
    width: 100%;
    border-radius: 8px;
}
.iev-video-card-v2--compact .iev-video-meta {
    padding: 0;
    gap: 4px;
    min-width: 0;
}
.iev-video-card-v2--compact .iev-video-title-line {
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    -webkit-line-clamp: 2;
}
.iev-video-card-v2--compact .iev-video-subline {
    font-size: 11px;
    color: #94a3b8;
}
.iev-video-card-v2--compact .iev-video-chips {
    gap: 4px;
    margin-top: 1px;
}
.iev-video-card-v2--compact .iev-video-chip {
    font-size: 10px;
    padding: 1px 6px;
    line-height: 1.4;
}

/* --- スケルトン読み込み --- */
.iev-video-card-v2--skeleton {
    pointer-events: none;
}
.iev-video-card-v2--skeleton .iev-video-thumb-v2 {
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-size: 200% 100%;
    animation: iev-skeleton-shimmer 1.4s ease-in-out infinite;
}
.iev-video-card-v2--skeleton .iev-video-title-line,
.iev-video-card-v2--skeleton .iev-video-subline {
    background: #e2e8f0;
    color: transparent !important;
    border-radius: 4px;
    min-height: 12px;
}
@keyframes iev-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- prefers-reduced-motion 配慮 --- */
@media (prefers-reduced-motion: reduce) {
    .iev-video-card-v2,
    .iev-video-card-v2:hover,
    .iev-video-card-v2 .iev-video-thumb-play {
        transition: none;
        transform: none;
    }
    .iev-video-card-v2--skeleton .iev-video-thumb-v2 {
        animation: none;
    }
}

/* =====================================================================
 * watch.php — レイアウト v2（プレイヤー + Up Next レール）
 * ===================================================================== */
.iev-watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 24px;
    align-items: start;
}
.iev-watch-layout.is-theater {
    grid-template-columns: minmax(0, 1fr);
}
.iev-watch-layout.is-theater .iev-up-next {
    display: none;
}

.iev-watch-main {
    min-width: 0;
}
.iev-watch-title {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.35;
    color: #0f172a;
}

.iev-watch-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.18);
}
.iev-watch-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.iev-watch-layout.is-theater .iev-watch-player {
    border-radius: 0;
    max-height: calc(100vh - 160px);
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    aspect-ratio: auto;
    height: calc(100vh - 200px);
}

.iev-watch-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 0 6px;
}
.iev-watch-autonext {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid #cbd5f5;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.iev-watch-autonext input { accent-color: var(--iev-accent); }
.iev-watch-autonext:hover {
    border-color: rgba(99,102,241,0.6);
    background: #eef2ff;
    color: #4338ca;
}

.iev-watch-theater {
    padding: 6px 12px;
    border: 1px solid #cbd5f5;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.iev-watch-theater:hover {
    border-color: rgba(99,102,241,0.6);
    background: #eef2ff;
    color: #4338ca;
}
.iev-watch-theater[aria-pressed="true"] {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.iev-watch-yt-link {
    margin-left: auto;
    font-size: 13px;
}

.iev-watch-hint {
    margin: 6px 0 14px;
    color: #64748b;
    font-size: 12px;
}

.iev-watch-info {
    margin-top: 8px;
}
.iev-watch-synopsis {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
}
.iev-watch-synopsis > summary {
    cursor: pointer;
    font-weight: 800;
    color: #0f172a;
    font-size: 15px;
    padding: 4px 0;
}
.iev-watch-synopsis > summary::marker { color: #94a3b8; }
.iev-watch-synopsis .iev-synopsis-body {
    margin-top: 10px;
    color: #334155;
    line-height: 1.75;
    font-size: 14px;
}

.iev-watch-ai-cta { margin: 18px 0 0; }
.iev-watch-bottom-nav { padding-top: 8px; }

/* --- watch info cards 共通（AI 要約 / チャプター / クイズ / あらすじ） --- */
.iev-watch-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 12px;
}
.iev-watch-card > summary {
    cursor: pointer;
    list-style: none;
    font-weight: 800;
    color: #0f172a;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.iev-watch-card > summary::-webkit-details-marker { display: none; }
.iev-watch-card > summary::after {
    content: '\25BC';
    margin-left: auto;
    color: #94a3b8;
    font-size: 12px;
    transition: transform 0.2s ease;
}
.iev-watch-card[open] > summary::after { transform: rotate(180deg); }
.iev-watch-card-icon { color: var(--iev-accent); }
.iev-watch-card-tag {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 1px 7px;
    border-radius: 999px;
}

.iev-watch-summary-body {
    margin-top: 10px;
    color: #334155;
    line-height: 1.85;
    font-size: 14px;
    white-space: pre-wrap;
}

/* --- チャプターリスト --- */
.iev-watch-chapter-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.iev-watch-chapter-btn {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 8px 10px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    color: #1e293b;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.iev-watch-chapter-btn:hover {
    background: #eef2ff;
    border-color: rgba(99, 102, 241, 0.35);
    color: #4338ca;
}
.iev-watch-chapter-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.iev-watch-chapter-btn.is-active {
    background: rgba(225, 29, 72, 0.06);
    border-color: rgba(225, 29, 72, 0.3);
    color: #be123c;
}
.iev-watch-chapter-time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--iev-accent);
    min-width: 56px;
    font-size: 13px;
}
.iev-watch-chapter-label {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
}

/* --- クイズ --- */
.iev-watch-quiz-list {
    list-style: none;
    counter-reset: ievqz;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.iev-watch-quiz-item {
    counter-increment: ievqz;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fafafa;
}
.iev-watch-quiz-q {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.55;
}
.iev-watch-quiz-q::before {
    content: 'Q' counter(ievqz) '. ';
    color: var(--iev-accent);
    font-weight: 900;
}
.iev-watch-quiz-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}
.iev-watch-quiz-choice {
    text-align: left;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.iev-watch-quiz-choice:hover:not(:disabled) {
    background: #eef2ff;
    border-color: rgba(99, 102, 241, 0.4);
}
.iev-watch-quiz-choice:disabled { cursor: default; opacity: 0.85; }
.iev-watch-quiz-choice.is-correct {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #047857;
    font-weight: 800;
}
.iev-watch-quiz-choice.is-wrong {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}
.iev-watch-quiz-answer {
    margin: 6px 0 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 13px;
}
.iev-watch-quiz-answer-label {
    font-weight: 800;
    margin-right: 6px;
}
.iev-watch-quiz-reveal {
    margin-top: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5f5;
    background: #fff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.iev-watch-quiz-reveal:hover:not(:disabled) {
    background: #eef2ff;
}
.iev-watch-quiz-reveal:disabled { display: none; }
.iev-watch-quiz-item.is-revealed { background: #f8fafc; }

/* --- Up Next レール（右側パネル） --- */
.iev-up-next {
    position: sticky;
    top: 76px;
    align-self: start;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    max-height: calc(100vh - 100px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.iev-up-next-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 4px 10px;
}
.iev-up-next-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}
.iev-up-next-count {
    font-size: 12px;
    color: #64748b;
}
.iev-up-next-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    padding: 2px 2px 4px;
    scrollbar-width: thin;
}
/* Up Next 専用の微調整。基本スタイルは .iev-video-card-v2--compact に集約済み */
.iev-up-next-list .iev-video-card-v2--compact .iev-video-title-line {
    -webkit-line-clamp: 2;
}

@media (max-width: 1024px) {
    .iev-watch-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .iev-up-next {
        position: static;
        max-height: none;
    }
    .iev-up-next-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
        padding-bottom: 6px;
    }
    .iev-up-next-list .iev-video-card-v2--compact {
        flex: 0 0 260px;
        grid-template-columns: 120px 1fr;
        gap: 8px;
    }
    .iev-up-next-list .iev-video-card-v2--compact .iev-video-title-line {
        font-size: 12px;
    }
}

/* =====================================================================
 * history.php — 視聴履歴ページ
 * ===================================================================== */
.iev-history-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin: 12px 0 0;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.iev-history-tab {
    padding: 6px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.iev-history-tab:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #4338ca;
}
.iev-history-tab.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}
.iev-history-tab-count {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.15);
    padding: 1px 6px;
    border-radius: 999px;
}
.iev-history-tab.is-active .iev-history-tab-count {
    background: rgba(99, 102, 241, 0.15);
    color: #4338ca;
}

.iev-history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0 32px;
}
.iev-history-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 16px;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.iev-history-row .iev-video-card-v2 {
    box-shadow: none;
    border-radius: 10px;
}
.iev-history-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 8px 4px;
    min-width: 0;
}
.iev-history-progress-label {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    font-variant-numeric: tabular-nums;
}
.iev-history-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
}
.iev-history-badge--done {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #6ee7b7;
}
.iev-history-badge--partial {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}
.iev-history-badge--start {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.iev-history-meta {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}
.iev-history-actions {
    margin: 4px 0 0;
}
.iev-history-empty {
    text-align: center;
    padding: 36px 16px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.iev-history-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 48px;
}
.iev-history-pager-status {
    font-size: 13px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .iev-history-row {
        grid-template-columns: 1fr;
    }
    .iev-history-info {
        border-top: 1px solid #f1f5f9;
        padding-top: 12px;
    }
}

/* =====================================================================
 * search.php — 検索結果ページ + タグクラウド
 * ===================================================================== */
.iev-search-form {
    display: flex;
    gap: 8px;
    max-width: 720px;
    margin: 16px 0 0;
}
.iev-search-form__input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #0f172a;
    outline: 0;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.iev-search-form__input:focus-visible {
    border-color: var(--iev-accent);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.18);
}
.iev-search-form__btn {
    border-radius: 999px;
    padding: 10px 22px;
}

.iev-search-lang-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 14px;
    align-items: center;
}

.iev-search-lang-chip {
    display: inline-flex;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.iev-search-lang-chip:hover {
    background: #f3f4f6;
}

.iev-search-lang-chip.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.iev-search-empty {
    margin: 24px 0;
    padding: 16px;
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
}

.iev-tag-cloud {
    margin: 32px 0 8px;
}
.iev-tag-cloud__title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}
.iev-tag-cloud__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.iev-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.iev-tag-chip:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    transform: translateY(-1px);
}
.iev-tag-chip:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.iev-tag-chip-count {
    font-size: 11px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.7);
    padding: 0 6px;
    border-radius: 999px;
    font-weight: 800;
}
.iev-tag-chip--audience {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}
.iev-tag-chip--audience:hover { background: #fde68a; border-color: #fbbf24; }
.iev-tag-chip--audience .iev-tag-chip-count { color: #92400e; }
.iev-tag-chip--language {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}
.iev-tag-chip--language:hover { background: #d1fae5; border-color: #34d399; }
.iev-tag-chip--language .iev-tag-chip-count { color: #047857; }

/* =====================================================================
 * キッズモード — kids-mode.php 設定画面 + 全ページの実行時 UI
 * ===================================================================== */
.iev-kids-mode-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    margin: 16px 0;
    max-width: 720px;
}
.iev-kids-mode-card__title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}
.iev-kids-mode-card__desc {
    margin: 0 0 12px;
    font-size: 13px;
    color: #475569;
    line-height: 1.7;
}
.iev-kids-mode-pin-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.iev-kids-mode-pin-input {
    width: 120px;
    padding: 10px 16px;
    font-size: 22px;
    letter-spacing: 0.4em;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-family: 'Menlo', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
}
.iev-kids-mode-pin-input:focus-visible {
    outline: 0;
    border-color: var(--iev-accent);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.18);
}
.iev-kids-mode-pin-status,
.iev-kids-mode-start-hint {
    margin: 10px 0 0;
    font-size: 13px;
    color: #475569;
}
.iev-kids-mode-duration-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 14px;
    color: #1e293b;
}
.iev-kids-mode-duration-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}
.iev-kids-mode-duration-row input { accent-color: var(--iev-accent); }
.iev-kids-mode-actions {
    display: flex;
    gap: 10px;
    margin: 6px 0 0;
    flex-wrap: wrap;
}

/* --- 実行時: body 全体に適用 --- */
body.iev-kids-mode-on .iev-topnav,
body.iev-kids-mode-on .iev-topbar-center,
body.iev-kids-mode-on .iev-topbar-right,
body.iev-kids-mode-on .iev-footer,
body.iev-kids-mode-on .iev-watch-toolbar,
body.iev-kids-mode-on .iev-watch-ai-cta,
body.iev-kids-mode-on .iev-watch-bottom-nav,
body.iev-kids-mode-on .iev-watch-info {
    display: none !important;
}
body.iev-kids-mode-on .iev-up-next {
    display: none !important;
}
body.iev-kids-mode-on .iev-topbar {
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
}
body.iev-kids-mode-on .iev-topbar-left,
body.iev-kids-mode-on .iev-logo {
    color: #fff;
}
body.iev-kids-mode-on .iev-watch-layout {
    grid-template-columns: minmax(0, 1fr);
}

.iev-kids-mode-bar {
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: #fff;
    border: 2px solid #db2777;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
    font-size: 13px;
    font-weight: 800;
}
.iev-kids-mode-bar__label {
    color: #db2777;
}
.iev-kids-mode-bar__remain {
    color: #1e293b;
    font-variant-numeric: tabular-nums;
    font-family: 'Menlo', 'Courier New', monospace;
    background: #fdf2f8;
    padding: 2px 8px;
    border-radius: 999px;
}
.iev-kids-mode-bar__exit {
    padding: 4px 10px;
    border: 1px solid #cbd5f5;
    border-radius: 999px;
    background: #fff;
    color: #4338ca;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}
.iev-kids-mode-bar__exit:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
}

.iev-kids-mode-break {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.iev-kids-mode-break__panel {
    background: #fff;
    border-radius: 24px;
    padding: 32px 28px;
    text-align: center;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.iev-kids-mode-break__emoji {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 14px;
}
.iev-kids-mode-break__panel h2 {
    margin: 0 0 10px;
    font-size: 22px;
    color: #0f172a;
}
.iev-kids-mode-break__panel p {
    margin: 0 0 18px;
    color: #475569;
    font-size: 14px;
    line-height: 1.8;
}

/* =====================================================================
 * モバイルミニプレイヤー（watch.php のスクロール時に右下にピン留め）
 * + Shorts 風スワイプヒント
 * ===================================================================== */
.iev-mini-sentinel {
    height: 1px;
    margin: 0;
    pointer-events: none;
}
.iev-mini-close,
.iev-mini-expand {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 15, 15, 0.78);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 5;
}
.iev-mini-close {
    top: 4px;
    right: 4px;
}
.iev-mini-expand {
    top: 4px;
    left: 4px;
}
.iev-watch-player.is-mini .iev-mini-close,
.iev-watch-player.is-mini .iev-mini-expand {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 720px) {
    .iev-watch-player.is-mini {
        position: fixed;
        bottom: 16px;
        right: 12px;
        width: 240px;
        aspect-ratio: 16 / 9;
        max-height: 145px;
        z-index: 9985;
        border-radius: 10px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
        animation: iev-mini-slide-in 0.22s ease;
    }
    .iev-watch-player.is-mini iframe {
        border-radius: 10px;
    }
    @keyframes iev-mini-slide-in {
        from { transform: translateY(20px); opacity: 0; }
        to   { transform: translateY(0); opacity: 1; }
    }
    body.iev-has-mini-player .iev-up-next {
        margin-bottom: 180px;
    }
}

/* Shorts ヒント（上スワイプで次へ）— モバイルだけ控えめに表示 */
@media (max-width: 720px) {
    .iev-watch-main::after {
        content: '上にスワイプで次の動画へ';
        display: block;
        text-align: center;
        font-size: 11px;
        color: #94a3b8;
        padding: 8px 12px;
        background: rgba(99, 102, 241, 0.04);
        border: 1px dashed rgba(99, 102, 241, 0.2);
        border-radius: 999px;
        margin: 8px 12px 0;
    }
}

/* reduced-motion 配慮 */
@media (prefers-reduced-motion: reduce) {
    .iev-watch-player.is-mini {
        animation: none;
    }
}
