/* YouTube用ポップテロップメーカー — ページ固有のスタイル。配色は /assets/css/base.css の変数を使う。 */

/* Web フォントが届くまでの代役：端末に入っている極太ゴシックを「太さ 400」として使えるようにする */
@font-face {
    font-family: 'TAM Heavy';
    font-weight: 400;
    src: local('HiraginoSans-W8'), local('Hiragino Sans W8'), local('HiraKakuStdN-W8'), local('NotoSansJP-Black'),
        local('Noto Sans JP Black'), local('Noto Sans CJK JP Black'), local('YuGothic-Bold'), local('Yu Gothic Bold'), local('Meiryo-Bold');
}

.tam {
    --tam-ink: #14161d;
    --tam-line: #e3eaef;
    --tam-soft: #f4f9fc;
    padding-bottom: 56px;
}
.tam [hidden] { display: none !important; }
.tam-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}
.tam button, .tam select, .tam textarea, .tam input { font-family: inherit; }
.tam :focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}
.nb { display: inline-block; }

/* ---------- 見出し ---------- */
.tam-intro { padding-top: 26px; padding-bottom: 14px; }
.tam-intro h1 {
    font-size: clamp(23px, 4.4vw, 38px);
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: .02em;
}
.tam-intro p {
    margin-top: 10px;
    max-width: 46em;
    color: var(--text-sub);
    font-size: 15px;
    line-height: 1.9;
}
.tam-intro .tam-mark { background: linear-gradient(transparent 70%, var(--accent-yellow) 70%); }
.tam-intro-video {
    display: block;
    width: 100%;
    max-width: 322px;
    height: auto;
    margin: 16px auto 0;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
}

/* ---------- 全体の並び（スマホ：入力 → プレビュー → 演出 → 保存 → 詳細） ---------- */
.tam-app {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}
.tam-card {
    background: #fff;
    border: 1px solid var(--tam-line);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
    padding: 18px 16px;
}
.tam-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.4;
}
.tam .step {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-yellow);
    font-size: 15px;
    font-weight: 800;
}

/* ---------- 1. 入力 ---------- */
.tam-textarea {
    display: block;
    width: 100%;
    min-height: 76px;
    padding: 12px 14px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    background: #fcfcfc;
    color: var(--text-main);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.5;
    resize: vertical;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.tam-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--input-focus-ring);
    background: #fff;
}
.tam-text-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.tam-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--tam-line);
    border-radius: 999px;
    background: #fff;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, border-color .15s, background .15s;
}
.tam-chip-btn:active { transform: scale(.95); }
.tam-chip-btn i { color: var(--primary-color); }
.tam-count {
    margin-left: auto;
    color: var(--text-sub);
    font-size: 12px;
}
.tam-count.long { color: #b7791f; font-weight: 700; }
.tam-note {
    margin-top: 8px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.7;
}
.tam code {
    padding: 1px 5px;
    border-radius: 5px;
    background: #eef3f6;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .92em;
}

/* ---------- プレビュー（スクロールしても上に残る） ---------- */
.tam-stage {
    position: sticky;
    top: 62px;
    z-index: 30;
    margin: 0 -8px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 26px rgba(30, 41, 59, .12);
}
.tam-screen-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: var(--tam-ink);
}
.tam-screen {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #00ff00;
    cursor: pointer;
}
/* 効果音のオン・オフ（プレビューの右上） */
.tam-sound {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(20, 22, 29, .72);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: transform .15s, background .15s;
}
.tam-sound:active { transform: scale(.92); }
.tam-sound[aria-pressed="false"] { background: rgba(20, 22, 29, .5); color: rgba(255, 255, 255, .75); }
.tam-sound.pulse { animation: tam-sound-pulse .45s ease-out; }
@keyframes tam-sound-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 212, 0, .9); } 100% { box-shadow: 0 0 0 12px rgba(255, 212, 0, 0); } }

