:root {
  --bg: #f7f3ea; --card: #fffdf8; --ink: #1d2433; --muted: #6b7280; --line: #e7dfcf;
  --navy: #1f3b73; --gold: #c9963a; --gold-soft: #fbf1dc;
  --ok: #1f7a4d; --ok-bg: #e6f4ec; --warn: #9a6200; --warn-bg: #fdf2d8; --err: #b42318; --err-bg: #fde8e6;
  --info: #475467; --info-bg: #eef1f5; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c; --card: #1a1f29; --ink: #e8eaf0; --muted: #9aa3b2; --line: #2b3240;
    --navy: #9db7ec; --gold: #e2b65f; --gold-soft: #2a2416;
    --ok: #6fd3a0; --ok-bg: #16301f; --warn: #f0c060; --warn-bg: #33280f; --err: #ff8a80; --err-bg: #3a1714;
    --info: #b8c0cc; --info-bg: #222936;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 "Be Vietnam Pro", system-ui, sans-serif; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--navy); color: #fff; padding: 22px 0 18px; margin-bottom: 22px; }
@media (prefers-color-scheme: dark) { .top { background: #182a52; } }
.brand { font-weight: 700; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--gold); color: #1f3b73; }
.tagline { margin: 6px 0 0; opacity: .85; font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
h2 { margin: 0 0 14px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); font-size: 14px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 16px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; text-align: center; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-soft); }
.drop span { color: var(--muted); font-size: 13px; }
.thumbs { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs li { position: relative; width: 96px; }
.thumbs img, .thumbs .pdf { width: 96px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; background: var(--info-bg); font-weight: 600; color: var(--muted); }
.thumbs small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumbs button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border-radius: 50%; font-size: 12px; line-height: 1; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
button { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--gold); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; padding: 10px 20px; }
@media (prefers-color-scheme: dark) { button.primary { color: #10131a; } }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.status { min-height: 1.5em; margin: 10px 0 0; color: var(--muted); }
.status.error { color: var(--err); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.meta label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; }
.chip { font-size: 12.5px; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.OK { color: var(--ok); background: var(--ok-bg); } .WARN { color: var(--warn); background: var(--warn-bg); }
.ERROR { color: var(--err); background: var(--err-bg); } .INFO { color: var(--info); background: var(--info-bg); }
.items { list-style: none; padding: 0; margin: 8px 0 0; }
.item { border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.item.s-OK { border-left-color: var(--ok); } .item.s-WARN { border-left-color: var(--gold); } .item.s-ERROR { border-left-color: var(--err); }
.item-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.idx { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.6em; }
.sec { color: var(--muted); font-size: 13px; }
.title { font-weight: 600; flex: 1; min-width: 200px; }
.leader { color: var(--muted); font-size: 13px; font-style: italic; }
.msgs { margin: 6px 0 0 2.4em; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.msgs li::before { content: "› "; }
.sugg { margin: 6px 0 0 2.4em; display: flex; gap: 6px; flex-wrap: wrap; }
.sugg button { font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: var(--gold-soft); border-color: transparent; }
.tools { display: flex; gap: 4px; }
.tools button { padding: 2px 8px; font-size: 13px; }
.editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 0 2.4em; }
.editor label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
details.preview { margin: 6px 0 0 2.4em; font-size: 13.5px; }
details.preview summary { cursor: pointer; color: var(--navy); }
details.preview pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; padding: 10px; background: var(--bg); border-radius: 8px; max-height: 320px; overflow: auto; }
.exports { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.dl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; text-align: left; }
.dl b { font-size: 16px; color: var(--navy); } .dl span { font-size: 12.5px; color: var(--muted); }
.dl.ghost b { color: var(--ink); }
.hint { color: var(--muted); margin: 0 0 12px; }
.hint.warn { color: var(--err); }
.foot { color: var(--muted); font-size: 12px; padding-bottom: 30px; }
@media (max-width: 560px) { .msgs, .sugg, .editor, details.preview { margin-left: 0; } }
[hidden] { display: none !important; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { color: inherit; text-decoration: none; }
.userbox { font-size: 13px; opacity: .9; display: flex; gap: 8px; align-items: center; }
.userbox .link, button.link { background: none; border: 0; color: inherit; text-decoration: underline; padding: 0; cursor: pointer; font-size: 13px; }
.church { margin: 12px 0 0; font-size: 22px; font-weight: 700; }
.member-list { list-style: none; padding: 0; margin: 0; }
.member-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.member-list li:last-child { border-bottom: 0; }
.site-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-list a { display: flex; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.site-list a:hover { border-color: var(--gold); }
a.btn { display: inline-block; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; color: var(--navy); text-decoration: none; font-weight: 600; }
a.btn:hover { border-color: var(--gold); }
