:root {
  --navy: #101A47; --blue: #3256DE; --purple: #7348CE; --orange: #E28F3F; --teal: #2F9E8F; --red: #D64545;
  --bg: #F6F8FE; --tint: #EAF0FF; --line: #DCE3F5; --sub: #5B6488; --white: #fff;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--navy);
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  font-size: 16px; line-height: 1.6; padding-bottom: calc(76px + var(--safe-b));
}
a { color: var(--blue); text-decoration: none; }
button { font: inherit; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: rgba(246, 248, 254, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 800; font-size: 17px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.reload { border: 1px solid var(--line); background: var(--white); border-radius: 10px; width: 40px; height: 40px; font-size: 20px; color: var(--blue); }
main { padding: 16px; max-width: 760px; margin: 0 auto; }
.loading, .empty { color: var(--sub); font-size: 15px; }
h2 { font-size: 15px; color: var(--sub); margin: 22px 0 8px; font-weight: 700; letter-spacing: 0.02em; }
h2:first-child { margin-top: 4px; }
.card { background: var(--white); border-radius: 16px; box-shadow: 0 6px 18px rgba(16, 26, 71, 0.06); padding: 14px 16px; }
.banner { margin: 10px 16px 0; padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.banner.error { background: #FDECEC; color: var(--red); }
.banner.ok { background: #E7F6F2; color: var(--teal); }
.banner.info { background: var(--tint); color: var(--navy); }
.banner button { margin-left: 8px; border: 0; border-radius: 8px; padding: 4px 10px; background: var(--navy); color: #fff; font-size: 14px; }

/* やること */
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo li a {
  display: flex; align-items: center; gap: 10px; background: var(--white); border-radius: 14px; padding: 12px 14px;
  color: var(--navy); box-shadow: 0 4px 12px rgba(16, 26, 71, 0.05); font-size: 15px; font-weight: 600;
}
.todo .tt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.todo .when { color: var(--sub); font-size: 14px; font-weight: 500; white-space: nowrap; }
.kind { flex: none; font-size: 14px; font-weight: 700; border-radius: 999px; padding: 2px 10px; color: #fff; }
.kind.pr { background: var(--purple); } .kind.hold { background: var(--orange); } .kind.stopped { background: var(--red); } .kind.deadline { background: var(--blue); }
.done-all { background: var(--white); border-radius: 14px; padding: 14px; color: var(--teal); font-weight: 700; }

/* 次の投稿 */
.next { display: block; color: var(--navy); }
.next .d { font-size: 22px; font-weight: 800; }
.next .t { font-size: 16px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }

/* 状態 */
.st { display: inline-block; font-size: 14px; font-weight: 700; border-radius: 999px; padding: 1px 10px; color: #fff; white-space: nowrap; }
.st.scheduled { background: var(--blue); } .st.review { background: var(--purple); } .st.published { background: var(--teal); }
.st.hold { background: var(--orange); } .st.stopped, .st.due { background: var(--red); }
.st.due { background: #8A93B5; }

/* 実行結果 */
.runs { list-style: none; margin: 0; padding: 0; }
.runs li a { display: flex; gap: 10px; align-items: center; padding: 8px 2px; color: var(--navy); font-size: 15px; border-bottom: 1px solid var(--line); }
.runs .r { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex: none; }
.r.success { background: var(--teal); } .r.failure { background: var(--red); } .r.pending { background: #8A93B5; }
.runs .w { flex: 1; } .runs .when { color: var(--sub); font-size: 14px; }

/* カレンダー */
.month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.month b { font-size: 20px; }
.month a { padding: 8px 14px; background: var(--white); border-radius: 10px; border: 1px solid var(--line); font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: 14px; color: var(--sub); font-weight: 700; }
.cal .day {
  min-height: 52px; background: var(--white); border-radius: 10px; padding: 4px 4px 6px; border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--navy); font-size: 14px;
}
.cal .day.out { visibility: hidden; }
.cal .day.today { border-color: var(--blue); }
.cal .day.sel { background: var(--tint); }
.cal .dots { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.scheduled { background: var(--blue); } .dot.review { background: var(--purple); } .dot.published { background: var(--teal); }
.dot.hold { background: var(--orange); } .dot.stopped, .dot.due { background: var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 12px 0; font-size: 14px; color: var(--sub); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* 一覧 */
.plist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plist a { display: block; background: var(--white); border-radius: 14px; padding: 12px 14px; color: var(--navy); box-shadow: 0 4px 12px rgba(16, 26, 71, 0.05); }
.plist .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 14px; color: var(--sub); }
.plist .t { font-weight: 700; font-size: 16px; margin-top: 2px; overflow-wrap: anywhere; }
.plist .note { color: var(--orange); font-size: 14px; margin-top: 2px; }

/* 詳細 */
.phead .d { font-size: 20px; font-weight: 800; }
.phead .t { font-size: 17px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
.phead .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--sub); align-items: center; }
.slides { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 14px -16px 0; padding: 0 16px 6px; }
.slides img, .slides video { flex: none; width: 82%; max-width: 420px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; scroll-snap-align: center; background: var(--tint); }
.slides video { aspect-ratio: 9 / 16; width: 62%; }
.count { font-size: 14px; color: var(--sub); margin-top: 4px; }
.caption { white-space: pre-wrap; font-size: 15px; overflow-wrap: anywhere; }
.review { font-size: 14px; }
.review summary { font-weight: 700; cursor: pointer; font-size: 15px; }
.review pre { white-space: pre-wrap; font-family: inherit; font-size: 14px; margin: 8px 0 0; overflow-wrap: anywhere; }
.judge { font-weight: 800; }
.judge.ok { color: var(--teal); } .judge.ng { color: var(--red); }
.actions {
  position: sticky; bottom: calc(66px + var(--safe-b)); display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px;
  background: rgba(246, 248, 254, 0.95); padding: 10px 0; margin-top: 16px;
}
.btn { border: 0; border-radius: 12px; padding: 12px 10px; font-weight: 800; font-size: 16px; color: #fff; background: var(--blue); }
.btn.approve { background: var(--teal); } .btn.reject { background: var(--orange); } .btn.sub { background: var(--white); color: var(--navy); border: 1px solid var(--line); }
.btn:disabled { opacity: 0.45; }
.hint { font-size: 14px; color: var(--sub); }

/* 確認の小窓 */
dialog { border: 0; border-radius: 18px; padding: 20px; width: min(92vw, 420px); color: var(--navy); }
dialog::backdrop { background: rgba(16, 26, 71, 0.45); }
dialog h3 { margin: 0 0 8px; font-size: 18px; }
dialog p { margin: 0 0 12px; font-size: 15px; }
dialog textarea, dialog input { width: 100%; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
dialog textarea { min-height: 96px; }
dialog .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
dialog .btns { display: flex; gap: 8px; margin-top: 14px; }
dialog .btns .btn { flex: 1; }

/* 下のタブ */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--white); border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tabs a { display: flex; flex-direction: column; align-items: center; padding: 8px 0 10px; color: var(--sub); font-size: 14px; font-weight: 700; }
.tabs a .ic { font-size: 20px; line-height: 1.2; }
.tabs a.on { color: var(--blue); }
