.center { min-height: 80vh; display: grid; place-items: center; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; position: sticky; top: 0; height: 100vh; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px;
  background: rgba(245,245,247,.82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--separator); }
.sidebar .brand { padding: 6px 12px 18px; display: flex; flex-direction: column; gap: 2px; }
.sidebar .brand b { font-size: 17px; letter-spacing: -0.01em; }
.sidebar .brand span { font-size: 12px; color: var(--label-2); }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--label); font-size: 14px; font-weight: 500; text-decoration: none; }
.nav a:hover { background: rgba(0,0,0,.04); }
.nav a[aria-current="page"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }
.nav svg { width: 18px; height: 18px; color: var(--accent-text); flex: none; }
.sidebar .foot { margin-top: auto; padding: 12px; font-size: 12px; color: var(--label-2); display: flex; flex-direction: column; gap: 8px; }
.content { flex: 1 1 auto; min-width: 0; padding: 32px 40px 120px; max-width: 1240px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.page-head .sub { color: var(--label-2); font-size: 14px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; margin-bottom: 8px; color: var(--accent-text); }

.tabs { display: flex; gap: 2px; overflow-x: auto; margin: 0 -4px 24px; padding: 2px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--label); text-decoration: none; }
.tabs a:hover { background: rgba(0,0,0,.05); }
.tabs a[aria-current="page"] { background: var(--label); color: #fff; }

.sec { margin-bottom: 28px; }
.sec > h2 { font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .04em; margin: 0 4px 8px; }
.sec > .note { font-size: 13px; color: var(--label-2); margin: 8px 4px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px; }
.form-grid .full { grid-column: 1 / -1; }
.toggle-row { display: flex; align-items: center; gap: 16px; padding: 12px 20px; min-height: 56px; }
.toggle-row + .toggle-row, .form-grid + .toggle-row, .toggle-row + .form-grid { border-top: 1px solid var(--separator); }
.toggle-row .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.toggle-row .grow b { font-size: 15px; font-weight: 500; }
.toggle-row .grow span { font-size: 13px; color: var(--label-2); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 0 0 1px rgba(0,0,0,.04); display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 13px; color: var(--label-2); }
.kpi b { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--label-2); }

.wlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.wcard { background: var(--surface); border-radius: var(--radius-l); overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.04); display: flex; flex-direction: column; text-decoration: none !important; color: var(--label); transition: box-shadow .2s, transform .2s; }
.wcard:hover { box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.08); transform: translateY(-1px); }
.wcard .cover { aspect-ratio: 16/8; background: var(--fill); display: grid; place-items: center; color: var(--label-3); font-size: 13px; }
.wcard .cover img { width: 100%; height: 100%; object-fit: cover; }
.wcard .b { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.wcard h3 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.wcard .stats { display: flex; gap: 16px; font-size: 13px; color: var(--label-2); }
.wcard .stats b { color: var(--label); font-variant-numeric: tabular-nums; }

.empty-state { text-align: center; padding: 64px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state h3 { font-size: 22px; font-weight: 700; }
.empty-state p { color: var(--label-2); max-width: 26em; }

.savebar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 20px;
  border-radius: 999px; background: rgba(29,29,31,.92); color: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.2); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font-size: 14px; }
.savebar .btn-gray { background: rgba(255,255,255,.14); color: #fff; }

.list-editor { display: flex; flex-direction: column; }
.list-item { display: grid; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--separator); position: relative; }
.list-item:first-child { border-top: 0; }
.list-item .rm { position: absolute; top: 10px; right: 10px; }
.list-item .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-right: 48px; }
.list-add { padding: 12px 20px; border-top: 1px solid var(--separator); }

.sched { display: grid; grid-template-columns: 150px 1fr 1fr 44px; gap: 10px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--separator); }
.sched:first-child { border-top: 0; }

