/* Sline Đăng Bài — bản 2 */
:root {
  --bg: #F3F1EE; --card: #FFFFFF; --line: #E7E2DC; --line2: #F0ECE7; --line3: #D9D2CB;
  --ink: #1C1917; --ink2: #4A433E; --muted: #6B635C;
  --brand: #9F2F4A; --brand-d: #7A2238; --brand-s: #F8E9ED; --brand-xs: #FBF3F5;
  --ok: #24704A; --ok-d: #1D5C3C; --ok-s: #E3F1E9;
  --warn: #B7791F; --warn-d: #6E4708; --warn-s: #FBF0DC;
  --err: #8E1F17; --err-s: #FBE4E2;
  --info: #1E4A8C; --info-s: #E6EEFB;
  --grey-s: #EEF0F2; --grey-d: #3B4148;
  --cream: #FBF7F2; --cream-l: #EDE3D6; --soft: #FBFAF8;
  --sh: 0 1px 2px rgba(28,25,23,.06); --sh2: 0 2px 10px rgba(28,25,23,.08); --sh3: 0 12px 28px rgba(28,25,23,.12);
  --rail: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: var(--brand); } a:hover { color: var(--brand-d); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
h1 { margin: 0; font-size: 22px; font-weight: 700; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
.hidden { display: none !important; }
.sr { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .xs { font-size: 11.5px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; } .stack.s8 { gap: 8px; }
.boot { padding: 80px 20px; text-align: center; color: var(--muted); }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line3); background: #fff; border-radius: 9px; padding: 9px 16px; min-height: 40px; font-weight: 500; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--soft); color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-d); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; } .btn.ok:hover { background: var(--ok-d); color: #fff; }
.btn.outline { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.btn.danger { color: var(--err); border-color: #E8B4AF; } .btn.danger:hover { background: var(--err-s); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--grey-s); }
.btn.link { border: none; background: none; color: var(--brand); font-weight: 600; padding: 6px 0; min-height: 36px; }
.btn.sm { padding: 5px 11px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input { width: 100%; border: 1px solid var(--line3); border-radius: 9px; padding: 9px 12px; background: #fff; min-height: 40px; }
textarea.input { line-height: 1.55; resize: vertical; }
label.f { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.c-ok { background: var(--ok-s); color: var(--ok-d); } .c-warn { background: var(--warn-s); color: var(--warn-d); }
.c-err { background: var(--err-s); color: var(--err); } .c-info { background: var(--info-s); color: var(--info); }
.c-grey { background: var(--grey-s); color: var(--grey-d); } .c-brand { background: var(--brand-s); color: var(--brand-d); }
.c-dark { background: var(--ink); color: #fff; }
.pill { font-size: 11px; font-weight: 600; border-radius: 99px; padding: 0 8px; display: inline-block; }
.reeltag { font-size: 10px; font-weight: 700; color: #fff; background: var(--ink); border-radius: 4px; padding: 0 5px; }
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.alert svg { flex: none; margin-top: 2px; }
.alert.ok { background: var(--ok-s); color: var(--ok-d); } .alert.warn { background: var(--warn-s); color: var(--warn-d); }
.alert.err { background: var(--err-s); color: var(--err); } .alert.info { background: var(--info-s); color: var(--info); }
.card { background: var(--card); border-radius: 12px; padding: 16px 18px; box-shadow: var(--sh); }
.card .hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card .hd h2 { flex: 1; }
.card p.sub { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line3); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: none; background: #fff; padding: 7px 14px; cursor: pointer; font-size: 13px; min-height: 36px; }
.seg button.on { background: var(--ink); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fchip { font-size: 13px; font-weight: 500; border-radius: 99px; padding: 6px 13px; cursor: pointer; border: 1px solid var(--line3); background: #fff; min-height: 36px; }
.fchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fchip.off { background: var(--grey-s); color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; border-radius: 99px; border: none; background: #C9C1BA; cursor: pointer; flex: none; padding: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--ok); } .switch[aria-checked="true"]::after { left: 23px; }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 40px; height: 40px; font-size: 13px; } .av.sm { width: 22px; height: 22px; font-size: 9px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- shell */
.app { display: flex; min-height: 100vh; }
.rail { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; z-index: 30; }
.rail .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 10px; }
.rail a { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--ink2); position: relative; }
.rail a:hover { background: var(--grey-s); color: var(--ink); }
.rail a.on { background: var(--brand); color: #fff; }
.rail a .bdg { position: absolute; top: 5px; right: 4px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.rail a .bdg.r { background: #C0392B; }
.rail a .tip { position: absolute; left: 52px; top: 50%; transform: translateY(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
.rail a:hover .tip, .rail a:focus-visible .tip { opacity: 1; }
.rail .sp { flex: 1; }
.rail .me { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-s); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: none; cursor: pointer; }
.page { margin-left: var(--rail); flex: 1; min-width: 0; }
.main { padding: 22px 28px 60px; max-width: 1480px; }
.main.withfoot { padding-bottom: 120px; }
.ptitle { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lockbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--warn-s); color: var(--warn-d); padding: 10px 28px; font-size: 13.5px; border-bottom: 1px solid #F1D7A8; }
.lockbar b { color: #5A3A06; }
.menu { position: fixed; left: 70px; bottom: 14px; background: #fff; border-radius: 12px; box-shadow: var(--sh3); border: 1px solid var(--line); padding: 8px; min-width: 220px; z-index: 40; }
.menu .who { padding: 6px 10px 10px; border-bottom: 1px solid var(--line2); margin-bottom: 6px; }
.menu button, .menu a { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.menu button:hover, .menu a:hover { background: var(--grey-s); }

/* ---------- toast & modal */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: min(560px, 92vw); white-space: pre-wrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #8E1F17; }
.modal { position: fixed; inset: 0; background: rgba(28,25,23,.45); display: none; align-items: center; justify-content: center; z-index: 90; padding: 16px; }
.modal.open { display: flex; }
.modal .box { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--sh3); }
.modal .box.wide { width: min(780px, 100%); }
.mhd { display: flex; align-items: center; gap: 10px; padding: 16px 20px 6px; } .mhd h3 { margin: 0; font-size: 17px; flex: 1; }
.mbd { padding: 8px 20px 12px; }
.mft { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; flex-wrap: wrap; }

/* ---------- auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth .card.wide { width: min(560px, 100%); }
.auth .logo { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; margin-bottom: 14px; }
.auth h1 { font-size: 20px; margin-bottom: 4px; }
.code6 { font-size: 26px; letter-spacing: .35em; text-align: center; font-weight: 600; }
.qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr img { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 10px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--soft); border: 1px dashed var(--line3); border-radius: 8px; padding: 6px 10px; word-break: break-all; font-size: 13px; }
.bcodes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; }
.bcodes span { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.steps { margin: 0; padding-left: 20px; } .steps li { margin-bottom: 6px; }

/* ---------- compose */
.compose { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.compose .left { flex: 999 1 520px; min-width: 0; max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.compose .right { flex: 1 1 360px; max-width: 460px; min-width: 0; position: sticky; top: 20px; display: flex; flex-direction: column; gap: 12px; }
.ddbtn { width: 100%; min-height: 48px; border: 1px solid var(--line3); border-radius: 10px; background: #fff; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 10px; cursor: pointer; text-align: left; }
.ddbtn[aria-expanded="true"] { border-color: var(--brand); }
.pchip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-s); color: var(--brand-d); border-radius: 99px; padding: 3px 10px 3px 4px; font-size: 13px; font-weight: 500; max-width: 260px; }
.pchip span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--sh3); overflow: hidden; }
.dd .top { padding: 10px 12px; border-bottom: 1px solid var(--line2); }
.dd .grp { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.dd .grp button { border: 1px solid var(--line); background: var(--soft); border-radius: 99px; padding: 4px 12px; font-size: 12px; cursor: pointer; min-height: 30px; }
.dd .list { max-height: 320px; overflow: auto; padding: 6px; }
.dd .head { font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--muted); padding: 8px 8px 4px; }
.dd label.pg { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.dd label.pg:hover { background: var(--soft); } .dd label.pg.on { background: var(--brand-xs); }
.dd label.pg.dis { opacity: .55; cursor: not-allowed; }
.dd label.pg input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.dd .nm { flex: 1; min-width: 0; font-weight: 500; }
.sgrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.sug { text-align: left; border: 1px solid #ECE7E1; background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--ink); text-decoration: none; }
.sug:hover { border-color: #D8C7CC; color: var(--ink); }
.sug.done { background: #FAFAF9; } .sug.on { border-color: var(--brand); background: var(--brand-xs); }
.sug .t { font-weight: 600; font-size: 13.5px; }
.sug .m { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.sug .dn { font-size: 11px; font-weight: 600; color: var(--ok-d); }
.sugd { margin-top: 10px; border-radius: 10px; background: var(--cream); border: 1px solid var(--cream-l); padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.th { width: 96px; height: 96px; border-radius: 10px; background: #D9C6BA; position: relative; overflow: hidden; cursor: grab; }
.th img, .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.th .n { position: absolute; left: 5px; top: 5px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 5px; padding: 0 6px; }
.th .rm { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 12px; }
.th .prog { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.6); }
.th .prog i { display: block; height: 100%; background: var(--brand); border-radius: 9px; }
.th.dragging { opacity: .4; }
.drop { outline: 2px dashed var(--brand); outline-offset: 4px; border-radius: 12px; }
.editor { border: 1px solid var(--line3); border-radius: 10px; }
.editor textarea { display: block; width: 100%; min-height: 220px; border: none; border-radius: 10px; padding: 12px 14px 4px; font-size: 15px; line-height: 1.6; resize: vertical; background: transparent; }
.editor textarea:focus { outline: none; } .editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.etools { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.etools .cnt { font-size: 12px; color: var(--muted); padding-left: 6px; flex: 1; min-width: 160px; }
.tbtn { width: 40px; height: 40px; border-radius: 8px; border: none; background: transparent; color: var(--ink2); cursor: pointer; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.tbtn:hover { background: var(--grey-s); } .tbtn[aria-pressed="true"] { background: var(--brand-s); color: var(--brand); }
.tpanel { border-top: 1px solid var(--line2); background: var(--soft); border-radius: 0 0 10px 10px; padding: 10px 12px; }
.tpanel .thd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.subtabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; }
.subtab { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 11px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.subtab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; max-height: 230px; overflow: auto; }
.egrid button, .sgrid button { border: 1px solid #ECE7E1; background: #fff; border-radius: 7px; min-height: 40px; font-size: 20px; cursor: pointer; padding: 0; }
.egrid button:hover, .sgrid button:hover, .fgrid button:hover { border-color: var(--brand); }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; max-height: 230px; overflow: auto; }
.sgrid button { font-size: 17px; }
.sgrid.wide { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.sgrid.wide button { font-size: 13px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.fgrid button { border: 1px solid #ECE7E1; background: #fff; border-radius: 8px; padding: 8px; cursor: pointer; text-align: left; font-size: 15px; }
.fgrid small { display: block; font-size: 11px; color: var(--muted); }
.snip { display: flex; gap: 8px; align-items: center; border: 1px solid #ECE7E1; background: #fff; border-radius: 8px; padding: 6px 8px; }
.snip .t { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qchip { border: 1px solid var(--line); background: var(--soft); border-radius: 99px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.slot { margin-top: 10px; font-size: 12.5px; border-radius: 8px; padding: 7px 10px; }
.slot.free { color: var(--ok-d); background: var(--ok-s); } .slot.busy { color: var(--warn-d); background: var(--warn-s); }
.when { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; align-items: center; font-size: 13px; }
.when .input { width: auto; }
.footbar { position: fixed; left: var(--rail); right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 28px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; box-shadow: 0 -2px 12px rgba(28,25,23,.06); z-index: 20; }
.footbar .msg { flex: 1; min-width: 220px; font-size: 13px; color: var(--muted); }
.footbar .btn { min-height: 44px; }

/* ---------- facebook preview */
.fb { align-self: center; width: 460px; max-width: 100%; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--sh2); }
.fb.phone { width: 360px; }
.fb .hd { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.fb .tx { padding: 0 14px 10px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.fb .tx .more { color: var(--muted); font-weight: 600; cursor: pointer; }
.fb .imgs { display: grid; gap: 2px; background: #fff; }
.fb .imgs div { position: relative; background: #E9E4DF; overflow: hidden; }
.fb .imgs img, .fb .imgs video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb .imgs.n1 div { aspect-ratio: 1 / 1; max-height: 520px; }
.fb .imgs.n2 { grid-template-columns: 1fr 1fr; } .fb .imgs.n2 div { aspect-ratio: 1 / 1.25; }
.fb .imgs.n3 { grid-template-columns: 1fr 1fr; } .fb .imgs.n3 div:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; } .fb .imgs.n3 div { aspect-ratio: 1 / 1; }
.fb .imgs.n4 { grid-template-columns: 1fr 1fr 1fr; } .fb .imgs.n4 div:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; } .fb .imgs.n4 div { aspect-ratio: 1 / 1; }
.fb .imgs.n5 { grid-template-columns: repeat(6, 1fr); } .fb .imgs.n5 div { grid-column: span 2; aspect-ratio: 1 / 1; } .fb .imgs.n5 div:nth-child(-n+2) { grid-column: span 3; }
.fb .imgs .plus { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 26px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.fb .imgs.reel div { aspect-ratio: 9 / 16; max-height: 560px; background: #000; } .fb .imgs.reel video { object-fit: contain; }
.fb .act { display: flex; justify-content: space-around; padding: 8px 6px; border-top: 1px solid var(--line2); font-size: 13px; color: var(--muted); }
.fb .cm { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line2); }
.fb .cm .bub { background: #F0F2F5; border-radius: 14px; padding: 7px 11px; font-size: 13px; white-space: pre-wrap; word-wrap: break-word; min-width: 0; }
.pvtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pvtabs button { font-size: 12px; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line3); background: #fff; cursor: pointer; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvtabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pvtabs button.ov::after { content: ' •'; color: var(--brand); }
.dev button { width: 42px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- calendar */
.wk { display: inline-flex; align-items: center; gap: 4px; }
.wk .nb { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line3); background: #fff; cursor: pointer; font-size: 18px; }
.calwrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.calgrid { flex: 999 1 640px; min-width: 0; overflow-x: auto; }
.days { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; min-width: 940px; }
.day { text-align: left; cursor: pointer; background: #fff; border-radius: 12px; border: 2px solid transparent; padding: 0; display: flex; flex-direction: column; min-height: 440px; box-shadow: var(--sh); overflow: hidden; }
.day.sel { border-color: var(--brand); } .day.gap { border-color: #F1D7A8; } .day.past { opacity: .85; }
.day .dh { display: block; padding: 8px 10px; } .day.today .dh { background: var(--brand); color: #fff; }
.day .dh small { display: block; font-size: 12px; opacity: .85; } .day .dh b { display: block; }
.day .ps { display: flex; flex-direction: column; gap: 5px; padding: 8px; flex: 1; }
.cp { display: flex; flex-direction: column; gap: 1px; border-radius: 8px; padding: 6px 8px; border-left: 3px solid; text-decoration: none; color: var(--ink); }
.cp:hover { color: var(--ink); filter: brightness(.97); }
.cp .l1 { display: flex; gap: 6px; align-items: center; font-size: 11px; } .cp .l1 .s { margin-left: auto; font-weight: 600; }
.cp .tt { font-size: 12px; font-weight: 500; line-height: 1.3; word-break: break-word; }
.cp.done { background: #EEF6F1; border-color: var(--ok-d); } .cp.done .s { color: var(--ok-d); }
.cp.sched { background: #EEF3FC; border-color: var(--info); } .cp.sched .s { color: var(--info); }
.cp.pending { background: #FDF5E7; border-color: var(--warn); } .cp.pending .s { color: var(--warn-d); }
.cp.approved { background: #F1F7F3; border-color: var(--ok); } .cp.approved .s { color: var(--ok); }
.cp.queued { background: #F4F2EF; border-color: var(--muted); } .cp.queued .s { color: var(--ink2); }
.cp.failed { background: var(--err-s); border-color: var(--err); } .cp.failed .s { color: var(--err); }
.dempty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed #E0B26A; background: #FFF8EC; border-radius: 10px; color: var(--warn-d); font-size: 12px; font-weight: 600; text-align: center; padding: 10px; }
.dempty span { font-weight: 400; }
.day .df { display: block; padding: 8px 10px; border-top: 1px solid var(--line2); }
.day .df .c { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink2); }
.bar { display: flex; gap: 3px; margin-top: 5px; } .bar i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); } .bar i.gap { flex: 0 0 4px; background: none; }
.bar i.r { background: var(--ink); } .bar i.n { background: var(--brand); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink2); margin-top: 10px; }
.legend span { display: flex; gap: 6px; align-items: center; } .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.side { flex: 1 1 280px; max-width: 340px; min-width: 0; background: #fff; border-radius: 12px; box-shadow: var(--sh); padding: 16px; }

/* ---------- posts list */
.tbl { background: #fff; border-radius: 12px; box-shadow: var(--sh); overflow-x: auto; }
.tbl .in { min-width: 900px; }
.prow { display: grid; grid-template-columns: 64px minmax(0, 3fr) minmax(0, 1.4fr) 150px 150px 220px; gap: 14px; padding: 12px 18px; align-items: center; border-bottom: 1px solid #F3EFEA; }
.prow.head { font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid #ECE7E1; }
.pthumb { width: 64px; height: 64px; border-radius: 9px; background: #ECE7E1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.pthumb img, .pthumb video { width: 100%; height: 100%; object-fit: cover; }
.pthumb .reeltag { position: absolute; left: 4px; bottom: 4px; }
.ptl { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note { display: block; margin-top: 6px; font-size: 12.5px; background: var(--err-s); color: var(--err); border-radius: 8px; padding: 5px 9px; }
.note.ok { background: var(--ok-s); color: var(--ok-d); }
.acts { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; align-items: center; }
.tg { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }

/* ---------- review */
.rv { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.rq { flex: 1 1 280px; max-width: 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rqi { text-align: left; cursor: pointer; display: flex; gap: 10px; align-items: center; background: #fff; border: 2px solid transparent; border-radius: 12px; padding: 10px; width: 100%; }
.rqi.on { border-color: var(--brand); } .rqi.dn { opacity: .6; }
.rqi .pthumb { width: 54px; height: 54px; flex: none; }
.rd { flex: 999 1 560px; min-width: 0; display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.rd .col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 13px; }
.meta small { display: block; font-size: 11px; color: var(--muted); }
.checks label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 4px; cursor: pointer; font-size: 13.5px; }
.checks input { width: 18px; height: 18px; accent-color: var(--ok); margin-top: 2px; flex: none; }

/* ---------- admin tables */
.grid-t { display: grid; gap: 0; }
.pgrow { display: grid; grid-template-columns: minmax(0, 2.4fr) 150px 170px minmax(150px, 1.2fr) 90px 120px; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #F3EFEA; }
.pgrow.head { font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid #ECE7E1; }
.pgrow.off { background: #FAFAF9; } .pgrow.off .nm { color: var(--muted); }
.urow { display: grid; grid-template-columns: minmax(0, 1.4fr) 130px 130px minmax(0, 2fr) 90px 90px 110px 70px; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #F3EFEA; font-size: 13.5px; }
.urow.head { font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid #ECE7E1; }
.pgsel { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.pgsel label { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; cursor: pointer; font-size: 13px; }
.pgsel input { accent-color: var(--brand); width: 16px; height: 16px; }
.settings { max-width: 860px; }
.sec-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin: 12px 0 -4px; }
.kv { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.rules textarea { min-height: 150px; }

/* ---------- mobile */
@media (max-width: 760px) {
  :root { --rail: 0px; }
  .rail { top: auto; right: 0; width: auto; height: 60px; flex-direction: row; justify-content: space-around; border-right: none; border-top: 1px solid var(--line); padding: 0 6px; gap: 0; }
  .rail .logo, .rail .sp, .rail a .tip { display: none; }
  .rail a { width: 42px; height: 42px; }
  .page { margin-left: 0; }
  .main { padding: 16px 16px 90px; }
  .main.withfoot { padding-bottom: 190px; }
  .footbar { left: 0; bottom: 60px; padding: 10px 16px; }
  .footbar .msg { display: none; }
  .footbar .btn { flex: 1; padding: 9px 10px; }
  .lockbar { padding: 10px 16px; }
  .compose .right { position: static; max-width: 100%; }
  .sgrid2 { grid-template-columns: 1fr; }
  .menu { left: auto; right: 10px; bottom: 70px; }
  .toast { bottom: 140px; }
  .meta { grid-template-columns: 1fr 1fr; }
  .rq { max-width: 100%; }
  .tbl .in.posts { min-width: 0; }
  .in.posts .prow.head { display: none; }
  .in.posts .prow { grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; align-items: start; }
  .in.posts .prow > .pthumb { grid-row: span 5; width: 56px; height: 56px; }
  .in.posts .prow > :nth-child(n+2) { grid-column: 2; }
  .in.posts .prow .acts { justify-content: flex-start; }
  #pq { width: 100% !important; order: 5; }
}
