:root {
  --bg: #f4f5f7; --card: #fff; --text: #1c1f24; --muted: #6b7280; --line: #e3e5e9;
  --brand: #1f6feb; --brand-ink: #fff; --green: #1a7f37; --red: #cf222e; --orange: #b35900; --blue: #1f6feb; --gray: #6b7280;
  --green-bg: #e6f4ea; --red-bg: #fde8e8; --orange-bg: #fff1e0; --blue-bg: #e7efff; --gray-bg: #eef0f3;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --card: #181b21; --text: #e6e8eb; --muted: #9aa1ab; --line: #2a2f37;
    --brand: #4c8dff; --green: #3fb950; --red: #f85149; --orange: #e3a03f; --blue: #58a6ff; --gray: #9aa1ab;
    --green-bg: #12261a; --red-bg: #2d1416; --orange-bg: #2b1f0e; --blue-bg: #13213a; --gray-bg: #22262d;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; }
a { color: var(--brand); }
code { background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); min-height: 1.2em; }

input, textarea, select, button, .button {
  font: inherit; color: inherit; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
}
input, textarea, select { padding: 9px 11px; width: 100%; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
button, .button { padding: 8px 14px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.ok-btn { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
.danger { background: var(--red); color: #fff; border-color: var(--red); }
.danger-text { color: var(--red) !important; }
.link { border: 0; background: none; padding: 0; color: var(--brand); }
.wide { width: 100%; padding: 12px; font-size: 16px; margin-top: 8px; }
.small-btn { padding: 5px 10px; font-size: 13px; }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; font-size: 17px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 12px; color: var(--muted); font-weight: 600; border-radius: 8px; }
.tabs button.active { color: var(--brand); background: var(--blue-bg); }
.who { display: flex; align-items: center; gap: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--gray); }
.dot.green { background: var(--green); } .dot.red { background: var(--red); }
.dot.blue { background: var(--blue); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

main { max-width: 1180px; margin: 0 auto; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cards .card { margin: 0; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; gap: 10px; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top-align { align-items: flex-start; }
.row input { flex: 1; min-width: 140px; }
.row input[type=radio], .row input[type=checkbox] { flex: none; min-width: 0; }
.grow { flex: 1; min-width: 0; }

.banner { background: var(--orange-bg); color: var(--orange); padding: 10px 20px; font-weight: 600; text-align: center; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 30px); opacity: 0; transition: .2s; z-index: 20;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); color: #fff; }

.drop {
  display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer;
}
.drop.over { border-color: var(--brand); background: var(--blue-bg); }
.drop input { display: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 84px; height: 84px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.thumb.busy img { opacity: .4; }
.thumb .x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; padding: 0; border-radius: 50%; background: var(--red); color: #fff; border: 0; line-height: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { padding: 4px 11px; border-radius: 99px; font-size: 13px; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.checklist { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.checklist.short { max-height: 160px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check:hover { background: var(--gray-bg); }
.checklist > p { padding: 10px 12px; margin: 0; }
.tag { font-size: 12px; color: var(--muted); background: var(--gray-bg); border-radius: 5px; padding: 1px 7px; white-space: nowrap; }
.radio { display: flex; gap: 6px; align-items: center; }
#whenAt { width: auto; }

.badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge.green { color: var(--green); background: var(--green-bg); }
.badge.red { color: var(--red); background: var(--red-bg); }
.badge.orange { color: var(--orange); background: var(--orange-bg); }
.badge.blue { color: var(--blue); background: var(--blue-bg); }
.badge.gray { color: var(--gray); background: var(--gray-bg); }

.post-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { display: flex; height: 6px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; margin: 12px 0 8px; }
.bar .ok { background: var(--green); } .bar .bad { background: var(--orange); } .bar .skip { background: var(--gray); }
.actions { display: flex; gap: 14px; flex-wrap: wrap; }
.details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.body-preview { white-space: pre-wrap; font: inherit; background: var(--gray-bg); padding: 10px 12px; border-radius: 8px; max-height: 200px; overflow: auto; margin: 0 0 10px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
th, td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td input, td select { padding: 6px 8px; min-width: 110px; }
.account h3 { margin: 0; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 100%; max-width: 360px; box-shadow: var(--shadow); }
.login-card form { display: grid; gap: 14px; margin-top: 18px; }
.login-card label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.login-card .primary { padding: 11px; }

@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .tabs { order: 3; flex-basis: 100%; }
  .who { margin-left: auto; }
  main { padding: 16px; }
  .card { padding: 14px; }
}
