:root {
  color-scheme: dark;
  --bg: #070908;
  --surface: rgba(20, 24, 22, 0.92);
  --surface-solid: #151917;
  --surface-raised: #1d221f;
  --line: rgba(255, 255, 255, 0.08);
  --muted: #8f9a94;
  --text: #f5f8f6;
  --green: #27e07f;
  --green-dark: #0e7f48;
  --green-soft: rgba(39, 224, 127, 0.12);
  --red: #ed5a5a;
  --red-soft: rgba(237, 90, 90, 0.12);
  --radius-lg: 26px;
  --radius-md: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -10%, rgba(28, 136, 75, 0.18), transparent 38%),
    linear-gradient(180deg, #0b0d0c 0%, #060807 100%);
  color: var(--text);
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.18;
  pointer-events: none;
}
.ambient-one { background: var(--green); top: -180px; left: -130px; }
.ambient-two { background: #7a42ff; bottom: -210px; right: -170px; opacity: 0.1; }

.app-shell {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(92px + env(safe-area-inset-bottom));
  position: relative;
}

.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(7, 9, 8, 0.98) 60%, transparent);
}

.brand-button, .persona-button, .icon-button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

.brand-button { display: flex; align-items: center; gap: 11px; text-align: left; }
.brand-button strong { display: block; font-size: 15px; letter-spacing: -0.02em; }
.brand-button small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

