:root {
  --bg: #14110f;
  --card: #201c19;
  --card2: #2a2521;
  --line: #3a332d;
  --ink: #f4efe8;
  --muted: #b3a89c;
  --accent: #f29a3a;
  --accent-ink: #1d1206;
  --keep: #34b36b;
  --skip: #e05252;
  --warn: #f2c94c;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
a { color: var(--accent); }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.err { color: #ff8a80; min-height: 1.2em; margin: 4px 0 0; }
.lead { font-size: 17px; margin: 0; }

/* ---------- pages ---------- */
.screen { min-height: 100dvh; }
.page {
  max-width: 560px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.top { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.top h2 { flex: 1; }
.brand { display: flex; align-items: center; gap: 12px; margin: 28px 0 8px; }
.brand.small { margin: 0; flex: 1; }
.brand h1 { font-size: 28px; letter-spacing: .3px; }
.brand.small h1 { font-size: 22px; }
.logo {
  width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 26px; font-weight: 700;
}
.brand.small .logo { width: 36px; height: 36px; font-size: 21px; border-radius: 11px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.warn { border-color: var(--warn); color: var(--warn); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.section { margin-top: 8px; font-size: 18px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
input, textarea {
  font: inherit; color: var(--ink); background: var(--card2); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn {
  font: inherit; font-weight: 650; border: 0; border-radius: 14px; padding: 13px 18px;
  background: var(--card2); color: var(--ink); cursor: pointer; text-decoration: none; text-align: center;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: transparent; border: 1px solid #6b2b2b; color: #ff8a80; }
.btn.big { padding: 16px 20px; font-size: 18px; flex: 1; }
.btn:disabled { opacity: .5; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.35);
  color: var(--ink); font-size: 22px; display: grid; place-items: center; cursor: pointer;
}
.page .icon-btn { background: var(--card2); }

/* ---------- home ---------- */
.dot { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #6f655b; }
.dot.on { color: var(--keep); }
.dot.on::before { background: var(--keep); box-shadow: 0 0 0 4px rgba(52,179,107,.18); }
.money .label { color: var(--muted); font-size: 14px; display: block; }
.money-today b { font-size: 34px; margin-right: 8px; }
.money-today small { color: var(--muted); }
.bar { height: 8px; background: var(--card2); border-radius: 8px; overflow: hidden; margin: 12px 0 10px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 8px; transition: width .4s; }
.money-row { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.money-row b { color: var(--ink); }
.big-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 14px; text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-height: 150px;
}
.choice .ico { font-size: 34px; }
.choice b { font-size: 20px; margin-top: auto; }
.choice small { color: var(--muted); }
.choice:active { transform: scale(.98); }
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job {
  font: inherit; color: var(--ink); text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; cursor: pointer;
}
.job b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .meta { color: var(--muted); font-size: 13px; }
.status { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--card2); color: var(--muted); align-self: start; justify-self: end; }
.status.done { background: rgba(52,179,107,.18); color: var(--keep); }
.status.working, .status.picked, .status.queued, .status.waiting_uploads { background: rgba(242,154,58,.16); color: var(--accent); }
.status.failed { background: rgba(224,82,82,.16); color: var(--skip); }
.empty { color: var(--muted); text-align: center; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; }

/* ---------- viewers ---------- */
.viewer { position: fixed; inset: 0; background: #000; overflow: hidden; touch-action: pan-y; }
.media { position: absolute; inset: 0; display: grid; place-items: center; }
.media img { -webkit-user-drag: none; user-select: none; }
.media img, .media video, #c-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
#c-video { position: absolute; inset: 0; object-fit: cover; }
.overlay-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 8px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 18px;
  background: linear-gradient(rgba(0,0,0,.6), transparent);
}
.overlay-top .icon-btn { margin-right: auto; }
.pill { background: rgba(0,0,0,.55); border-radius: 99px; padding: 6px 12px; font-size: 14px; font-weight: 600; backdrop-filter: blur(6px); }
.pill.small { font-size: 12px; align-self: center; }
.overlay-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 40px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,.78) 30%);
}
.heard { margin: 0; color: #d9d0c6; font-style: italic; min-height: 1.3em; font-size: 15px; }
.heard:not(:empty)::before { content: "You: "; font-style: normal; color: var(--muted); }
.reply {
  margin: 0; background: rgba(32,28,25,.92); border: 1px solid var(--line); border-radius: 16px;
  padding: 11px 14px; font-size: 17px; max-height: 26dvh; overflow: auto;
}
.reply.error { border-color: #6b2b2b; color: #ffb4ab; }
.controls { display: flex; justify-content: space-around; align-items: center; gap: 10px; }
.controls.thin .btn { flex: 1; padding: 11px 8px; }
.controls.thin .btn.primary { flex: 1.4; }
.round {
  width: 64px; height: 64px; border-radius: 50%; border: 0; font-size: 28px; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.12);
}
.round.skip { background: rgba(224,82,82,.9); }
.round.keep { background: rgba(52,179,107,.92); }
.round.mic { width: 82px; height: 82px; background: #3a332d; font-size: 32px; position: relative; }
.round.mic::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid transparent; }
.round.mic.listening { background: var(--accent); }
.round.mic.listening::after { border-color: var(--accent); animation: pulse 1.4s ease-out infinite; }
.round.mic.thinking::after { border-color: var(--accent) transparent transparent transparent; animation: spin .9s linear infinite; }
.round.mic.speaking { background: #6b5d4f; }
@keyframes pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.badge {
  position: absolute; top: calc(70px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%) rotate(-4deg);
  font-size: 22px; font-weight: 800; letter-spacing: 2px; padding: 6px 18px; border-radius: 10px; border: 3px solid;
}
.badge.keep { color: var(--keep); border-color: var(--keep); background: rgba(0,0,0,.4); }
.badge.skip { color: var(--skip); border-color: var(--skip); background: rgba(0,0,0,.4); }
.type-row { display: flex; gap: 8px; }
.type-row input { padding: 11px 12px; background: rgba(42,37,33,.92); }

/* ---------- make / job ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; color: var(--ink); background: var(--card2); border: 1px solid var(--line); border-radius: 99px; padding: 8px 13px; cursor: pointer; }
.log { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
#j-video { width: 100%; border-radius: 12px; background: #000; max-height: 70dvh; margin-bottom: 10px; }
#j-result { display: flex; flex-direction: column; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumbs figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--card2); display: grid; place-items: center; font-size: 28px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs figcaption { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; padding: 3px 5px; background: rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- settings ---------- */
.seg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg span { flex-basis: 100%; font-weight: 600; }
.seg button { font: inherit; flex: 1; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--ink); cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.toggle { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); }
.days { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.days div { display: flex; justify-content: space-between; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #f4efe8; color: #14110f; padding: 11px 18px; border-radius: 12px; font-weight: 600; z-index: 50;
  max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
