/* TemoWeb Client Portal — premium dark theme v2 */
:root {
  --ink-0: #070A12;
  --ink-1: #0B0F1C;
  --ink-2: #111729;
  --ink-3: #1B2340;
  --card: linear-gradient(180deg, #10162B, #0C1120);
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.16);
  --brand-200: #93B0FF;
  --brand-400: #5B83FF;
  --brand-500: #2D5BFF;
  --accent-500: #7B5BFF;
  --text-1: #F2F5FF;
  --text-2: #9FACC6;
  --text-3: #5F6C88;
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #FB7185;
  --grad: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
html, body { overscroll-behavior-y: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Inter, sans-serif;
  background: var(--ink-0);
  color: var(--text-1);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}

body::before {
  content: ''; position: fixed; z-index: 0; pointer-events: none; inset: -20%;
  background:
    radial-gradient(480px 340px at 80% 0%, rgba(45,91,255,.16), transparent 70%),
    radial-gradient(420px 300px at 0% 90%, rgba(123,91,255,.12), transparent 70%),
    radial-gradient(340px 260px at 100% 65%, rgba(52,211,153,.05), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(-3%, 2.5%, 0) scale(1.06); }
}

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 12px 14px 90px; }

.hidden { display: none !important; }
svg.ic { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* ---------- loading ---------- */
.loading-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; gap: 18px; }
.logo-mark {
  width: 68px; height: 68px; border-radius: 18px;
  box-shadow: 0 12px 40px rgba(45,91,255,.4);
  animation: pulse 1.6s ease-in-out infinite;
}
.logo-mark img { width: 100%; height: 100%; display: block; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.loading-text { color: var(--text-3); font-size: 14px; }
.logo-mark.dim { opacity: .25; animation: none; box-shadow: none; }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 14px; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; min-width: 0; }
.brand .logo-sm { width: 32px; height: 32px; flex: 0 0 auto; }
.brand .logo-sm img { width: 100%; height: 100%; display: block; }
.brand .sub { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }
.lang-switch { display: flex; background: var(--ink-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex: 0 0 auto; }
.lang-switch button {
  border: 0; background: transparent; color: var(--text-3); font-size: 12px; font-weight: 700;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: .2s;
}
.lang-switch button.on { background: var(--ink-3); color: var(--text-1); }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  margin-bottom: 12px;
  animation: rise .4s cubic-bezier(.2,.7,.3,1) backwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.section-title .ic { width: 15px; height: 15px; color: var(--brand-400); }
.section-title .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: 20px; }
.hero-aurora {
  content: ''; position: absolute; inset: -40% -20% auto; height: 120%; pointer-events: none;
  background:
    radial-gradient(360px 220px at 85% 10%, rgba(45,91,255,.22), transparent 70%),
    radial-gradient(300px 200px at 10% 0%, rgba(123,91,255,.16), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
.hero > *:not(.hero-aurora) { position: relative; z-index: 1; }
.hero-mark { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); align-self: center; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.proj-status { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: rgba(52,211,153,.1); color: var(--success); }
.proj-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.proj-status.paused { background: rgba(251,191,36,.1); color: var(--warning); }
.proj-status.done { background: rgba(91,131,255,.12); color: var(--brand-200); }
.hero-hello { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }
.hero-hello b { color: var(--text-1); }
.hero-hello span { color: var(--text-3); }
.hero h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.16; margin-bottom: 3px; }
.hero .client-label { color: var(--text-3); font-size: 13.5px; }

.hero-grid { display: flex; align-items: center; gap: 18px; margin-top: 16px; }
.ring-wrap { position: relative; width: 108px; height: 108px; flex: 0 0 auto; }
.ring-wrap svg { transform: rotate(-90deg); display: block; }
.ring-bg { stroke: var(--ink-3); }
.ring-fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.3,.7,.2,1); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center .pct { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.ring-center .lbl { font-size: 9.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }

.hero-stats { flex: 1; display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.stat .k { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; font-weight: 700; }
.stat .v { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.stat .v small { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.stat .v.green { color: var(--success); }
.money-bar { height: 7px; border-radius: 999px; background: var(--ink-3); overflow: hidden; margin-top: 6px; }
.money-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10B981, var(--success)); transition: width 1.1s cubic-bezier(.3,.7,.2,1); }

.meta-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.meta-row:empty { display: none; }
.meta-chip { display: inline-flex; gap: 7px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--ink-2); border: 1px solid var(--line); padding: 8px 11px; border-radius: var(--r-sm); }
.meta-chip .ic { width: 14px; height: 14px; color: var(--text-3); }
.meta-chip.late { color: var(--danger); border-color: rgba(251,113,133,.3); }

/* done banner */
.done-banner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(52,211,153,.12), rgba(45,91,255,.1));
  border: 1px solid rgba(52,211,153,.3); border-radius: var(--r-lg);
  animation: rise .4s cubic-bezier(.2,.7,.3,1) backwards;
}
.done-banner .emoji { font-size: 28px; }
.done-banner .tt { font-weight: 800; font-size: 15px; }
.done-banner .ss { font-size: 12.5px; color: var(--text-2); }

