/* SNS配信 管理画面。2026-10-21 社長の指示で明るめに変更：白いヘッダーとメニュー・明るい青の主ボタン・橙の注意。外部フォントは使わない。 */
:root {
  --bg: #F6F8FC;
  --surface: #FFFFFF;
  --surface-2: #EEF2F8;
  --text: #172033;
  --muted: #566176;
  --line: #DCE3EE;
  --line-soft: #EDF1F7;
  --accent: #2257D6;
  --accent-strong: #1A44AA;
  --accent-soft: #E6EEFE;
  --on-accent: #FFFFFF;
  --warn: #A34A06;
  --warn-line: #E3B48F;
  --warn-soft: #FBEFE4;
  --danger: #B3261E;
  --danger-soft: #FCE8E6;
  --ok: #1D6B3A;
  --ok-soft: #E6F2EA;
  --bar: #FFFFFF;
  --bar-text: #172033;
  --bar-muted: #566176;
  --bar-line: #DCE3EE;
  --pf: #172033;
  --pf-text: #FFFFFF;
  --article: #6D3FC0;
  --article-soft: #F1EAFD;
  --article-line: #C9B3F2;
  --focus: #8FB0F0;
  --radius: 10px;
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Noto Sans Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1115;
    --surface: #181B21;
    --surface-2: #22262E;
    --text: #E8EAEE;
    --muted: #A3AAB6;
    --line: #2E333C;
    --line-soft: #252A32;
    --accent: #7FA6F5;
    --accent-strong: #A9C3F8;
    --accent-soft: #1B2A47;
    --on-accent: #0B1530;
    --warn: #F2A86A;
    --warn-line: #8A5528;
    --warn-soft: #3A2616;
    --danger: #F2B8B5;
    --danger-soft: #3B1A18;
    --ok: #7FD39D;
    --ok-soft: #173223;
    --bar: #181B21;
    --bar-text: #E8EAEE;
    --bar-muted: #A3AAB6;
    --bar-line: #2E333C;
    --pf: #E8EAEE;
    --pf-text: #0F1115;
    --article: #C4A6F7;
    --article-soft: #2A1F40;
    --article-line: #5B4590;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 12px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.loading { padding: 32px 16px; color: var(--muted); text-align: center; }

/* ヘッダーと切り替え */
.top {
  position: sticky; top: 0; z-index: 10; background: var(--bar); color: var(--bar-text);
  border-bottom: 1px solid var(--bar-line); box-shadow: 0 1px 4px rgba(23, 32, 51, .05);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 12px;
}
.top h1 { margin: 0; font-size: 16px; font-weight: 700; flex: 1 1 auto; }
.top .count { font-family: var(--mono); font-size: 13px; color: var(--bar-muted); }
.top .icon-btn { color: var(--bar-text); border-color: var(--bar-line); background: transparent; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs:empty { display: none; }
.tabs a {
  min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; position: relative; white-space: nowrap;
}
.tabs a svg { width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.tabs a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent);
}
.tabs .badge {
  position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--warn); color: #FFFFFF; font-size: 11px; line-height: 18px; text-align: center;
  font-family: var(--mono);
}
main { max-width: 760px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
main:focus { outline: none; }
h2 { margin: 8px 0 0; font-size: 17px; }
h3 { margin: 0; font-size: 15px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.empty { padding: 20px 16px; text-align: center; color: var(--muted); background: var(--surface);
         border: 1px dashed var(--line); border-radius: var(--radius); }

/* カード */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
        display: flex; flex-direction: column; gap: 12px; }
.card.alert { border-color: var(--warn-line); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent-strong); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.quote-note { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--accent-strong); }
.source summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.source p { margin: 6px 0 0; word-break: break-word; }
.card .chips { flex-wrap: wrap; overflow: visible; align-items: center; }
.card .chip { min-height: 44px; }
.card .chip:hover { border-color: var(--warn); color: var(--warn); }
.body-text { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line-soft);
             border-radius: var(--radius); padding: 10px 12px; font-size: 15px; margin: 0; }