/* 見出し下の「ウリ」 */
.tam-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}
.tam-points li {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 260px;
    max-width: 420px;
    padding: 10px 14px;
    border: 1.5px solid var(--tam-line);
    border-radius: 14px;
    background: #fff;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.5;
}
.tam-points li i { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px; background: #fff4c2; color: #b07a00; font-size: 15px; }
.tam-points li strong { display: block; color: var(--text-main, #222); font-size: 14px; }
.tam-sfx { margin: 4px 0 10px; }
.tam-sfx small { display: block; color: var(--text-sub); font-size: 11px; font-weight: 500; }

.tam-screen[data-bg="alpha"] {
    background: repeating-conic-gradient(#3b3f4b 0 25%, #2a2d37 0 50%) 0 0 / 22px 22px;
}
.tam-screen canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.tam-screen-msg {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: var(--tam-ink);
    color: #fff;
    font-size: 14px;
    line-height: 1.8;
    text-align: center;
}
.tam-export {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(20, 22, 29, .9);
    color: #fff;
    text-align: center;
}
.tam-export strong { font-size: 14px; }
.tam-export progress {
    width: min(78%, 360px);
    height: 10px;
    accent-color: var(--primary-color);
}
.tam-cancel {
    min-height: 36px;
    padding: 0 16px;
    border: 1.5px solid rgba(255, 255, 255, .6);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.loading-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
}
.loading-bars span {
    width: 4px;
    height: 34px;
    border-radius: 999px;
    background: var(--primary-color);
    animation: tam-wave .9s ease-in-out infinite;
}
.loading-bars span:nth-child(2) { background: var(--accent-pink); animation-delay: -.8s; }
.loading-bars span:nth-child(3) { background: var(--accent-yellow); animation-delay: -.7s; }
.loading-bars span:nth-child(4) { background: var(--accent-pink); animation-delay: -.6s; }
.loading-bars span:nth-child(5) { animation-delay: -.5s; }
@keyframes tam-wave {
    0%, 40%, 100% { transform: scaleY(.08); }
    20% { transform: scaleY(1); }
}

.tam-time {
    height: 4px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6edf1;
}
.tam-time span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-color), #5fd4ff);
}
.tam-transport {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.tam-replay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--tam-ink);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s;
}
.tam-replay:active { transform: scale(.93); }
.tam-replay i { font-size: 13px; }
.tam-replay span { display: none; }
.tam-time-label {
    display: none;
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--text-sub);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* ---------- 切り替えボタン（サイズ・背景・形式など） ---------- */
.tam-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tam-seg button, .tam-seg .tam-color-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--tam-line);
    border-radius: 999px;
    background: #fff;
    color: #445;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .15s, background .15s, border-color .15s, color .15s;
}
.tam-seg button small {
    color: #8a96a3;
    font-size: 11px;
    font-weight: 500;
}
.tam-seg button:active { transform: scale(.95); }
.tam-seg button[aria-pressed="true"], .tam-seg .tam-color-chip[data-on="true"] {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}
.tam-seg button[aria-pressed="true"] small { color: rgba(255, 255, 255, .85); }
.tam-seg.sm button { min-height: 36px; min-width: 56px; }
.tam-sizes { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
.tam-sizes button {
    flex: 1 1 0;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    min-height: 44px;
    padding: 0 2px;
    font-size: 12px;
    white-space: nowrap;
}
.tam-sizes button small { font-size: 10px; }
.tam-dot {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(0, 0, 0, .18);
    border-radius: 50%;
}
.tam-dot.alpha { background: repeating-conic-gradient(#b9c0c9 0 25%, #fff 0 50%) 0 0 / 8px 8px; }
.tam-color-chip { position: relative; overflow: hidden; }
.tam-color-chip input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ---------- 2. 演出プリセット（グループ → プリセットのツリー） ---------- */
.tam-search {
    display: block;
    width: 100%;
    min-height: 42px;
    margin-bottom: 10px;
    padding: 0 12px;
    border: 1.5px solid var(--tam-line);
    border-radius: 10px;
    background: #fff;
    color: var(--text-main);
    font-size: 16px;
}
.tam-search:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}
.tam-tree-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: 8px;
    color: var(--text-sub);
    font-size: 13px;
}
.tam-tree-tools span { flex: 1 1 150px; overflow-wrap: anywhere; }
.tam-tree-tools .tam-link { min-height: 36px; }
.tam-tree-tools .tam-link:disabled { color: var(--text-sub); opacity: .5; text-decoration: none; cursor: default; }
.tam-tree-tools-bottom { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--tam-line); }
.tam-tree { padding-bottom: 6px; }
.tam-group + .tam-group { border-top: 1px solid var(--tam-line); }
.tam-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}
.tam-group-head i {
    width: 12px;
    color: var(--text-sub);
    font-size: 13px;
    text-align: center;
    transition: transform .15s;
}
.tam-group-head[aria-expanded="true"] i { transform: rotate(90deg); }
.tam-group-count {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--tam-soft);
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 700;
}
.tam-group-list { padding: 0 0 8px 28px; }
.tam-preset {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
    padding: 5px 5px 5px 10px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    background: none;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}