/* hint block */
.hint-block {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; margin-top: 4px;
  background: rgba(251,191,36,.07); border: 1px dashed rgba(251,191,36,.3); border-radius: var(--r-md);
  font-size: 12.5px; color: var(--text-2); line-height: 1.45;
}
.hint-block .ic { width: 15px; height: 15px; color: var(--warning); }
.hint-block.blue { background: rgba(91,131,255,.06); border-color: rgba(91,131,255,.3); }
.hint-block.blue .ic { color: var(--brand-400); }

/* members */
.members-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member { display: flex; align-items: center; gap: 8px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 5px; }
.member .m-ava { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: var(--ink-3); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--brand-200); }
.member .m-ava img { width: 100%; height: 100%; object-fit: cover; }
.member .m-n { font-size: 12.5px; font-weight: 700; }
.member .m-r { font-size: 10px; color: var(--text-3); }

/* pay details */
.paydet-btn { margin-top: 12px; }
.paydet-body { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px; font-size: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; margin-bottom: 12px; }

/* manager card */
.manager-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.manager-row .ava { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: #fff; flex: 0 0 auto; }
.manager-row .who { flex: 1; min-width: 0; }
.manager-row .n { font-weight: 700; font-size: 14px; }
.manager-row .r { font-size: 11.5px; color: var(--text-3); }
.manager-row a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; background: var(--ink-3); color: var(--text-1); font-size: 12.5px; font-weight: 700; padding: 9px 13px; border-radius: var(--r-sm); }

/* ---------- finance ---------- */
.fin-grid { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; }
.donut-wrap { position: relative; width: 124px; height: 124px; flex: 0 0 auto; }
.donut-wrap svg { transform: rotate(-90deg); display: block; }
.donut-track { stroke: var(--ink-3); }
.donut-paid { stroke: var(--success); stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.3,.7,.2,1); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center .pct { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--success); }
.donut-center .lbl { font-size: 9.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }

