/* ================================================================
   LOGOGUIDE — editor styles
   フォントは ../common/fonts/ を self-host（外部CDN不使用）
   ================================================================ */

:root {
    --ink: #101014;
    --ink2: #17171d;
    --ink3: #1f1f27;
    --line: #2b2b36;
    --line2: #3a3a48;
    --txt: #f2f2f5;
    --dim: #8f8fa3;
    --dim2: #5f5f72;
    --acc: #e8ff47;         /* シグネチャの蛍光イエロー */
    --acc-ink: #16160a;
    --danger: #ff5470;
    --r-lg: 18px;
    --r-md: 12px;
    --r-sm: 8px;
    --sans: 'Inter', 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic', sans-serif;
    --disp: 'Fraunces', 'Zen Kaku Gothic New', serif;
    --mono: 'JetBrains Mono', 'Menlo', monospace;
    /* iOS 26 の Safari は固定要素の入れ物が下のツールバーの裏まで伸びることがある。その差だけ下端を上げる（PC・古いiOSでは0） */
    --tb: max(0px, calc(100% - 100svh));
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--ink);
    color: var(--txt);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}
button { font-family: inherit; }
.mono { font-family: var(--mono); }

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

/* ================= HERO ================= */

.lp-root { background: var(--ink); }

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-gl {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.hero-bg.gl-on .hero-gl { opacity: 1; }
.hero-bg.gl-on .hero-orb { display: none; }
.hero-3d {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.hero-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
}
.orb-a {
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(232,255,71,.22), transparent 65%);
    top: -160px; right: -120px;
    animation: orbFloat 14s ease-in-out infinite alternate;
}
.orb-b {
    width: 560px; height: 560px;
    background: radial-gradient(circle, rgba(90,110,255,.18), transparent 65%);
    bottom: -220px; left: -160px;
    animation: orbFloat 18s ease-in-out infinite alternate-reverse;
}
@keyframes orbFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-40px, 40px) scale(1.12); }
}

.hero-head {
    position: relative;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 26px 34px;
}
.wordmark {
    font-family: var(--disp);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: .04em;
}
.wordmark-dot { color: var(--acc); }
.hero-head-tag {
    font-size: 10px;
    letter-spacing: .32em;
    color: var(--dim);
}

.hero-main {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 24px 40px;
    gap: 26px;
    isolation: isolate;
}
/* 漂うカードやシェーダーの上でも文字が読めるよう、本文の後ろだけ暗く沈める */
.hero-main::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(1000px, 130vw);
    height: 112%;
    transform: translate(-50%, -50%);
    background: radial-gradient(closest-side, rgba(16,16,20,.9) 40%, rgba(16,16,20,.6) 70%, rgba(16,16,20,0));
    z-index: -1;
    pointer-events: none;
}
.hero-title {
    margin: 0;
    font-family: var(--disp);
    font-weight: 600;
    font-size: clamp(34px, 5.6vw, 68px);
    line-height: 1.28;
    letter-spacing: .01em;
}
.hero-line { display: block; }
.hero-title em {
    font-style: normal;
    color: var(--acc);
    position: relative;
}
.hero-lead {
    margin: 0;
    max-width: 620px;
    color: #c2c2cf;
    font-size: 15.5px;
    line-height: 2;
}