.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--label-2); padding: 12px 16px; border-bottom: 1px solid var(--separator); white-space: nowrap; background: var(--surface-2); }
td { padding: 12px 16px; border-bottom: 1px solid var(--separator); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
td .tags { display: flex; flex-wrap: wrap; gap: 4px; }
td .tags .pill { font-size: 11px; padding: 2px 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.filters .input { width: auto; min-width: 180px; }
.filters .search { flex: 1 1 240px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 12px; font-size: 13px; color: var(--label-2); }

/* Timeline editor */
.track-card { padding: 20px; }
.track { position: relative; height: 72px; border-radius: 12px; background: var(--fill); cursor: copy; margin-top: 8px; user-select: none; touch-action: none; }
.track .ticks { position: absolute; left: 0; right: 0; bottom: -22px; display: flex; justify-content: space-between; font-size: 11px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.track .span { position: absolute; top: 44px; height: 6px; border-radius: 3px; opacity: .35; }
.marker { position: absolute; top: 10px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); cursor: grab; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.marker:active { cursor: grabbing; }
.marker.message { background: #8E8E93; }
.marker.offer { background: var(--accent); color: var(--accent-ink); }
.marker.cta { background: #1D7A4E; }
.marker.poll { background: #5E5CE6; }
.q-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.poll-res { display: grid; gap: 8px; padding: 16px 20px; }
.poll-res .opt { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 10px; align-items: center; font-size: 14px; }
.poll-res .fbar { height: 8px; }
.marker.off { opacity: .4; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--label-2); margin-top: 34px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.ev-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--separator); cursor: pointer; min-height: 60px; }
.ev-row:first-child { border-top: 0; }
.ev-row:hover { background: var(--surface-2); }
.ev-row .at { font-variant-numeric: tabular-nums; font-weight: 600; width: 56px; flex: none; }
.ev-row .grow { flex: 1 1 auto; min-width: 0; }
.ev-row .grow b { display: block; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-row .grow span { font-size: 13px; color: var(--label-2); }

/* Sheet (modal) */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--bg); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.25); animation: pop .22s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: rgba(245,245,247,.9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 1px solid var(--separator); }
.sheet-head h2 { font-size: 17px; font-weight: 600; text-align: center; flex: 1; }
.sheet-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sheet-body .group .form-grid { padding: 16px; }
.drawer { margin-left: auto; height: 100%; width: min(520px, 100%); max-height: none; border-radius: 0; }
.backdrop.right { justify-content: flex-end; padding: 0; }

/* Control room */
.control { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .9fr); gap: 18px; align-items: start; }
.cfeed { height: 560px; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.cmsg { display: flex; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.cmsg.q { background: var(--accent-soft); }
.cmsg.hidden { opacity: .4; }
.cmsg .body { flex: 1 1 auto; min-width: 0; }
.cmsg .who { font-size: 13px; font-weight: 600; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cmsg .who small { font-weight: 500; color: var(--label-3); }
.cmsg .text { font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.cmsg .acts { display: flex; gap: 4px; flex: none; align-items: flex-start; }
.ccompose { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--separator); }
.ccompose .row2 { display: flex; gap: 8px; align-items: center; }
.online { max-height: 260px; overflow: auto; font-size: 14px; }
.online div { padding: 8px 20px; border-top: 1px solid var(--separator); }
.online div:first-child { border-top: 0; }

/* Stats */
.funnel { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.fstep { display: grid; grid-template-columns: 170px minmax(0, 1fr) 90px; gap: 14px; align-items: center; font-size: 14px; }
.fbar { height: 26px; border-radius: 8px; background: var(--fill); overflow: hidden; }
.fbar i { display: block; height: 100%; background: var(--accent); border-radius: 8px; min-width: 2px; }
.fstep .v { text-align: right; font-variant-numeric: tabular-nums; }
.fstep .v small { display: block; font-size: 11px; color: var(--label-2); }
.chart { padding: 16px 20px 20px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }

.login { max-width: 380px; margin: 14vh auto; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-size: 28px; font-weight: 700; text-align: center; }
.login p { text-align: center; color: var(--label-2); margin-top: -8px; }

.preview-frame { display: flex; justify-content: center; padding: 16px; background: var(--fill); border-radius: var(--radius); }
.preview-frame iframe { border: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow); height: 720px; transition: width .25s ease; }

.mobile-top { display: none; }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; background: rgba(245,245,247,.97); }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; position: sticky; top: 0; z-index: 40; background: rgba(245,245,247,.88); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 1px solid var(--separator); }
  .content { padding: 20px 16px 120px; }
  .page-head h1 { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .control { grid-template-columns: 1fr; }
  .fstep { grid-template-columns: 110px minmax(0, 1fr) 70px; }
  .sched { grid-template-columns: 1fr 1fr; }
  .list-item .two { grid-template-columns: 1fr; }
}