/* 枝の線：├ は上半分（L字）＋下半分（縦線）、最後の行は L字だけで └ にする */
.tam-preset::before, .tam-preset::after {
    content: '';
    position: absolute;
    left: -19px;
    border-left: 2px solid var(--tam-line);
    pointer-events: none;
}
.tam-preset::before {
    top: -6px;
    bottom: 50%;
    width: 14px;
    border-bottom: 2px solid var(--tam-line);
    border-bottom-left-radius: 6px;
}
.tam-preset::after { top: 50%; bottom: -2px; }
.tam-preset[data-last]::after { display: none; }
.tam-preset-text { flex: 1 1 auto; min-width: 0; }
.tam-preset canvas {
    display: block;
    flex: 0 0 auto;
    width: 104px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    background: #1b1e27;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}
.tam-preset strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}
.tam-preset small {
    display: block;
    margin-top: 2px;
    color: var(--text-sub);
    font-size: 11px;
    line-height: 1.35;
}
.tam-preset[aria-pressed="true"] {
    border-color: var(--primary-color);
    background: var(--tam-soft);
}
.tam-preset[aria-pressed="true"] strong { color: #0081b2; }
.tam-preset[aria-pressed="true"] strong::before { content: '✓ '; }
.tam-tree-empty {
    margin: 4px 0 12px;
    color: var(--text-sub);
    font-size: 13px;
}
.tam-colors {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--tam-line);
}
.tam-colors-label, .tam-field-label {
    flex: 0 0 auto;
    min-width: 2.6em;
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 700;
}
.tam-swatches {
    display: flex;
    gap: 7px;
    min-width: 0;
    margin: -4px 0;
    padding: 4px 3px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tam-swatches::-webkit-scrollbar { display: none; }
.tam-swatches button {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1.5px var(--tam-line);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.tam-swatches button:active { transform: scale(.9); }
.tam-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--text-main); }
.tam-swatches .tam-custom-color {
    background: conic-gradient(#ff3b30, #ff9500, #ffcc00, #34c759, #00c7be, #007aff, #af52de, #ff3b30);
}
.tam-swatches .auto {
    display: grid;
    place-items: center;
    width: auto;
    min-width: 52px;
    padding: 0 10px;
    border-radius: 999px;
    background: #fff;
    color: #445;
    font-size: 12px;
    font-weight: 800;
}

/* ---------- 3. 保存 ---------- */
.tam-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.tam-field-label { padding-top: 11px; }
.tam-hint {
    margin: 2px 0 12px;
    color: var(--text-sub);
    font-size: 12.5px;
    line-height: 1.75;
}
.tam-hint.warn {
    padding: 9px 12px;
    border: 1px solid #fbd38d;
    border-radius: 10px;
    background: #fffaf0;
    color: #975a16;
}
.tam-hint.warn button {
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: #007ea9;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.tam-save-row {
    display: grid;
    gap: 10px;
}
.tam .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    font-size: 14px;
}
.tam .btn:hover { transform: translateY(-1px); }
.tam .btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.tam .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.tam .tam-save {
    width: 100%;
    min-height: 58px;
    font-size: 17px;
    box-shadow: 0 10px 22px rgba(0, 174, 239, .3);
}
.tam .tam-save-png { width: 100%; }
.tam-privacy {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #eefbf5;
    color: #167153;
    font-size: 12.5px;
    line-height: 1.6;
}
.tam-alert {
    margin-top: 12px;
    padding: 11px 14px;
    border: 1px solid #feb2b2;
    border-radius: 10px;
    background: #fff5f5;
    color: #c53030;
    font-size: 13px;
    line-height: 1.7;
}
.tam-result {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #b2f5ea;
    border-radius: 12px;
    background: #e6fffa;
    color: #2c7a7b;
}
.tam-result-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
}
.tam-result-meta {
    margin-top: 4px;
    font-size: 12px;
    overflow-wrap: anywhere;
}
.tam-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.tam-result-tip {
    margin-top: 10px;
    color: #285e61;
    font-size: 12.5px;
    line-height: 1.75;
}

