:root {
  --green: #0B6E4F; --green-2: #0E8A63; --green-soft: #E6F2EC; --ink: #1C2321; --muted: #66706C; --line: #E7E3DA;
  --bg: #F7F5F0; --card: #FFFFFF; --gold: #C98A1B; --gold-soft: #FBF1DD; --red: #B3261E; --red-soft: #FBEAE8; --blue-soft: #E8F0FB; --blue: #1F5FAD;
  --r: 16px; --shadow: 0 1px 2px rgba(28,35,33,.05), 0 4px 16px rgba(28,35,33,.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; font-size: 15.5px; line-height: 1.5; padding-bottom: 76px; }
a { color: var(--green); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; }
.demo-bar { background: var(--ink); color: #fff; font-size: .78rem; text-align: center; padding: 4px 8px; letter-spacing: .02em; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: rgba(247,245,240,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 1.12rem; color: var(--ink); }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--green); color: #fff; font-size: 15px; }
.top-nav { display: none; gap: 4px; margin-left: 12px; }
.top-nav a, .bottom-nav a { color: var(--muted); font-weight: 600; }
.top-nav a { padding: 8px 12px; border-radius: 10px; font-size: .94rem; }
.top-nav a.on { color: var(--green); background: var(--green-soft); }
.who { margin-left: auto; }
.who button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px 4px 4px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; padding: 4px 8px; min-width: 60px; }
.bottom-nav a .i { font-size: 1.25rem; line-height: 1; filter: grayscale(1); opacity: .7; }
.bottom-nav a.on { color: var(--green); } .bottom-nav a.on .i { filter: none; opacity: 1; }
@media (min-width: 880px) { .top-nav { display: flex; } .bottom-nav { display: none; } body { padding-bottom: 0; } }

/* layout */
.view { max-width: 1080px; margin: 0 auto; padding: 22px 18px 40px; outline: none; }
.grid { display: grid; gap: 14px; }
.cols-2 { display: grid; gap: 18px; }
@media (min-width: 880px) { .cols-2 { grid-template-columns: 1.55fr 1fr; align-items: start; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.grid > .card + .card, .grid > .item + .item, .kpis > * + *, .cols-2 > .card + .card { margin-top: 0; }
.cols-2 > div > .card + .card, .stack > * + * { margin-top: 14px; }
.section-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* hero */
.hero { background: linear-gradient(135deg, #0B6E4F 0%, #0E8A63 60%, #2E9E77 100%); color: #fff; border-radius: 22px; padding: 26px 22px; box-shadow: var(--shadow); }
.hero h1 { font-size: 1.75rem; margin-bottom: 6px; }
.hero p { opacity: .92; margin-bottom: 16px; }
.hero .btn { background: #fff; color: var(--green); }
@media (min-width: 880px) { .hero { padding: 36px 36px; } .hero h1 { font-size: 2.1rem; } }

/* trades */
.trades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 880px) { .trades { grid-template-columns: repeat(6, 1fr); } }
.trade { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 600; font-size: .86rem; text-align: center; cursor: pointer; transition: border-color .15s, transform .15s; }
.trade:hover { border-color: var(--green); transform: translateY(-1px); }
.trade .i { font-size: 1.6rem; }
.trade.on { border-color: var(--green); background: var(--green-soft); }

/* buttons, forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 650; cursor: pointer; background: var(--green); color: #fff; text-align: center; }
.btn:hover { background: var(--green-2); }
.btn.ghost { background: transparent; color: var(--green); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--green-soft); }
.btn.soft { background: var(--green-soft); color: var(--green); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.gold { background: var(--gold); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: .88rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 6px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-soft); border-color: var(--green); }
textarea { min-height: 84px; resize: vertical; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title .chips { flex-wrap: nowrap; }
.chip-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.chip-btn.on { background: var(--green); color: #fff; border-color: var(--green); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: #8A5A00; }
.badge.grey { background: #EFEDE7; color: var(--muted); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.status { font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.st-open { background: var(--blue-soft); color: var(--blue); } .st-assigned { background: var(--green-soft); color: var(--green); }
.st-done { background: var(--gold-soft); color: #8A5A00; } .st-completed { background: #EFEDE7; color: var(--muted); }
.st-disputed { background: var(--red-soft); color: var(--red); } .st-cancelled { background: #EFEDE7; color: var(--muted); }

/* avatars + people */
.av { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 700; font-size: .95rem; }
.av.sm { width: 28px; height: 28px; font-size: .72rem; }
.av.lg { width: 76px; height: 76px; font-size: 1.6rem; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: .92rem; }
.person { display: flex; gap: 12px; align-items: center; }
.person .name { font-weight: 700; }

/* lists */
.item { display: block; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); transition: border-color .15s; }
a.item:hover { border-color: #CFC9BC; }
.item .title { font-weight: 700; margin-bottom: 2px; }
.meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.price { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.big-price { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; border: 1px dashed var(--line); border-radius: var(--r); }

/* money box */
.secure { display: flex; gap: 12px; align-items: center; background: var(--green-soft); color: var(--green); border-radius: 14px; padding: 14px; font-weight: 600; }
.secure .i { font-size: 1.4rem; }
.alert { border-radius: 14px; padding: 14px; background: var(--gold-soft); color: #6B4700; }
.alert.red { background: var(--red-soft); color: var(--red); }
.alert.blue { background: var(--blue-soft); color: var(--blue); }
.split { display: grid; grid-template-columns: 1fr auto; gap: 6px 0; font-size: .94rem; }
.split > :nth-child(even) { text-align: right; padding-left: 12px; font-variant-numeric: tabular-nums; }
.split .t { font-weight: 750; border-top: 1px solid var(--line); padding-top: 6px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 880px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.kpi .v { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .84rem; }

/* timeline + chat + ledger */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 22px; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; padding: 4px 2px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; background: #F1EFE9; font-size: .92rem; }
.msg.me { align-self: flex-end; background: var(--green); color: #fff; }
.msg .w { font-size: .72rem; opacity: .75; margin-top: 2px; }
.ledger { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ledger td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.in { color: var(--green); } .out { color: var(--ink); }

/* feed preview */
.feed { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .feed { grid-template-columns: repeat(3, 1fr); max-width: 860px; } }
.reel { position: relative; aspect-ratio: 9/14; border-radius: 18px; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; box-shadow: var(--shadow); }
.reel .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; opacity: .85; }
.reel .cap { position: relative; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.reel .acts { position: relative; display: flex; gap: 8px; margin-top: 10px; }
.reel .acts a { display: inline-flex; }
.reel .acts span { background: rgba(255,255,255,.2); backdrop-filter: blur(6px); padding: 6px 10px; border-radius: 999px; font-size: .8rem; }

/* sheet + toast */
.sheet-back { position: fixed; inset: 0; background: rgba(20,24,22,.45); z-index: 40; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 40px rgba(0,0,0,.18); }
@media (min-width: 680px) { .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 520px; border-radius: 20px; } }
.sheet h2 { margin-bottom: 4px; }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .92rem; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; max-width: 90vw; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 880px) { .toast { bottom: 28px; } }
.acct-list { display: grid; gap: 8px; }
.acct { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; text-align: left; width: 100%; }
.acct:hover { border-color: var(--green); }
.role-tag { margin-left: auto; }
.code-box { font-size: 1.8rem; letter-spacing: .3em; font-weight: 800; text-align: center; background: var(--gold-soft); border-radius: 14px; padding: 12px; color: #6B4700; }
.check { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--green); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 800; font-size: .85rem; }
table.fees { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.fees td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
table.fees td:last-child { text-align: right; font-weight: 700; }