.dropzone {
    position: relative;
    width: min(640px, calc(100vw - 48px));
    border-radius: var(--r-lg);
    border: 1.5px dashed var(--line2);
    background: linear-gradient(180deg, rgba(28,28,36,.82), rgba(20,20,26,.78));
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: border-color .25s, background .25s, transform .25s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
    border-color: var(--acc);
    background: linear-gradient(180deg, rgba(232,255,71,.06), rgba(232,255,71,.02));
    transform: translateY(-2px);
    outline: none;
}
.dz-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 44px 24px 34px;
}
.dz-icon {
    width: 34px; height: 34px;
    color: var(--acc);
    margin-bottom: 4px;
}
.dropzone.dragover .dz-icon { animation: dzBounce .5s ease infinite alternate; }
@keyframes dzBounce { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.dz-text { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.dz-sub { font-size: 12.5px; color: #b4b4c4; }
.dz-note {
    margin-top: 12px;
    font-size: 10.5px;
    letter-spacing: .24em;
    color: var(--dim);
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn-ghost {
    background: rgba(16,16,20,.7);
    border: 1px solid var(--line2);
    color: #d2d2dc;
    border-radius: 999px;
    padding: 11px 22px;
    font-size: 13px;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}
.btn-ghost:hover { color: var(--txt); border-color: var(--dim); }

.hero-scrollcue {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 9px;
    letter-spacing: .34em;
    color: var(--dim2);
}
.cue-line {
    width: 1px;
    height: 34px;
    background: linear-gradient(180deg, var(--dim2), transparent);
    animation: cueDrop 1.8s ease-in-out infinite;
}
@keyframes cueDrop {
    0% { transform: scaleY(0); transform-origin: top; }
    45% { transform: scaleY(1); transform-origin: top; }
    55% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

.site-foot {
    position: relative;
    text-align: center;
    padding: 44px 20px 40px;
    border-top: 1px solid var(--line);
}
.sf-tag {
    font-size: 9.5px;
    letter-spacing: .3em;
    color: var(--dim2);
    margin-bottom: 18px;
}
.sf-links {
    font-size: 12px;
    line-height: 2.2;
    color: var(--dim);
}
.sf-links a {
    color: var(--txt);
    text-decoration: none;
    border-bottom: 1px solid var(--line2);
    transition: color .2s, border-color .2s;
}
.sf-links a:hover { color: var(--acc); border-bottom-color: var(--acc); }

/* ================= LPセクション ================= */

.lp-sec {
    position: relative;
    max-width: 1060px;
    margin: 0 auto;
    padding: 110px 28px 40px;
}
.lp-label {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 10px;
    letter-spacing: .3em;
    color: var(--dim2);
    margin-bottom: 26px;
}
.lp-label b { color: var(--acc); font-weight: 700; }
.lp-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}
.lp-h2 {
    font-family: var(--disp);
    font-weight: 600;
    font-size: clamp(26px, 3.6vw, 42px);
    line-height: 1.5;
    letter-spacing: .01em;
    margin: 0 0 18px;
}
.lp-lead {
    color: var(--dim);
    font-size: 14px;
    line-height: 2;
    margin: 0 0 34px;
    max-width: 620px;
}

/* 特徴カード */
.lp-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-top: 40px;
}
.lp-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012));
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 26px 24px 28px;
    transition: transform .25s ease-out, border-color .3s;
    overflow: hidden;
}
.lp-card:hover { transform: translateY(-4px); border-color: var(--line2); }
/* カーソル追従スポットライト（--px/--pyはJSが更新） */
.lp-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(240px circle at var(--px, 50%) var(--py, 50%), rgba(232,255,71,.09), transparent 65%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.lp-card:hover::after { opacity: 1; }
.lp-card-num {
    font-size: 10px;
    letter-spacing: .2em;
    color: var(--acc);
    margin-bottom: 16px;
}
.lp-card h3 { margin: 0 0 10px; font-size: 16px; letter-spacing: .02em; }
.lp-card p { margin: 0; font-size: 12.5px; line-height: 2; color: var(--dim); }

/* 使い方 */
.lp-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 40px;
    counter-reset: step;
}
.lp-step {
    border-top: 1px solid var(--line2);
    padding: 22px 4px 0;
}
.lp-step-num {
    font-size: 10px;
    letter-spacing: .24em;
    color: var(--acc);
    margin-bottom: 14px;
}
.lp-step h3 { margin: 0 0 10px; font-size: 17px; }
.lp-step p { margin: 0; font-size: 12.5px; line-height: 2; color: var(--dim); }