/* ---------- 詳細設定 ---------- */
.tam-details { padding: 0; }
.tam-details summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}
.tam-details summary::-webkit-details-marker { display: none; }
.tam-details summary span {
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 500;
}
.tam-details summary::after {
    content: '';
    width: 9px;
    height: 9px;
    margin-left: auto;
    border-right: 2.5px solid #8a96a3;
    border-bottom: 2.5px solid #8a96a3;
    transform: rotate(-45deg);
    transition: transform .2s;
}
.tam-details[open] summary::after { transform: rotate(45deg); }
.tam-details-body { padding: 0 16px 18px; }
.tam-details fieldset {
    margin: 0 0 14px;
    padding: 12px 14px 14px;
    border: 0;
    border-radius: 12px;
    background: var(--tam-soft);
}
.tam-details legend {
    float: left;
    width: 100%;
    margin-bottom: 8px;
    padding: 0;
    font-size: 13px;
    font-weight: 800;
}
.tam-details legend + * { clear: both; }
.tam-row {
    display: grid;
    grid-template-columns: 6.4em minmax(0, 1fr) 3.6em;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    font-size: 13px;
}
.tam-row > label, .tam-row-label { font-weight: 700; }
.tam-row output {
    color: var(--text-sub);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.tam-row select {
    grid-column: 2 / -1;
    min-height: 40px;
    padding: 0 10px;
    border: 1.5px solid var(--input-border);
    border-radius: 10px;
    background: #fff;
}
.tam-row .tam-seg { grid-column: 2 / -1; }
.tam-row input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
}
.tam-row.colors {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}
.tam-row.colors label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}
.tam-row.colors input[type="color"] {
    width: 38px;
    height: 38px;
    padding: 2px;
    border: 1.5px solid var(--input-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.tam-link {
    padding: 0;
    border: 0;
    background: none;
    color: #007ea9;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}
.tam-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.tam-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

/* ---------- 説明コンテンツ ---------- */
.tam-doc {
    max-width: 860px;
    margin-top: 46px;
}
.tam-doc section { margin-bottom: 38px; }
.tam-doc h2 {
    margin-bottom: 14px;
    font-size: clamp(19px, 3vw, 23px);
    font-weight: 800;
    line-height: 1.5;
}
.tam-doc h3 {
    margin: 22px 0 10px;
    font-size: 16px;
    font-weight: 800;
}
.tam-doc p {
    color: #444;
    font-size: 15px;
    line-height: 2;
}
.tam-doc p + p { margin-top: 10px; }
.tam-doc .tam-small { color: var(--text-sub); font-size: 13px; }
.tam-related { margin-bottom: 38px; }
.tam-related .image-movie-links {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}
.tam-steps {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: tam-step;
}
.tam-steps li {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    background: var(--tam-soft);
    counter-increment: tam-step;
}
.tam-steps li::before {
    content: counter(tam-step);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-yellow);
    font-weight: 800;
}
.tam-steps strong { font-size: 15px; }
.tam-steps p { margin-top: 2px; font-size: 13.5px; line-height: 1.8; }
.tam-bullets {
    margin: 12px 0;
    padding-left: 1.3em;
    list-style: disc;
    color: #444;
    font-size: 14.5px;
    line-height: 2;
}
.tam-table-wrap {
    margin-top: 14px;
    overflow-x: auto;
    border: 1px solid var(--tam-line);
    border-radius: 14px;
}
.tam-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 13.5px;
    line-height: 1.75;
}
.tam-table th, .tam-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--tam-line);
    text-align: left;
    vertical-align: top;
}
.tam-table thead th { background: var(--tam-soft); font-size: 12.5px; }
.tam-table tbody th { white-space: nowrap; }
.tam-table tbody tr:last-child th, .tam-table tbody tr:last-child td { border-bottom: 0; }
.tam-table small { color: var(--text-sub); font-weight: 500; }

