:root {
  --bg: #000;
  --card: #1c1c1e;
  --card-border: #2c2c30;
  --field: #2c2c2e;
  --field-hover: #353538;
  --text: #fff;
  --muted: #8e8e93;
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, .14);
  --accent-line: rgba(10, 132, 255, .32);
  --ok: #30d158;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --radius: 28px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

[v-cloak] { display: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.app { max-width: 560px; margin: 0 auto; padding: 14px 14px calc(120px + var(--safe-bottom)); min-height: 100vh; }

/* ---- banner (same role as the orange notice in the reference) ---- */
.banner {
  position: relative;
  margin: -14px -14px 14px;
  padding: 16px 52px 16px 56px;
  background: linear-gradient(100deg, #8a3b12, #c76a12);
  font-size: 15px;
  line-height: 1.45;
}
.banner b { color: #ffd60a; }
.banner .ico { position: absolute; left: 18px; top: 16px; width: 24px; height: 24px; }
.banner .x { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); }
.banner.info { background: linear-gradient(100deg, #12345e, #1b5596); }

/* ---- card ---- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-bottom: 14px;
}
.card-title { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin: 0 0 16px; }
.card-title .logo { width: 30px; height: 30px; }
.card-sub { font-size: 17px; font-weight: 650; margin: 0 0 12px; }

/* ---- segmented tabs ---- */
.seg { display: flex; gap: 4px; background: var(--field); border-radius: 999px; padding: 5px; margin-bottom: 18px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 12px 6px; border-radius: 999px; font-size: 16px; font-weight: 500; white-space: nowrap; }
.seg button.on { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(10,132,255,.35); }

/* ---- fields ---- */
.label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; margin: 14px 4px 8px; }
.label svg { width: 18px; height: 18px; }
.field {
  width: 100%;
  min-height: 56px;
  border: 2px solid transparent;
  background: var(--field);
  border-radius: 999px;
  padding: 0 22px;
  font-size: 17px;
  outline: none;
  transition: border-color .15s;
}
.field:focus { border-color: var(--accent); background: #232326; }
textarea.field { border-radius: 24px; padding: 15px 22px; resize: none; line-height: 1.4; min-height: 56px; }
select.field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10'%3E%3Cpath d='M1 1l7 7 7-7' fill='%23c7c7cc'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 22px center;
  padding-right: 52px;
}
.hint { color: var(--muted); font-size: 13px; margin: 6px 6px 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- estimate box ---- */
.est {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-top: 18px; padding: 18px 20px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 18px;
  color: var(--muted); font-size: 15px;
}
.est b { color: var(--accent); font-size: 17px; white-space: nowrap; }

/* ---- buttons ---- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; margin-top: 18px;
  border: 0; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 18px; font-weight: 600;
}
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--field); color: var(--text); }
.btn.small { min-height: 40px; margin: 0; font-size: 14px; width: auto; padding: 0 16px; }
.btn.danger { background: rgba(255,69,58,.16); color: var(--bad); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---- filters ---- */
.toggle-head { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; padding: 16px 4px 4px; color: var(--muted); font-size: 15px; }
.toggle-head .count { color: var(--accent); }
.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 4px; border-bottom: 1px solid #262629; font-size: 16px; }
.check:last-child { border-bottom: 0; }
.check small { display: block; color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #39393d; border-radius: 999px; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---- tasks ---- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chips button { flex: none; border: 0; background: var(--field); color: var(--muted); border-radius: 999px; padding: 9px 16px; font-size: 14px; }
.chips button.on { background: var(--accent); color: #fff; }
.task { background: var(--card); border: 1px solid var(--card-border); border-radius: 22px; padding: 16px; margin-bottom: 10px; }
.task-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.task-title { font-weight: 650; font-size: 16px; word-break: break-word; }
.task-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.pill { flex: none; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--field); color: var(--muted); }
.pill.running { background: var(--accent-soft); color: var(--accent); }
.pill.done { background: rgba(48,209,88,.15); color: var(--ok); }
.pill.failed { background: rgba(255,69,58,.15); color: var(--bad); }
.bar { height: 6px; background: var(--field); border-radius: 99px; margin-top: 12px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.bar.indeterminate i { width: 35%; animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.task-note { color: var(--muted); font-size: 13px; margin-top: 8px; }
.task-err { color: var(--bad); font-size: 14px; margin-top: 8px; }
.big { font-size: 24px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ---- admin ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--field); border-radius: 16px; padding: 12px; }
.stat b { display: block; font-size: 20px; }
.stat span { color: var(--muted); font-size: 12px; }
.acc { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid #262629; }
.acc:last-child { border-bottom: 0; }
.acc small { display: block; color: var(--muted); font-size: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--ok); }
.dot.flood { background: var(--warn); }
.dot.off { background: var(--bad); }
.kv { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; padding: 6px 0; }
.kv b { color: var(--text); font-weight: 500; }

/* ---- bottom nav (floating pill like the reference) ---- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + var(--safe-bottom));
  display: flex; gap: 6px; padding: 7px;
  background: rgba(28,28,30,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border); border-radius: 999px; z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.nav button { position: relative; display: flex; align-items: center; gap: 8px; border: 0; background: none; color: #c7c7cc; height: 52px; min-width: 52px; justify-content: center; border-radius: 999px; padding: 0 14px; font-size: 16px; }
.nav button.on { background: rgba(10,132,255,.22); color: #fff; border: 1px solid var(--accent-line); padding: 0 18px; }
.nav svg { width: 26px; height: 26px; }
.nav .badge { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; }
.fab { position: fixed; right: 18px; bottom: calc(96px + var(--safe-bottom)); width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(10,132,255,.45); z-index: 9; }
.fab svg { width: 30px; height: 30px; }

/* ---- sheet / toast ---- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; }
.sheet { width: 100%; max-width: 560px; margin: 0 auto; max-height: 85vh; overflow: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 22px 20px calc(24px + var(--safe-bottom)); }
.sheet h3 { margin: 0 0 12px; font-size: 20px; }
.sheet p, .sheet li { color: #d1d1d6; font-size: 15px; }
.sheet ul { padding-left: 18px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-bottom)); background: #2c2c2e; color: #fff; padding: 12px 18px; border-radius: 16px; z-index: 30; font-size: 15px; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.bad { background: #5c1d1a; }
.center { display: flex; align-items: center; justify-content: center; min-height: 60vh; color: var(--muted); text-align: center; padding: 20px; }
.spin { width: 30px; height: 30px; border: 3px solid var(--field); border-top-color: var(--accent); border-radius: 50%; animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---- AI content ---- */
.warn { background: rgba(255,159,10,.14); border: 1px solid rgba(255,159,10,.35); color: #ffd60a; border-radius: 16px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags span { font-size: 12px; background: var(--field); color: #d1d1d6; border-radius: 999px; padding: 5px 10px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.post-img { display: block; width: 100%; border-radius: 16px; margin-top: 12px; background: var(--field); }
.post-text { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.45; margin-top: 10px; color: #f2f2f7; }
.post-text a { color: var(--accent); }
.post-text blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--accent); color: #d1d1d6; }
.sheet.tall { max-height: 92vh; }
.task-title .dot { vertical-align: middle; }
