/* Admin pages: the site's palette (deep grey-green, linen, persimmon) and type (Pretendard, Big Shoulders for numbers),
   laid out for work: a menu on the left, plain cards and forms on the right. */
:root{
  --green:#3F4A41; --green-d:#2F3831; --linen:#EAE4D3; --paper:#F3EFE5; --card:#FBF9F4; --persimmon:#F4A66A; --persimmon-t:#A34E1C;
  --ink:#232A25; --muted:#5E655F; --line:rgba(35,42,37,.14); --line-2:rgba(35,42,37,.26); --ok:#2f6b3a; --bad:#a3361c;
  --font:"Pretendard Variable",Pretendard,-apple-system,"Apple SD Gothic Neo","Noto Sans KR",sans-serif;
  --tall:"Big Shoulders Display","Pretendard Variable",sans-serif;
}
*{box-sizing:border-box}
html[data-lang="ko"] [lang="en"],html[data-lang="en"] [lang="ko"]{display:none !important}
body{margin:0;font-family:var(--font);color:var(--ink);background:var(--paper);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:inherit}
[hidden]{display:none !important}
h1,h2,h3{letter-spacing:-.02em;margin:0}
h1{font-size:26px;font-weight:800}
h2{font-size:18px;font-weight:800}
h3{font-size:15px;font-weight:700}
.num,.mono{font-family:var(--tall);letter-spacing:.03em}

/* shell: menu + page */
.shell{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh}
.side{background:var(--green);color:var(--linen);padding:20px 14px;display:flex;flex-direction:column;gap:4px;position:sticky;top:0;height:100vh;overflow:auto}
.side .brand{display:flex;align-items:center;gap:10px;text-decoration:none;padding:4px 8px 16px;font-weight:800;font-size:16px}
.side .brand img{width:22px;height:auto}
.side .brand small{display:block;font-weight:500;font-size:13px;opacity:.7;letter-spacing:.04em}
.side .grp{font-size:14px;letter-spacing:.06em;text-transform:uppercase;color:var(--persimmon);font-weight:800;margin-top:14px;padding:12px 10px 6px;border-top:1px solid rgba(234,228,211,.22)}
.side a.nav{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:5px;text-decoration:none;font-size:14.5px;font-weight:600;color:rgba(234,228,211,.86)}
.side a.nav:hover{background:rgba(234,228,211,.08);color:var(--linen)}
.side a.nav.on{background:var(--persimmon);color:var(--green-d)}
.side .foot{margin-top:auto;padding-top:16px;display:flex;flex-direction:column;gap:8px;border-top:1px solid rgba(234,228,211,.16)}
.side .who{font-size:13px;opacity:.8;padding:0 10px}
.side .foot .btns{display:flex;gap:6px;padding:0 6px}
.side button{background:transparent;color:var(--linen);border-color:rgba(234,228,211,.35)}
.topbar{display:none}
.page{padding:32px clamp(18px,3vw,44px) 80px;max-width:1180px;width:100%}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.page-head p{margin:6px 0 0;color:var(--muted)}
@media (max-width:900px){
  .shell{grid-template-columns:minmax(0,1fr)}
  .side{position:fixed;inset:0 30% 0 0;z-index:50;transform:translateX(-100%);transition:transform .3s;height:100%}
  .side.open{transform:none;box-shadow:0 0 0 100vmax rgba(0,0,0,.35)}
  .topbar{display:flex;align-items:center;gap:12px;background:var(--green);color:var(--linen);padding:10px 14px;position:sticky;top:0;z-index:40}
  .topbar b{font-size:15px}
  .topbar button{background:transparent;color:var(--linen);border-color:rgba(234,228,211,.35)}
  .page{padding:20px 14px 60px}
}

