:root {
  --green: #0b3d2e;
  --green-2: #14532d;
  --gold: #c9a227;
  --gold-soft: #f5e9c8;
  --ink: #1a1a1a;
  --muted: #666;
  --line: #e3e3e3;
  --bg: #faf9f6;
  --card: #ffffff;
  --red: #b3261e;
  --amber: #8a6d00;
  --ok: #137333;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--green-2); }
h1, h2, h3 { margin: 0 0 10px; color: var(--green); }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }

/* Header */
header {
  background: var(--green); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 10;
}
header .logo {
  width: 36px; height: 36px; border-radius: 9px; background: var(--gold);
  color: var(--green); font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center; flex: none;
}
header .title { font-size: 18px; font-weight: 700; flex: 1; }
header .title small { display: block; font-size: 12px; font-weight: 400; opacity: .8; }
header button.linklike {
  background: none; border: 0; color: #fff; font-size: 14px; cursor: pointer; padding: 8px;
}

/* Layout */
main { max-width: 720px; margin: 0 auto; padding: 16px 14px 90px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.space { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 5px; }
input[type=text], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; padding: 12px; font-size: 16px; border: 1px solid #bbb;
  border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input[type=range] { width: 100%; }
.counter { text-align: right; font-size: 13px; color: var(--muted); margin-top: 3px; }
.counter.over { color: var(--red); font-weight: 700; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  border: 1px solid var(--gold); background: var(--gold-soft); color: var(--green);
  border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer;
}
.toggle { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f0f0; }
.toggle:last-child { border-bottom: 0; }
.toggle input { width: 20px; height: 20px; accent-color: var(--green-2); }
.toggle .t-label { flex: 1; }
.toggle .t-label small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.radio-row { display: flex; gap: 8px; }
.radio-card {
  flex: 1; border: 2px solid var(--line); border-radius: 10px; padding: 12px;
  cursor: pointer; font-weight: 600; text-align: center; background: #fff;
}
.radio-card small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 3px; }
.radio-card.selected { border-color: var(--green-2); background: #eef7f0; }

/* Buttons */
.btn {
  display: inline-block; border: 0; border-radius: 10px; padding: 12px 18px;
  font-size: 16px; font-weight: 700; cursor: pointer; text-align: center;
  background: var(--green-2); color: #fff; text-decoration: none;
}
.btn.gold { background: var(--gold); color: var(--green); }
.btn.ghost { background: #fff; color: var(--green-2); border: 1px solid var(--green-2); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Drop zone + preview */
.dropzone {
  border: 2px dashed #aaa; border-radius: var(--radius); padding: 26px 14px;
  text-align: center; color: var(--muted); cursor: pointer; background: #fff;
}
.dropzone.drag { border-color: var(--gold); background: var(--gold-soft); }
.dropzone input { display: none; }
video.preview { width: 100%; border-radius: 10px; background: #000; max-height: 60vh; }

/* Accounts */
.account { display: flex; gap: 12px; align-items: center; }
.account img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #eee; }
.account .handle { font-weight: 700; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px;
  padding: 3px 10px; text-transform: uppercase; letter-spacing: .3px;
}
.badge.connected, .badge.posted { background: #e6f4ea; color: var(--ok); }
.badge.pending, .badge.processing, .badge.uploading { background: #fef3c7; color: var(--amber); }
.badge.failed, .badge.token_expired { background: #fdecea; color: var(--red); }
.badge.sent_to_inbox, .badge.cancelled { background: #e8eaf6; color: #3d5afe; }
.warn { background: #fff7e0; border: 1px solid #f0d878; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.error { background: #fdecea; border: 1px solid #f5c6c2; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--red); }
.okbox { background: #e6f4ea; border: 1px solid #a8d5b5; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* Jobs */
.job { border-bottom: 1px solid #f0f0f0; padding: 12px 0; }
.job:last-child { border-bottom: 0; }
.job .cap { font-size: 14px; margin: 6px 0; word-break: break-word; }
.job .meta { font-size: 13px; color: var(--muted); }
.job video.thumb, .job img.thumb { width: 84px; height: 110px; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.job .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Bottom nav (mobile-first) */
nav.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
  border-top: 1px solid var(--line); display: flex; z-index: 10;
}
nav.bottom a {
  flex: 1; text-align: center; padding: 12px 4px 14px; color: var(--muted);
  text-decoration: none; font-size: 13px; font-weight: 600;
}
nav.bottom a.active { color: var(--green-2); border-top: 3px solid var(--gold); padding-top: 9px; }
.hidden { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.progress { height: 8px; background: #eee; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--gold); width: 0%; transition: width .3s; }
.logline { font-size: 13px; border-bottom: 1px solid #f0f0f0; padding: 8px 0; }
.logline time { color: var(--muted); }
