:root {
  --radius: 22px;
  --radius-lg: 26px;
  --radius-field: 14px;
  --gap: 14px;
  --primary: #ff2d6f;
  --primary-fg: #fff7fa;
  --accent: #e11d48;
  --glow: #ff9ec4;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a0510;
  --text: #fff1f5;
  --muted: rgba(255, 241, 245, 0.64);
  --subtle: rgba(255, 241, 245, 0.42);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #ff5c7a;
  --glass: rgba(255, 255, 255, 0.065);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.12);
  --highlight: rgba(255, 255, 255, 0.25);
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  --field: rgba(0, 0, 0, 0.22);
  --field-border: rgba(255, 255, 255, 0.1);
  --tabbar: rgba(38, 8, 24, 0.62);
  --mesh:
    radial-gradient(560px 460px at 14% 6%, rgba(225, 29, 72, 0.5), transparent 70%),
    radial-gradient(620px 520px at 90% 28%, rgba(255, 111, 165, 0.3), transparent 72%),
    radial-gradient(700px 560px at 40% 92%, rgba(255, 45, 111, 0.28), transparent 70%),
    linear-gradient(180deg, #1a0510 0%, #2b0a1b 52%, #3d0f26 100%);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #fff1f5;
  --text: #3b0a22;
  --muted: rgba(59, 10, 34, 0.62);
  --subtle: rgba(59, 10, 34, 0.42);
  --ok: #15a36b;
  --warn: #d98a06;
  --bad: #dc2648;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --line: rgba(59, 10, 34, 0.09);
  --highlight: rgba(255, 255, 255, 0.9);
  --shadow: 0 14px 34px -14px rgba(120, 20, 60, 0.28);
  --field: rgba(255, 255, 255, 0.7);
  --field-border: rgba(59, 10, 34, 0.1);
  --tabbar: rgba(255, 255, 255, 0.72);
  --mesh:
    radial-gradient(520px 420px at 12% 8%, rgba(255, 111, 165, 0.42), transparent 70%),
    radial-gradient(560px 480px at 88% 22%, rgba(225, 29, 72, 0.2), transparent 72%),
    radial-gradient(640px 520px at 50% 100%, rgba(255, 158, 196, 0.45), transparent 70%),
    linear-gradient(180deg, #fff1f5 0%, #ffe6ee 60%, #ffdde8 100%);
}

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

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  min-height: 100dvh;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--mesh);
  background-repeat: no-repeat;
  background-size: 100% 140%;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom));
}

.glass,
.card,
.stat-card,
.mode-card,
.item,
.toast,
.tabbar,
.chip,
.icon-btn,
.filepick,
.banner,
.log-bubble {
  position: relative;
  isolation: isolate;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  overflow: hidden;
}
.glass::before,
.card::before,
.stat-card::before,
.mode-card::before,
.tabbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}
.glass::after,
.card::after,
.stat-card::after,
.mode-card::after,
.tabbar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(255, 255, 255, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 40%);
}