/* cards, rows, forms */
.card{background:var(--card);border:1px solid var(--line);border-radius:6px;padding:18px 20px;margin-bottom:16px}
.card>h2{margin-bottom:12px}
.grid{display:grid;gap:12px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(3,minmax(0,1fr))}.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:700px){.g2,.g3,.g4{grid-template-columns:1fr}}
.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.spacer{flex:1}
.hint{color:var(--muted);font-size:14px}
label.f{display:flex;flex-direction:column;gap:4px;font-size:14px;font-weight:600;color:var(--muted);min-width:0}
div.f.trf{display:flex;flex-direction:column;gap:4px;font-size:14px;font-weight:600;color:var(--muted);min-width:0}button.tr{padding:2px 8px;font-size:13px;min-height:0}
label.f.inline{flex-direction:row;align-items:center;gap:8px;color:var(--ink)}
input,textarea,select{font:inherit;color:var(--ink);background:#fff;border:1px solid var(--line-2);border-radius:5px;padding:8px 10px;width:100%;min-width:0}
input[type=checkbox],input[type=radio]{width:auto;accent-color:var(--green)}
input:focus,textarea:focus,select:focus{outline:2px solid var(--persimmon);outline-offset:0;border-color:transparent}
textarea{resize:vertical;min-height:40px;line-height:1.5}
button,.btn{font:inherit;font-weight:700;font-size:14px;border:1px solid var(--line-2);background:#fff;color:var(--ink);border-radius:5px;padding:7px 14px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
button:hover,.btn:hover{border-color:var(--green)}
button.primary,.btn.primary{background:var(--green);border-color:var(--green);color:var(--linen)}
button.accent,.btn.accent{background:var(--persimmon);border-color:var(--persimmon);color:var(--green-d)}
button.danger{color:var(--bad)}
button.sm,.btn.sm{padding:5px 11px;font-size:14px;min-height:32px;min-width:32px}
button:disabled{opacity:.5;cursor:default}
table.list{width:100%;border-collapse:collapse}
table.list th{font-size:13px;color:var(--muted);font-weight:600;text-align:left;padding:6px 8px;border-bottom:1px solid var(--line-2)}
table.list td{padding:9px 8px;border-bottom:1px solid var(--line);vertical-align:middle}
table.list tr:hover td{background:rgba(63,74,65,.03)}
.badge{display:inline-block;font-size:13px;font-weight:700;padding:1px 8px;border-radius:999px;background:var(--linen);color:var(--green)}
.badge.live{background:var(--persimmon);color:var(--green-d)}
.badge.mine{background:var(--green);color:var(--linen)}
.badge.lock{background:#ece9e2;color:var(--muted)}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line-2);border-radius:999px;padding:4px 11px;font-size:14px;background:#fff;cursor:pointer;font-weight:500}
.chip:has(input:checked){background:var(--green);border-color:var(--green);color:var(--linen)}
.chip input{margin:0}
.msg{font-size:13.5px;min-height:1.2em;margin:0;color:var(--bad)}
.ok{color:var(--ok)}
.saved{color:var(--ok)}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:16px}
.stat{background:var(--green);color:var(--linen);border-radius:6px;padding:16px 18px}
.stat b{display:block;font-family:var(--tall);font-size:40px;font-weight:800;line-height:1}
.stat span{font-size:14px;opacity:.8}
.quick{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}
.quick a{display:flex;flex-direction:column;gap:2px;padding:14px 16px;border:1px solid var(--line);border-radius:6px;background:var(--card);text-decoration:none}
.quick a:hover{border-color:var(--green)}
.quick a b{font-size:15px}.quick a span{font-size:13.5px;color:var(--muted)}
.linkbox{display:flex;gap:6px}.linkbox input{flex:1;font-size:14px}
dialog{border:0;border-radius:8px;padding:22px 24px;max-width:560px;width:calc(100% - 32px);background:var(--card);color:var(--ink)}
dialog::backdrop{background:rgba(20,24,21,.45)}

/* the schema editor (content.html): repeatable lists */
.items{display:flex;flex-direction:column;gap:10px}
.item{border:1px solid var(--line);border-radius:6px;background:#fff;padding:12px 14px}
.item>.ihead{display:flex;align-items:center;gap:6px;margin-bottom:10px;flex-wrap:wrap}
.item>.ihead b{font-size:14px;flex:1 1 140px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item.closed>.ibody{display:none}
.item.closed>.ihead{margin-bottom:0}
.item .item{background:var(--card)}
.ibody{display:flex;flex-direction:column;gap:10px}
.imgf{display:flex;gap:10px;align-items:flex-start}
.imgf img{width:84px;height:84px;object-fit:cover;border-radius:5px;background:var(--linen);flex:none}
.imgf .grow{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0}
/* each part its own clear box: a firmer border, a green bar down the left, room between parts and a heading on a tab */
fieldset.sec{border:1px solid var(--line-2);border-left:4px solid var(--green);border-radius:6px;background:var(--card);padding:16px 18px 18px;margin:0 0 26px;min-width:0;box-shadow:0 1px 3px rgba(35,42,37,.08)}
fieldset.sec>legend{font-weight:800;font-size:16px;padding:3px 12px;background:var(--green);color:var(--linen);border-radius:5px}
fieldset[disabled]{background:#f4f2ec}
fieldset[disabled] input,fieldset[disabled] textarea,fieldset[disabled] select{background:#f1efe9;color:#666}
.secbar{display:flex;align-items:center;gap:10px;margin-top:12px}.secbar .meta{color:var(--muted);font-size:13.5px;flex:1}
.savebar{position:sticky;bottom:0;background:linear-gradient(transparent,var(--paper) 30%);padding:18px 0 6px;display:flex;gap:10px;align-items:center;z-index:5}

/* bulletin editor */
.editor{display:grid;grid-template-columns:minmax(300px,var(--formw,60%)) 10px minmax(0,1fr);gap:0;height:calc(100vh - 64px);margin:-32px calc(-1 * clamp(18px,3vw,44px)) -80px}
.editor .form{overflow:auto;padding:20px}
.editor .preview{background:#5b6270;display:flex;flex-direction:column;min-width:0}
/* the line between the form and the print preview: drag it to make either side wider (remembered on this computer) */
.editor .split{cursor:col-resize;background:var(--line);position:relative}.editor .split:hover,.editor .split.on{background:var(--persimmon)}
.editor .split::after{content:"⋮";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:var(--muted);font-size:18px}
.editor.nopv{grid-template-columns:1fr 0 0}.editor.nopv .preview,.editor.nopv .split{display:none}
/* the bulletin editor uses the whole screen (no page width cap); "⛶ 전체" shows the print preview alone */
.page.wide{max-width:none}.editor.pvfull{grid-template-columns:minmax(0,1fr)}.editor.pvfull .form,.editor.pvfull .split{display:none}
/* slides-make: the box under the sermon (a Bible verse, photos, my words) */
.sermon-box{margin:-2px 0 10px 28px;padding:12px 14px;border:2px solid var(--persimmon);border-top-left-radius:0;border-radius:8px;background:rgba(244,166,106,.1);display:grid;gap:8px}
.sermon-box .row{flex-wrap:wrap;gap:8px}.sermon-box .sb-card{background:#fff;border:1px solid var(--line);border-radius:6px;padding:10px;display:grid;gap:8px}.sermon-box .sb-card textarea{font-size:15px;line-height:1.55}
.sb-drop{display:block;border:2px dashed var(--persimmon);border-radius:8px;padding:10px 14px;text-align:center;cursor:pointer;color:var(--ink);background:#fffaf4;font-weight:600}.sb-drop.big{padding:28px 14px;font-size:16px}.sb-drop.on{background:#fde3cc}.sb-drop .hint{display:block;font-weight:400}
.sb-pic{position:relative;display:inline-block}.sb-pic img{height:80px;border-radius:4px;display:block;background:#000}.sb-pic button{position:absolute;top:2px;right:2px;padding:0 6px;min-height:0}.sermon-box .sermon-head{font-size:17px;color:var(--green-d,#2F3831)}.sermon-box .lab{min-width:7.5rem;font-weight:700}
/* bulletin: 오타 점검 */
.typos{border:2px solid var(--persimmon)}.typo-list{margin:8px 0 0;padding-left:0;list-style:none}.typo-list li{padding:8px 0;border-bottom:1px dashed var(--line);line-height:1.6}
.typo-list del{color:#b3261e;background:#fdecea;text-decoration:line-through}.typo-list .ctx{color:var(--muted)}.typo-list b{color:#25612f;background:#dcebdc;padding:0 3px}
.typos .ok-line{margin:8px 0 0;color:#25612f;font-weight:600}
.prayertext .pr-open{cursor:pointer;background:#fff}
/* the prayer's large window (prayer.js) */
.pr-dlg{max-width:1200px;width:calc(100% - 32px);height:calc(100vh - 48px);display:none;flex-direction:column;gap:10px}.pr-dlg[open]{display:flex}
.pr-cols{display:grid;grid-template-columns:1fr 1fr;gap:12px;flex:1.4;min-height:0}.pr-cols .f{display:flex;flex-direction:column;min-height:0;margin:0}.pr-cols textarea{flex:1;font-size:16px;line-height:1.6;resize:none}
.pr-screens{flex:1;min-height:0;overflow:auto;margin:0;padding:8px 8px 8px 34px;border:1px solid var(--line);border-radius:6px;background:var(--paper,#F3EFE5)}
.pr-screens li{padding:4px 0;border-bottom:1px dashed var(--line)}.pr-screens li span{display:block;color:var(--muted);font-size:14px}
@media (max-width:700px){.pr-cols{grid-template-columns:1fr}.pr-dlg{height:calc(100vh - 24px);width:calc(100% - 16px);padding:14px}}
.prayertext{margin-top:8px;padding:10px;border:1px solid var(--line);border-radius:6px;background:rgba(244,166,106,.08)}
.pvshow{position:fixed;right:14px;bottom:14px;z-index:5}
@media (max-width:700px){.pvshow{right:auto;left:14px}}      /* a phone: not over the sections' save buttons (on the right) */
.editor .preview iframe{flex:1;border:0;background:#fff}
.editor .preview .bar{padding:6px 12px;color:#fff;font-size:13.5px;display:flex;gap:12px;align-items:center}
/* each item of the order its own card, so where one ends and the next begins is plain */
.ord .it{display:grid;grid-template-columns:1.1fr 2.2fr .5fr 1.1fr auto;gap:5px;align-items:start;padding:10px;margin-bottom:10px;border:1px solid var(--line-2);border-radius:6px;background:var(--paper)}
.ord .it:nth-child(even){background:#ECE6D8}
.ohead{display:grid;grid-template-columns:1.1fr 2.2fr .5fr 1.1fr auto;gap:5px;font-size:13px;font-weight:700;color:var(--muted);padding:0 0 4px;border-bottom:1px solid var(--line-2)}.ohead span:last-child{width:34px}
.ord .it .pair{display:grid;gap:4px;min-width:0}
.ord .it input,.ord .it textarea,.ord .it select{font-size:14px;padding:6px 8px}
.ord .it .handle{display:flex;flex-direction:column;gap:3px}
.list2 .li .handle,.serv .handle{display:flex;flex-direction:column;gap:3px}
.grip{cursor:grab;touch-action:none}.dragging{opacity:.6;outline:2px solid var(--persimmon);outline-offset:2px}
.ord .it.locked{opacity:.55}
.ord .it .who{font-size:13px;color:var(--muted)}
.ord .it details,.ord .it .prayertext,.ord .it .textbox{grid-column:1/-1}
.ord .it .auto-note{margin:2px 0 4px;font-size:14px;font-weight:600;color:var(--ok)}
.ord .it details summary{font-size:13.5px;color:var(--muted);cursor:pointer}
.list2 .li{display:grid;grid-template-columns:1fr 1.4fr auto;gap:5px;padding:5px 0;align-items:start}
.serv{width:100%;border-collapse:collapse}.serv th{font-size:13px;color:var(--muted);font-weight:600;text-align:left}
.serv td{padding:2px}.serv textarea,.serv input{font-size:14px;padding:4px 6px;min-height:2.6rem}
@media (max-width:1100px){.editor{grid-template-columns:1fr;height:auto;margin:0}.editor .split{display:none}.editor .preview{height:70vh}}

/* bulk entry (my section) */
.bulk{overflow:auto}
.bulk table{border-collapse:collapse;min-width:100%}
.bulk th,.bulk td{border:1px solid var(--line);padding:6px;vertical-align:top}
.bulk th{background:var(--linen);font-size:13.5px;text-align:left;position:sticky;top:0}
.bulk td input,.bulk td textarea{font-size:14px;padding:4px 6px;margin-bottom:3px}
.bulk .wk{min-width:220px}

/* sign-in pages */
.auth{min-height:100vh;display:grid;place-items:center;padding:20px;background:var(--green)}
.auth .card{width:min(420px,100%);padding:28px;display:flex;flex-direction:column;gap:14px}
.auth .brand{display:flex;gap:10px;align-items:center;font-weight:800;font-size:18px}
.auth .brand img{width:26px}
.auth input{font-size:16px;padding:10px 12px}
.auth button.primary{padding:11px;font-size:15px;justify-content:center}
@media (max-width:700px){.ohead{display:none}.ord .it{grid-template-columns:1fr 1fr}.ord .it .handle{flex-direction:row}.list2 .li{grid-template-columns:1fr}.list2 .li .handle{flex-direction:row}.serv{display:block;overflow:auto}}

/* keyboard: where the focus is, always visible */
button:focus-visible,.btn:focus-visible,a:focus-visible,summary:focus-visible,.chip:focus-within{outline:3px solid var(--persimmon);outline-offset:2px}
/* phones and touch screens: fingers need room, and a box under 16px makes iPhone zoom in */
@media (pointer:coarse),(max-width:700px){
  button,.btn{min-height:44px}button.sm,.btn.sm{min-height:40px;min-width:40px}button.tr{min-height:40px}
  input,select,textarea,.ord .it input,.ord .it textarea,.ord .it select,.serv textarea,.serv input,.bulk td input,.bulk td textarea,.linkbox input{font-size:16px}.chip{min-height:40px}
  .page{padding:20px 14px 80px}.page-head h1{font-size:24px}
}
.unsaved{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:#fbe3cd;color:#8a4a12;border-radius:6px;padding:8px 12px;margin:0 0 12px;font-weight:600;position:sticky;top:0;z-index:3}
fieldset.sec.folded>*:not(legend){display:none}fieldset.sec.folded legend{cursor:pointer}fieldset.sec.folded legend::after{content:" ▾";color:inherit}
/* phones: a list table becomes one card per row (its columns one under another), not columns squeezed to a word */
@media (max-width:700px){
  table.list:not(.yr),table.list:not(.yr) tbody,table.list:not(.yr) tr,table.list:not(.yr) td{display:block;width:auto}
  table.list:not(.yr) thead{display:none}
  table.list:not(.yr) tr{border-bottom:1px solid var(--line);padding:8px 0}
  table.list:not(.yr) td{border:0;padding:2px 0;text-align:left!important;white-space:normal!important}
  table.list:not(.yr) td img{max-width:120px}
}
/* 'AI로 정리해서 넣기' / 'AI로 고치기': a folded box above the form; nothing in it saves by itself */
details.ai-box{border:1px solid var(--line);border-left:4px solid var(--persimmon);border-radius:6px;background:#fff;padding:10px 14px;margin:0 0 14px}
details.ai-box summary{font-weight:700;cursor:pointer;font-size:15px}
details.ai-box textarea{width:100%;font-size:15px}
.ai-ch{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 10px;align-items:start;padding:8px 0;border-top:1px solid var(--line);font-size:14px}
.ai-ch b{font-weight:700}.ai-ch del{color:var(--muted)}.ai-ch ins{text-decoration:none;background:rgba(244,166,106,.18);padding:0 3px;border-radius:3px}
.ai-ch .w{grid-column:2;display:flex;flex-direction:column;gap:2px;overflow-wrap:anywhere}
/* the menu folded away on a wide screen: '«' at the top of the menu folds it, '☰ 메뉴' at the top left brings it back */
.side-fold{position:absolute;top:14px;right:10px;padding:2px 8px;min-height:0;background:transparent;color:var(--linen);border-color:rgba(234,228,211,.3)}
.side-unfold{display:none}
@media (min-width:901px){body.side-off .shell{grid-template-columns:minmax(0,1fr)}body.side-off .side{display:none}
  body.side-off .side-unfold{display:inline-flex;position:fixed;left:10px;bottom:12px;z-index:60;box-shadow:0 2px 8px rgba(0,0,0,.2)}}
@media (max-width:900px){.side-fold{display:none}}
/* the print preview's bar: short labels that wrap as a group, never a word per line */
.editor .preview .bar{flex-wrap:wrap;row-gap:6px}.editor .preview .bar > *{white-space:nowrap}
.editor .preview .bar .zoom{display:inline-flex;gap:4px;align-items:center}.editor .preview .bar .zoom b{min-width:42px;text-align:center;font-weight:600}
.editor .preview .bar small{opacity:.75}
/* slides made from a bulletin that changed since: what differs, item by item */
/* slides-make: the bulletin changed after the slides were made — red, so it is not missed */
.card.sync{border:2px solid #b3261e;border-left-width:8px;background:#fdecea}.card.sync h2{color:#8d1a12}.card.sync .hint{color:#5c1a14}.sync-list{margin:0 0 10px;padding-left:18px}.sync-list li{margin:6px 0;line-height:1.5}
fieldset.sec>legend .badge.mine{background:var(--persimmon);color:var(--ink)}fieldset.sec>legend .badge{vertical-align:1px}
.chips .chip.on{background:var(--green);border-color:var(--green);color:var(--linen)}
.fam-list{display:flex;flex-direction:column;gap:6px;margin-bottom:6px}.fam-row{display:grid;grid-template-columns:1.2fr 1fr 1.4fr 1fr auto;gap:6px;align-items:center}
@media (max-width:700px){.fam-row{grid-template-columns:1fr 1fr;padding:8px;border:1px solid var(--line);border-radius:6px}.fam-row button{justify-self:end}}
.profile .chips{display:flex;flex-wrap:wrap;gap:6px}