/* 収録ページ */
/* 収録ページ：デモ用ロゴから生成した実ページの縮小画像 */
.lp-pages {
    list-style: none;
    margin: 34px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px 16px;
}
.lp-pages li { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lp-pages img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 14px 30px -14px rgba(0,0,0,.7);
    transition: transform .3s;
}
.lp-pages li:hover img { transform: translateY(-3px); }
.lp-page-cap { display: flex; align-items: baseline; gap: 10px; font-size: 13px; line-height: 1.6; color: var(--txt); }
.lp-page-cap .mono { font-size: 10px; color: var(--acc); letter-spacing: .1em; }

.lp-h3 {
    font-family: var(--disp);
    font-weight: 600;
    font-size: clamp(20px, 2.4vw, 26px);
    line-height: 1.5;
    margin: 80px 0 14px;
}
/* テーマ見本：書き出したHTMLの実物を埋め込み、タブで切り替える */
.lp-theme-demo {
    container-type: inline-size;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: rgba(255,255,255,.02);
    overflow: hidden;
}
.lp-theme-tabs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border-bottom: 1px solid var(--line);
}
.lp-theme-tabs button {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    padding: 14px 16px;
    background: none;
    border: none;
    border-right: 1px solid var(--line);
    color: var(--dim);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s, color .2s;
}
.lp-theme-tabs button:last-child { border-right: none; }
.lp-theme-tabs button:hover { background: rgba(255,255,255,.03); color: var(--txt); }
.lp-theme-tabs button.active { background: rgba(232,255,71,.07); color: var(--txt); box-shadow: inset 0 -2px 0 var(--acc); }
.lp-theme-tabs b { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.lp-theme-tabs b i { font-style: normal; font-family: var(--sans); font-size: 9.5px; letter-spacing: .04em; color: var(--acc-ink); background: var(--acc); padding: 1px 6px; border-radius: 999px; }
.lp-theme-tabs span { font-size: 11.5px; line-height: 1.5; }
/* 見本のビューアは「幅1340・高さ720＋操作部90」に合わせて縮むので、高さもそれに合わせる */
.lp-theme-frame { position: relative; height: calc(100cqw * 720 / 1340 + 90px); background: #101014; }
.lp-theme-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 900px) {
    .lp-pages { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
    .lp-theme-tabs { grid-template-columns: repeat(3, 1fr); }
    .lp-theme-tabs button { padding: 11px 12px; border-bottom: 1px solid var(--line); }
    .lp-theme-tabs button:nth-child(3n) { border-right: none; }
    .lp-theme-tabs button:nth-child(n+4) { border-bottom: none; }
    .lp-theme-tabs span { display: none; }
    .lp-page-cap { font-size: 12px; gap: 8px; }
}

/* 場面 */
.lp-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 40px;
}
.lp-case {
    border-left: 2px solid var(--acc);
    padding: 6px 0 6px 22px;
}
.lp-case h3 { margin: 0 0 10px; font-size: 15.5px; }
.lp-case p { margin: 0; font-size: 12.5px; line-height: 2; color: var(--dim); }

/* FAQ */
.lp-faq { margin-top: 34px; display: flex; flex-direction: column; gap: 10px; }
.lp-faq details {
    background: rgba(255,255,255,.02);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color .3s;
}
.lp-faq details[open] { border-color: var(--line2); }
.lp-faq summary {
    cursor: pointer;
    padding: 17px 46px 17px 20px;
    font-size: 13.5px;
    font-weight: 600;
    list-style: none;
    position: relative;
    user-select: none;
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--acc);
    font-size: 17px;
    font-weight: 400;
    transition: transform .3s;
}
.lp-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.lp-faq details p {
    margin: 0;
    padding: 0 20px 18px;
    font-size: 12.5px;
    line-height: 2;
    color: var(--dim);
}

