/* ブリッジくん 画面デザイン（白基調・アップル風） */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --fill: #f2f2f5; --fill2: #e8e8ed;
  --line: #e5e5ea; --line2: #d2d2d7; --text: #1d1d1f; --sub: #6e6e73; --sub2: #86868b;
  --accent: #0071e3; --accent-h: #0077ed; --accent-soft: #e8f1fc;
  --pos: #d70015; --neg: #0066cc;          /* 良い＝赤・悪い＝青（ユーザー指定） */
  --ok: #248a3d; --danger: #d70015;
  --radius: 14px; --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .05);
  --shadow-l: 0 12px 40px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 13px; letter-spacing: .01em; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent); }
::selection { background: rgba(0, 113, 227, .2); }

/* ---------- 上部バー（すりガラス） ---------- */
.top {
  position: sticky; top: 0; z-index: 50; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.logo { color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.logo b { color: var(--accent); font-weight: 700; }
.nav { display: flex; gap: 2px; padding: 3px; background: var(--fill); border-radius: 10px; }
.nav a { color: var(--sub); text-decoration: none; font-weight: 600; padding: 6px 14px; border-radius: 8px; font-size: 13px; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.top-proj { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.proj-name { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; font-size: 15px; font-weight: 600; width: 240px; min-width: 0; }
.proj-name:hover { background: var(--fill); }
.proj-name:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .15); }
.save-state { color: var(--sub2); font-size: 12px; white-space: nowrap; }
.top-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.user-box { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--sub); font-size: 12px; white-space: nowrap; }
.top-actions:not([hidden]) ~ .user-box { margin-left: 8px; }
.role { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--fill); color: var(--sub); }
.role-admin { background: var(--accent-soft); color: var(--accent); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--fill); color: var(--text); border: 0; border-radius: 99px; padding: 8px 16px;
  cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--fill2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-h); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn.icon { padding: 3px 9px; font-size: 12px; border-radius: 8px; background: transparent; color: var(--sub); }