.faq-list {
    overflow: hidden;
    border: 1px solid #eee;
    border-radius: 16px;
}
.faq-list details { border-bottom: 1px solid #eee; }
.faq-list details:last-child { border: 0; }
.faq-list summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before {
    content: 'Q';
    color: var(--primary-color);
    font-size: 18px;
}
.faq-list summary::after {
    content: '+';
    margin-left: auto;
    color: #666;
    font-size: 20px;
}
.faq-list details[open] { background: var(--bg-light); }
.faq-list details[open] summary::after { content: '−'; }
.faq-list p {
    margin: 0 20px 20px 46px;
    color: #666;
    font-size: 13px;
    line-height: 1.9;
}
.tam-related {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
    margin-top: 28px;
    color: #007ea9;
    font-size: 13px;
}
.tam-related a { text-decoration: underline; }

/* ---------- 画面の高さが足りないときは、プレビューを固定しない ---------- */
@media (max-height: 560px) {
    .tam-stage { position: static; }
}

/* ---------- タブレット以上 ---------- */
@media (min-width: 620px) {
    .tam-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tam-steps li { flex-direction: column; gap: 8px; }
}

/* ---------- PC：左に設定、右に大きなプレビュー ---------- */
@media (min-width: 980px) {
    .tam-intro {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
        gap: 32px;
        align-items: center;
        padding-top: 34px;
        padding-bottom: 20px;
    }
    .tam-intro-video { max-width: none; margin: 0; }
    .tam-app {
        grid-template-columns: minmax(0, 452px) minmax(0, 1fr);
        gap: 18px 26px;
        align-items: start;
    }
    .tam-app > .tam-card { grid-column: 1; }
    .tam-stage {
        grid-column: 2;
        grid-row: 1 / span 4;
        top: 98px;
        margin: 0;
        padding: 12px;
        border: 1px solid var(--tam-line);
        box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
    }
    .tam-card { padding: 20px; }
    .tam-tree {
        margin: 0 -8px;
        padding: 0 8px 6px;
    }
    .tam-preset canvas { width: 116px; }
    .tam-transport { gap: 8px; margin-top: 10px; }
    .tam-sizes button { font-size: 13px; }
    .tam-sizes button small { font-size: 11px; }
    .tam-time-label { display: block; }
    .tam-swatches { gap: 6px; flex-wrap: wrap; overflow: visible; }
    .tam-swatches button { width: 32px; height: 32px; }
    .tam-swatches .auto { min-width: 50px; }
    .tam-details-body { padding: 0 20px 20px; }
    .tam-details summary { padding: 18px 20px; }
}

/* ---------- 右の列に余裕があるときだけ、再生ボタンに文字を出す（サイズのボタンは残りの幅を分け合う） ---------- */
@media (min-width: 1100px) {
    .tam-replay { width: auto; height: 44px; padding: 0 18px; }
    .tam-replay span { display: inline; }
    .tam-replay i { font-size: 11px; }
}

@media (hover: hover) {
    .tam-chip-btn:hover, .tam-seg button:hover { border-color: var(--primary-color); }
    .tam-seg button[aria-pressed="true"]:hover { border-color: var(--primary-hover); }
    .tam-group-head:hover, .tam-group-head:hover i { color: #0081b2; }
    .tam-preset:hover { border-color: #9fdcf5; }
    .tam-preset[aria-pressed="true"]:hover { border-color: var(--primary-color); }
    .tam-swatches button:hover { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .loading-bars span { animation-duration: 2.4s; }
    .tam *, .tam *::after { transition: none !important; }
}