.tiles { flex: 1; display: grid; grid-template-columns: 1fr; gap: 8px; min-width: 0; }
.tile { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; }
.tile .k { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 1px; display: flex; align-items: center; gap: 5px; }
.tile .k .sw { width: 7px; height: 7px; border-radius: 2.5px; flex: 0 0 auto; }
.tile .v { font-size: 16px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.tile.paid .v { color: var(--success); }

.sub-block { margin-top: 16px; }

/* budget bars */
.b-item { padding: 8px 0; }
.b-item .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.b-item .t { font-size: 13.5px; font-weight: 600; min-width: 0; line-height: 1.35; }
.b-item .a { font-size: 12.5px; font-weight: 800; color: var(--text-2); flex: 0 0 auto; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; }
.b-item .bar { position: relative; height: 12px; border-radius: 4px; background: var(--ink-3); overflow: hidden; }
.b-item .bar .len { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: rgba(91,131,255,.25); }
.b-item .bar .cov { position: absolute; inset: 0 auto 0 0; border-radius: 4px 0 0 4px; background: linear-gradient(90deg, #10B981, var(--success)); transition: width 1s cubic-bezier(.3,.7,.2,1); }
.b-item .bar .cov.full { border-radius: 4px; }
.b-item .sub { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.b-item .sub b { color: var(--success); font-weight: 700; }
.budget-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line-strong); margin-top: 8px; padding-top: 10px; font-size: 14px; font-weight: 800; }
.budget-total .lbl { color: var(--text-3); font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: .07em; align-self: center; }

/* flow chart */
.flow-wrap svg { display: block; width: 100%; height: auto; }
.flow-axis { font-size: 9px; fill: var(--text-3); }
.flow-target-lbl { font-size: 9px; fill: var(--text-3); }
.chart-tip {
  position: fixed; z-index: 80; background: var(--ink-1); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 8px 12px; font-size: 12px; pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); opacity: 0; transition: opacity .15s; max-width: 230px;
}
.chart-tip.show { opacity: 1; }
.chart-tip .tv { font-weight: 800; font-size: 14px; }
.chart-tip .tk { color: var(--text-3); font-size: 11px; }

/* ---------- stages ---------- */
.stage { display: flex; gap: 13px; position: relative; padding-bottom: 16px; }
.stage:last-child { padding-bottom: 0; }
.stage::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--ink-3); }
.stage:last-child::before { display: none; }
.stage .bullet {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; z-index: 1;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  background: var(--ink-2); border: 2px solid var(--ink-3); color: var(--text-3); transition: .3s;
}
.stage .bullet .ic { width: 13px; height: 13px; }
.stage.done .bullet { background: var(--grad); border-color: transparent; color: #fff; }
.stage.active .bullet { border-color: var(--brand-400); color: var(--brand-200); animation: ringPulse 2s infinite; }
@keyframes ringPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(45,91,255,.3); } 50% { box-shadow: 0 0 0 6px rgba(45,91,255,0); } }
.stage .body { flex: 1; min-width: 0; padding-top: 3px; }
.stage .t { font-weight: 700; font-size: 14.5px; }
.stage.pending .t { color: var(--text-3); font-weight: 600; }
.stage .s { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.stage.done .s { color: var(--success); }
.stage.active .s { color: var(--brand-200); }
/* ---------- tasks ---------- */
.task-group { margin-bottom: 6px; }
.task-group:last-child { margin-bottom: 0; }
.tg-head {
  display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
  padding: 8px 0 4px;
}
.tg-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.tg-head.inprog { color: var(--warning); } .tg-head.inprog .dot { background: var(--warning); box-shadow: 0 0 8px rgba(251,191,36,.6); }
.tg-head.todo { color: var(--text-3); }
.tg-head.done { color: var(--success); } .tg-head.done .dot { background: var(--success); }
.tg-head .n { margin-left: auto; background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-size: 10px; color: var(--text-2); }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .check {
  width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--ink-3); flex: 0 0 auto; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; color: #fff; transition: .25s; background: transparent;
}
.task .check .ic { width: 13px; height: 13px; }
.task.done .check { background: var(--grad); border-color: transparent; }
.task.inprog .check { border-color: var(--warning); color: var(--warning); }
.task.inprog .check .ic { width: 10px; height: 10px; }
.task .body { flex: 1; min-width: 0; }
.task .t { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.task.done .t { color: var(--text-2); }
.task .d { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.task .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.task .side .when { font-size: 10.5px; color: var(--text-3); }
.count-badge { font-size: 12px; color: var(--text-3); font-weight: 700; }

/* ---------- payments ---------- */
.pay-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-ic { width: 36px; height: 36px; border-radius: var(--r-sm); background: rgba(52,211,153,.1); color: var(--success); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pay-row .body { flex: 1; min-width: 0; }
.pay-row .a { font-weight: 800; font-size: 14.5px; }
.pay-row .n { font-size: 12px; color: var(--text-3); }
.pay-row .dt { font-size: 12px; color: var(--text-3); flex: 0 0 auto; text-align: right; }

/* ---------- comments ---------- */
.comment { display: flex; gap: 10px; margin-bottom: 13px; }
.comment .ava { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; background: var(--ink-3); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--brand-200); overflow: hidden; }
.comment .ava img { width: 100%; height: 100%; object-fit: cover; }
.comment .bubble { background: var(--ink-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 13px; max-width: 85%; min-width: 0; }
.comment.own { flex-direction: row-reverse; }
.comment.own .bubble { background: rgba(45,91,255,.14); border-color: rgba(45,91,255,.25); border-radius: 14px 4px 14px 14px; }
.comment .who { font-size: 11px; font-weight: 700; color: var(--brand-200); margin-bottom: 3px; }
.comment .txt { font-size: 14px; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; }
.comment .when { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.composer { display: flex; gap: 8px; margin-top: 8px; align-items: flex-end; }
.composer input, .composer textarea {
  flex: 1; min-width: 0; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; color: var(--text-1); font-size: 16px; outline: none;
  font-family: inherit; line-height: 1.4; resize: none; max-height: 132px; overflow-y: auto;
}
.composer input:focus, .composer textarea:focus { border-color: var(--brand-500); }
.composer button { border: 0; background: var(--grad); color: #fff; border-radius: var(--r-md); width: 48px; height: 46px; flex: 0 0 auto; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ---------- activity ---------- */
.evt { display: flex; gap: 9px; align-items: center; padding: 7px 0; font-size: 12.5px; color: var(--text-2); }
.evt .eic { width: 26px; height: 26px; border-radius: 8px; background: var(--ink-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--text-3); flex: 0 0 auto; }
.evt .eic .ic { width: 12px; height: 12px; }
.evt .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt .when { margin-left: auto; font-size: 10.5px; color: var(--text-3); flex: 0 0 auto; }

/* ---------- home hero ---------- */
.home-hero { position: relative; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); padding: 22px 18px; margin-bottom: 14px; animation: rise .4s cubic-bezier(.2,.7,.3,1) backwards; }
.home-hero::after {
  content: ''; position: absolute; inset: -60% -30% auto; height: 160%;
  background: conic-gradient(from 0deg, transparent 60%, rgba(45,91,255,.14) 72%, rgba(123,91,255,.18) 80%, transparent 92%);
  animation: sweep 9s linear infinite; pointer-events: none;
}
@keyframes sweep { to { transform: rotate(360deg); } }
.home-hero .hh-top { position: relative; display: flex; align-items: center; gap: 14px; z-index: 1; }
.logo-lg {
  width: 54px; height: 54px; border-radius: 15px;
  box-shadow: 0 10px 30px rgba(45,91,255,.45); position: relative; overflow: hidden; flex: 0 0 auto;
}
.logo-lg img { width: 100%; height: 100%; display: block; }
.logo-lg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 48%, transparent 62%);
  transform: translateX(-110%); animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(-110%); } 75%, 100% { transform: translateX(110%); } }
.home-hero .hh-hello { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.home-hero .hh-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.hh-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; z-index: 1; }
.hh-stat { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 8px; text-align: center; }
.hh-stat .v { font-size: 17px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.hh-stat .v.green { color: var(--success); }
.hh-stat .k { font-size: 9.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* ---------- project list ---------- */
.proj-card { cursor: pointer; transition: transform .15s; position: relative; overflow: hidden; }
.proj-card:active { transform: scale(.985); }
.proj-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); opacity: .85; }
.proj-card .head { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.proj-ava {
  width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; color: #fff;
  border: 1px solid var(--line-strong);
}
.proj-ava img { width: 100%; height: 100%; object-fit: cover; }
.proj-card .tit { flex: 1; min-width: 0; }
.proj-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 1px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-card .sub { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bar { height: 6px; border-radius: 999px; background: var(--ink-3); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .9s cubic-bezier(.3,.7,.2,1); }
.proj-card .row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--text-2); margin-top: 9px; }
.proj-card .meta { display: flex; gap: 10px; font-size: 11.5px; color: var(--text-3); margin-top: 8px; align-items: center; }
.proj-card .meta .m { display: inline-flex; align-items: center; gap: 5px; }
.proj-card .meta .ic { width: 12px; height: 12px; }
#projects-list .proj-card:nth-child(1) { animation-delay: .05s; }
#projects-list .proj-card:nth-child(2) { animation-delay: .12s; }
#projects-list .proj-card:nth-child(3) { animation-delay: .19s; }
#projects-list .proj-card:nth-child(4) { animation-delay: .26s; }

/* hero client logo — big premium card */
.hero-head { display: flex; align-items: center; gap: 14px; }
.hero-head .proj-ava.xl {
  width: 76px; height: 76px; border-radius: 22px; font-size: 30px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 40px rgba(45,91,255,.35), inset 0 1px 0 rgba(255,255,255,.12);
}
.hero-desc { color: var(--text-2); font-size: 14px; line-height: 1.55; margin: 12px 0 2px; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: 0; border-radius: var(--r-md); padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; transition: .15s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(45,91,255,.3); }
.btn-ghost { background: var(--ink-2); border: 1px solid var(--line); color: var(--text-2); }

/* ---------- PIN gate ---------- */
.pin-input {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px 14px; color: var(--text-1); outline: none; font-family: inherit;
  text-align: center; font-size: 22px; font-weight: 800; letter-spacing: .35em;
}
.pin-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(45,91,255,.14); }
.wait-wrap .field { margin-bottom: 14px; }
.pin-err { color: var(--danger); text-align: center; font-size: 13px; margin-top: 12px; }

