/* Ascend — calm, light, mobile-first. Same visual family as the Zobet app. */
:root {
  --text: #141414; --muted: #6b6b6b; --muted-2: #9a9a9a;
  --bg-app: #f3f7fd; --surface: #fff; --surface-2: #f6f5f3;
  --line: #e6e5e2; --line-2: #dedddb;
  --blue: #2e78ef; --blue-soft: #eaf3ff; --blue-text: #1f5fd0;
  --green: #1f9d55; --green-soft: #e6f6ec;
  --red: #d63b3b; --red-soft: #fdecec;
  --amber: #b7791f; --amber-soft: #fff5e0;
  --purple: #6d4bd6; --purple-soft: #efeaff;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(20,20,20,.05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg-app); color: var(--text); font: 15px/1.5 var(--font); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
body.center { display: grid; place-items: center; padding: 24px; }
a { color: var(--blue-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; margin: 22px 0 10px; }
h3 { font-size: 15px; font-weight: 650; margin: 18px 0 6px; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: .9em; }
pre.code { background: #141414; color: #eee; padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.late { color: var(--red); }
.warn { color: #8a4b00; background: var(--amber-soft); border: 1px solid #f3dcae; padding: 8px 12px; border-radius: var(--radius-sm); }
.inline { display: inline; }
.right { text-align: right; }
.grow { flex: 1 1 auto; }
.wide { width: 100%; }

/* topbar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: rgba(255,255,255,.8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); font-size: 17px; }
.brand-sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 10px; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--text); padding: 6px 10px; border-radius: 8px; font-weight: 500; }
.nav a.active, .nav a:hover { background: var(--blue-soft); color: var(--blue-text); text-decoration: none; }
.pill { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; margin-left: 6px; }
.main { max-width: 1180px; margin: 0 auto; padding: 18px 18px 60px; }
.flash { max-width: 1180px; margin: 12px auto 0; padding: 10px 14px; background: var(--green-soft); color: #14622f; border: 1px solid #bfe6cc; border-radius: var(--radius-sm); transition: opacity .6s; }
.flash.fade { opacity: 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #141414; color: #fff; padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); z-index: 50; font-size: 14px; }

/* layout */
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.empty { color: var(--muted); }
.card.list { padding: 6px 0; }
.row-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; color: var(--text); border-bottom: 1px solid var(--line); font-size: 14px; }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--surface-2); text-decoration: none; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .k { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.tile .l { font-size: 12.5px; color: var(--muted); }

/* badges */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; }
.badge.offer { background: var(--purple-soft); color: var(--purple); border-color: transparent; }
.badge.late { background: var(--red-soft); color: var(--red); border-color: transparent; }
.status-active { background: var(--blue-soft); color: var(--blue-text); border-color: transparent; }
.status-waiting { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.status-upgraded { background: var(--green-soft); color: var(--green); border-color: transparent; }
.status-not_now, .status-snoozed { background: var(--surface-2); color: var(--muted); }
.status-dnc, .status-refunded { background: var(--red-soft); color: var(--red); border-color: transparent; }
.sent-hot { background: var(--red-soft); color: var(--red); border-color: transparent; }
.sent-warm { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.sent-cold { background: var(--blue-soft); color: var(--blue-text); border-color: transparent; }
.sent-problem { background: var(--purple-soft); color: var(--purple); border-color: transparent; }

/* due cards */
.due-card { border-left: 4px solid var(--blue); position: relative; }
.due-card.overdue { border-left-color: var(--red); }
.due-card.done { border-left-color: var(--green); background: var(--green-soft); }
.done-line { color: #14622f; font-weight: 500; }
.due-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.due-head .name { font-weight: 700; font-size: 17px; color: var(--text); margin-right: 6px; }
.meta { color: var(--muted); font-size: 13px; }
.step-line { margin-top: 10px; }
.goal { color: var(--muted); font-size: 13.5px; margin: 2px 0 10px; }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; margin: 8px 0; background: var(--blue-soft); color: var(--blue-text); }
.notice.warn { background: var(--amber-soft); color: #8a4b00; }
.notice form.row { margin-top: 8px; }
textarea.msg { width: 100%; font: 15px/1.5 var(--font); padding: 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); resize: vertical; background: #fffdf8; }
textarea.msg:focus { outline: 2px solid var(--blue); border-color: transparent; }
textarea.msg:disabled { background: var(--surface-2); color: var(--muted-2); }
.msg-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin: 4px 2px 8px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.actions.wrap { margin-top: 12px; }
.sub-form { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-top: 10px; }
.tips { margin-top: 10px; font-size: 13.5px; }
.tips summary { cursor: pointer; color: var(--blue-text); }
.tips-body { white-space: pre-line; color: var(--muted); padding: 6px 0 0 4px; }
.notes-line { margin-top: 10px; font-size: 13.5px; color: var(--muted); white-space: pre-line; }
.tips-card ul { padding-left: 18px; margin-top: 6px; color: var(--muted); }

/* buttons, forms */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 500 14px var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: linear-gradient(180deg, #3a84f5, #2e78ef); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger, .link.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--blue-text); cursor: pointer; font: inherit; padding: 0; }
.link:hover { text-decoration: underline; }
details.menu { position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; top: 110%; left: 0; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); min-width: 190px; padding: 6px; display: flex; flex-direction: column; }
.menu-body button { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; font: 14px var(--font); cursor: pointer; color: var(--text); }
.menu-body button:hover { background: var(--surface-2); }
.menu-body button.danger { color: var(--red); }
@media (max-width: 600px) {
  details.menu { position: static; }
  .menu-body { left: 12px; right: 12px; min-width: 0; }
  .btn, .menu-body button { min-height: 44px; }
  .actions { gap: 8px 6px; }
}
label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: 4px; font: 14px var(--font); color: var(--text); padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }
label.check { display: inline-flex; align-items: center; gap: 6px; }
label.check input { width: auto; margin: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 140px; }
.row > input { flex: 1 1 200px; font: 14px var(--font); padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.row > select { font: 14px var(--font); padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }
.form label { margin-bottom: 10px; }
.login { width: 100%; max-width: 380px; }
.login h1 { margin-bottom: 4px; }
.login label { margin: 16px 0 12px; }

/* tables */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.notes-cell { color: var(--muted); font-size: 13px; max-width: 260px; }
.kv td { padding: 4px 10px 4px 0; font-size: 14px; vertical-align: top; }
.kv td:first-child { color: var(--muted); white-space: nowrap; }

/* timeline */
.timeline .row { margin-bottom: 12px; }
.tl-item { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
@media (max-width: 600px) { .tl-item { grid-template-columns: 1fr; gap: 2px; } }
.tl-when { color: var(--muted); font-size: 13px; }
.tl-text { white-space: pre-wrap; font: 14px/1.5 var(--font); background: var(--surface-2); padding: 8px 10px; border-radius: 8px; margin-top: 4px; }
.kind-reply .tl-text { background: var(--green-soft); }
.kind-sent .tl-text, .kind-bump .tl-text { background: #fffdf8; border: 1px solid var(--line); }
.kind-status strong { color: var(--purple); }

/* sequence editor */
.steps details.step summary { display: grid; grid-template-columns: 34px 1fr 1.2fr; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.steps details.step summary::-webkit-details-marker { display: none; }
.steps details.step[open] summary { margin-bottom: 14px; }
.steps details.step.disabled { opacity: .6; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.step-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .steps details.step summary { grid-template-columns: 34px 1fr; } .step-preview { display: none; } }
.steps-mini { padding-left: 20px; font-size: 14px; }
.steps-mini li { padding: 3px 0; color: var(--muted); }
.steps-mini li.done { text-decoration: line-through; color: var(--muted-2); }
.steps-mini li.current { color: var(--text); font-weight: 600; }