/* CTA */
.lp-cta {
    text-align: center;
    padding-top: 130px;
    padding-bottom: 120px;
}
.btn-cta {
    margin-top: 14px;
    background: var(--acc);
    color: var(--acc-ink);
    border: none;
    border-radius: 999px;
    padding: 17px 46px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(232,255,71,.22);
    transition: transform .2s, box-shadow .3s;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 0 60px rgba(232,255,71,.4); }

/* スクロールリビール */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.3,1); }
.rv.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .rv { opacity: 1; transform: none; transition: none; }
    .cue-line { animation: none; }
    .hero-orb { animation: none; }
}

/* ================= 生成演出 ================= */

.gen-overlay {
    position: fixed; inset: 0;
    background: var(--ink);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gen-overlay[hidden] { display: none; }
.gen-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
.gen-logo-wrap {
    position: relative;
    width: 220px; height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gen-logo {
    max-width: 78%;
    max-height: 78%;
    filter: drop-shadow(0 8px 30px rgba(0,0,0,.5));
    animation: genLogoIn .55s cubic-bezier(.2,.9,.25,1.2) both;
}
@keyframes genLogoIn {
    from { transform: scale(.6); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.gen-frame {
    position: absolute; inset: 0;
    border: 1px solid var(--line2);
    border-radius: var(--r-lg);
}
.gen-frame::before, .gen-frame::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border: 2px solid var(--acc);
}
.gen-frame::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.gen-frame::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.gen-scanline {
    position: absolute;
    left: 8px; right: 8px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--acc), transparent);
    box-shadow: 0 0 18px rgba(232,255,71,.65);
    animation: genScan 1.1s ease-in-out infinite alternate;
}
@keyframes genScan {
    from { top: 12%; }
    to   { top: 88%; }
}
.gen-chips {
    display: flex;
    gap: 10px;
    min-height: 46px;
}
.gen-chip {
    width: 46px; height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.14);
    animation: chipPop .45s cubic-bezier(.2,1.1,.3,1.3) both;
}
@keyframes chipPop {
    from { transform: translateY(18px) scale(.4); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.gen-status {
    font-size: 10px;
    letter-spacing: .34em;
    color: var(--dim);
    min-height: 14px;
}

/* ================= エディタ全体 ================= */

.editor {
    height: 100svh;
    display: flex;
    flex-direction: column;
}
.editor[hidden] { display: none; }

.ed-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    height: 56px;
    border-bottom: 1px solid var(--line);
    background: var(--ink2);
    flex-shrink: 0;
}
.ed-back {
    background: none;
    border: none;
    color: var(--dim);
    width: 34px; height: 34px;
    border-radius: var(--r-sm);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.ed-back:hover { color: var(--txt); background: var(--ink3); }
.ed-back svg { width: 18px; height: 18px; }
.ed-brandmark {
    font-family: var(--disp);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .04em;
}
.ed-project {
    font-size: 10.5px;
    color: var(--dim2);
    letter-spacing: .12em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.ed-top-actions { display: flex; gap: 8px; align-items: center; }

.btn-sub {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--ink3);
    border: 1px solid var(--line);
    color: var(--txt);
    border-radius: var(--r-sm);
    padding: 8px 13px;
    font-size: 12px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.btn-sub:hover { border-color: var(--line2); background: #252530; }
.btn-sub svg { width: 14px; height: 14px; color: var(--dim); }

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--acc);
    color: var(--acc-ink);
    border: none;
    border-radius: var(--r-sm);
    padding: 9px 16px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 24px rgba(232,255,71,.18);
    transition: transform .15s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 34px rgba(232,255,71,.32); }
.btn-primary svg { width: 15px; height: 15px; }

.ed-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* ---------- 左パネル ---------- */

.ed-panel {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--line);
    background: var(--ink2);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.ed-tabs {
    display: flex;
    padding: 10px 10px 0;
    gap: 2px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.ed-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--dim);
    font-size: 11.5px;
    font-weight: 600;
    padding: 9px 2px 11px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    letter-spacing: .04em;
    white-space: nowrap;
}
.ed-tab:hover { color: var(--txt); }
.ed-tab.active { color: var(--acc); border-bottom-color: var(--acc); }

.ed-panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 18px 18px 40px;
}
.ed-panel-scroll::-webkit-scrollbar { width: 6px; }
.ed-panel-scroll::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 10px; }

