:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #1d2420;
  --muted: #6b756f;
  --line: #e2e7e4;
  --accent: #06a74b;
  --accent-dark: #048a3d;
  --ok-bg: #e7f6ed;
  --ng-bg: #fdecec;
  --ng: #c23b3b;
  --wait-bg: #fff6e0;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-right: 8px; }
.container { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
.narrow { max-width: 440px; margin: 24px auto 0; }

.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--accent); }
.list .card { margin-bottom: 8px; }

.form label { display: block; font-weight: 600; margin-bottom: 14px; }
.form small { display: block; font-weight: 400; color: var(--muted); }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=url], .form input[type=datetime-local], .form textarea,
.filter input, .filter select, .copy-row input {
  width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
.form textarea { resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.form .check { font-weight: 400; }
.error { color: var(--ng); margin: -8px 0 12px; font-size: .9rem; }

.button {
  display: inline-block; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  padding: 10px 18px; cursor: pointer; white-space: nowrap;
}
.button:hover { background: var(--accent-dark); text-decoration: none; }
.button.small { padding: 6px 12px; font-size: .9rem; }
.button.ghost { background: transparent; color: var(--accent-dark); border: 1px solid var(--accent); }
.button.ghost:hover { background: var(--ok-bg); }
.form .button { width: 100%; margin-top: 4px; }
.link-button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; }
.flash.ok { background: var(--ok-bg); }
.flash.ng { background: var(--ng-bg); color: var(--ng); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.crumb { margin: 0 0 8px; font-size: .9rem; }
.grow { flex: 1; min-width: 0; }

.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.head-row h1, .head-row h2 { margin: 0; }
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.account-head h1 { margin: 0; }
.account-row, .friend-row { display: flex; align-items: center; gap: 12px; }
.account-row strong, .friend-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-row .muted { display: block; }

.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--line); }
.avatar.large { width: 64px; height: 64px; }
.avatar.placeholder { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }

