/* ─────────────────────────  ГАРАНТ · clinical white / deep red  ───────────────────────── */
:root {
  --white: #ffffff;
  --off-white: #fafaf9;
  --surface: #f4f4f2;
  --border: #e8e6e1;
  --border-hi: #d4d0c8;
  --ink: #110F1C;
  --ink-2: #1D1B2B;
  --soft: #72716d;
  --softer: #a8a5a0;
  --red: #E82827;
  --red-light: #FDF0F0;
  --red-mid: #F7C3C2;
  --red-dark: #C21C1B;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --amber: #b45309;
  --amber-light: #fffbeb;

  --sans: 'Manrope', 'Plus Jakarta Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--white); color: var(--ink); }
body {
  font: 400 15px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
body.has-dev-main { padding-bottom: 84px; }
#app { max-width: 620px; margin: 0 auto; padding: 0 var(--gutter) 40px; overflow-x: clip; }
::selection { background: var(--red-mid); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.red { color: var(--red); }

/* full-bleed band inside the narrow column */
.band { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); }
.band.off { background: var(--off-white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ───── nav ───── */
.dev-badge { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 10px; }
.dev-badge a { color: var(--softer); }
.dev-badge a b { color: var(--red); font-weight: 500; }
.nav {
  position: sticky; top: 0; z-index: 30; height: 58px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: -.03em; }
.brand span { color: var(--red); }
.nav-right { display: flex; align-items: center; gap: 8px; }

/* ───── badges & pills ───── */
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--surface);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--soft);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex: none; animation: dot-pulse 2s ease-in-out infinite; }
@keyframes dot-pulse { 50% { opacity: .35; } }
.eyebrow {
  display: inline-block; padding: 4px 10px; border-radius: 100px;
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--red); background: var(--red-light); border: 1px solid var(--red-mid);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 100px; white-space: nowrap;
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  color: var(--soft); background: var(--surface); border: 1px solid var(--border);
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.red { color: var(--red); background: var(--red-light); border-color: var(--red-mid); }
.pill.redfill { color: #fff; background: var(--red); border-color: var(--red); }
.pill.amber { color: var(--amber); background: var(--amber-light); border-color: #fde68a; }
.pill.green { color: var(--green); background: var(--green-light); border-color: #bbf7d0; }
.pill.ink { color: var(--ink); background: var(--white); border-color: var(--border-hi); }

/* ───── type ───── */
.h1 { font-weight: 800; letter-spacing: -.045em; line-height: 1.05; font-size: clamp(38px, 10.5vw, 64px); margin: 0; }
.h2 { font-weight: 800; letter-spacing: -.04em; line-height: 1.08; font-size: clamp(28px, 7.5vw, 40px); margin: 0; }
.h3 { font-weight: 700; letter-spacing: -.02em; line-height: 1.25; font-size: 17px; margin: 0; }
.sub { color: var(--soft); font-size: 16px; line-height: 1.65; margin: 0; }
.center { text-align: center; }
.section { padding: 44px 0 8px; }
.section-head { margin-bottom: 20px; }
.section-head .h2 { margin-top: 12px; }
.section-head .sub { margin-top: 8px; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 28px 0 12px; }
.row-head .h3 { font-size: 18px; }

/* ───── hero ───── */
.hero { padding: 34px 0 8px; text-align: center; }
.hero .h1 { margin: 22px auto 0; max-width: 13ch; }
.hero .sub { margin: 16px auto 0; max-width: 36ch; }
.cta-row { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.trust { margin-top: 18px; color: var(--softer); font-size: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
.trust span + span::before { content: '·'; margin-right: 10px; }

/* ───── buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px;
  border-radius: 8px; border: 1.5px solid var(--red); background: var(--red); color: #fff;
  font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.ghost { background: var(--white); color: var(--ink); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--border-hi); background: var(--off-white); }
.btn.danger { background: var(--white); color: var(--red); border-color: var(--red-mid); }
.btn.danger:hover { background: var(--red-light); }
.btn.ink { background: var(--ink); border-color: var(--ink); }
.btn.ink:hover { background: var(--ink-2); }
.btn.sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 6px; }
.btn.xs { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 6px; font-weight: 600; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row > * { flex: 1; }
.link-btn { font-weight: 600; font-size: 14px; color: var(--soft); padding: 10px 0; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--red); }

/* ───── forms ───── */
input, textarea {
  font: 400 15px/1.5 var(--sans); color: var(--ink); width: 100%;
  background: var(--white); border: 1.5px solid var(--border); border-radius: 8px;
  padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-light); }
textarea { resize: vertical; min-height: 88px; }
input::placeholder, textarea::placeholder { color: var(--softer); }
.card { background: var(--white); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px; }
.card.surface { background: var(--surface); border-width: 1px; }
.card + .card { margin-top: 10px; }
.field + .field { margin-top: 14px; }
.field label { display: block; margin-bottom: 7px; }
.item-edit { display: grid; grid-template-columns: 26px minmax(0, 1fr) 82px 38px; gap: 6px; align-items: center; }
.item-edit + .item-edit { margin-top: 8px; }
.item-edit .ix { font-family: var(--mono); font-size: 11px; color: var(--red); }
.item-edit input.price { text-align: right; font-family: var(--mono); font-size: 14px; }
.item-edit .rm { width: 38px; height: 44px; border-radius: 8px; border: 1.5px solid var(--border); color: var(--softer); font-size: 18px; display: grid; place-items: center; transition: color .15s, border-color .15s; }
.item-edit .rm:hover { color: var(--red); border-color: var(--red-mid); }
.item-edit .rm[disabled] { opacity: .3; pointer-events: none; }
.add-item { margin-top: 14px; font-weight: 700; font-size: 14px; color: var(--red); }
.note { color: var(--soft); font-size: 13px; margin: 10px 2px 0; line-height: 1.55; }

.join-row { display: flex; gap: 8px; margin-top: 10px; }
.join-row input { font-family: var(--mono); font-weight: 500; letter-spacing: .24em; text-transform: uppercase; text-align: center; font-size: 17px; }
.join-row .btn { height: auto; padding: 0 18px; }

/* ───── stats bar ───── */
.stats { display: grid; grid-template-columns: 1fr 1fr; padding-top: 6px; padding-bottom: 6px; margin-top: 30px; }
.stat { padding: 18px 8px; text-align: center; }
.stat:nth-child(odd) { border-right: 1px solid var(--border); }
.stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
.stat .v { font-weight: 800; font-size: 34px; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .v em { font-style: normal; color: var(--red); }
.stat .l { margin-top: 4px; font-size: 10px; }
@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat { border-bottom: 0 !important; border-right: 1px solid var(--border); }
  .stat:last-child { border-right: 0; }
}

/* ───── marquee ───── */
.marquee { display: flex; align-items: center; gap: 14px; height: 52px; overflow: hidden; border-bottom: 1px solid var(--border); }
.marquee .mono { flex: none; font-size: 9.5px; color: var(--softer); }
.marquee-mask { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: scroll 28s linear infinite; }
.marquee-track span { font-weight: 600; font-size: 13.5px; color: var(--border-hi); white-space: nowrap; padding-right: 22px; transition: color .15s; }
.marquee-track span:hover { color: var(--soft); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ───── feature cards ───── */
.feats { display: flex; flex-direction: column; gap: 10px; }
.feat { background: var(--white); border: 1.5px solid var(--border); border-radius: 14px; padding: 22px; transition: border-color .2s, transform .2s; }
.feat:hover { border-color: var(--red-mid); transform: translateY(-2px); }
.feat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.feat-ic { width: 40px; height: 40px; border-radius: 8px; background: var(--red-light); color: var(--red); display: grid; place-items: center; }
.feat-num { transition: color .2s; }
.feat:hover .feat-num { color: var(--red); }
.feat p { margin: 6px 0 0; color: var(--soft); font-size: 14px; line-height: 1.65; }

/* ───── deal list ───── */
.dlist { display: flex; flex-direction: column; gap: 8px; }
.dcard { display: block; width: 100%; text-align: left; background: var(--white); border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px; transition: border-color .2s, transform .2s; }
.dcard:hover { border-color: var(--red-mid); transform: translateY(-1px); }
.dcard-top, .dcard-bot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dcard-top .mono { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcard-bot { margin-top: 8px; }
.dtitle-sm { font-weight: 700; font-size: 15.5px; letter-spacing: -.02em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsum { font-family: var(--mono); font-weight: 500; font-size: 13px; white-space: nowrap; }
.dsum small { color: var(--softer); font-size: 10px; }

/* ───── FAQ ───── */
.faq { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; text-align: left; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.faq-q i { font-style: normal; color: var(--red); font-size: 20px; line-height: 1; font-weight: 400; transition: transform .3s var(--ease); flex: none; }
.faq-item.open .faq-q i { transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.faq-a > div { overflow: hidden; color: var(--soft); font-size: 14px; line-height: 1.7; }
.faq-a > div > p { margin: 0 0 16px; }
.faq-item.open .faq-a { grid-template-rows: 1fr; }

/* ───── deal: dashboard ───── */
.dhead { padding: 22px 0 0; }
.dhead-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chip-code { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .12em; color: var(--ink); transition: border-color .15s; }
.chip-code:hover { border-color: var(--border-hi); }
.chip-code svg { color: var(--soft); }
.dtitle { font-weight: 800; letter-spacing: -.04em; line-height: 1.1; font-size: clamp(28px, 8vw, 40px); margin: 16px 0 0; word-break: break-word; }
.dmeta { margin-top: 8px; font-size: 10px; color: var(--softer); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; min-width: 0; }
.kpi .mono { font-size: 9px; display: block; }
.kpi .k-v { font-weight: 800; font-size: 21px; letter-spacing: -.04em; line-height: 1.2; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi .k-v small { font-size: 11px; font-weight: 600; color: var(--soft); letter-spacing: 0; }
.kpi .k-d { font-family: var(--mono); font-size: 9.5px; margin-top: 2px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-d.up { color: var(--green); } .k-d.warn { color: var(--amber); } .k-d.red { color: var(--red); }

.chart { margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 14px 10px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; }
.chart-head .mono { font-size: 9.5px; }
.legend { display: flex; gap: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 9px; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; }
.legend span::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 92px; margin-top: 14px; }
.bar { flex: 1; min-width: 6px; max-width: 46px; background: var(--border); border-radius: 3px 3px 0 0; transition: background .15s ease, height .5s var(--ease); position: relative; }
.bar.delivered { background: var(--border-hi); }
.bar.active, .bar:hover { background: var(--red); }
.xlabels { display: flex; gap: 6px; margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; }
.xlabels span { flex: 1; min-width: 6px; max-width: 46px; text-align: center; font-family: var(--mono); font-size: 9px; color: var(--softer); }

.track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.seg i { display: block; height: 4px; border-radius: 4px; background: var(--border); }
.seg span { display: block; margin-top: 7px; font-family: var(--mono); font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--softer); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg.done i { background: var(--ink); }
.seg.done span { color: var(--soft); }
.seg.active i { background: var(--red); animation: dot-pulse 2s ease-in-out infinite; }
.seg.active span { color: var(--red); }
.seg.danger i { background: var(--red); }
.seg.danger span { color: var(--red); }

.insight { margin-top: 8px; background: var(--red-light); border: 1.5px solid var(--red-mid); border-left: 3px solid var(--red); border-radius: 10px; padding: 14px 16px; animation: insight-pulse 3s ease-in-out infinite; }
@keyframes insight-pulse { 0%, 100% { border-left-color: var(--red); } 50% { border-left-color: var(--red-mid); } }
.insight-head { display: flex; align-items: center; gap: 8px; color: var(--red); font-weight: 700; font-size: 13px; }
.insight-head svg { flex: none; }
.insight b { display: block; font-weight: 800; letter-spacing: -.02em; font-size: 17px; color: var(--ink); margin: 8px 0 2px; line-height: 1.3; }
.insight p { margin: 0; color: var(--soft); font-size: 13.5px; line-height: 1.6; }
.insight.calm { background: var(--surface); border-color: var(--border); border-left-color: var(--ink); animation: none; }
.insight.calm .insight-head { color: var(--ink); }
.insight.ok { background: var(--green-light); border-color: #bbf7d0; border-left-color: var(--green); animation: none; }
.insight.ok .insight-head { color: var(--green); }
.meter { height: 4px; background: var(--red-mid); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.meter > div { height: 100%; background: var(--red); border-radius: 4px; transition: width .5s var(--ease); }

.people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.person { display: flex; align-items: center; gap: 10px; background: var(--white); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; min-width: 0; }
.ava { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--soft); }
.person.me .ava { background: var(--red-light); border-color: var(--red-mid); color: var(--red); }
.person .mono { font-size: 9px; display: block; }
.person .n { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .n a { color: var(--ink); }
.person .n.wait { color: var(--softer); font-weight: 500; }
.terms { background: var(--off-white); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); font-size: 14px; }

.item { background: var(--white); border: 1.5px solid var(--border); border-radius: 14px; padding: 16px; transition: border-color .2s; }
.item + .item { margin-top: 8px; }
.item:hover { border-color: var(--border-hi); }
.item.confirmed { background: var(--off-white); }
.item-top { display: flex; justify-content: space-between; align-items: center; }
.item-top .mono.red { font-size: 10px; }
.item-name { font-weight: 700; letter-spacing: -.02em; font-size: 16px; margin-top: 8px; display: flex; justify-content: space-between; gap: 12px; word-break: break-word; }
.item-name span:last-child { font-family: var(--mono); font-weight: 500; font-size: 13px; white-space: nowrap; color: var(--ink); }
.item .body { margin-top: 12px; }
.payload-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.payload-label button { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.payload { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--ink); }

.table { background: var(--white); border: 1.5px solid var(--border); border-radius: 14px; padding: 4px 16px; }
.trow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; font-size: 14px; }
.trow + .trow { border-top: 1px solid var(--border); }
.trow span { color: var(--soft); }
.trow b { font-family: var(--mono); font-weight: 500; font-size: 13px; white-space: nowrap; }
.trow.total span { color: var(--ink); font-weight: 700; }
.trow.total b { color: var(--red); font-size: 14px; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--border); }
.tl { position: relative; padding: 6px 0; font-size: 14px; line-height: 1.5; }
.tl::before { content: ''; position: absolute; left: -20px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--white); border: 1.5px solid var(--border-hi); }
.tl.paid::before, .tl.released::before, .tl.confirmed::before { background: var(--red); border-color: var(--red); }
.tl.dispute::before, .tl.payout_failed::before, .tl.cancelled::before { border-color: var(--red); }
.tl time { display: block; font-family: var(--mono); font-size: 10px; color: var(--softer); letter-spacing: .06em; text-transform: uppercase; }

.actions-list { margin-top: 24px; padding-top: 6px; border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; }

/* ───── misc ───── */
.empty { border: 1.5px dashed var(--border); border-radius: 14px; padding: 26px 16px; text-align: center; color: var(--soft); font-size: 14px; }
.empty .h3 { color: var(--ink); margin-bottom: 4px; }
.skeleton { height: 76px; border-radius: 12px; background: var(--surface); position: relative; overflow: hidden; }
.skeleton + .skeleton { margin-top: 8px; }
.skeleton.tall { height: 220px; margin-top: 22px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; z-index: 50; text-align: center; max-width: calc(100% - 32px); animation: pop .25s var(--ease); }
body.has-dev-main .toast { bottom: 88px; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }
.dev-main { position: fixed; left: 16px; right: 16px; bottom: 14px; max-width: 588px; margin: 0 auto; z-index: 40; height: 52px; border-radius: 10px; background: var(--red); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 8px 24px rgba(200, 16, 46, .22); }
.dev-main[disabled] { opacity: .5; }

/* ───── entrance (first render of a screen only) ───── */
.enter .fu { animation: fade-up .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } }
.enter .fu-lg { animation: fade-up-lg .7s var(--ease) .3s both; }
@keyframes fade-up-lg { from { opacity: 0; transform: translateY(40px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ─────────────────────────  simplified layout  ───────────────────────── */
.hero { text-align: left; padding: 40px 0 24px; }
.hero .h1 { margin: 0; max-width: none; }
.hero .sub { margin: 12px 0 0; max-width: 32ch; }

.toggles { margin-top: 28px; border-top: 1px solid var(--border); }
.toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 15px 0;
  font-weight: 600; font-size: 15px; color: var(--soft); border-bottom: 1px solid var(--border);
}
.toggle svg { transition: transform .25s var(--ease); color: var(--softer); }
.toggle.open { color: var(--ink); }
.toggle.open svg { transform: rotate(180deg); }
.toggles > .dlist { margin-top: 10px; }
.how { margin: 14px 0 6px; padding-left: 20px; color: var(--soft); font-size: 14px; line-height: 1.6; }
.how li + li { margin-top: 6px; }
.how li::marker { color: var(--red); font-family: var(--mono); font-size: 12px; }

/* create */
.items-edit { margin-top: 10px; }
.item-edit { grid-template-columns: minmax(0, 1fr) 92px; }
.item-edit:has(.rm) { grid-template-columns: minmax(0, 1fr) 92px 38px; }
.add-row { display: flex; gap: 20px; }
.sumline { margin: 14px 2px 0; color: var(--soft); font-size: 14px; }
.sumline b { color: var(--ink); font-weight: 700; }

/* deal */
.dhead .dtitle { margin-top: 12px; }
.bigsum { font-weight: 800; font-size: 34px; letter-spacing: -.04em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.bigsum small { font-size: 14px; font-weight: 600; color: var(--soft); letter-spacing: 0; }
.insight { margin-top: 22px; }
.insight b { margin: 0 0 2px; font-size: 16px; }
.insight p { font-size: 14px; }
.code-big {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: var(--white); border: 1px solid var(--red-mid);
  font-family: var(--mono); font-weight: 500; font-size: 20px; letter-spacing: .14em; color: var(--ink);
}
.code-big svg { color: var(--red); }
.link-sm { display: inline-block; margin-top: 8px; font-weight: 600; font-size: 13px; color: var(--red); }
.link-sm:hover { text-decoration: underline; }

.item { padding: 14px 16px; }
.item-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.iname { font-weight: 700; letter-spacing: -.02em; font-size: 15.5px; line-height: 1.35; min-width: 0; word-break: break-word; }
.iname > div { display: flex; align-items: center; gap: 12px; margin-top: 3px; }
.iname .link-sm { margin: 0; font-size: 12.5px; }
.iprice { font-family: var(--mono); font-size: 13px; white-space: nowrap; padding-top: 2px; }
.istatus { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--softer); }
.istatus.ok { color: var(--green); }
.istatus.red { color: var(--red); }
.item.confirmed { background: var(--white); }
.item.confirmed .iname { color: var(--soft); }
.payload { position: relative; cursor: copy; padding-right: 34px; }
.copy-hint { position: absolute; top: 10px; right: 10px; color: var(--softer); }
.payload:hover .copy-hint { color: var(--red); }

.details { padding: 6px 0 4px; }
.details .trow { padding: 9px 0; border-bottom: 1px solid var(--border); }
.details .trow + .trow { border-top: 0; }
.details .trow b.plain { font-family: var(--sans); font-weight: 600; font-size: 14px; }
.details .terms { margin-top: 14px; }
.details .timeline { margin-top: 16px; }
.details .actions-list { border-top: 0; margin-top: 12px; }

/* home: join → or → create */
.start { margin-top: 8px; }
.start-label { display: block; font-weight: 700; font-size: 15px; letter-spacing: -.01em; margin-bottom: 2px; }
.start .join-row input { letter-spacing: .16em; }
.start .join-row input::placeholder { letter-spacing: 0; font-family: var(--sans); text-transform: none; font-size: 15px; }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--softer); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* brand logo */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.dev-main { box-shadow: 0 8px 24px rgba(232, 40, 39, .22); }
.brand .bt { color: var(--ink); }
.brand em { font-style: normal; color: var(--red); }

/* create: role choice */
.roles { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.role-card {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  width: 100%; text-align: left; padding: 18px; border-radius: 14px; background: var(--white); border: 1.5px solid var(--border);
  transition: border-color .2s, transform .2s;
}
.role-card:hover, .role-card:active { border-color: var(--red); transform: translateY(-1px); }
.role-card b { font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.role-card span { grid-column: 1; color: var(--soft); font-size: 14px; line-height: 1.5; margin-top: 2px; }
.role-card svg { grid-column: 2; grid-row: 1 / 3; color: var(--red); }
.role-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 100px;
  background: var(--red-light); border: 1px solid var(--red-mid); color: var(--red); font-weight: 700; font-size: 13px;
}
.role-chip span { font-weight: 500; color: var(--soft); }

/* create step 2: back arrow before the title */
.title-back { display: flex; align-items: center; gap: 6px; margin-top: 4px !important; }
.back {
  flex: none; width: 36px; height: 36px; margin-left: -8px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink); transition: background .15s;
}
.back:hover, .back:active { background: var(--surface); }

/* create: role segmented control inside the card */
.seg-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 10px; background: var(--surface); border: 1.5px solid transparent; transition: border-color .2s; }
.seg-ctl button { height: 40px; border-radius: 7px; font-weight: 700; font-size: 14.5px; color: var(--soft); transition: background .15s, color .15s, box-shadow .15s; }
.seg-ctl button.on { background: var(--white); color: var(--red); box-shadow: 0 1px 3px rgba(17, 15, 28, .08); }
.seg-ctl.error { border-color: var(--red-mid); }

/* create: description + sum + fee payer */
.form { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.form .seg-ctl { margin-bottom: 0; }
.form textarea { min-height: 132px; }
.seg-ctl.three { grid-template-columns: repeat(3, 1fr); }
.seg-ctl.three button { font-size: 13.5px; }
.form-label { margin: 6px 2px -4px; }
.price-field { position: relative; }
.price-field input { font-weight: 700; font-size: 20px; letter-spacing: -.02em; padding-right: 64px; font-variant-numeric: tabular-nums; }
.price-field input::placeholder { font-weight: 400; font-size: 15px; letter-spacing: 0; }
.price-field span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 12px; color: var(--soft); }
.sumline:empty { display: none; }

/* deal head: description + viewer's amount */
.ddesc { margin: 10px 0 0; color: var(--soft); font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.sum-label { margin-top: 18px; font-size: 10px; }
.dhead .bigsum { margin-top: 2px; }

.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { background: #15803d; border-color: #15803d; }

/* deposit card + deal tabs + chat */
.deposit { margin-top: 18px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--white); }
.dep-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dep-state { font-size: 12.5px; font-weight: 700; color: var(--soft); text-align: right; }
.dep-state.ok { color: #15803d; }
.dep-sum { margin-top: 6px; font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }
.dep-sum b { font-size: 24px; letter-spacing: -.02em; color: var(--ink); }
.dep-bar { height: 5px; margin-top: 10px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.dep-bar i { display: block; height: 100%; background: var(--red); border-radius: 3px; transition: width .4s; }
.seg-ctl.tabs { margin: 12px 0 16px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; min-height: 120px; overflow-y: auto; padding: 4px 2px; }
.chat-empty { padding: 18px 8px; text-align: center; font-size: 13.5px; color: var(--soft); }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--surface); font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.msg.mine .bubble { background: var(--red); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg time { margin-top: 3px; font-size: 11px; color: var(--softer); }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }

/* deal stages progress bar */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 18px; }
.st i { display: block; height: 5px; border-radius: 3px; background: var(--surface); }
.st span { display: block; margin-top: 7px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--softer); }
.st.done i { background: var(--red); }
.st.now i { background: linear-gradient(90deg, var(--red) 0 50%, var(--surface) 50%); animation: stnow 1.6s ease-in-out infinite; }
.st.done span, .st.now span { color: var(--ink); }
@keyframes stnow { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .st.now i { animation: none; } }

.ticks { margin-left: 4px; color: var(--softer); }
.ticks.read { color: #15803d; }
