:root {
  --bg: #0B0D10;
  --card: #12141A;
  --card-border: #1E2229;
  --btn: #171A1F;
  --btn-border: #262A31;
  --text: #E7EAEE;
  --muted: #8C94A0;
  --accent: #4EA1FF;
  --accent-2: #7BB8FF;
  --green: #7CE29A;
  --red: #FF6B6B;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
::-webkit-scrollbar { width: 0; height: 0; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(11,13,16,0.92); backdrop-filter: blur(10px);
  padding: 14px 16px 12px; border-bottom: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; background: var(--btn);
  border: 1px solid var(--btn-border); display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; flex: none;
}
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--btn); border: 1px solid var(--btn-border);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex: none; }
.title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brand-anim {
  display: inline-block;
  background: linear-gradient(90deg, var(--text) 0%, var(--accent-2) 25%, var(--green) 50%, var(--accent-2) 75%, var(--text) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brand-shimmer 5s linear infinite, brand-float 2.8s ease-in-out infinite;
  will-change: transform;
}
@keyframes brand-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@keyframes brand-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.logo.brand-pulse {
  animation: brand-glow 2.4s ease-in-out infinite;
}
@keyframes brand-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(78,161,255,0.35); }
  50% { box-shadow: 0 0 0 6px rgba(78,161,255,0); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-anim { animation: none; color: var(--text); background: none; }
  .logo.brand-pulse { animation: none; }
}
.badge { font-size: 11px; font-weight: 600; color: var(--green); background: rgba(124,226,154,0.1);
  border: 1px solid rgba(124,226,154,0.25); padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.badge.free { color: var(--muted); background: rgba(140,148,160,0.08); border-color: rgba(140,148,160,0.2); }

.screen { padding: 16px 16px 100px; display: flex; flex-direction: column; gap: 14px; max-width: 640px; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 18px; }
.card-title { font-size: 18px; font-weight: 700; }
.card-desc { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; white-space: pre-line; }

.stat-row { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 13px 14px;
  display: flex; align-items: center; justify-content: space-between; }
.stat-row .label { font-size: 13px; color: var(--muted); }
.stat-row .value { font-size: 14px; font-weight: 700; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  background: var(--btn); border: 1px solid var(--btn-border); border-radius: 12px; padding: 13px;
  text-align: center; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
}
.btn:active { opacity: 0.7; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #08131F; }
.btn.danger { color: var(--red); }
.btn.row { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.btn.row .r { color: var(--muted); font-size: 12px; }

.list-item {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
}
.list-item .name { font-size: 14px; font-weight: 600; }
.list-item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-item .chev { color: var(--muted); }

.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 10px; }

textarea, input[type=text] {
  width: 100%; background: var(--btn); border: 1px solid var(--btn-border); border-radius: 12px;
  color: var(--text); padding: 12px; font-size: 13px; font-family: inherit; resize: vertical;
}

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 0; color: var(--muted); font-size: 13px; }
.pager .icon-btn { width: 30px; height: 30px; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--btn); border: 1px solid var(--btn-border); border-radius: 12px;
  padding: 10px 16px; font-size: 13px; z-index: 20; opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }

.dev-banner {
  background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.3); color: var(--red);
  border-radius: 12px; padding: 10px 14px; font-size: 12px;
}

.section-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 4px 2px -4px; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tab {
  background: var(--btn); border: 1px solid var(--btn-border); border-radius: 12px;
  padding: 10px 4px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1.2;
}
.tab .ic { font-size: 16px; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #08131F; }

.plan-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 18px; position: relative; }
.plan-card.current { border-color: var(--accent); }
.plan-head { display: flex; align-items: center; justify-content: space-between; }
.plan-name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.plan-price { font-size: 14px; font-weight: 700; color: var(--accent-2); }
.plan-current-tag { position: absolute; top: -10px; right: 14px; background: var(--green); color: #08131F;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.plan-features { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.plan-feature { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.plan-feature .ok { color: var(--green); flex: none; }

.brand-footer {
  margin-top: 6px; text-align: center; padding: 16px 12px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(78,161,255,0.08), rgba(124,226,154,0.06));
  border: 1px solid var(--card-border);
}
.brand-footer .bf-name { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--text); }
.brand-footer .bf-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

.help-block { display: flex; flex-direction: column; gap: 6px; }
.help-block .h-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cmd-row { display: flex; gap: 10px; font-size: 13px; padding: 4px 0; }
.cmd-row code { background: var(--btn); border: 1px solid var(--btn-border); border-radius: 6px; padding: 2px 6px; font-size: 12px; color: var(--accent-2); white-space: nowrap; flex: none; }
.cmd-row .d { color: var(--muted); }

.fmt-toolbar { display: flex; gap: 6px; margin-bottom: 8px; }
.fmt-btn {
  width: 34px; height: 30px; background: var(--btn); border: 1px solid var(--btn-border); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; color: var(--text);
}
input[type="datetime-local"] {
  width: 100%; background: var(--btn); border: 1px solid var(--btn-border); border-radius: 12px;
  color: var(--text); padding: 10px 12px; font-size: 13px; font-family: inherit; color-scheme: dark;
}

.post-item { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 13px 14px; }
.post-item .p-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.post-item .p-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.post-item .p-status.sent { color: var(--green); background: rgba(124,226,154,0.1); }
.post-item .p-status.scheduled { color: var(--accent-2); background: rgba(78,161,255,0.1); }
.post-item .p-status.cancelled { color: var(--muted); background: rgba(140,148,160,0.1); }
.post-item .p-text { font-size: 13px; color: var(--muted); margin-top: 8px; white-space: pre-line; }
.post-item .p-meta { font-size: 11px; color: var(--muted); margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--btn); border: 1px solid var(--btn-border); border-radius: 20px;
  padding: 6px 8px 6px 12px; font-size: 12px; color: var(--text); display: flex; align-items: center; gap: 8px;
}
.chip-x { color: var(--red); cursor: pointer; font-size: 12px; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
