:root {
  color-scheme: light dark;
  --bg: #f6f7f9; --card: #fff; --text: #16181d; --muted: #5f6673; --line: #dfe2e8;
  --accent: #2563eb; --bad: #dc2626;          /* text and links */
  --accent-fill: #2563eb; --bad-fill: #dc2626; /* behind white text: 5.2:1 and 4.8:1 in both themes */
  --in: #eef1f5; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #171a21; --text: #e8eaee; --muted: #9aa3b2; --line: #2a2f3a; --accent: #4f8cff; --bad: #f87171; --in: #222733; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* buttons set display, which would otherwise beat the hidden attribute */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", "Noto Sans Bengali", sans-serif; background: var(--bg); color: var(--text); }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.25; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
a { color: var(--accent); }
code { font: 13px ui-monospace, Consolas, monospace; word-break: break-all; background: var(--in); padding: 2px 5px; border-radius: 5px; }
small, .muted { color: var(--muted); font-size: 13px; font-weight: 400; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top strong { font-size: 16px; margin-right: auto; }
#tabs { display: flex; gap: 4px; overflow-x: auto; order: 3; width: 100%; }
#tabs button { background: none; color: var(--muted); border: 0; padding: 8px 10px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
#tabs button[aria-current="page"] { background: var(--in); color: var(--text); }
@media (min-width: 760px) { #tabs { order: 0; width: auto; } .top strong { margin-right: 12px; } #logout { margin-left: auto; } }
.badge:not(:empty) { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--bad-fill); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }

main { max-width: 980px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
label { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
label.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
input, textarea, select { width: 100%; padding: 9px 11px; font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
input[type="checkbox"] { width: 18px; height: 18px; }
textarea { resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; font: inherit; font-weight: 600; color: #fff; background: var(--accent-fill); border: 1px solid var(--accent-fill); border-radius: 8px; cursor: pointer; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
button.danger { background: transparent; color: var(--bad); border-color: var(--line); }
button.link { background: none; border: 0; padding: 4px; color: var(--accent); font-weight: 500; }
button:disabled { opacity: .55; cursor: progress; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toolbar p { margin: 0; }

#notice { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 10; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px; background: var(--text); color: var(--bg); box-shadow: 0 4px 18px rgb(0 0 0 / .25); }
#notice:empty { display: none; }
#notice.bad { background: var(--bad-fill); color: #fff; }

.photo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.photo-row img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.platform { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.hint { background: var(--in); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }

.item { display: grid; gap: 8px; }
.item-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.item-head .when { margin-left: auto; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; float: right; margin-left: 10px; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.error { color: var(--bad); font-size: 14px; white-space: pre-wrap; margin: 0; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--in); color: var(--muted); }
.chip.scheduled { background: #fef3c7; color: #92400e; }
.chip.posted { background: #dcfce7; color: #166534; }
.chip.failed { background: #fee2e2; color: #991b1b; }
.chip.facebook { background: #e0e7ff; color: #3730a3; }
.chip.instagram { background: #fce7f3; color: #9d174d; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
dl { margin: 0; }
dt { font-weight: 600; font-size: 14px; }
dd { margin: 2px 0 10px; }
.results { list-style: none; padding: 0; margin: 10px 0 0; }
.results li { padding: 4px 0; }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; }

/* sign-in and privacy pages */
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.center form { width: 100%; max-width: 340px; }
.center button { width: 100%; }
.page { max-width: 720px; margin: 0 auto; padding: 24px 16px; }
.page h1 { font-size: 28px; }
.page h2 { font-size: 20px; margin-top: 24px; } /* reading page: clear steps 15 → 20 → 28 px */