.brand-mark { display: grid; place-items: center; }
.brand-mark svg { width: 100%; height: 100%; overflow: visible; }
.brand-mark path:first-child { fill: var(--green); }
.brand-mark .brand-cut { fill: #09110d; }
.brand-mark-small { width: 39px; height: 39px; padding: 8px; border: 1px solid var(--line); background: #121614; border-radius: 13px; }
.brand-mark-hero { width: 86px; height: 86px; padding: 13px; border-radius: 26px; background: rgba(9, 17, 13, 0.72); border: 1px solid rgba(39, 224, 127, 0.24); box-shadow: 0 0 60px rgba(39, 224, 127, 0.22); position: relative; z-index: 2; }

.persona-button { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-raised); border: 1px solid var(--line); font-weight: 800; }

.view { display: none; animation: view-in 220ms ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.hero-card {
  min-height: 276px;
  border-radius: 30px;
  border: 1px solid rgba(39, 224, 127, 0.16);
  background: linear-gradient(145deg, #0f1512, #080a09 66%);
  position: relative;
  overflow: hidden;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(70, 220, 139, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 220, 139, 0.18) 1px, transparent 1px);
  background-size: 31px 31px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}
.hero-grid::after { content: ""; position: absolute; width: 130%; height: 2px; left: -15%; top: 38%; background: linear-gradient(90deg, transparent, var(--green), transparent); transform: rotate(-13deg); box-shadow: 0 0 22px var(--green); }
.hero-glow { position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(39, 224, 127, 0.18); filter: blur(70px); top: -70px; right: -20px; }
.hero-copy { position: relative; z-index: 2; max-width: 330px; }
.eyebrow { color: var(--green); font-size: 10px; line-height: 1; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; }
.hero-copy h1, .section-heading h1 { margin: 8px 0 8px; font-size: clamp(30px, 8vw, 40px); line-height: 0.98; letter-spacing: -0.055em; }
.hero-copy p, .section-lead { margin: 0; color: #aab4ae; font-size: 14px; line-height: 1.55; }

.intro-card { margin-top: 12px; padding: 19px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.intro-heading { display: flex; align-items: center; gap: 12px; }
.intro-heading small { color: var(--muted); font-size: 11px; }
.intro-heading h2 { margin: 3px 0 0; font-size: 17px; letter-spacing: -0.03em; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px var(--green); }
.trust-grid { display: grid; gap: 10px; margin-top: 17px; }
.trust-grid div { display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 8px; }
.trust-grid span { color: var(--green); font-size: 10px; font-weight: 900; padding-top: 3px; }
.trust-grid p { margin: 0; color: #c3cbc7; font-size: 12px; line-height: 1.4; }

.primary-action, .support-action, .danger-action {
  width: 100%; border: 0; cursor: pointer; border-radius: var(--radius-md); display: flex; align-items: center; text-align: left;
}
.primary-action { min-height: 76px; margin: 12px 0; padding: 13px 16px; gap: 13px; background: linear-gradient(135deg, #1de275, #12b95f); color: #041008; box-shadow: 0 17px 45px rgba(22, 199, 102, 0.2); }
.primary-action strong { display: block; font-size: 16px; }
.primary-action small { display: block; margin-top: 3px; color: rgba(4, 16, 8, 0.63); font-size: 11px; }
.primary-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, 0.28); font-size: 24px; }
.action-arrow { margin-left: auto; font-size: 24px; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.action-grid button { min-height: 92px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); text-align: left; cursor: pointer; transition: transform 150ms ease, border-color 150ms ease; }
.action-grid button:active { transform: scale(0.98); }
.action-grid button > span { display: block; color: var(--green); font-size: 20px; margin-bottom: 15px; }
.action-grid strong, .action-grid small { display: block; }
.action-grid strong { font-size: 13px; }
.action-grid small { margin-top: 3px; font-size: 10px; color: var(--muted); }

.support-action { margin-top: 10px; min-height: 58px; padding: 0 16px; justify-content: space-between; background: var(--red-soft); border: 1px solid rgba(237, 90, 90, 0.18); color: #ff9b9b; }
.support-action span:first-child { position: absolute; opacity: 0; }
.support-action strong { font-size: 13px; }

.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 12px 2px 22px; }
.section-heading h1 { font-size: 34px; }
.section-lead { margin: -12px 2px 20px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-raised); border: 1px solid var(--line); font-size: 20px; }
.demo-chip { color: var(--green); background: var(--green-soft); border: 1px solid rgba(39, 224, 127, 0.22); border-radius: 999px; padding: 8px 10px; font-size: 9px; font-weight: 900; letter-spacing: 0.12em; }

.deal-list { display: grid; gap: 10px; }
.empty-state { padding: 42px 22px; border: 1px dashed rgba(255,255,255,0.14); border-radius: var(--radius-lg); text-align: center; }
.empty-state span { display: block; font-size: 30px; color: var(--green); }
.empty-state h3 { margin: 14px 0 7px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.deal-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); padding: 16px; cursor: pointer; }
.deal-card-top { display: flex; justify-content: space-between; gap: 12px; }
.deal-id { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; }
.deal-card h3 { margin: 6px 0; font-size: 18px; letter-spacing: -0.03em; }
.deal-card p { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state-pill { align-self: flex-start; border-radius: 999px; padding: 6px 8px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.balance-card, .panel-form, .requisite-list article { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-lg); }
.balance-card { padding: 18px; margin-bottom: 10px; }
.balance-card small, .balance-card strong { display: block; }
.balance-card small { color: var(--muted); font-size: 10px; }
.balance-card strong { margin-top: 4px; font-size: 17px; }
.balance-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.balance-chips span { padding: 7px 9px; background: rgba(255,255,255,0.05); border-radius: 10px; font-size: 10px; }
.panel-form { padding: 18px; margin-top: 10px; display: grid; gap: 12px; }
.form-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.form-heading span { color: var(--green); font-size: 10px; font-weight: 900; }
.form-heading h2 { margin: 0; font-size: 16px; }
.panel-form label, .wizard-field { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.panel-form input, .panel-form select, .panel-form textarea, .wizard-field input, .wizard-field textarea { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 13px; background: #0d100f; color: var(--text); padding: 13px; outline: none; text-transform: none; letter-spacing: normal; }
.panel-form input:focus, .panel-form select:focus, .panel-form textarea:focus, .wizard-field input:focus, .wizard-field textarea:focus { border-color: rgba(39, 224, 127, 0.65); box-shadow: 0 0 0 3px var(--green-soft); }
.form-submit { border: 0; border-radius: 13px; background: var(--green); color: #05120a; min-height: 45px; font-weight: 800; cursor: pointer; }
.danger-action { margin-top: 12px; min-height: 52px; justify-content: center; background: var(--red-soft); border: 1px solid rgba(237,90,90,0.22); color: #ff9f9f; font-weight: 700; }

.review-summary { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: linear-gradient(135deg, rgba(39,224,127,0.13), rgba(255,255,255,0.025)); }
.review-summary small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.review-summary strong { display: block; margin-top: 5px; font-size: 34px; letter-spacing: -.04em; }
.review-summary strong span, .review-item span { color: var(--green); }
.review-summary p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.review-form { margin-top: 12px; }
.view[data-view="reviews"] { padding-bottom: 112px; }
.review-form textarea { min-height: 92px; resize: vertical; }
.review-form-locked { opacity: .62; }
.review-feed { display: grid; gap: 9px; margin-top: 12px; }
.review-item { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.review-item > div { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.review-item strong { font-size: 13px; overflow-wrap: anywhere; }
.review-item span { letter-spacing: .08em; font-size: 12px; white-space: nowrap; }
.review-item p { margin: 10px 0; color: #c8d0cb; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.review-item small { color: var(--muted); font-size: 10px; }

.requisite-list { display: grid; gap: 9px; }
.requisite-list article { padding: 15px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; }
.requisite-list article > span { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.requisite-list small, .requisite-list strong { display: block; }
.requisite-list small { color: var(--muted); font-size: 9px; }
.requisite-list strong { margin-top: 3px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.requisite-list em { color: var(--green); font-size: 8px; font-style: normal; font-weight: 900; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.timeline li { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline li > span { color: var(--green); font-size: 11px; font-weight: 900; }
.timeline strong { font-size: 14px; }
.timeline p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.bottom-nav { position: fixed; z-index: 30; width: min(calc(100% - 24px), 456px); left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 22px; background: rgba(17, 21, 19, 0.92); backdrop-filter: blur(22px); display: grid; grid-template-columns: repeat(3, 1fr); padding: 7px; box-shadow: 0 16px 50px rgba(0,0,0,0.42); }
.bottom-nav button { border: 0; background: none; color: var(--muted); border-radius: 15px; padding: 8px; font-size: 9px; font-weight: 700; cursor: pointer; }
.bottom-nav button span { display: block; font-size: 16px; margin-bottom: 3px; }
.bottom-nav button.active { color: var(--text); background: rgba(255,255,255,0.06); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.66); backdrop-filter: blur(7px); }
.sheet { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, 500px); max-height: 94dvh; overflow-y: auto; padding: 9px 17px calc(22px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; border: 1px solid var(--line); background: #101412; box-shadow: 0 -30px 80px rgba(0,0,0,0.62); animation: sheet-in 220ms ease; }
@keyframes sheet-in { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 10px; background: rgba(255,255,255,0.18); border-radius: 999px; }
.sheet-header { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; padding: 5px 0 17px; }
.sheet-header > div { text-align: center; }
.sheet-header h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -0.03em; }
.sheet-content { min-height: 280px; }
.choice-grid { display: grid; gap: 9px; }
.choice-grid.two { grid-template-columns: 1fr 1fr; }
.choice-card { min-height: 116px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); padding: 16px; text-align: left; cursor: pointer; }
.choice-card span { color: var(--green); font-size: 23px; }
.choice-card strong, .choice-card small { display: block; }
.choice-card strong { margin-top: 19px; font-size: 14px; }
.choice-card small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.choice-card.selected { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.wizard-stack { display: grid; gap: 14px; }
.wizard-field textarea { min-height: 120px; resize: vertical; }
.wizard-next { width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--green); color: #06130b; font-weight: 900; cursor: pointer; }
.review-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); overflow: hidden; }
.review-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.review-row:last-child { border: 0; }
.review-row small { color: var(--muted); }
.review-row strong { text-align: right; overflow-wrap: anywhere; }
.created-state { text-align: center; padding: 15px 0 5px; }
.created-state > span { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 22px; margin: 0 auto 15px; background: var(--green-soft); color: var(--green); font-size: 30px; }
.created-state h3 { margin: 0; font-size: 22px; }
.created-state p { margin: 8px auto 17px; max-width: 300px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.share-box { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 13px; border: 1px solid var(--line); background: #0b0e0c; border-radius: 13px; text-align: left; }
.share-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b9c2bd; font-size: 10px; }
.share-box button { border: 0; background: var(--green); color: #06130b; border-radius: 9px; padding: 8px 10px; font-weight: 800; cursor: pointer; }

.deal-detail { display: grid; gap: 12px; }
.deal-summary { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); padding: 17px; }
.deal-summary .amount { font-size: 30px; font-weight: 850; letter-spacing: -0.04em; }
.deal-summary .description { margin-top: 15px; color: #c2cac6; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.participant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.participant-grid div { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.03); }
.participant-grid small, .participant-grid strong { display: block; }
.participant-grid small { color: var(--muted); font-size: 9px; }
.participant-grid strong { margin-top: 5px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.state-callout { padding: 14px; border-radius: 14px; background: var(--green-soft); color: #b8f4d1; font-size: 12px; line-height: 1.45; }
.deal-actions { display: grid; gap: 8px; }
.deal-actions button, .manager-link { min-height: 48px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-raised); color: var(--text); font-weight: 750; cursor: pointer; text-decoration: none; display: grid; place-items: center; }
.deal-actions .positive { background: var(--green); color: #06130b; border-color: transparent; }
.deal-actions .warning { color: #ffadad; background: var(--red-soft); }

.persona-menu { position: fixed; z-index: 80; top: calc(62px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 448px); padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: #171b19; box-shadow: var(--shadow); }
.persona-menu button { width: 100%; border: 0; background: none; color: var(--text); text-align: left; border-radius: 10px; padding: 12px; cursor: pointer; }
.persona-menu button:hover { background: rgba(255,255,255,0.05); }
.toast { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(98px + env(safe-area-inset-bottom)); width: min(calc(100% - 36px), 420px); padding: 13px 15px; border-radius: 14px; background: #e9f7ef; color: #102017; box-shadow: var(--shadow); font-size: 12px; font-weight: 700; text-align: center; }

.hidden { display: none !important; }

@media (min-width: 700px) {
  .app-shell { padding-left: 0; padding-right: 0; }
  .hero-card { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