.ed-sec[hidden] { display: none; }

.ed-field { margin-bottom: 15px; min-width: 0; }
.ed-field label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--dim);
    margin-bottom: 6px;
}
.ed-field input[type="text"], .ed-field textarea, .ed-field select {
    width: 100%;
    background: var(--ink);
    border: 1px solid var(--line);
    color: var(--txt);
    border-radius: var(--r-sm);
    padding: 9px 11px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color .2s;
}
.ed-field input:focus, .ed-field textarea:focus, .ed-field select:focus {
    outline: none;
    border-color: var(--acc);
}
.ed-field textarea { resize: vertical; line-height: 1.7; }
.ed-field-row { display: flex; gap: 10px; }
.ed-field-row .ed-field { flex: 1; }

.ed-divider { height: 1px; background: var(--line); margin: 18px 0; }
.ed-hint {
    font-size: 11px;
    color: var(--dim2);
    line-height: 1.8;
    margin: 0 0 14px;
}

.ed-logo-row { display: flex; gap: 12px; align-items: center; }
.ed-logo-thumb {
    width: 64px; height: 64px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background:
        repeating-conic-gradient(#26262e 0% 25%, #1c1c23 0% 50%) 0 0 / 16px 16px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.ed-logo-thumb img { max-width: 82%; max-height: 82%; }
.ed-logo-thumb.small { width: 48px; height: 48px; }
.ed-logo-thumb.dark {
    background:
        repeating-conic-gradient(#101014 0% 25%, #060608 0% 50%) 0 0 / 14px 14px;
}
.ed-logo-thumb .auto-tag {
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: .12em;
    color: var(--dim2);
}
.ed-variant-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}
.ed-variant-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.ed-variant-name { font-size: 12px; color: var(--txt); }
.ed-variant-btns { display: flex; gap: 6px; }
.btn-mini.danger { color: var(--danger); border-color: rgba(255,84,112,.35); }
.btn-mini.danger:hover { border-color: var(--danger); }
.ed-logo-meta { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
#edLogoName { font-size: 10px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-mini {
    background: var(--ink3);
    border: 1px solid var(--line);
    color: var(--txt);
    border-radius: var(--r-sm);
    padding: 7px 12px;
    font-size: 11.5px;
    cursor: pointer;
    align-self: flex-start;
    transition: border-color .2s;
}
.btn-mini:hover { border-color: var(--line2); }
.btn-mini.wide { width: 100%; align-self: stretch; }

/* カラーリスト */
.color-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.color-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 9px 10px;
}
.color-swatch {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.12);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    background: none;
    position: relative;
    overflow: hidden;
}
.color-swatch input[type="color"] {
    position: absolute; inset: -6px;
    width: calc(100% + 12px); height: calc(100% + 12px);
    border: none; padding: 0;
    cursor: pointer;
}
.color-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.color-item-main input[type="text"] {
    background: none;
    border: none;
    border-bottom: 1px solid transparent;
    color: var(--txt);
    font-size: 12px;
    padding: 2px 0;
    width: 100%;
}
.color-item-main input[type="text"]:focus { outline: none; border-bottom-color: var(--acc); }
.color-item-main input.c-hex { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.color-role {
    background: var(--ink3);
    border: 1px solid var(--line);
    color: var(--dim);
    border-radius: 6px;
    font-size: 10px;
    padding: 4px 6px;
    font-family: inherit;
}
.color-del {
    background: none; border: none;
    color: var(--dim2);
    font-size: 15px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
}
.color-del:hover { color: var(--danger); background: rgba(255,84,112,.1); }

/* ページ構成 */
.page-list { display: flex; flex-direction: column; gap: 8px; }
.page-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 11px 13px;
    cursor: pointer;
    transition: border-color .2s;
    user-select: none;
}
.page-item:hover { border-color: var(--line2); }
.page-item .p-num {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--dim2);
    width: 20px;
}
.page-item .p-name { flex: 1; font-size: 13px; }
.page-item .p-desc { font-size: 10px; color: var(--dim2); display: block; margin-top: 2px; }
.p-switch {
    width: 34px; height: 20px;
    border-radius: 999px;
    background: var(--line);
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.p-switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--dim);
    transition: transform .2s, background .2s;
}
.page-item.on .p-switch { background: rgba(232,255,71,.25); }
.page-item.on .p-switch::after { transform: translateX(14px); background: var(--acc); }
.page-item.locked { opacity: .55; cursor: default; }

