:root{
  --bg:#f4f2ef;
  --card:#ffffff;
  --ink:#171717;
  --muted:#6c6965;
  --line:#ded9d3;
  --accent:#c23b5a;
  --accent-dark:#9e2d48;
  --soft:#f7e8ec;
  --ok:#287a4b;
  --shadow:0 8px 28px rgba(0,0,0,.07);
}
*{box-sizing:border-box}
html{background:var(--bg)}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Hiragino Kaku Gothic ProN","Yu Gothic Medium","Yu Gothic",sans-serif;
  background:var(--bg);
  color:var(--ink);
}
button,input,textarea{font:inherit}
button{cursor:pointer}
.app-shell{max-width:720px;margin:0 auto;padding:env(safe-area-inset-top) 14px calc(24px + env(safe-area-inset-bottom))}
.topbar{
  display:flex;justify-content:space-between;gap:16px;align-items:flex-start;
  padding:22px 4px 14px;
}
.eyebrow,.step{font-size:11px;font-weight:800;letter-spacing:.11em;color:var(--accent)}
h1{font-size:29px;line-height:1.08;margin:2px 0 6px}
h2{font-size:19px;margin:2px 0}
.sub,.hint{color:var(--muted);font-size:13px;line-height:1.55;margin:0}
.card{
  background:var(--card);border:1px solid var(--line);border-radius:18px;
  padding:16px;margin:0 0 12px;box-shadow:var(--shadow);
}
.card.compact{padding:12px 14px}
.section-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.status-row{display:flex;align-items:center;gap:9px;font-size:13px}
.status-row .ghost{margin-left:auto}
.dot{width:9px;height:9px;border-radius:50%;background:#aaa;box-shadow:0 0 0 4px rgba(0,0,0,.04)}
.dot.ok{background:var(--ok)}
.pill,.counter{font-size:12px;background:#f1efec;border:1px solid var(--line);border-radius:999px;padding:5px 9px;white-space:nowrap}
.counter.over{background:#ffe8e8;color:#a62424;border-color:#eabbbb}
.icon-btn{
  border:1px solid var(--line);background:var(--card);border-radius:12px;
  min-width:42px;height:42px;font-size:19px;
}
.primary,.secondary,.ghost{
  border-radius:13px;padding:12px 14px;font-weight:750;border:1px solid transparent;
}
.primary{background:var(--accent);color:white}
.primary:active{background:var(--accent-dark)}
.secondary{background:#1c1c1c;color:white}
.ghost{background:#fff;color:var(--ink);border-color:var(--line)}
.small{padding:7px 10px;border-radius:10px;font-size:12px}
.full{width:100%;margin-top:9px}
button:disabled{opacity:.45;cursor:not-allowed}
.posts-list{display:grid;gap:9px}
.post-item{
  display:grid;grid-template-columns:72px 1fr auto;gap:11px;align-items:center;
  border:1px solid var(--line);border-radius:14px;padding:8px;background:#fff;
}
.post-item.selected{border:2px solid var(--accent);padding:7px;background:var(--soft)}
.post-thumb{
  width:72px;height:72px;object-fit:cover;border-radius:10px;background:#eee;
}
.post-thumb.placeholder{display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--muted)}
.post-title{font-weight:800;font-size:13px;margin-bottom:4px}
.post-caption{font-size:12px;color:var(--muted);line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.radio-dot{width:19px;height:19px;border-radius:50%;border:2px solid var(--line)}
.post-item.selected .radio-dot{border:6px solid var(--accent)}
.hero-image{width:100%;max-height:420px;object-fit:cover;border-radius:13px;background:#eee;margin-bottom:10px}
.meta-line{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:var(--muted);margin:4px 0 8px}
.meta-line a{color:var(--accent);text-decoration:none;font-weight:700}
textarea{
  width:100%;border:1px solid var(--line);border-radius:13px;padding:12px;
  resize:vertical;background:#fff;color:var(--ink);line-height:1.55;
}
#originalCaption{min-height:150px;background:#f7f6f4}
.editor{min-height:150px;margin-top:10px;font-size:16px}
.empty{padding:18px 4px;text-align:center;color:var(--muted);font-size:13px}
.hidden{display:none!important}
dialog{
  border:0;padding:0;background:transparent;width:min(92vw,520px);
}
dialog::backdrop{background:rgba(0,0,0,.45)}
.dialog-card{background:white;border-radius:20px;padding:18px;box-shadow:var(--shadow)}
.dialog-card label{display:block;font-size:13px;font-weight:700;margin:12px 0}
.dialog-card input[type=password]{
  display:block;width:100%;margin-top:6px;padding:12px;border:1px solid var(--line);border-radius:12px;
}
.check-row{display:flex!important;align-items:center;gap:8px}
.check-row input{width:18px;height:18px}
.toast{
  position:fixed;left:50%;bottom:calc(28px + env(safe-area-inset-bottom));
  transform:translateX(-50%);z-index:999;background:#171717;color:white;
  border-radius:12px;padding:11px 14px;max-width:90vw;font-size:13px;box-shadow:var(--shadow);
}
.history-list{display:grid;gap:8px;margin:10px 0}
.history-item{border-top:1px solid var(--line);padding-top:8px;font-size:12px}
summary{font-weight:800;cursor:pointer}
@media (min-width:680px){
  .app-shell{padding-left:24px;padding-right:24px}
  .card{padding:20px}
}

.show-posted-toggle{
  display:flex;align-items:center;gap:8px;margin:-2px 0 12px;
  font-size:13px;color:var(--muted);font-weight:700;
}
.show-posted-toggle input{width:18px;height:18px}
.post-item.posted{
  opacity:.68;
  background:#f6f5f3;
}
.posted-badge{
  display:inline-block;
  margin-left:6px;
  padding:2px 7px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  background:#e9e7e3;
  color:#5d5954;
  vertical-align:1px;
}