.btn.icon:hover { background: var(--fill); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.on { background: var(--text); color: #fff; }
a.btn { color: inherit; }
a.btn.primary { color: #fff; }

/* 入力欄 */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea {
  background: var(--surface); border: 1px solid var(--line2); border-radius: 9px; padding: 7px 10px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .15); }
input[type=range] { accent-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; }
input[type=color] { width: 40px; height: 28px; padding: 2px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); cursor: pointer; }
textarea { line-height: 1.55; resize: vertical; }

/* スイッチ（ON/OFF） */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 42px; height: 25px; border-radius: 99px; background: var(--fill2); position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + i { background: #34c759; }
.switch input:checked + i::after { transform: translateX(17px); }

/* セグメント（押したら：次へ／LPへ…） */
.seg { display: flex; padding: 3px; background: var(--fill); border-radius: 10px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 6px 4px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--sub); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.hint { color: var(--sub); font-size: 12px; line-height: 1.6; margin: 4px 0 8px; }
.hint b { color: var(--text); }
.warn { color: #9a5b00; background: #fff6e0; border-radius: 8px; padding: 6px 10px; font-size: 12px; margin: 6px 0; }
.warn-t { color: #b26a00 !important; }
.chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.chk.block { display: flex; margin: 8px 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row .val { min-width: 44px; text-align: right; color: var(--sub); font-size: 12px; font-variant-numeric: tabular-nums; }
.muted { color: var(--sub); }
.pos { color: var(--pos) !important; }
.neg { color: var(--neg) !important; }
code { font-family: "SF Mono", Menlo, Consolas, monospace; color: #b0368a; background: var(--fill); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

/* ---------- 制作画面 ---------- */
.editor { display: grid; grid-template-columns: 240px 1fr 380px; height: calc(100vh - 56px); }
.scenes, .props { background: var(--surface); overflow-y: auto; }
.scenes { border-right: 1px solid var(--line); }
.props { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.pane-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 8px; font-weight: 700; font-size: 14px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.scene-list { padding: 4px 10px 20px; display: flex; flex-direction: column; gap: 6px; }
.sc-item { display: flex; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.sc-item:hover { background: var(--fill); }
.sc-item.on { background: var(--accent-soft); border-color: rgba(0, 113, 227, .35); }
.sc-thumb { width: 40px; height: 71px; border-radius: 7px; overflow: hidden; flex: none; position: relative; background: #000; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.sc-thumb video, .sc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sc-thumb .sc-motion { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; text-align: center; background: rgba(0, 0, 0, .55); color: #fff; padding: 1px 0; }
.sc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sc-info b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-info span { color: var(--sub); font-size: 11px; }
.sc-no { color: var(--accent); font-weight: 700; margin-right: 5px; }
.sc-ops { display: flex; gap: 0; margin-top: auto; opacity: 0; transition: opacity .15s; }
.sc-item:hover .sc-ops, .sc-item.on .sc-ops { opacity: 1; }

.stagewrap { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; overflow: hidden; background: var(--bg); }
.phone { width: 372px; height: 652px; border-radius: 44px; border: 6px solid #1d1d1f; overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .1); transform-origin: center center; flex: none; background: #000; }
.phone.wide { border-radius: 18px; }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.pv-ctrl { display: flex; gap: 8px; }
.pv-size { display: flex; align-items: center; gap: 6px; color: var(--sub); font-size: 12px; flex-wrap: wrap; justify-content: center; }
.pv-size .btn { background: transparent; color: var(--sub); }
.pv-size .btn.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.pv-note { color: var(--sub2); font-size: 12px; margin: 0; }

/* 右パネル */
.tabs { display: flex; margin: 12px 14px 4px; padding: 3px; background: var(--fill); border-radius: 10px; position: sticky; top: 0; z-index: 2; }
.tabs button { flex: 1; background: none; border: 0; padding: 7px; cursor: pointer; color: var(--sub); font-weight: 600; border-radius: 8px; }
.tabs button.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.prop-body { padding: 8px 14px 80px; }
.sec { border-radius: var(--radius); padding: 0; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.sec > h3 { margin: 0; padding: 12px 14px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 6px; cursor: pointer; user-select: none; }
.sec > h3 small { color: var(--sub); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec > h3::after { content: '›'; color: var(--sub2); font-size: 18px; transform: rotate(90deg); transition: transform .2s; margin-left: 4px; }
.sec.closed > h3::after { transform: rotate(0deg); }
.sec.closed > :not(h3) { display: none !important; }
.sec > :not(h3) { margin-left: 14px; margin-right: 14px; }
.sec > :last-child { margin-bottom: 14px; }
.sec.motion { border-color: rgba(0, 113, 227, .3); }
.f { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 8px; margin-bottom: 9px; }
.f > label { color: var(--sub); font-size: 12px; }
.f input:not([type=checkbox]):not([type=range]):not([type=color]), .f select, .f textarea { width: 100%; }
.add-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.add-row .btn { padding: 8px 4px; font-size: 12px; border-radius: 10px; }
.el-card { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface); }
.el-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .12); }
.el-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; }
.el-head .tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; flex: none; font-weight: 600; }
.el-head .tag.text { background: #eef0ff; color: #3d4ed8; }
.el-head .tag.button { background: #ffe9ee; color: #c8174b; }
.el-head .tag.choices { background: #e3f7ef; color: #087a52; }
.el-head .tag.next { background: var(--fill); color: var(--sub); }
.el-head .tag.link { background: #f1eaff; color: #6d3fd1; }
.el-head .ttl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-head .meas { font-size: 11px; color: var(--ok); white-space: nowrap; }
.el-body { padding: 6px 10px 12px; border-top: 1px solid var(--line); }
details.fine { border-top: 1px solid var(--line); padding: 8px 0 0; margin: 10px 0 0; }
details.fine summary { cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 600; margin-bottom: 8px; list-style: none; }
details.fine summary::-webkit-details-marker { display: none; }
details.fine summary::before { content: '＋ '; }
details.fine[open] summary::before { content: '－ '; }
.opt-row { display: grid; grid-template-columns: 1fr 104px 52px 26px; gap: 4px; margin-bottom: 4px; }
.opt-row input, .opt-row select { width: 100%; padding: 6px 7px !important; font-size: 12px; }
.opt-row input.emoji { text-align: center; padding: 6px 2px !important; }
.opt-row .btn.icon img { width: 30px; height: 22px; object-fit: cover; display: block; }
.media-box { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.media-box .mthumb { width: 54px; height: 96px; border-radius: 8px; overflow: hidden; background: #000; flex: none; }
.media-box .mthumb.wide { width: 110px; height: 54px; background: var(--fill); display: flex; align-items: center; }
.media-box .mthumb video, .media-box .mthumb img { width: 100%; height: 100%; object-fit: cover; }
.media-box .mthumb.wide img { height: auto; object-fit: contain; }
.progress { height: 6px; background: var(--fill2); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line2); cursor: pointer; padding: 0; }
.sw.on { box-shadow: 0 0 0 2px var(--accent); }
.sw.custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); color: #fff; font-size: 10px; font-weight: 700; text-shadow: 0 0 3px #000; }
.design-pick { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.design-pick span { color: var(--sub); font-size: 12px; }
.measure { background: #f0faf3; border-radius: 10px; padding: 10px; margin: 10px 0; }
.measure > b { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ok); }
.bgm-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.bgm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); font-weight: 600; }

/* ---------- プレビュー上のクイック編集カード ---------- */
.qe {
  position: absolute; z-index: 30; width: 320px; background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-radius: 18px; box-shadow: var(--shadow-l); border: 1px solid rgba(0, 0, 0, .06); padding: 14px 16px 12px;
  animation: qe-in .18s ease-out;
}
@keyframes qe-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.qe::before { content: ''; position: absolute; left: -7px; top: var(--ay, 40px); width: 14px; height: 14px; background: inherit; transform: rotate(45deg); border-left: 1px solid rgba(0, 0, 0, .06); border-bottom: 1px solid rgba(0, 0, 0, .06); }
.qe.left::before { left: auto; right: -7px; border: 0; border-top: 1px solid rgba(0, 0, 0, .06); border-right: 1px solid rgba(0, 0, 0, .06); }
.qe-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.qe-head b { flex: 1; font-size: 14px; }
.qe-x { border: 0; background: var(--fill); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; color: var(--sub); font-size: 13px; line-height: 1; }
.qe-x:hover { background: var(--fill2); }
.qe label.ql { display: block; color: var(--sub); font-size: 11px; font-weight: 600; margin: 8px 0 4px; }
.qe input:not([type=checkbox]):not([type=range]), .qe select, .qe textarea { width: 100%; }
.qe-measure { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--fill); }
.qe-measure.on { background: #ecf8ef; }
.qe-measure .q { font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qe-measure .q small { display: block; font-weight: 400; color: var(--sub); font-size: 11px; margin-top: 2px; }
.qe-measure .sub { margin-top: 8px; }
.qe-foot { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.qe-opts { display: flex; flex-direction: column; gap: 4px; }
.qe-opts .o { display: grid; grid-template-columns: 1fr 112px; gap: 4px; }

/* ---------- 書き出しメニュー ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-l); border: 1px solid var(--line); padding: 6px; z-index: 60; }
.menu button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--fill); }
.menu button b { font-size: 13px; }
.menu button small { color: var(--sub); font-size: 11px; margin-top: 2px; }

/* ---------- モーダル ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--surface); border-radius: 20px; width: min(1100px, 94vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-l); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.gal-group { margin-bottom: 20px; }
.gal-group h4 { margin: 0 0 10px; color: var(--sub); font-size: 12px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.gal-tile { cursor: pointer; text-align: center; }
.gal-tile .g-stage { width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; border: 3px solid transparent; box-shadow: var(--shadow); }
.gal-tile:hover .g-stage { border-color: var(--line2); }
.gal-tile.cur .g-stage { border-color: var(--accent); }
.gal-tile span { display: block; margin-top: 6px; font-size: 12px; }
.g-face { display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; color: #fff; }
.gal-themes { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.dgal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.dtile { cursor: pointer; text-align: center; }
.dtile > span { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; font-size: 12px; }
.dstage {
  position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; border: 3px solid transparent;
  container-type: size; --u: 1cqw; background: linear-gradient(160deg, #4a5a70, #232b38 60%, #5a4862);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "YuGothic", "Meiryo", sans-serif;
}
.dstage.choices { aspect-ratio: 4 / 5; }
.dtile:hover .dstage { border-color: var(--line2); }
.dtile.cur .dstage { border-color: var(--accent); }
.dstage .bl-el { pointer-events: none; }
.mp4-tbl { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.mp4-tbl th, .mp4-tbl td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
.mp4-tbl th { color: var(--sub); font-weight: 400; font-size: 12px; }
.mp4-tbl td:first-child { width: 30px; }
.mp4-tbl td:last-child { width: 150px; }
.mp4-tbl input[type=number] { width: 90px; }
.mp4-tbl small { color: var(--sub); }
.mp4-sizes { display: grid; grid-template-columns: 50px repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.mp4-sizes > b { align-self: center; }
.mp4-size { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 1px solid var(--line2); border-radius: 14px; cursor: pointer; text-align: center; }
.mp4-size:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mp4-size small { color: var(--sub); line-height: 1.4; }
.ar { display: block; border: 2px solid var(--text); border-radius: 4px; height: 34px; }
.ar-9x16 { width: 19px; } .ar-4x5 { width: 27px; } .ar-1x1 { width: 34px; } .ar-16x9 { width: 60px; }
.mp4-fit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 12px; padding: 10px 12px; background: var(--fill); border-radius: 12px; }
.mp4-fit .hint { flex-basis: 100%; margin: 0; }
.mp4-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.mp4-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mp4-foot span { font-size: 15px; font-weight: 700; }
.mp4-prog { margin-top: 14px; }
.mp4-prog .progress { height: 8px; margin-bottom: 8px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: rgba(29, 29, 31, .92); color: #fff; padding: 11px 20px; border-radius: 99px; z-index: 200; max-width: 80vw; box-shadow: var(--shadow-l); font-weight: 500; }

/* ---------- 管理・数値 ---------- */
.admin { display: flex; min-height: calc(100vh - 56px); }
.a-side { width: 230px; flex: none; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.a-side a, .a-side .fd { display: flex; justify-content: space-between; align-items: center; color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; background: none; border: 0; cursor: pointer; text-align: left; font-weight: 600; }
.a-side a:hover, .a-side .fd:hover { background: rgba(0, 0, 0, .04); }
.a-side a.on, .a-side .fd.on { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }
.a-side .fd { font-weight: 400; }
.a-side .fd span { color: var(--sub); font-size: 11px; }
.a-side-h { color: var(--sub2); font-size: 11px; font-weight: 600; margin: 16px 12px 4px; }
.a-main { flex: 1; padding: 26px 32px 70px; min-width: 0; max-width: 1400px; }
.a-main.wide { max-width: 1500px; margin: 0 auto; }
.a-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.a-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.a-head .back { color: var(--sub); text-decoration: none; font-size: 15px; margin-right: 6px; font-weight: 400; }
.a-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.new-box { display: flex; gap: 8px; padding: 14px; margin-bottom: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); flex-wrap: wrap; }
.new-box input { flex: 1; min-width: 200px; }
.a-tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.a-card .a-tbl { box-shadow: none; border: 1px solid var(--line); }
.a-tbl th { text-align: left; color: var(--sub); font-weight: 500; font-size: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.a-tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.a-tbl tr:last-child td { border-bottom: 0; }
.a-tbl tbody tr:hover td { background: #fafafc; }
.a-tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.a-tbl .empty { color: var(--sub); text-align: center; padding: 36px; }
.a-tbl .nowrap { white-space: nowrap; }
.a-tbl .ops { white-space: nowrap; }
.a-tbl .ops .btn { margin-right: 2px; }
.pcell { display: flex; gap: 12px; align-items: center; max-width: 340px; }
.pcell b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 270px; font-weight: 600; }
.pcell small { color: var(--sub); font-size: 11px; }
.mthumb-s { width: 30px; height: 53px; border-radius: 6px; overflow: hidden; flex: none; display: block; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.mthumb-s img, .mthumb-s video { width: 100%; height: 100%; object-fit: cover; }
.stag { font-size: 11px; padding: 3px 9px; border-radius: 99px; white-space: nowrap; font-weight: 600; }
.s-public { background: #e3f6e8; color: var(--ok); }
.s-draft { background: var(--fill); color: var(--sub); }
.s-stop { background: #e5effa; color: var(--neg); }
.a-tabs { display: flex; gap: 2px; padding: 3px; background: var(--fill2); border-radius: 11px; margin-bottom: 18px; width: fit-content; }
.a-tabs a { padding: 7px 18px; color: var(--sub); text-decoration: none; font-weight: 600; border-radius: 9px; }
.a-tabs a.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.a-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.a-card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.a-card h3 small { color: var(--sub); font-weight: 400; margin-left: 6px; font-size: 12px; }
.a-card h4 { margin: 14px 0 8px; font-size: 13px; }
.a-card h4 small { color: var(--sub); font-weight: 400; }
.a-card textarea { width: 100%; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.a-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: start; margin-bottom: 14px; }
.a-row > label { color: var(--sub); padding-top: 8px; font-weight: 500; }
.a-row input, .a-row select { width: 100%; max-width: 560px; }
.a-alert { background: #fff8e6; color: #7a4f00; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; line-height: 1.7; }
.code-line { display: flex; gap: 8px; align-items: center; }
.code-line code { padding: 8px 12px; border-radius: 9px; color: var(--text); }
.code-box { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.code-box pre { flex: 1; margin: 0; background: #f7f7f9; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; white-space: pre-wrap; word-break: break-all; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: #1d1d1f; }
.tag-item, .cv-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.tag-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.tag-row input { flex: 1; min-width: 160px; }
.flow { display: flex; align-items: stretch; gap: 10px; margin-bottom: 14px; }
.flow > div { flex: 1; background: var(--fill); border-radius: 12px; padding: 12px 14px; line-height: 1.65; }
.flow > div b { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; margin-right: 6px; font-size: 12px; }
.flow > span { align-self: center; color: var(--sub2); font-size: 18px; }
.steps { margin: 0; padding-left: 20px; line-height: 1.9; }
.tag-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.tag-type { border: 1px solid var(--line2); border-radius: 14px; padding: 14px; cursor: pointer; background: var(--surface); text-align: left; }
.tag-type:hover { border-color: var(--accent); background: var(--accent-soft); }
.tag-type b { display: block; font-size: 14px; margin-bottom: 4px; }
.tag-type small { color: var(--sub); line-height: 1.5; }
.tag-list .tl { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tag-list .tl:last-child { border-bottom: 0; }
.tag-list .tl b { flex: 1; }
.tag-list .tl small { color: var(--sub); }

/* 種類タグ */
.ktag { font-size: 11px; padding: 3px 9px; border-radius: 99px; white-space: nowrap; font-weight: 600; }
.k-answer { background: #e3f7ef; color: #087a52; } .k-next { background: var(--fill); color: var(--sub); }
.k-cta { background: #ffe9ee; color: #c8174b; } .k-link { background: #f1eaff; color: #6d3fd1; }
.mcv { font-size: 11px; color: #9a5b00; background: #fff4d6; padding: 2px 7px; border-radius: 6px; white-space: nowrap; font-weight: 600; }

/* 数値 */
.r-filter { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.r-filter .btn { background: var(--surface); box-shadow: 0 0 0 1px var(--line2) inset; }
.r-filter .btn.on, .r-kinds .btn.on, .heat-scenes .btn.on { background: var(--text); color: #fff; box-shadow: none; }
.r-period { color: var(--sub); font-size: 12px; margin-left: auto; }
.r-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.r-kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; }
.r-kpi .lb { color: var(--sub); font-size: 12px; font-weight: 600; }
.r-kpi b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.r-kpi small { color: var(--sub); font-size: 11px; }
.dl { font-size: 12px; color: var(--sub); margin-top: 2px; }
.r-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.r-kinds { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.r-kinds .btn, .heat-scenes .btn { background: var(--fill); }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #e8e8ed; stroke-width: 1; }
.chart .ax { fill: #52514e; font-size: 11px; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover { fill: rgba(0, 0, 0, .03); }
.chart .tip { position: absolute; background: rgba(29, 29, 31, .92); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; pointer-events: none; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12px; margin-bottom: 4px; color: var(--sub); }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.mdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.bar { display: inline-block; width: 100%; max-width: 260px; height: 10px; background: var(--fill); border-radius: 5px; overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hbar { display: grid; grid-template-columns: 220px 1fr 130px; gap: 12px; align-items: center; margin-bottom: 8px; }
.hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .bar { max-width: none; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; }
.heat-wrap { display: flex; gap: 24px; align-items: flex-start; }
.heat-scenes { display: flex; flex-direction: column; gap: 6px; width: 300px; }
.heat-scenes .btn { justify-content: space-between; border-radius: 10px; }
.heat-scenes small { color: inherit; opacity: .7; }
.heat-phone { position: relative; width: 270px; height: 480px; border-radius: 30px; overflow: hidden; border: 5px solid #1d1d1f; flex: none; box-shadow: var(--shadow-l); }
.heat-phone iframe, .heat-phone canvas, .heat-shield { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.heat-phone canvas { pointer-events: none; }
.heat-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--sub); margin-top: 8px; }
.heat-legend span { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(255, 200, 60, .35), rgb(255, 0, 0)); }

/* ログイン */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, #ffffff, var(--bg)); }
.login-box { width: 380px; background: var(--surface); border-radius: 22px; padding: 34px 32px 28px; box-shadow: var(--shadow-l); }
.login-box h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; text-align: center; }
.login-box h1 b { color: var(--accent); }
.login-box p { color: var(--sub); margin: 0 0 20px; line-height: 1.7; text-align: center; }
.login-box label { display: block; color: var(--sub); font-size: 12px; font-weight: 600; margin: 12px 0 5px; }
.login-box input { width: 100%; padding: 10px 12px !important; font-size: 14px; }
.login-box .btn { width: 100%; margin-top: 22px; padding: 11px; font-size: 14px; }
.login-err { color: var(--danger); margin-top: 12px; min-height: 1em; text-align: center; }

/* v6：シーン名・ドロップ枠・ドラッグ中 */
.scene-title { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.scene-title .sc-no { font-size: 15px; }
.scene-title input { flex: 1; font-size: 15px; font-weight: 600; border-color: transparent !important; background: transparent !important; padding: 6px 4px !important; }
.scene-title input:hover { background: var(--fill) !important; }
.scene-title input:focus { background: var(--surface) !important; border-color: var(--accent) !important; }
.drop { display: flex; align-items: center; gap: 12px; padding: 16px; margin-bottom: 6px; border: 2px dashed var(--line2); border-radius: 16px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; flex-wrap: wrap; }
.drop:hover, #propBody.dragging .drop { border-color: var(--accent); background: var(--accent-soft); }
.drop.has { border-style: solid; border-color: var(--line); padding: 10px; }
.drop-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.drop-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.drop-txt b { font-size: 13px; }
.drop-txt span { color: var(--sub); font-size: 11.5px; line-height: 1.5; }
.drop-thumb { width: 46px; height: 82px; border-radius: 8px; overflow: hidden; flex: none; }
.drop-thumb img, .drop-thumb video { width: 100%; height: 100%; object-fit: cover; }
.drop .progress { flex-basis: 100%; }
.drop-sub { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.stagewrap.dragging::after, #sceneList.dragging::after {
  content: 'ここにドロップ'; position: absolute; inset: 10px; border: 3px dashed var(--accent); border-radius: 20px; background: rgba(0, 113, 227, .08);
  display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 18px; font-weight: 700; pointer-events: none; z-index: 40;
}
#sceneList { position: relative; min-height: 120px; }
#sceneList.dragging::after { content: 'ドロップすると 1本＝1シーン で追加'; font-size: 13px; text-align: center; padding: 10px; }
.scene-add { padding: 4px 12px 16px; }
.scene-add .btn { width: 100%; }
.scene-add .hint { font-size: 11px; }
/* v6：項目名は入力欄の上に（パネルとカード共通） */
label.ql { display: block; color: var(--sub); font-size: 11px; font-weight: 600; margin: 10px 0 4px; }
.el-body input:not([type=checkbox]):not([type=range]):not([type=color]), .el-body select, .el-body textarea { width: 100%; }
.el-body .qe-measure { margin-top: 12px; }
/* クイック編集カードを開いている間は、スマホを左に寄せてカードの場所を空ける */
.stagewrap.qe-open { padding-right: 350px; }

/* v7：独自ドメイン */
.stepper { display: flex; gap: 8px; margin-bottom: 18px; }
.stp { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--fill); color: var(--sub); font-weight: 600; font-size: 12px; }
.stp span { width: 22px; height: 22px; border-radius: 50%; background: var(--fill2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.stp.on { background: var(--accent-soft); color: var(--accent); }
.stp.on span { background: var(--accent); color: #fff; }
.stp.done { color: var(--ok); }
.stp.done span { background: #d8f2df; color: var(--ok); }
.step-body { line-height: 1.75; }
.step-body p { margin: 0 0 12px; }
.reg-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.a-tbl.dns { margin: 8px 0 12px; }
.check-list { margin: 12px 0 4px; padding-left: 18px; line-height: 1.9; }
.done-msg { font-size: 16px; font-weight: 700; color: var(--ok); }
.slug { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.slug span { color: var(--sub); }
.slug input { width: 220px !important; }
.pub-ok { background: #ecf8ef; color: var(--ok); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.pub-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 20; background: rgba(255,255,255,.92); color: var(--text); border: 1px solid var(--line); border-radius: 99px; padding: 8px 8px 8px 16px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); font-weight: 600; font-size: 12px; white-space: nowrap; }
.menu button:disabled { opacity: .45; cursor: default; }

/* v9：配信チェック */
.chk-sum { border-radius: 12px; padding: 12px 16px; font-weight: 700; margin-bottom: 12px; }
.chk-sum.ng { background: #fdecee; color: var(--danger); }
.chk-sum.warn { background: #fff6e0; color: #8a5a00; }
.chk-sum.ok { background: #ecf8ef; color: var(--ok); }
.chk-list .ck { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.chk-list .ck:last-child { border-bottom: 0; }
.ck-ico { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex: none; color: #fff; }
.lv-ng .ck-ico { background: var(--danger); } .lv-warn .ck-ico { background: #e8a200; } .lv-info .ck-ico { background: var(--sub2); } .lv-ok .ck-ico { background: #34c759; }
.ck-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ck-t small { color: var(--sub); line-height: 1.55; }
.ck-lv { font-size: 11px; font-weight: 700; color: var(--sub); white-space: nowrap; }
.lv-ng .ck-lv { color: var(--danger); } .lv-warn .ck-lv { color: #a06a00; } .lv-ok .ck-lv { color: var(--ok); }
.switch span { font-weight: 500; }

/* v11：Googleでログイン */
.google-btn { width: 100%; padding: 12px; font-size: 15px; gap: 10px; text-decoration: none; }
.g-ico { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.login-note { font-size: 12px; margin: 8px 0 0 !important; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--sub2); font-size: 12px; margin: 18px 0 4px; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#f .btn { margin-top: 16px; }

/* v14：分析くんとの連携 */
.aa-bar { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.aa-bar a { margin-left: auto; }
.aa-chip { align-self: center; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 4px 12px; font-weight: 600; font-size: 12px; }