/* テーマ */
.theme-list { display: flex; flex-direction: column; gap: 12px; }
.theme-card {
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--ink);
    transition: border-color .2s, transform .2s;
    padding: 0;
    text-align: left;
    color: var(--txt);
    font-family: inherit;
}
.theme-card:hover { transform: translateY(-1px); }
.theme-card.active { border-color: var(--acc); }
.theme-thumb {
    height: 74px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 10px;
}
.theme-thumb .tt-bar { height: 8px; border-radius: 4px; }
.theme-meta { padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.theme-meta .t-name { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; }
.theme-meta .t-motion {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(232,255,71,.14);
    color: var(--acc);
    font-size: 8px;
    letter-spacing: .18em;
    vertical-align: 2px;
}
.theme-meta .t-desc { font-size: 10.5px; color: var(--dim2); margin-top: 3px; }

/* ---------- ステージ ---------- */

.ed-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,.02), transparent),
        var(--ink);
    position: relative;
}
.stage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px 0;
    flex-shrink: 0;
}
.stage-counter { font-size: 10.5px; letter-spacing: .22em; color: var(--dim2); }
.stage-tools { display: flex; gap: 8px; }

.stage-view {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 0;
    padding: 10px 8px;
}
.stage-arrow {
    background: none;
    border: 1px solid var(--line);
    color: var(--dim);
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: color .2s, border-color .2s, background .2s;
    z-index: 5;
}
.stage-arrow:hover:not(:disabled) { color: var(--acc); border-color: var(--acc); }
.stage-arrow:disabled { opacity: .25; cursor: default; }
.stage-arrow svg { width: 17px; height: 17px; }

.slide-scaler {
    flex: 1;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    position: relative;
}
.slide-host {
    width: 1280px;
    height: 720px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.3);
    transform-origin: center center;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.07);
    background: #fff;
}
.slide-host.turning .bk-slide { animation: slideIn .38s cubic-bezier(.25,.9,.3,1) both; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(26px); }
    to   { opacity: 1; transform: translateX(0); }
}

.dot-nav {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 14px 0 20px;
    flex-shrink: 0;
}
.dot-nav button {
    width: 7px; height: 7px;
    border-radius: 50%;
    border: none;
    background: var(--line2);
    cursor: pointer;
    padding: 0;
    transition: transform .2s, background .2s;
}
.dot-nav button.active { background: var(--acc); transform: scale(1.35); }
.dot-nav button:hover { background: var(--dim); }

/* 一覧表示 */
.overview-view {
    position: absolute;
    inset: 46px 0 0;
    background: var(--ink);
    z-index: 8;
    overflow-y: auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    align-content: start;
}
.overview-view[hidden] { display: none; }
.ov-item {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    text-align: left;
    color: var(--txt);
    font-family: inherit;
}
.ov-thumb {
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08);
    position: relative;
    background: #fff;
    transition: box-shadow .2s, transform .2s;
}
.ov-item:hover .ov-thumb { box-shadow: 0 0 0 2px var(--acc); transform: translateY(-2px); }
.ov-item.current .ov-thumb { box-shadow: 0 0 0 2px var(--acc); }
.ov-thumb .ov-scale {
    width: 1280px; height: 720px;
    transform-origin: top left;
    position: absolute; top: 0; left: 0;
    pointer-events: none;
}
.ov-label {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-top: 8px;
    font-size: 11px;
    color: var(--dim);
}
.ov-label .mono { font-size: 9px; color: var(--dim2); }