/* ---------- owner mode choice + view-as ---------- */
#mode-list { display: flex; flex-direction: column; gap: 10px; }
.mode-btn { justify-content: flex-start; text-align: left; gap: 10px; }
.mode-btn b { font-weight: 800; }
.viewas-banner {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.35); color: var(--warning);
  border-radius: var(--r-md); padding: 10px 12px; font-size: 12.5px; font-weight: 700;
}
.viewas-banner button {
  margin-left: auto; border: 1px solid rgba(251,191,36,.45); background: transparent; color: var(--warning);
  font-size: 11.5px; font-weight: 800; padding: 5px 11px; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.view-only-note { text-align: center; color: var(--text-3); font-size: 12.5px; font-weight: 600; padding: 4px 0; }

/* ---------- project tabs ---------- */
.proj-tabs {
  display: flex; gap: 6px; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 4px; margin-bottom: 12px;
  position: sticky; top: 8px; z-index: 20;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.proj-tabs .pt {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; background: transparent; color: var(--text-3); font-weight: 700; font-size: 13.5px;
  padding: 10px 6px; border-radius: 11px; cursor: pointer; font-family: inherit;
}
.proj-tabs .pt .ic { width: 15px; height: 15px; }
.proj-tabs .pt.on { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(45,91,255,.35); }
.proj-tabs .pt .n {
  font-style: normal; background: rgba(255,255,255,.16); border-radius: 999px;
  padding: 1px 7px; font-size: 10.5px; font-weight: 800;
}
.proj-tabs .pt:not(.on) .n { background: var(--ink-3); color: var(--text-2); }

/* ---------- discussion tab ---------- */
.chat-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chat-filters::-webkit-scrollbar { display: none; }
.chat-filters .cf {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--ink-2); color: var(--text-3);
  font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.chat-filters .cf.on { background: rgba(45,91,255,.16); border-color: rgba(45,91,255,.45); color: var(--brand-200); }
.chat-card { min-height: 40vh; }
.chat-empty { text-align: center; padding: 34px 16px; color: var(--text-3); }
.chat-empty .ic { width: 30px; height: 30px; color: var(--brand-400); margin-bottom: 10px; }
.chat-empty p { font-size: 13.5px; line-height: 1.55; }
.kbadge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; margin-bottom: 5px;
  background: rgba(91,131,255,.14); color: var(--brand-200);
}
.kbadge.k-task { background: rgba(52,211,153,.14); color: var(--success); }
.kbadge.k-question { background: rgba(251,191,36,.14); color: var(--warning); }
.kbadge.k-meeting { background: rgba(123,91,255,.16); color: #C4B5FD; }
.kbadge.k-brief { background: rgba(251,113,133,.14); color: var(--danger); }
.composer-card { position: sticky; bottom: 10px; z-index: 15; }
.kind-chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.kind-chips::-webkit-scrollbar { display: none; }
.kind-chips .kc {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--ink-2); color: var(--text-3);
  font-size: 11.5px; font-weight: 700; padding: 6px 11px; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.kind-chips .kc.on { background: var(--grad); border-color: transparent; color: #fff; }

/* support subscription */
.support-card { border-color: rgba(91,131,255,.25); }
.sup-price { font-size: 15px; font-weight: 800; color: var(--brand-200); letter-spacing: -.01em; }
.sup-price small { font-size: 10px; color: var(--text-3); font-weight: 700; }
.sup-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; }
.sup-row b { color: var(--text-1); font-size: 13px; }
.sup-row.sub { margin-top: 7px; font-size: 12px; color: var(--text-3); }
.sup-row.sub b { font-size: 12px; color: var(--text-2); }
.sup-bar { height: 9px; border-radius: 999px; background: var(--ink-3); overflow: hidden; }
.sup-bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width 1.1s cubic-bezier(.3,.7,.2,1); }
.sup-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.sup-total b { font-size: 15px; font-weight: 800; color: var(--text-1); }
.sup-total.sub { margin-top: 6px; padding-top: 0; border-top: 0; }
.sup-total.sub b { font-size: 13.5px; }
.sup-total b.ok { color: var(--success); }
.sup-total b.due { color: var(--warning); }

.report-btn { margin-bottom: 12px; }
.report-btn:disabled { opacity: .6; }

/* ---------- showcase numbers ---------- */
.stats-card { position: relative; }
.stats-card::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--r-lg); padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(45,91,255,.55), rgba(123,91,255,.12) 40%, rgba(52,211,153,.4));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.big-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.big-stats .bs { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 10px; text-align: center; }
.big-stats .v {
  font-size: 21px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #A9C0FF, #CFC3FF); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.big-stats .k { font-size: 9.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

/* value / market comparison */
.value-block { margin-top: 16px; background: rgba(52,211,153,.05); border: 1px solid rgba(52,211,153,.22); border-radius: var(--r-md); padding: 14px; }
.vb-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--success); margin-bottom: 12px; }
.vb-title .ic { width: 14px; height: 14px; }
.vb-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.vb-row .val { font-weight: 800; font-size: 14px; }
.vb-row .val.dim { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(251,113,133,.6); }
.vb-row .val.green { color: var(--success); }
.vb-bar { height: 8px; border-radius: 999px; background: var(--ink-3); overflow: hidden; margin-bottom: 12px; }
.vb-bar i { display: block; height: 100%; border-radius: 999px; transition: width 1.1s cubic-bezier(.3,.7,.2,1); }
.vb-bar i.m { background: rgba(255,255,255,.14); }
.vb-bar i.o { background: linear-gradient(90deg, #10B981, var(--success)); }
.vb-save { text-align: center; font-size: 15px; font-weight: 800; color: var(--success); letter-spacing: -.01em; }

/* ---------- module catalog ---------- */
.mod-list { display: flex; flex-direction: column; }
.mod-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.mod-row:last-child { border-bottom: 0; }
.mod-row:active { opacity: .7; }
.mod-ic {
  width: 42px; height: 42px; border-radius: 13px; background: var(--ink-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto;
}
.mod-tx { flex: 1; min-width: 0; }
.mod-tx .t { font-weight: 700; font-size: 14.5px; }
.mod-tx .s { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-n { background: rgba(91,131,255,.1); border: 1px solid rgba(91,131,255,.25); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 800; color: var(--brand-200); flex: 0 0 auto; }
.mod-row .chev { color: var(--text-3); display: inline-flex; flex: 0 0 auto; }
.mod-row .chev .ic { width: 15px; height: 15px; }

.mod-ov { background: var(--ink-0); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mod-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  background: rgba(7,10,18,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.mod-head-brand { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.mod-body { max-width: 560px; margin: 0 auto; padding: 20px 16px 60px; position: relative; }
.mod-aurora { position: absolute; inset: 0 0 auto; height: 340px; pointer-events: none; }
.mod-body > *:not(.mod-aurora) { position: relative; }
.mod-hero { text-align: center; padding: 8px 0 4px; }
.mod-hero .mod-ic.xl { width: 64px; height: 64px; border-radius: 19px; font-size: 30px; margin: 0 auto 12px; background: var(--card); }
.mod-hero h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.mod-hero p { color: var(--text-2); font-size: 13.5px; margin-top: 6px; line-height: 1.5; }
.mod-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.mod-stats .ms { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 6px; }
.mod-stats .v { font-weight: 800; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.mod-stats .k { font-size: 9px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.mod-sec { margin-top: 20px; }
.mod-sec h3 { font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--brand-200); margin-bottom: 6px; }
.mod-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.mod-item:last-child { border-bottom: 0; }
.mod-item .ic { width: 14px; height: 14px; color: var(--success); margin-top: 3px; }
.mod-item span { min-width: 0; }

/* ---------- waiting for access ---------- */
.wait-wrap { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.wait-wrap .logo-mark { margin: 0 auto 22px; }
.wait-wrap h2 { text-align: center; font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.wait-wrap p { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 22px; line-height: 1.55; }

/* ---------- modal (keyboard-safe) ---------- */
.modal-ov {
  position: fixed; inset: 0; background: rgba(5,7,13,.75); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12vh 14px 40vh; animation: fadeIn .18s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 480px; background: var(--ink-1); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 20px 18px;
  animation: slideUp .25s cubic-bezier(.2,.7,.3,1);
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal h3 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.modal .m-close { border: 0; background: var(--ink-2); border: 1px solid var(--line); color: var(--text-3); width: 30px; height: 30px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal .m-close .ic { width: 14px; height: 14px; }
.modal .btns { display: flex; gap: 10px; margin-top: 14px; }

.back-btn { border: 1px solid var(--line); background: var(--ink-2); color: var(--text-2); border-radius: var(--r-sm); padding: 8px 13px; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.back-btn .ic { width: 13px; height: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(80px); z-index: 99;
  background: var(--ink-2); border: 1px solid var(--line-strong); color: var(--text-1);
  padding: 12px 20px; border-radius: var(--r-md); font-size: 14px; font-weight: 600; opacity: 0; transition: .3s;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: var(--text-3); font-size: 13.5px; padding: 16px 0; }

.footer-brand { text-align: center; color: var(--text-3); font-size: 11.5px; padding: 18px 0 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.footer-brand .ic { width: 12px; height: 12px; }
.footer-brand a { color: var(--text-2); text-decoration: none; font-weight: 700; }

/* ---------- internal registry (owner's own projects) ---------- */
.int-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card, rgba(255,255,255,.04));
  border: 1px solid var(--stroke, rgba(255,255,255,.08));
  border-radius: 16px; padding: 11px 14px; margin-bottom: 8px;
  cursor: pointer; transition: transform .12s ease, border-color .12s ease;
}
.int-row:active { transform: scale(.985); }
.int-row .proj-ava { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; flex: 0 0 40px; }
.int-row .int-tx { flex: 1; min-width: 0; }
.int-row .int-tx .t { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.int-row .int-tx .s { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.int-row .proj-status { flex: 0 0 auto; }

/* ---------- timeline («Хроніка») ---------- */
.tl-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tl-arr {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--stroke, rgba(255,255,255,.1));
  background: rgba(255,255,255,.05); color: var(--text-1, #fff); font-size: 19px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.tl-arr:disabled { opacity: .3; cursor: default; }
.tl-per { flex: 1; text-align: center; font-size: 13.5px; font-weight: 800; letter-spacing: .2px; text-transform: capitalize; }
.tl-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tl-chip {
  font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--stroke, rgba(255,255,255,.09)); color: var(--text-2);
}
.tl-chip.ok { color: #3ADE8B; border-color: rgba(58,222,139,.3); background: rgba(58,222,139,.08); }
.tl-chip.pay { color: #6BA4FF; border-color: rgba(107,164,255,.3); background: rgba(107,164,255,.08); }
.tl-chip.sup { color: #C9A15A; border-color: rgba(201,161,90,.3); background: rgba(201,161,90,.08); }
.tl-card { padding: 6px 14px 10px; }
.tl-day { padding-top: 8px; }
.tl-dh {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-3); padding: 8px 0 4px; position: sticky; top: 0;
}
.tl-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.045); }
.tl-day:last-child .tl-row:last-child { border-bottom: none; }
.tl-ic { font-size: 16px; line-height: 22px; flex: 0 0 22px; text-align: center; }
.tl-tx { flex: 1; min-width: 0; }
.tl-tx .t { font-size: 13.5px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.tl-tx .s { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.tl-row.pay .t { color: #3ADE8B; font-weight: 800; }
.tl-row.support .t { color: #C9A15A; }
.tl-when { font-size: 11px; color: var(--text-3); flex: 0 0 auto; line-height: 22px; }

/* 3 tabs now — tighten so «Обговорення» fits on narrow phones */
.proj-tabs .pt { font-size: 12.5px; padding: 10px 4px; gap: 5px; }
.proj-tabs .pt:not(.on) .ic { display: none; }
.proj-tabs .pt .n { padding: 1px 6px; }

/* hero money stat: explicit remaining line under the bar */
.hero-stats .fin-sub { font-size: 11px; color: var(--text-3); margin-top: 5px; letter-spacing: .2px; }
.hero-stats .fin-sub b { color: #FFC46B; font-weight: 800; }
.hero-stats .fin-sub b.ok { color: var(--success, #3ADE8B); }
