/* Кабинет клиента ТОПТРИ. Мобильный первым: открывается как Telegram Mini App. */
:root {
  --navy: #000d37; --pink: #ff008d; --grad: linear-gradient(120deg, #ff008d 0%, #ff6a00 55%, #ffca00 100%);
  --bg: #f3f5fb; --card: #fff; --line: #e7eaf3; --ink: #16204a; --muted: #7a86ab;
  --ok: #17b26a; --warn: #f79009; --err: #f04438;
  --r: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg); color: var(--ink); padding-bottom: 76px;
}
.top { background: var(--navy); color: #fff; padding: 14px 16px calc(14px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 800; letter-spacing: .5px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.who { margin-left: auto; font-size: 12.5px; opacity: .85; text-align: right; line-height: 1.2; }
main { padding: 14px 14px 0; max-width: 680px; margin: 0 auto; }
.loading, .empty { color: var(--muted); font-size: 14px; padding: 24px 4px; text-align: center; }

.cohead { background: var(--card); border-radius: var(--r); padding: 14px 16px; box-shadow: 0 6px 24px rgba(16,26,74,.07); margin-bottom: 14px; }
.cohead h1 { margin: 0; font-size: 17px; line-height: 1.25; }
.cohead .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--muted); }

.sec-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 18px 4px 8px; }
.card { background: var(--card); border-radius: 14px; padding: 13px 15px; box-shadow: 0 4px 16px rgba(16,26,74,.06); margin-bottom: 10px; }
.card.act { border: 1px solid #ffd7ec; }
.t-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.t-desc { font-size: 13.5px; color: #47527d; margin-top: 5px; white-space: pre-wrap; }
.t-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; color: var(--muted); }
.st { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.quote { margin-top: 9px; border-left: 3px solid var(--line); padding: 2px 0 2px 10px; font-size: 13px; color: var(--muted); font-style: italic; }
.acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; background: var(--grad); color: #fff; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
textarea, input[type=text] { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); }
textarea { resize: vertical; min-height: 64px; }
.form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

.ev { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); margin-top: 6px; flex: none; }
.ev-b { flex: 1; min-width: 0; }
.ev-t { font-weight: 600; font-size: 14px; }
.ev-x { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; }
.ev-d { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.person { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.ava { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.p-n { font-weight: 700; font-size: 14px; }
.p-p { font-size: 12.5px; color: var(--muted); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); padding: 14px 4px; cursor: pointer; }
.tab.active { color: var(--navy); box-shadow: inset 0 2px 0 var(--pink); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13.5px; z-index: 50; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1424; --card: #161d31; --line: #26304a; --ink: #e8ecf8; --muted: #939dbd; }
  .t-desc { color: #b9c2dd; }
  .tabs { background: var(--card); }
  textarea, input[type=text] { background: #101729; }
  .btn.ghost { background: var(--card); color: var(--ink); }
}