.media { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.media img, .media video { width: 100%; max-height: 420px; object-fit: contain; background: #000;
                           border-radius: var(--radius); display: block; }
.checks { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; }
.checks.ok { color: var(--ok); }
.checks.bad { color: var(--warn); }
.checks ul { margin: 0; padding-left: 18px; }
details { font-size: 13px; color: var(--muted); }
details summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
details ul { margin: 4px 0 0; padding-left: 18px; }

/* ボタン */
.btn {
  min-height: 48px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.danger { border-color: var(--warn-line); color: var(--warn); }
.btn.danger.armed { background: var(--warn); border-color: var(--warn); color: #FFFFFF; font-weight: 700; }
.btn.link { border: 0; background: transparent; color: var(--accent); min-height: 44px; padding: 0 4px; font-size: 14px; }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 12px; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { min-width: 44px; min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
            display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .main { display: flex; gap: 10px; }
.actions .main .btn { flex: 1 1 0; }
.actions .main .btn.primary { flex: 2 1 0; }
/* 直す・あとで決める（D-102） */
.sub-actions { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.sub-title { font-size: 13px; color: var(--muted); font-weight: 700; }
.sub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.btn.tile { flex-direction: column; gap: 2px; min-height: 72px; padding: 8px 6px; background: var(--accent-soft); border-color: var(--accent-line, var(--line)); color: var(--accent-strong); }
.btn.tile:hover { border-color: var(--accent); }
.tile-label { font-size: 14px; font-weight: 700; line-height: 1.25; text-align: center; }
.tile-hint { font-size: 11.5px; color: var(--muted); font-weight: 400; text-align: center; }
.actions .sub { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; }

/* 入力 */
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
label .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type="text"], input[type="password"], input[type="url"], input[type="date"], input[type="time"],
input[inputmode="numeric"], input[type="number"], select, textarea {
  min-height: 48px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); font-size: 16px; width: 100%;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.form { display: flex; flex-direction: column; gap: 12px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > label { flex: 1 1 140px; }
.full { flex-basis: 100%; }
.counter { font-size: 13px; text-align: right; color: var(--muted); }
.counter.over { color: var(--warn); font-weight: 700; }
.notice { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; color: var(--muted); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

/* ログイン */
.login { max-width: 420px; margin: 24px auto; }
.login .card { gap: 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }

/* 一覧（予定・状態） */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.list > li:last-child { border-bottom: 0; }
.list .time { font-family: var(--mono); font-size: 16px; min-width: 52px; }
.list .grow { flex: 1 1 0; min-width: 0; }
.list > li > .btn { flex: 0 0 auto; }
.list .inline-form.grow { flex-basis: 200px; }
.list .snippet { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list .past { opacity: .6; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--text); }
.stat .label { font-size: 13px; color: var(--muted); display: block; }
.stat .num { font-family: var(--mono); font-size: 28px; font-weight: 500; }
.stat.warn .num { color: var(--warn); }
.stat.accent .num { color: var(--accent); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.daypick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.daypick .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 700; }
.daypick input { width: auto; }

/* 知らせ */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom));
  max-width: calc(100% - 32px); width: max-content; z-index: 30; pointer-events: none;
}
.toast > div { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--radius);
               font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.2); margin-top: 8px; }
.toast > div.error { background: var(--warn); color: #FFFFFF; }
@media (min-width: 1024px) { .toast { bottom: 24px; } }
@media (prefers-reduced-motion: no-preference) {
  .toast > div { animation: rise .18s ease-out; }
  @keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* プラットフォームとアカウントの切り換え（D-75） */
.filter { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip {
  flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.chip-note { font-size: 11px; opacity: .75; }
.chip-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn); color: #FFFFFF;
              font-size: 12px; line-height: 20px; font-family: var(--mono); text-align: center; }
.filter-account { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--muted); }
.filter-account label { font-weight: 400; font-size: 14px; white-space: nowrap; }
.filter-account select { flex: 1 1 auto; min-height: 44px; }
.tag.pf { background: var(--pf); color: var(--pf-text); }
/* 記事（X の長文）は通常の投稿と見分けやすく：紫の帯と「記事」の印 */
.tag.kind-article { background: var(--article); color: #FFFFFF; }
.card.is-article { border-color: var(--article-line); border-left: 5px solid var(--article); background: linear-gradient(var(--article-soft), var(--surface) 72px); }
.card.is-article .body-text { max-height: 16em; overflow-y: auto; }
.article-note { margin: 0; font-size: 13px; color: var(--article); font-weight: 600; }
.cards { display: flex; flex-direction: column; gap: 16px; }
.platform-block { display: flex; flex-direction: column; gap: 12px; }
.add-row { display: flex; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 420px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.table thead th { color: var(--muted); font-weight: 500; font-size: 13px; }

/* PC：左にメニュー、広い一覧（スマホと同じ画面・同じログイン） */
@media (min-width: 1024px) {
  body { padding-bottom: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr);
         grid-template-areas: "top top" "tabs main"; min-height: 100vh; align-content: start; }
  .top { grid-area: top; padding: 12px 24px; }
  .top h1 { font-size: 18px; }
  .tabs { grid-area: tabs; position: sticky; top: 64px; bottom: auto; align-self: start; display: flex; flex-direction: column;
          gap: 4px; padding: 20px 14px; border-top: 0; border-right: 1px solid var(--line); background: var(--surface);
          height: calc(100vh - 64px); }
  .tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 14px; font-size: 16px;
            border-radius: 10px; color: var(--text); font-weight: 600; }
  .tabs a:hover { background: var(--surface-2); }
  .tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
  .tabs a[aria-current="page"]::before { top: 10px; bottom: 10px; left: 0; right: auto; width: 4px; height: auto; border-radius: 0 3px 3px 0; }
  .tabs .badge { position: static; margin-left: auto; }
  main { grid-area: main; max-width: 1280px; width: 100%; margin: 0; padding: 24px 32px; }
  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); align-items: start; }
  .filter { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .filter-account { min-width: 280px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .toast { bottom: 24px; }
}

.slot-preview { flex-basis: 100%; margin: 0; font-size: 14px; font-family: var(--mono); color: var(--accent-strong); }
.slot-editor > label { flex: 1 1 130px; }
.slot-box { margin: 8px 0; display: grid; gap: 8px; justify-items: start; }
.slot-box .notice { margin: 0; }
.card.waiting { border-color: var(--warn); }
.slot-preview.warn { color: var(--warn); font-weight: 700; }

/* ---------- 社長の依頼（D-98〜D-100） ---------- */
.row.end { justify-content: flex-end; }
.row.wrap > label { flex: 1 1 140px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
label.check input { width: 20px; height: 20px; }
/* 投稿の形（通常・長いポスト・記事）を3つのボタンから選ぶ */
.style-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.style-option { position: relative; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; min-height: 64px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; }
.style-option input { position: absolute; opacity: 0; pointer-events: none; }
.style-option:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-soft); }
.style-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.style-label { font-size: 14px; font-weight: 700; }
.style-hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.tag.style-long { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.tag.style-article { background: var(--article-soft, var(--accent-soft)); color: var(--article, var(--accent-strong)); border-color: var(--article, var(--accent)); }
/* 画像・動画の依頼欄（承認して予約の上） */
.media-request { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.media-request-head { display: flex; align-items: center; gap: 6px; color: var(--accent-strong); }
.media-request.is-requested, .media-request.is-working { border-color: var(--accent); background: var(--accent-soft); }
.media-request.is-failed { border-color: var(--warn-line); }
.media-request.is-failed .media-status { color: var(--warn); font-weight: 700; }
.media-status { margin: 0; font-size: 14px; }
.media-form, .media-fields { display: flex; flex-direction: column; gap: 10px; }
.media-fields textarea, .media-form textarea { min-height: 96px; }
.compose { display: flex; flex-direction: column; gap: 14px; }
.compose-link { margin: 4px 0 8px; }
@media (max-width: 420px) { .style-choice, .sub-grid { gap: 6px; } .style-hint, .tile-hint { font-size: 11px; } }

/* ---------- ペルソナ（D-106） ---------- */
.persona-form { display: flex; flex-direction: column; gap: 12px; }
.persona-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 14px; }
.persona-group[open] { padding-bottom: 14px; }
.persona-group > summary { cursor: pointer; font-weight: 700; padding: 14px 0; min-height: 48px; color: var(--accent-strong); }
.persona-group > label { margin-top: 12px; }
.persona-group textarea { min-height: 96px; }
.persona-group textarea.persona-list { min-height: 120px; font-family: inherit; }
.persona-accounts { border: 0; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.persona-accounts legend { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; z-index: 2; }
@media (max-width: 767px) { .sticky-actions { bottom: 64px; } }

.bands { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0; display: grid; gap: 8px; }
.bands legend { font-weight: 700; padding: 0 6px; }
.band-rows { display: grid; gap: 8px; }
.band-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.band-row input[type=number] { max-width: 100%; }
.band-row > :nth-child(5), .band-row > :nth-child(6), .band-row > :nth-child(7) { align-self: center; }
@media (max-width: 480px) { .band-row { grid-template-columns: 1fr 1fr; } .band-row > :first-child { grid-column: 1 / -1; } .band-row > .muted:nth-child(3) { display: none; } .band-row > .btn { justify-self: end; } }

/* セットの自動作成（D-119）：場面の1行・画像の候補 */
.scene { border-left: 3px solid var(--accent); padding: 4px 10px; background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; }
.scene summary { cursor: pointer; font-size: 14px; }
.scene-label { font-weight: 700; color: var(--accent-strong); }
.scene .kv { margin: 8px 0 4px; font-size: 13px; }
.candidates { display: flex; flex-direction: column; gap: 8px; }
.candidate-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.candidate { position: relative; padding: 0; border: 3px solid var(--line); border-radius: var(--radius); background: #000; overflow: hidden; cursor: pointer; }
.candidate img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.candidate[aria-pressed="true"] { border-color: var(--accent); }
.candidate-mark { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--surface); color: var(--text); }
.candidate[aria-pressed="true"] .candidate-mark { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.retry-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.sets-fields { display: flex; flex-direction: column; gap: 8px; }
.sets-fields[hidden] { display: none; }
.sets-fields textarea { min-height: 72px; }

/* 依頼の状況：種類ごとに色を分ける（新規投稿＝青・画像と動画＝緑・修正＝橙・作り直し＝灰・セット＝紫） */
.progress { display: block; }
.progress > summary.progress-head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; }
.progress > summary.progress-head::-webkit-details-marker { display: none; }
.progress > summary.progress-head::before { content: "▸"; color: var(--muted); }
.progress[open] > summary.progress-head::before { content: "▾"; }
.progress h2 { margin: 0; font-size: 16px; }
.progress-counts { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 auto; }
.progress-toggle { margin-left: auto; }
.progress-body { margin-top: 8px; max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; }
.progress-body > p { margin: 0; }
.progress-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.progress-item { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); padding: 6px 10px; background: var(--surface); }
.progress-item summary.progress-line { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; min-width: 0; }
.progress-item summary.progress-line::-webkit-details-marker { display: none; }
.progress-item.is-working { border-left-color: var(--accent); background: var(--accent-soft); }
.progress-item.is-waiting { border-left-color: var(--muted); }
.progress-item.is-failed { border-left-color: var(--warn); background: var(--warn-soft); }
.progress-item.is-done { border-left-color: var(--ok); }
.progress-title { font-size: 14px; font-weight: 600; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-item details[open] .progress-title { white-space: normal; }
.progress-stage { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.progress-item .small.muted { margin: 2px 0 0; }
.progress-item.is-failed .progress-stage { color: var(--warn); }
.progress-recent summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.progress-recent .progress-list { margin-top: 8px; }
.progress-body > p.progress-power { padding: 8px 10px; border-radius: var(--radius); border-left: 4px solid var(--warn); background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.progress-times summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.progress-times ul { margin: 6px 0 0; padding-left: 18px; }
/* 承認済み・投稿待ち（D-122）：緑の枠で、承認待ちと見分ける */
.card.is-approved { border-color: var(--ok); border-left: 5px solid var(--ok); background: linear-gradient(var(--ok-soft), var(--surface) 72px); }
.approved-badge { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ok); }
.list > li.is-approved { border-left: 4px solid var(--ok); background: var(--ok-soft); padding-left: 8px; border-radius: 6px; }
.tag.type { font-weight: 700; }
.tag.type-post { background: var(--accent-soft); color: var(--accent-strong); }
.tag.type-media { background: var(--ok-soft); color: var(--ok); }
.tag.type-revision { background: var(--surface-2); color: var(--text); }
.tag.type-set { background: var(--article-soft); color: var(--article); }
.tag.type-media_fix { background: var(--warn-soft); color: var(--warn); }
article.card.flash { outline: 3px solid var(--focus); transition: outline-color .3s; }

/* 参考画像の欄・これまでの画像と動画（D-123） */
.ref-field { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.ref-field[hidden] { display: none; }      /* 解説画像（ChatGPT・テンプレート）では参考画像を使わない */
.ref-list { display: flex; gap: 8px; flex-wrap: wrap; }
.ref-list:empty { display: none; }
.ref-item { position: relative; margin: 0; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2, var(--surface)); }
.ref-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-remove { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; cursor: pointer; }
.ref-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; max-height: 40vh; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.ref-gallery[hidden] { display: none; }
.ref-pick { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; aspect-ratio: 1; background: var(--surface); cursor: pointer; }
.ref-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-badge { position: absolute; left: 4px; bottom: 4px; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: rgba(0,0,0,.65); color: #fff; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.library-item { padding: 10px; font-size: 13px; }
.library-item { display: flex; flex-direction: column; gap: 8px; }
.library-thumb { position: relative; border-radius: 8px; overflow: hidden; background: var(--line-soft, var(--line)); aspect-ratio: 3 / 4; }
.library-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.library-detail { margin: 0; font-size: 14px; }
.library-prompt { white-space: pre-wrap; word-break: break-word; font-size: 12px; }

/* 自動の点検（P3-①・D-124）：画像の下に出す。赤＝越えている可能性・橙＝確かめて・緑＝問題なし */
.media-item { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.candidate-cell { display: flex; flex-direction: column; gap: 4px; }
.ai-check { font-size: 13px; border-left: 4px solid var(--ok); background: var(--ok-soft); border-radius: 6px; padding: 4px 8px; }
.ai-check summary { cursor: pointer; font-weight: 700; color: var(--ok); }
.ai-check.is-caution { border-left-color: var(--warn); background: var(--warn-soft); }
.ai-check.is-caution summary { color: var(--warn); }
.ai-check.is-danger { border-left-color: var(--danger); background: var(--danger-soft); }
.ai-check.is-danger summary { color: var(--danger); }
.ai-check .kv { display: block; margin: 4px 0; }
.ai-check .kv dt { font-weight: 700; margin-top: 4px; }
.ai-check .kv dd { margin: 0; }
.ai-check p { margin: 2px 0 0; }

/* 返信の受け箱（E1・D-129）：承認待ちのカードの「誰のどの返信への返信か」と、受け箱の画面 */
.reply-context { border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.reply-context p { margin: 0; }
.reply-who { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.like-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.follow-bio { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-theirs { margin: 0; padding: 6px 10px; border-left: 3px solid var(--line); background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.reply-ours summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.reply-item .reply-ours-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.replies-fields { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.also-fields { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 12px; display: grid; gap: 6px; }
.also-fields legend { font-weight: 700; padding: 0 6px; }
.also-fields[hidden] { display: none; }
.tag.type-reply { background: var(--accent-soft); color: var(--accent); }

/* note と X の連携（D-152）：承認待ちのカードの「リンクを返信で付けます」と、note の画面 */
.note-context { border-left: 4px solid var(--ok); background: var(--surface); border-radius: var(--radius); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.note-context p { margin: 0; }
.note-link-text { margin: 0; padding: 6px 10px; border-left: 3px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.note-title { margin: 4px 0; font-size: 16px; overflow-wrap: anywhere; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 14px; max-height: 60vh; overflow: auto; margin: 6px 0 0; }
.note-item input[type=url] { flex: 1 1 220px; min-width: 0; }

/* 承認前／承認後のタブ（D-139） */
.seg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.seg-tab { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; }
.seg-tab + .seg-tab { border-left: 1px solid var(--line); }
.seg-tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 -3px 0 var(--accent); }
.seg-count { font-family: var(--mono); font-size: 13px; min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); text-align: center; }
.seg-tab[aria-current="page"] .seg-count { background: var(--accent); color: var(--on-accent); }

/* 予定の1行を押して中身を開く（D-139） */
.list > li.slot-row { align-items: flex-start; }
.slot-open { display: flex; gap: 10px; align-items: flex-start; flex: 1 1 0; min-width: 0; text-align: left; background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit; cursor: pointer; }
.slot-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.slot-info { display: flex; flex-direction: column; gap: 4px; }
.slot-line { font-size: 14px; color: var(--text); }
.slot-picks { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.slot-chevron { font-size: 22px; line-height: 1; color: var(--muted); transition: transform .15s; padding-top: 2px; }
.slot-open[aria-expanded="true"] .slot-chevron { transform: rotate(90deg); }
.slot-panel { flex: 1 1 100%; min-width: 0; margin-top: 8px; }
.slot-plan .kv dd { font-family: inherit; }
.tag.role { background: var(--surface-2); }
.list > li.slot-row .row { flex-wrap: wrap; gap: 6px; }

/* 社長の案（D-139） */
.idea-modes { display: grid; gap: 8px; }
label.idea-mode { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
label.idea-mode > span { flex: 1 1 0; min-width: 0; }
label.idea-mode input { margin-top: 3px; width: 20px; height: 20px; flex: 0 0 auto; }
label.idea-deck[hidden] { display: none; }
.idea-mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.idea-hint { display: block; font-size: 12.5px; color: var(--muted); }
.tag.kind-video { border-color: var(--accent); color: var(--accent-strong); }

/* アカウントごとのタブ・ジャンルの設定（D-140） */
.seg-tabs.many { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.seg-tabs.many .seg-tab { overflow-wrap: anywhere; font-size: 14px; }
.follow-why { margin: 0; color: var(--accent-strong); }
.genre-box { display: flex; flex-direction: column; gap: 10px; }
.genre-box summary { cursor: pointer; font-weight: 600; }
.genre-box[open] summary { margin-bottom: 8px; }
.genre-box label { margin-top: 8px; }
.genre-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.genre-acc { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.genre-acc p { margin: 0; }
.genre-acc.off { opacity: 0.6; }
.btn.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }

.note-saved-shot { display:block; max-width:100%; height:auto; border-radius:12px; margin-top:12px; }
