:root {
  --bg: #f0f2f5;
  --card: #fff;
  --brand: #1877f2;
  --text: #1c1e21;
  --muted: #65676b;
  --border: #dddfe2;
  --ok: #187a3c;
  --err: #d93025;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }
.view { min-height: 100vh; }
.center { display: flex; align-items: center; justify-content: center; padding: 20px; }

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 18px;
  margin: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
h1 { font-size: 22px; text-align: center; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }

input, textarea, select, button {
  width: 100%;
  font-size: 16px; /* prevents iOS zoom */
  font-family: inherit;
  padding: 12px;
  margin: 6px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
textarea { resize: vertical; }
label { font-size: 13px; color: var(--muted); display: block; margin-top: 8px; }

button { cursor: pointer; border: none; }
button.primary { background: var(--brand); color: #fff; font-weight: 600; }
button.primary:active { opacity: 0.85; }
button.link { background: none; color: var(--brand); width: auto; padding: 6px; }
.filebtn {
  display: block; text-align: center; background: #e7f0fe; color: var(--brand);
  padding: 12px; border-radius: 8px; font-weight: 600; cursor: pointer; margin: 6px 0;
}

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.tabs {
  display: flex; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 49px; z-index: 9; overflow-x: auto;
}
.tabs button {
  width: auto; flex: 1; background: none; padding: 12px 8px; white-space: nowrap;
  border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; margin: 0;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

.tab { padding-bottom: 40px; }
.row { display: flex; gap: 8px; padding: 12px; }
.row input { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.list { padding: 6px 12px; }
.list .item {
  background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.list.checks .item { display: flex; align-items: center; gap: 10px; }
.list.checks input[type="checkbox"] { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; }
.item .name { font-weight: 600; }
.item .sub { font-size: 13px; color: var(--muted); }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--err); font-size: 14px; min-height: 18px; }
.ok { color: var(--ok); font-size: 14px; min-height: 18px; }

.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.badge.posted { background: #e3f4e8; color: var(--ok); }
.badge.failed { background: #fce8e6; color: var(--err); }
.badge.running, .badge.scheduled, .badge.queued { background: #e7f0fe; color: var(--brand); }