.brand-grad {
  background: linear-gradient(135deg, #ff6fa5 0%, #ff2d6f 48%, #e11d48 100%);
}

.glow-pink {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 0 1px rgba(255, 45, 111, 0.55),
    0 10px 28px -8px rgba(255, 45, 111, 0.6);
}

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.topbar-main { min-width: 0; flex: 1; }
.logo {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 13px;
  font-weight: 800; font-size: 13px; letter-spacing: -0.03em;
  color: var(--primary-fg);
  background: linear-gradient(135deg, #ff6fa5 0%, #ff2d6f 48%, #e11d48 100%);
  box-shadow: 0 8px 20px -8px rgba(255, 45, 111, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.brand { font-size: 16px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  background: var(--glass-strong);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.chip.on .dot { animation: pulse-dot 1.6s ease-in-out infinite; }
.chip.off { color: var(--muted); }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
}

.icon-btn {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  background: var(--glass-strong);
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- blocks ---------- */
.stack { display: flex; flex-direction: column; gap: var(--gap); animation: fade-up 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.stack > .btn { width: 100%; flex: none; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.card {
  border-radius: var(--radius);
  padding: 16px;
}
.card.flush { padding: 0; }
.card.flush .card-head { padding: 16px 16px 4px; }
.card.flush .list { gap: 0; }
.card.flush .item {
  border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none;
  background: transparent; overflow: visible;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.card.flush .item:last-child { border-bottom: 0; }
.card.flush .item::before, .card.flush .item::after { display: none; }
.card.flush .help { padding: 0 16px 14px; }

.card-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  font-size: 15px; font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.card-title span.count,
.card-title .link {
  color: var(--muted); font-weight: 700; font-size: 13px;
}
.card-title .link { color: var(--primary); border: 0; background: none; cursor: pointer; font: inherit; font-weight: 700; }

.hero {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  padding: 20px;
  color: var(--primary-fg);
  background:
    radial-gradient(140% 90% at 100% 0%, rgba(255, 158, 196, 0.55), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(225, 29, 72, 0.7), transparent 60%),
    linear-gradient(135deg, #ff2d6f 0%, #c81a4f 55%, #7a1237 100%);
  box-shadow: 0 24px 50px -20px rgba(225, 29, 72, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.hero::before, .hero::after { display: none; }
.hero .hero-shine {
  pointer-events: none;
  position: absolute; inset: 0;
  background:
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.22) 45%, rgba(255, 255, 255, 0.05) 52%, transparent 60%),
    radial-gradient(120% 70% at 10% -10%, rgba(255, 255, 255, 0.28), transparent 55%);
}
.hero-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.9;
}
.hero-label i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hero.on .hero-label i { background: var(--ok); animation: pulse-dot 1.6s ease-in-out infinite; }
.hero .hero-mode { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 10px 0 6px; }
.hero .hero-desc { font-size: 14px; opacity: 0.85; max-width: 320px; position: relative; z-index: 1; }
.hero .row { position: relative; z-index: 1; margin-top: 16px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.stat-card {
  min-height: 92px;
  border-radius: var(--radius);
  padding: 12px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
}
.stat-card:active { transform: scale(0.97); }
.stat-card.on {
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(255, 45, 111, 0.4);
}
.health { cursor: pointer; }
.health-row {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  font-size: 13px; color: var(--muted); font-weight: 600;
}
.health-row b { color: var(--text); font-size: 17px; font-weight: 800; margin-right: 4px; }
.health-row .bad, .health-row .bad b { color: var(--bad); }
.stat-ico { color: var(--primary); }
.stat-ico svg { width: 18px; height: 18px; display: block; }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat-value span { font-size: 13px; font-weight: 700; color: var(--subtle); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; }

/* ---------- buttons ---------- */
.row { display: flex; gap: 10px; }
.btn {
  flex: 1;
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, #ff6fa5 0%, #ff2d6f 48%, #e11d48 100%);
  color: var(--primary-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(255, 45, 111, 0.55), 0 10px 28px -8px rgba(255, 45, 111, 0.6);
}
.btn-light {
  background: rgba(255, 255, 255, 0.92);
  color: #3b0a22;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.4);
}
.btn-ghost {
  background: var(--glass-strong);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost-light {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
}
.btn-danger { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); }
.btn-sm { flex: 0 0 auto; min-height: 36px; width: 36px; padding: 0; }
.btn-sm.wide { width: auto; padding: 0 14px; font-size: 13px; }

/* ---------- mode selector ---------- */
.mode-list { display: flex; flex-direction: column; gap: 10px; }
.mode-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: var(--radius);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.mode-card:active { transform: scale(0.985); }
.mode-card.active {
  border-color: color-mix(in srgb, var(--primary) 60%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(255, 45, 111, 0.55), 0 10px 28px -8px rgba(255, 45, 111, 0.55);
}
.mode-ico {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  color: var(--primary);
}
.mode-card.active .mode-ico {
  border-color: transparent;
  color: var(--primary-fg);
  background: linear-gradient(135deg, #ff6fa5 0%, #ff2d6f 48%, #e11d48 100%);
}
.mode-ico svg { width: 24px; height: 24px; }
.mode-text { flex: 1; min-width: 0; }
.mode-text b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.mode-text span { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.35; }
.mode-check {
  width: 24px; height: 24px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: transparent;
}
.mode-card.active .mode-check {
  border-color: transparent;
  color: var(--primary-fg);
  background: linear-gradient(135deg, #ff6fa5 0%, #ff2d6f 48%, #e11d48 100%);
}
.mode-check svg { width: 14px; height: 14px; }

/* ---------- fields ---------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.field > label .hint { font-size: 12px; font-weight: 600; color: var(--subtle); }
.help, .field .help { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }

input, textarea, select {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-field);
  border: 1px solid var(--field-border);
  background: var(--field);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(255, 45, 111, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 3px rgba(255, 45, 111, 0.18);
}
input::placeholder, textarea::placeholder { color: var(--subtle); }
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff9ec4' stroke-width='2.2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

.range { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 8px; }
.range .sep { color: var(--muted); font-size: 13px; }
.range input { text-align: center; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preset, .tpl {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--highlight);
}
.preset.active, .tpl.active {
  border-color: color-mix(in srgb, var(--primary) 70%, transparent);
  color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(255, 45, 111, 0.4);
}

.filepick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 124px;
  text-align: center;
  padding: 18px 14px;
  border: 1.5px dashed color-mix(in srgb, var(--primary) 45%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  cursor: pointer;
  box-shadow: none;
}
.filepick.compact { min-height: 88px; }
.filepick:active { transform: scale(0.99); }
.filepick svg { width: 24px; height: 24px; color: var(--primary); }
.filepick b { display: block; font-size: 14px; font-weight: 800; }
.filepick span { display: block; font-size: 12.5px; color: var(--muted); }

.tpl-row {
  display: flex; gap: 8px;
  margin: 10px -16px 0;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tpl-row::-webkit-scrollbar { display: none; }
.tpl { flex: 0 0 auto; max-width: 220px; padding-right: 6px; }
.tpl > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.tpl > i {
  width: 28px; height: 28px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--subtle);
  font-style: normal; font-size: 14px; line-height: 1;
}
.tpl-add {
  border-style: dashed;
  background: transparent;
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  box-shadow: none;
  padding-right: 12px;
}

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; }
.item.off { opacity: 0.55; }
.item.blocked { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 35%, transparent); }
.item.current { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent); }

.switcher {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.switcher::-webkit-scrollbar { display: none; }
.chip-acc {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--text);
  font: inherit; font-size: 13px; font-weight: 750;
  cursor: pointer;
}
.chip-acc.on {
  color: var(--primary-fg);
  border-color: transparent;
  background: linear-gradient(135deg, #ff6fa5 0%, #ff2d6f 48%, #e11d48 100%);
}
.chip-acc .dot-px {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
}
.chip-acc.on .dot-px { background: #fff; }
.avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 800; font-size: 14px;
  color: var(--primary-fg);
  background: linear-gradient(135deg, #ff6fa5 0%, #ff2d6f 48%, #e11d48 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.avatar.ch { border-radius: 14px; }
.item-body { min-width: 0; flex: 1; }
.item-body b { display: block; font-size: 14.5px; font-weight: 800; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-body small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-actions { display: flex; gap: 4px; flex: 0 0 auto; }

.quota { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.quota-bar { flex: 1; height: 4px; border-radius: 999px; background: var(--glass-strong); overflow: hidden; }
.quota-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ff6fa5, #ff2d6f);
}
.quota-text { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.quota-text.full { color: var(--warn); }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .empty-ico {
  width: 48px; height: 48px; margin: 0 auto 10px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  color: var(--primary);
  font-size: 22px;
}
.empty .empty-ico svg { width: 24px; height: 24px; }
.empty p { margin: 0; font-size: 13.5px; line-height: 1.5; }

.check-list { display: flex; flex-direction: column; }
.check-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 48px;
  padding: 6px 0;
  border: 0; background: none; color: inherit; font: inherit;
  text-align: left;
  cursor: pointer;
}
.check-mark {
  width: 24px; height: 24px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: transparent;
}
.check-mark svg { width: 14px; height: 14px; }
.check-row.done .check-mark { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.check-row .check-text { flex: 1; font-size: 14px; font-weight: 650; }
.check-row .check-hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.check-row .chev { color: var(--subtle); }
.check-row .chev svg { width: 16px; height: 16px; display: block; }

.steps { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.step { flex: 1; height: 6px; border-radius: 999px; background: var(--glass-strong); }
.step.done { background: linear-gradient(135deg, #ff6fa5 0%, #ff2d6f 48%, #e11d48 100%); }

.log-item { display: flex; gap: 16px; padding: 0 0 20px; }
.log-item:last-child { padding-bottom: 0; }
.log-rail { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; width: 11px; padding-top: 6px; }
.log-rail i {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.log-item:not(:first-child) .log-rail i { width: 9px; height: 9px; box-shadow: none; background: transparent; border: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); }
.log-rail span { flex: 1; width: 1px; margin-top: 6px; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 60%, transparent), var(--line), transparent); }
.log-item:last-child .log-rail span { display: none; }
.log-body { min-width: 0; flex: 1; }
.log-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--subtle); margin-bottom: 8px; }
.log-text {
  font-size: 13.5px; line-height: 1.5; word-break: break-word;
  padding: 10px 14px;
  border-radius: 16px 16px 16px 6px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
}

.tag {
  display: inline-flex; align-items: center;
  height: 24px;
  font-size: 11.5px; font-weight: 700;
  padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass-strong); color: var(--muted);
  vertical-align: middle;
}
.tag.accent, .tag-premium {
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}
html[data-theme="dark"] .tag.accent, html[data-theme="dark"] .tag-premium { color: var(--glow); }
.tag.ok { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.tag.warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.tag.bad { border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }

.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.4;
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  color: var(--text);
}
.banner.err { border-color: color-mix(in srgb, var(--bad) 25%, transparent); background: color-mix(in srgb, var(--bad) 8%, var(--glass)); }
.banner b { display: block; margin-bottom: 2px; font-weight: 800; }
.banner.err b { color: var(--bad); }

.tabbar {
  position: fixed;
  left: 50%; bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 496px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--tabbar);
  z-index: 10;
}
.tabbar button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 56px;
  padding: 6px 2px;
  border: 0; border-radius: 20px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  z-index: 1;
}
.tabbar button svg { width: 21px; height: 21px; position: relative; z-index: 1; }
.tabbar button span { position: relative; z-index: 1; }
.tabbar button.active { color: var(--primary-fg); }
.tabbar button.active::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff6fa5 0%, #ff2d6f 48%, #e11d48 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(255, 45, 111, 0.4), 0 10px 22px -8px rgba(255, 45, 111, 0.55);
  z-index: 0;
}

.toasts {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  z-index: 50;
  pointer-events: none;
}
.toast {
  max-width: 400px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  animation: fade-up 0.22s ease;
}
.toast.err { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.toast.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .stack, .toast, .chip.on .dot, .hero.on .hero-label i { animation: none; }
}