.stat { text-align: center; }
.stat b, .stat-card b { display: block; font-size: 1.4rem; line-height: 1.2; }
.stat span, .stat-card span { color: var(--muted); font-size: .85rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.stat-card { text-align: center; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .85rem; margin: 0 0 10px; }
.badge.ok { background: var(--ok-bg); color: var(--accent-dark); }
.badge.wait { background: var(--wait-bg); color: #8a6100; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.steps { padding-left: 1.3em; margin: 14px 0 0; color: var(--muted); font-size: .9rem; }
.steps li { margin-bottom: 4px; }

.event-row { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.event-row:first-of-type { border-top: 0; }
.event-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-row time { white-space: nowrap; font-size: .8rem; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .78rem; background: var(--line); color: var(--text); white-space: nowrap; }
.tag-follow { background: var(--ok-bg); color: var(--accent-dark); }
.tag-unfollow { background: var(--ng-bg); color: var(--ng); }
.tag-message { background: #e8f0fb; color: #2a5ea8; }
.tag-postback { background: #f3eafb; color: #7040a8; }

.filter { display: flex; gap: 8px; margin-bottom: 8px; }
.filter input { margin: 0; flex: 1; }
.filter select { margin: 0; width: auto; }
.empty { text-align: center; padding: 28px 16px; }
.empty p { margin: 0 0 6px; }
.facts { display: grid; grid-template-columns: 7em 1fr; gap: 6px 12px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.pager { display: flex; justify-content: center; gap: 18px; margin-top: 16px; }

@media (max-width: 480px) {
  .filter { flex-wrap: wrap; }
  .filter input { flex-basis: 100%; }
  .head-row { flex-wrap: wrap; }
}

/* ---- タグ・一斉配信 ---- */
.subnav { display: flex; gap: 4px; margin: -4px 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subnav a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover { text-decoration: none; color: var(--text); }
.subnav a.on { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: #eef3f0; border: 1px solid #d5e3da; font-size: .82rem; color: var(--text); }
.chip.removable button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0 0 2px; }
.chip.removable button:hover { color: var(--ng); }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.inline-form input[type=text], .inline-form select, .rule-form input, .rule-form select {
  flex: 1; min-width: 140px; padding: 8px 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
.inline-form select { flex: 0 1 auto; }
.tag-add { margin: 12px 0 0; }
.rule-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.rule-form select { flex: 0 1 auto; min-width: 0; }

.tag-item { border-top: 1px solid var(--line); padding: 8px 0; }
.tag-item summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.tag-item summary::-webkit-details-marker { display: none; }
.tag-edit { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 10px; }
.tag-edit .inline-form { margin: 0; flex: 1; }
.link-button.danger { color: var(--ng); }
.hint { margin: 14px 0 0; }
code { background: #f1f3f2; padding: 1px 5px; border-radius: 4px; font-size: .85em; }

.status { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: .78rem; white-space: nowrap; background: var(--line); }
.status-scheduled { background: var(--wait-bg); color: #8a6100; }
.status-sending { background: #e8f0fb; color: #2a5ea8; }
.status-sent { background: var(--ok-bg); color: var(--accent-dark); }
.status-failed { background: var(--ng-bg); color: var(--ng); }
.broadcast-row { display: flex; align-items: center; gap: 12px; }
.broadcast-row strong { display: block; }
.quota { margin: -6px 0 14px; }
.actions { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.error-text { color: var(--ng); }

.message-block { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.message-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.message-head b { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; font-size: .8rem; }
.form .radio { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 0; }
.form .radio.block { display: flex; margin: 8px 0; }
.form .message-block small { display: block; margin-top: 4px; }
.message-block textarea { font-family: inherit; font-size: 15px; }
.thumb { display: block; max-width: 160px; max-height: 160px; border-radius: 8px; margin-bottom: 6px; }
.field-label { font-weight: 600; margin: 12px 0 6px; }
.tag-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { display: inline-flex !important; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-weight: 400 !important; margin: 0 !important; cursor: pointer; }
.check-chip:has(input:checked) { border-color: var(--accent); background: var(--ok-bg); }
.mode { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 0; }
.estimate { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.estimate b { font-size: 1.3rem; color: var(--accent-dark); }
.schedule-input { width: auto !important; margin: 0 0 4px 24px !important; }
.broadcast-form .button[type=submit] { margin-top: 12px; }

.preview { background: #8cabd8; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bubble { background: #fff; border-radius: 14px; padding: 8px 12px; max-width: 85%; white-space: pre-wrap; word-break: break-word; font-size: .92rem; }
.bubble-image { max-width: 60%; border-radius: 12px; }

/* ---- サイドバー ---- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; background: #1f2a24; color: #dfe7e2; display: flex; flex-direction: column; z-index: 30; overflow-y: auto; }
.has-sidebar .container { max-width: 980px; margin: 0 0 0 232px; padding: 28px 32px 56px; }
.side-account { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.side-account:hover { text-decoration: none; background: rgba(255,255,255,.04); }
.side-account strong { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-account .muted { color: #93a59a; }
.side-account .avatar { width: 38px; height: 38px; }
.side-nav { padding: 10px 10px 20px; flex: 1; }
.side-heading { margin: 16px 10px 6px; font-size: .72rem; letter-spacing: .08em; color: #7f9488; }
.side-nav a, .side-nav .soon { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #dfe7e2; font-size: .92rem; }
.side-nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.side-nav a.on { background: var(--accent); color: #fff; font-weight: 600; }
.side-nav .soon { color: #6f8277; cursor: default; }
.side-nav .soon em { margin-left: auto; font-style: normal; font-size: .68rem; border: 1px solid #4a5a50; border-radius: 4px; padding: 0 5px; }
.side-nav svg, .menu-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.side-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot a, .side-foot .link-button { color: #93a59a; }
.mobilebar, .sidebar-backdrop { display: none; }

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 24px rgba(0,0,0,.2); }
  .menu-open .sidebar { transform: none; }
  .menu-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .has-sidebar .container { margin: 0 auto; padding: 18px 16px 48px; }
  .mobilebar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .menu-button { background: none; border: 0; padding: 6px; color: var(--text); cursor: pointer; display: inline-flex; }
  .menu-button svg { width: 22px; height: 22px; }
  .mobilebar-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.insert-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.insert-label { font-size: .75rem; color: var(--muted); margin-right: 2px; }
.insert-chip { font: inherit; font-size: .78rem; line-height: 1.4; padding: 2px 9px; border-radius: 999px; border: 1px solid #cfe3d6; background: #f3faf6; color: var(--accent-dark); cursor: pointer; }
.insert-chip:hover { background: var(--ok-bg); border-color: var(--accent); }

/* ---- スマホ実寸プレビュー（iPhone 375×812pt） ---- */
.phone { width: 395px; max-width: 100%; margin: 0 auto; padding: 10px; border-radius: 48px; background: #111; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.phone-screen { width: 375px; max-width: 100%; height: 812px; border-radius: 38px; overflow: hidden; display: flex; flex-direction: column; background: #8cabd8; }
.phone-status { display: flex; justify-content: space-between; padding: 14px 28px 6px; font-size: 15px; font-weight: 600; background: #fff; color: #000; }
.phone-icons { font-size: 10px; letter-spacing: 1px; }
.phone-header { display: flex; align-items: center; gap: 10px; padding: 8px 14px 10px; background: #fff; border-bottom: 1px solid #e5e5e5; color: #000; }
.phone-back { font-size: 26px; line-height: 1; }
.phone-name { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-chat { flex: 1; overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; }
.phone-row { display: flex; align-items: flex-end; gap: 8px; }
.phone-avatar, .phone-avatar-space { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; align-self: flex-start; }
.phone-avatar { object-fit: cover; background: #dde3ea; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: #556; font-weight: 700; }
.phone-bubble { background: #fff; color: #111; border-radius: 18px; padding: 8px 12px; max-width: 250px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.phone-image { max-width: 220px; max-height: 300px; border-radius: 14px; display: block; }
.phone-row time { font-size: 10px; color: #333; opacity: .7; }
.phone-input { display: flex; align-items: center; gap: 10px; padding: 8px 12px 26px; background: #fff; color: #888; font-size: 18px; }
.phone-field { flex: 1; border-radius: 18px; background: #f1f1f1; padding: 6px 12px; font-size: 14px; }
.center { text-align: center; }

.compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.compose-main { min-width: 0; }
.compose-preview { position: sticky; top: 12px; }
.compose-preview .field-label { margin-top: 0; }
.has-sidebar .container:has(.compose) { max-width: 1160px; }
/* 画面の高さ・幅が足りない時は、右に置いたまま縮小する（JSで zoom を設定） */
.compose-preview .phone { margin: 0; }
@media (max-width: 860px) {
  .compose { grid-template-columns: minmax(0, 1fr); }
  .compose-preview { position: static; }
  .compose-preview .phone { margin: 0 auto; zoom: 1 !important; }
}
@media (max-width: 420px) {
  .phone { padding: 6px; border-radius: 40px; }
  .phone-screen { height: 700px; }
}

.confirm-dialog { border: 0; border-radius: 14px; padding: 22px 22px 18px; max-width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); color: var(--text); }
.confirm-dialog::backdrop { background: rgba(0,0,0,.4); }
.confirm-dialog p { margin: 0 0 18px; white-space: pre-wrap; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---- ステップ配信 ---- */
.toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.toggle-track { width: 42px; height: 24px; border-radius: 999px; background: #cfd6d2; position: relative; transition: background .15s; }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle.on { color: var(--accent-dark); }
.toggle.on .toggle-track { background: var(--accent); }
.toggle.on .toggle-knob { left: 21px; }

.timeline { list-style: none; margin: 4px 0 8px; padding: 0 0 0 22px; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 18px 6px; }
.timeline-dot { position: absolute; left: -29px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent); }
.timeline-start { color: var(--muted); font-size: .9rem; }
.timeline-start .timeline-dot { background: #fff; }
.timeline-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.step-card { margin: 0 0 6px; padding: 12px 14px; }
.step-text { margin: 0 0 6px; white-space: pre-wrap; font-size: .9rem; }
.step-thumb { max-height: 80px; border-radius: 8px; display: block; margin-bottom: 6px; }
.step-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.step-actions .inline-form { margin: 0; }
.step-actions select { padding: 3px 6px; font-size: .85rem; min-width: 0; }

.timing-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px !important; margin: 8px 0; font-weight: 400; }
label.timing-row { margin-left: 18px !important; }
.form .num { width: 4.5em !important; padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: 8px; margin: 0; }
.form input[type=time] { padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.form select { width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.indent-select { width: auto !important; margin: 0 0 8px 24px !important; }
.narrow-form { max-width: 640px; }

.table-card { padding: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfa; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f7faf8; }
.data-table .num-col { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.block { display: block; }
.form-section { margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.setup-box { background: #f6f8f7; border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.setup-box p { margin: 0 0 8px; }
.field-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.field-row a.grow { color: inherit; }
.field-row a.grow:hover { text-decoration: none; }
.field-row a.grow:hover strong { color: var(--accent-dark); }
.move { display: flex; flex-direction: column; gap: 2px; }
.move button { background: none; border: 1px solid var(--line); border-radius: 4px; font-size: .6rem; line-height: 1; padding: 3px 5px; cursor: pointer; color: var(--muted); }
.move button:disabled { opacity: .3; cursor: default; }
.req { font-size: .7rem; color: var(--ng); margin-left: 6px; }
.chip.mini { font-size: .7rem; padding: 0 6px; margin-left: 3px; }
.option-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.option-row input { flex: 1; padding: 9px 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.form .option-row select { width: auto; margin: 0; max-width: 45%; }
.narrow-button { max-width: 640px; }
.answer-cell { max-width: 240px; white-space: pre-wrap; word-break: break-word; }
.response { border-top: 1px solid var(--line); padding: 10px 0; }
.response summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.response .facts { margin-top: 10px; grid-template-columns: minmax(6em, 30%) 1fr; }
.response dd { white-space: pre-wrap; }
.form [data-add-option] { width: auto; }
.tag-new { background: none; border: 0; padding: 4px 0 0; font: inherit; font-size: .82rem; color: var(--accent-dark); cursor: pointer; display: inline-block; }
.tag-new:hover { text-decoration: underline; }
.option-row .tag-new { padding: 0; white-space: nowrap; }
.confirm-dialog input[type=text] { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; }
.confirm-dialog .error { margin: -6px 0 10px; }

/* ---- アンケートの実寸プレビュー（LIFF Full サイズ） ---- */
.liff-screen { background: #f4f6f5; }
.liff-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e5e5e5; color: #111; }
.liff-bar-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liff-bar-close { font-size: 16px; color: #555; }
.liff-frame { flex: 1; width: 100%; border: 0; background: #f4f6f5; display: block; }

/* ---- 質問の編集（Googleフォーム型） ---- */
.settings-summary { padding: 12px 16px; }
.builder-bar { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.builder-bar h2 { margin: 0; }
.save-status { font-size: .8rem; color: var(--muted); }
.save-status.ok { color: var(--accent-dark); }
.save-status.ng { color: var(--ng); }
.gq { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin-bottom: 12px; cursor: pointer; transition: box-shadow .15s; }
.gq:hover { box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.gq.active, .gq-head { cursor: default; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.gq.active::before, .gq-head::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 6px; border-radius: 10px 0 0 10px; background: var(--accent); }
.gq-head { border-top: 8px solid var(--accent); padding-top: 18px; }
.gq-head::before { display: none; }
.gq-form-title, .gq-form-desc, .gq-title, .gq-help, .gq-option input { width: 100%; border: 0; border-bottom: 1px solid transparent; background: transparent; font: inherit; color: var(--text); padding: 6px 0; outline: none; }
.gq-form-title { font-size: 1.6rem; font-weight: 600; }
.gq-form-desc { resize: vertical; color: var(--muted); }
.gq-form-title:hover, .gq-form-desc:hover, .gq-help:hover, .gq-option input:hover { border-bottom-color: var(--line); }
.gq-form-title:focus, .gq-form-desc:focus, .gq-help:focus, .gq-option input:focus { border-bottom: 2px solid var(--accent); }
.gq-row { display: flex; gap: 16px; align-items: flex-start; }
.gq-title { flex: 1; background: #f6f8f7; border-bottom: 1px solid #c9d2cd; padding: 14px 12px; border-radius: 4px 4px 0 0; font-size: 1rem; }
.gq-title:focus { border-bottom: 2px solid var(--accent); }
.gq-type { width: 190px; padding: 12px 10px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.gq-help { font-size: .88rem; color: var(--muted); margin-top: 6px; }
.gq-label { font-size: 1rem; }
.gq-star { color: var(--ng); margin-left: 4px; }
.gq-help-view { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.gq-body { margin-top: 14px; }
.gq-option { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.gq-option input { flex: 1; }
.gq-option .gq-x { order: 9; }
.gq-option select { width: auto; max-width: 34%; padding: 4px 6px; font-size: .78rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); }
.gq-option .tag-new { padding: 0; font-size: .75rem; white-space: nowrap; }
.gq-option.view { min-height: 32px; color: var(--text); }
.gq-circle, .gq-box { width: 18px; height: 18px; border: 2px solid #b9c3be; border-radius: 50%; flex-shrink: 0; }
.gq-box { border-radius: 3px; }
.gq-num { width: 18px; color: var(--muted); font-size: .9rem; flex-shrink: 0; }
.gq-x { background: none; border: 0; font-size: 1.2rem; color: var(--muted); cursor: pointer; padding: 0 4px; }
.gq-x:hover { color: var(--ng); }
.gq-add-option { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 6px 0; border-bottom: 1px solid transparent; }
.gq-add-option:hover { border-bottom-color: var(--line); color: var(--text); }
.gq-answer { color: #9aa49e; border-bottom: 1px dotted #c9d2cd; padding: 6px 0; width: 60%; font-size: .9rem; }
.gq-answer.tall { width: 100%; padding-bottom: 28px; }
.gq-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.gq-tool { background: none; border: 0; width: 36px; height: 36px; border-radius: 50%; font-size: 1rem; color: var(--muted); cursor: pointer; }
.gq-tool:hover:not(:disabled) { background: #f0f3f1; color: var(--text); }
.gq-tool:disabled { opacity: .3; cursor: default; }
.gq-sep { width: 1px; height: 26px; background: var(--line); margin: 0 8px; }
.gq-required { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); cursor: pointer; }
.toggle.small { padding: 0; }
.toggle.small .toggle-track { width: 36px; height: 20px; }
.toggle.small .toggle-knob { width: 14px; height: 14px; }
.toggle.small.on .toggle-knob { left: 19px; }
.empty-q { color: var(--muted); cursor: default; text-align: center; }
.gq-add { display: block; width: 100%; padding: 14px; border: 1px dashed #b9c3be; border-radius: 10px; background: transparent; font: inherit; font-weight: 600; color: var(--accent-dark); cursor: pointer; }
.gq-add:hover { background: #f3faf6; border-color: var(--accent); }
@media (max-width: 560px) {
  .gq { padding: 16px 14px; }
  .gq-row { flex-direction: column; gap: 8px; }
  .gq-type { width: 100%; }
  .gq-option { flex-wrap: wrap; row-gap: 2px; }
  .gq-option input { flex: 1 1 calc(100% - 70px); }
  .gq-option .gq-x { order: 0; }
  .gq-option select { margin-left: 30px; max-width: none; flex: 0 1 auto; }
}
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; padding: 12px 16px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 -2px 12px rgba(0,0,0,.05); }
.save-bar .button { min-width: 120px; }
.save-bar .button:disabled { background: #cfd6d2; cursor: default; }
.save-status.warn { color: #8a6100; font-weight: 600; }
.gq-other { flex: 1; color: var(--text); padding: 6px 0; }
.gq-other span { color: #9aa49e; font-size: .85rem; }
.gq-other-line { flex: 0 1 40%; border-bottom: 1px dotted #c9d2cd; height: 1.2em; }
.gq-option.add .muted { font-size: .85rem; }
.gq-add-other { background: none; border: 0; font: inherit; color: var(--accent-dark); cursor: pointer; padding: 6px 0; }
.gq-add-other:hover { text-decoration: underline; }
.form .liff-note-check { display: flex !important; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 10px; background: #f3faf6; border: 1px solid #cfe3d6; border-radius: 8px; font-weight: 400; font-size: .88rem; cursor: pointer; }
.form .liff-note-check[hidden] { display: none !important; }

/* ---- アンケートの回答（Googleフォームの「回答」タブ型） ---- */
.resp-wrap { max-width: 760px; }
.resp-head { padding-bottom: 0; cursor: default; }
.resp-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.resp-head h1 { font-size: 1.5rem; margin: 0; }
.resp-actions { display: flex; align-items: center; gap: 14px; }
.resp-tabs { display: flex; gap: 6px; margin: 16px -22px 0; padding: 0 22px; border-top: 1px solid var(--line); }
.resp-tabs a { padding: 12px 16px; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; }
.resp-tabs a:hover { text-decoration: none; color: var(--text); }
.resp-tabs a.on { color: var(--accent-dark); border-bottom-color: var(--accent); }
.resp-card { cursor: default; }
.resp-q { font-size: 1rem; font-weight: 600; margin: 0 0 2px; }
.resp-sub { margin: 16px 0 6px; font-size: .85rem; color: var(--muted); font-weight: 600; }

.bars { display: grid; gap: 10px; margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: 12px; padding: 2px 0; border-radius: 4px; outline: none; }
.bar-row:hover .bar-fill, .bar-row:focus .bar-fill { background: var(--accent-dark); }
.bar-label { font-size: .88rem; overflow-wrap: anywhere; }
.bar-track { height: 22px; display: flex; align-items: center; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; transition: background .1s; }
.bar-value { font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; min-width: 6.5em; }
.bar-value .muted { font-size: .78rem; margin-left: 2px; }
.chart-tip { position: absolute; z-index: 40; background: #1d2420; color: #fff; font-size: .8rem; padding: 6px 10px; border-radius: 6px; pointer-events: none; white-space: nowrap; }

.text-answers { list-style: none; margin: 12px 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.text-answers li { background: #f6f8f7; border-radius: 6px; padding: 9px 12px; margin-bottom: 6px; white-space: pre-wrap; font-size: .9rem; }

.resp-pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: default; padding: 12px 18px; }
.pager-btn { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.4rem; color: var(--text); }
.pager-btn:hover { background: #f0f3f1; text-decoration: none; }
.pager-btn.disabled { opacity: .3; pointer-events: none; }
.gq-option.picked span:last-child { font-weight: 600; }
.gq-option.picked .gq-circle { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
.gq-option.picked .gq-box { border-color: var(--accent); background: var(--accent); }
.resp-answer { margin: 10px 0 0; padding-bottom: 6px; border-bottom: 1px dotted #c9d2cd; white-space: pre-wrap; }
@media (max-width: 560px) {
  .bar-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .bar-label { grid-column: 1 / -1; }
  .resp-tabs { margin: 16px -14px 0; padding: 0 14px; }
}

.header-drop { position: relative; margin-bottom: 12px; border: 2px dashed #b9c3be; border-radius: 10px; background: #fafcfb; cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.header-drop:hover, .header-drop.dragging { border-color: var(--accent); background: #f3faf6; }
.header-drop img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.header-drop-empty span b { color: var(--accent-dark); font-size: inherit; }
.header-drop-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; text-align: center; color: var(--muted); font-size: .85rem; }
.header-drop-empty b { color: var(--text); font-size: .95rem; }
.header-drop.has-image { border-style: solid; border-color: var(--line); cursor: default; }
.header-drop.has-image .header-drop-empty { display: none; }
.header-drop-actions { display: none; position: absolute; right: 10px; bottom: 10px; gap: 10px; align-items: center; background: rgba(255,255,255,.94); padding: 6px 10px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.header-drop.has-image .header-drop-actions { display: flex; }
.header-drop-status { margin: 0; padding: 0 12px; font-size: .8rem; color: var(--accent-dark); }
.header-drop-status:empty { display: none; }
.header-drop.has-image .header-drop-status:not(:empty) { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.94); padding: 6px 10px; border-radius: 8px; }
.header-drop.dragging.has-image::after { content: "ドロップして画像を差し替え"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6,167,75,.75); color: #fff; font-weight: 700; }
.row-actions { white-space: nowrap; cursor: default; }
.row-actions .button { margin-left: 4px; }
.row-actions input:not([hidden]) { width: 220px; font-size: .75rem; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.phone-link { color: #2d63c8; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.mode[hidden] { display: none; }
.test-send { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.test-send-label { font-weight: 600; font-size: .9rem; }
.form .test-send select { width: auto; margin: 0; padding: 6px 8px; }
.form .test-send .button { width: auto; margin: 0; }
.ok-text { color: var(--accent-dark); }
.phone-image.large { max-width: none; width: calc(100% - 42px); max-height: none; border-radius: 16px; }
.form .large-check { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 400; flex-wrap: wrap; }
.form .image-link { display: block; margin: 8px 0 0 26px; font-weight: 400; font-size: .9rem; }
.form .image-link[hidden] { display: none; }
.form .image-link input { width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.phone-row.mine { justify-content: flex-end; margin-bottom: 6px; }
.phone-bubble.mine { background: #89e36a; }
td.move { width: 1%; }
.tester-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stats.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
.qr-box { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.qr-canvas { width: 160px; height: 160px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.qr-canvas canvas, .qr-canvas img { width: 100% !important; height: 100% !important; display: block; }
.insert-select { font: inherit; font-size: .78rem; padding: 2px 8px; border-radius: 999px; border: 1px solid #cfe3d6; background: #f3faf6; color: var(--accent-dark); cursor: pointer; }
.mode-detail { margin: 6px 0 4px 24px; }
.mode-detail[hidden], select[hidden] { display: none !important; }

select[hidden] + .tag-new { display: none; }
.form .mode-detail input[type=datetime-local] { width: auto; }

/* hidden を付けた要素は、表示の指定より優先して隠す */
[hidden] { display: none !important; }

.button-row{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 6px}
.button-row .button{width:auto;flex:0 0 auto}

/* Instagram自動DM：投稿を選ぶ欄 */
.ig-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.ig-media-item { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; font-weight: normal; }
.ig-media-item:has(input:checked) { border-color: var(--accent); background: var(--ok-bg); }
.ig-media-item img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; background: var(--line); }
details.card summary { cursor: pointer; }
details.card[open] summary { margin-bottom: 12px; }