/* エディタ内デッキ生成アニメーション（transformはslide-hostのscaleと衝突するためscaler側へ） */
.deck-reveal .slide-scaler { animation: deckIn .7s cubic-bezier(.2,.9,.3,1) both; }
@keyframes deckIn {
    from { opacity: 0; transform: translateY(36px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- トースト ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(28px + var(--tb));
    transform: translateX(-50%) translateY(20px);
    background: var(--ink3);
    border: 1px solid var(--line2);
    color: var(--txt);
    font-size: 12.5px;
    padding: 11px 20px;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 200;
    max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.wrap { width: max-content; max-width: min(520px, calc(100vw - 40px)); border-radius: 14px; line-height: 1.7; text-align: center; padding: 12px 20px; }

/* ================= 書き出し前の確認 ================= */

.ex-modal { position: fixed; inset: 0; bottom: var(--tb); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ex-modal[hidden] { display: none !important; }
.ex-backdrop { position: absolute; inset: 0; background: rgba(6,6,9,.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: exFade .2s ease; }
.ex-card {
    position: relative;
    width: min(520px, 100%);
    max-height: 100%; /* 入れ物（ツールバーの分を除いた範囲）に収める */
    display: flex;
    flex-direction: column;
    background: var(--ink2);
    border: 1px solid var(--line2);
    border-radius: var(--r-lg);
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
    animation: exRise .25s ease;
}
@keyframes exFade { from { opacity: 0; } }
@keyframes exRise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .ex-backdrop, .ex-card { animation: none; } }
.ex-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ex-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.ex-close { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: none; border: none; border-radius: 50%; color: var(--dim); cursor: pointer; }
.ex-close:hover { background: var(--ink3); color: var(--txt); }
.ex-close svg { width: 18px; height: 18px; }
.ex-body { overflow-y: auto; padding: 6px 22px 22px; overscroll-behavior: contain; }
.ex-sec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.ex-sec:last-child { border-bottom: none; padding-bottom: 0; }
.ex-h { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; color: var(--txt); }
.ex-summary { margin: 0 0 10px; font-size: 10.5px; letter-spacing: .14em; color: var(--dim); }
.ex-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ex-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--ink); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.7; }
.ex-check .ex-mark { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; line-height: 1; }
.ex-check.ok .ex-mark { background: rgba(232,255,71,.14); color: var(--acc); }
.ex-check.warn { border-color: rgba(255,200,69,.45); background: rgba(255,200,69,.06); }
.ex-check.warn .ex-mark { background: #ffc845; color: #241a00; }
.ex-check .ex-text { flex: 1; min-width: 0; color: var(--dim); overflow-wrap: anywhere; }
.ex-check .ex-text b { color: var(--txt); font-weight: 600; }
.ex-fix { flex-shrink: 0; align-self: center; background: var(--ink3); border: 1px solid var(--line2); color: var(--txt); border-radius: 999px; padding: 5px 12px; font-size: 11.5px; font-family: inherit; cursor: pointer; }
.ex-fix:hover { border-color: var(--acc); }
.ex-main, .ex-sub { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; border-radius: var(--r-md); font-family: inherit; cursor: pointer; transition: transform .15s, border-color .2s; }
.ex-main { padding: 14px 18px; background: var(--acc); color: var(--acc-ink); border: none; font-size: 14px; font-weight: 700; }
.ex-main:hover { transform: translateY(-1px); }
.ex-sub { padding: 11px 16px; background: var(--ink3); color: var(--txt); border: 1px solid var(--line2); font-size: 13px; }
.ex-sub:hover { border-color: var(--dim); }
.ex-main svg, .ex-sub svg { width: 17px; height: 17px; flex-shrink: 0; }
.ex-file { margin: 10px 0 0; font-size: 11px; color: var(--dim); text-align: center; overflow-wrap: anywhere; }
.ex-note { margin: 10px 0 0; font-size: 12px; line-height: 1.8; color: var(--dim); }
.ex-steps { margin: 0; padding-left: 1.4em; font-size: 12.5px; line-height: 1.9; color: var(--txt); }
@media (max-width: 520px) {
    .ex-modal { align-items: flex-end; padding: 0; }
    .ex-card { width: 100%; max-height: 92%; border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: none; padding-bottom: env(safe-area-inset-bottom); }
    .ex-body { padding: 4px 18px 20px; }
}

/* ================= レスポンシブ ================= */

/* 長い/短いラベルの出し分け（既定は長い方） */
.lbl-short { display: none; }

@media (max-width: 900px) {
    .btn-primary .lbl-full { display: none; }
    .btn-primary .lbl-short { display: inline; }

    .ed-top { padding: 0 10px; gap: 8px; height: 52px; }
    .ed-project { display: none; }
    .btn-sub span { display: none; }
    .btn-sub { padding: 8px 10px; }
    .btn-primary span { font-size: 11px; }
    .btn-primary { padding: 8px 12px; }

    .ed-body { flex-direction: column-reverse; }
    .ed-panel {
        width: 100%;
        flex: 1;
        height: auto;
        border-right: none;
        border-top: 1px solid var(--line);
    }
    /* プレビューはスライドの高さだけ取り、残りを入力欄に回す（キーボードが出ても書ける幅を残す） */
    .ed-stage { flex: none; }
    .stage-view { flex: none; aspect-ratio: 16 / 9; max-height: 34svh; }
    .ed-panel-scroll { padding: 14px 14px 30px; }
    .ed-tab { font-size: 11px; }

    .stage-toolbar { padding: 8px 14px 0; }
    .stage-view { padding: 6px 2px; gap: 0; }
    .stage-arrow { width: 32px; height: 32px; position: absolute; }
    .stage-arrow.prev { left: 6px; }
    .stage-arrow.next { right: 6px; }
    .stage-arrow { background: rgba(16,16,20,.55); backdrop-filter: blur(4px); }
    .dot-nav { padding: 4px 0 10px; }
    /* 一覧を開いている間は入力欄をしまい、一覧を画面いっぱいに */
    .editor:has(.overview-view:not([hidden])) .ed-panel { display: none; }
    .editor:has(.overview-view:not([hidden])) .ed-stage { flex: 1; }
    .overview-view { inset: 40px 0 0; padding: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

    .hero-head { padding: 20px 20px; }
    .hero-main { gap: 20px; }
    .hero-lead { font-size: 14px; }
    .dz-inner { padding: 32px 18px 26px; }
}

/* タッチ端末：16px未満の入力欄はiPhoneでフォーカス時に画面が拡大されるため、文字を16pxにそろえる */
@media (hover: none) and (pointer: coarse) {
    .ed-field input[type="text"], .ed-field textarea, .ed-field select,
    .color-item-main input[type="text"], .color-item-main input.c-hex,
    .color-role { font-size: 16px; }
    .color-role { padding: 4px 4px; }
}

@media (max-width: 520px) {
    .hero-title { font-size: clamp(30px, 9vw, 40px); }
    .gen-logo-wrap { width: 170px; height: 170px; }
    .gen-chip { width: 38px; height: 38px; }
    .hero-head { padding: 18px 20px; }
    .hero-head-tag { display: none; }
    /* タッチ端末想定：ドロップよりタップ選択を前面に */
    .dz-text .lbl-full { display: none; }
    .dz-text .lbl-short { display: inline; }
}
