:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #141a2e;
  --muted: #5b6478;
  --line: #e2e6ef;
  --brand: #10a86f;
  --brand-ink: #0b7a51;
  --brand-soft: #e3f7ee;
  --danger: #d6455a;
  --danger-soft: #fdecef;
  --warn: #b7791f;
  --warn-soft: #fdf4e3;
  --info-soft: #eaf0ff;
  --gold: #c99a2e;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(20, 26, 46, 0.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--brand-ink); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 10px; }
h1 { font-size: clamp(30px, 5vw, 52px); }
h2 { font-size: clamp(22px, 3vw, 32px); }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

/* Brand */
.logo { font-weight: 850; font-size: 24px; letter-spacing: -0.04em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo b { color: var(--brand); font-weight: 850; }
.logo svg { width: 30px; height: 30px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font: inherit; font-weight: 700; text-decoration: none;
  box-shadow: 0 6px 18px rgba(16, 168, 111, 0.28); transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: var(--danger); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.block { width: 100%; }

/* Layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.top {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.top nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.top nav a.navlink { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.top nav a.navlink:hover, .top nav a.navlink.active { background: var(--brand-soft); color: var(--brand-ink); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; text-align: center; margin-left: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 820px) { .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.file-drop {
  display: block; border: 2px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; cursor: pointer;
  background: #fafbfd; font-weight: 500;
}
.file-drop:hover { border-color: var(--brand); }
.file-drop input { display: none; }
.file-drop .fname { display: block; margin-top: 6px; color: var(--brand-ink); font-weight: 600; word-break: break-all; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice label { margin: 0; border: 2px solid var(--line); border-radius: 14px; padding: 16px; cursor: pointer; font-weight: 500; background: #fff; }
.choice input { display: none; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice strong { display: block; font-size: 16px; margin-bottom: 2px; }
.choice .emoji { font-size: 26px; display: block; margin-bottom: 4px; }

.alert { padding: 12px 16px; border-radius: 12px; font-size: 15px; margin-bottom: 14px; }
.alert.error { background: var(--danger-soft); color: #8b1f30; }
.alert.ok { background: var(--brand-soft); color: var(--brand-ink); }
.alert.warn { background: var(--warn-soft); color: #7a4d0b; }
.alert.info { background: var(--info-soft); color: #23387a; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #eef1f6; color: var(--muted); }
.pill.green { background: var(--brand-soft); color: var(--brand-ink); }
.pill.red { background: var(--danger-soft); color: #8b1f30; }
.pill.amber { background: var(--warn-soft); color: #7a4d0b; }
.pill.blue { background: var(--info-soft); color: #23387a; }

/* App shell */
.page { padding-top: 28px; padding-bottom: 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.narrow { max-width: 520px; margin: 0 auto; }
.mid { max-width: 760px; margin: 0 auto; }

.list { display: grid; gap: 12px; }
.row { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.amount { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.stat .l { font-size: 13px; color: var(--muted); }

.steps { display: grid; gap: 10px; counter-reset: s; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.step .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; background: #eef1f6; color: var(--muted); }
.step.done .dot { background: var(--brand); color: #fff; }
.step.current { border-color: var(--brand); }

/* Swipe */
.swipe-area { position: relative; height: min(540px, calc(100vh - 290px)); height: min(540px, calc(100dvh - 290px)); min-height: 360px; max-width: 420px; margin: 0 auto; }
.swipe-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.swipe-head h2 { margin: 0; }
.filters { display: flex; gap: 8px; flex: 1 1 280px; max-width: 420px; }
.filters select { flex: 1; min-width: 0; padding: 9px 10px; font-size: 15px; }
@media (max-width: 640px) {
  .page.swiping { padding-top: 14px; }
  .swipe-head h2 { font-size: 20px; }
  .swipe-card { padding: 18px; }
  .swipe-card .big { font-size: 38px; }
  .swipe-actions { margin-top: 14px; }
}
.modal .row .btn { flex: 1; }
.swipe-card {
  position: absolute; inset: 0; background: var(--card); border-radius: 24px; border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(20, 26, 46, 0.14); padding: 24px; display: flex; flex-direction: column;
  touch-action: none; user-select: none; cursor: grab; will-change: transform; overflow: hidden;
}
.swipe-card.dragging { cursor: grabbing; transition: none; }
.swipe-card.anim { transition: transform .35s ease, opacity .35s ease; }
.swipe-card.behind { transform: scale(.95) translateY(14px); opacity: .7; pointer-events: none; }
.swipe-card .cat { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.swipe-card .big { font-size: 44px; font-weight: 850; letter-spacing: -0.04em; margin: 4px 0; }
.swipe-card .title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.swipe-card .story { color: var(--muted); font-size: 15px; flex: 1; overflow: auto; white-space: pre-line; }
.swipe-card .meta { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; font-size: 14px; }
.swipe-card .meta div { display: flex; justify-content: space-between; gap: 10px; }
.swipe-card .meta span:first-child { color: var(--muted); }
.stamp { position: absolute; top: 26px; padding: 6px 14px; border: 4px solid; border-radius: 12px; font-size: 26px; font-weight: 900; letter-spacing: .04em; opacity: 0; transform: rotate(-12deg); }
.stamp.yes { left: 20px; color: var(--brand); }
.stamp.no { right: 20px; color: var(--danger); transform: rotate(12deg); }
.swipe-actions { display: flex; justify-content: center; gap: 26px; margin-top: 22px; }
.round {
  width: 70px; height: 70px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: #fff; box-shadow: 0 8px 22px rgba(20,26,46,.14); font-size: 30px; transition: transform .1s;
}
.round:active { transform: scale(.93); }
.round.no { color: var(--danger); }
.round.yes { color: #fff; background: var(--brand); width: 78px; height: 78px; }
.round svg { width: 30px; height: 30px; }
.empty { text-align: center; padding: 50px 20px; }
.empty .icon { font-size: 54px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(12, 16, 30, .5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--card); border-radius: 22px; padding: 24px; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; }
.tips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tips label { margin: 0; text-align: center; border: 2px solid var(--line); border-radius: 12px; padding: 10px 4px; cursor: pointer; font-size: 15px; }
.tips input { display: none; }
.tips label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.sum { display: grid; gap: 6px; background: #f7f9fc; border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 15px; }
.sum div { display: flex; justify-content: space-between; }
.sum .total { font-weight: 800; border-top: 1px solid var(--line); padding-top: 6px; }

/* Admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs img { width: 220px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #f0f2f6; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* Landing */
.hero { padding: clamp(40px, 8vw, 90px) 0 50px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero .lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 560px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero h1 b { color: var(--brand); }
.demo-phone { max-width: 330px; margin: 0 auto; position: relative; height: 430px; width: 100%; }
.demo-phone .swipe-card { cursor: default; }
.demo-phone .c2 { transform: rotate(-6deg) translate(-26px, 14px); opacity: .55; }
.demo-phone .c1 { transform: rotate(3deg); }
.section { padding: 56px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature { padding: 20px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.section.alt .feature { background: var(--bg); }
.feature .i { font-size: 28px; margin-bottom: 8px; }
.numbers { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.numbers .v { font-size: 28px; font-weight: 850; letter-spacing: -0.03em; }
.numbers .l { color: var(--muted); font-size: 14px; }
details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
details + details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 700; }
details p { margin: 10px 0 0; color: var(--muted); }
.prose { max-width: 780px; }
.prose h2 { font-size: 22px; margin-top: 30px; }
.prose h3 { margin-top: 18px; }
.prose li { margin-bottom: 6px; }
footer.site { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--muted); font-size: 14px; background: #fff; }
footer.site .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
footer.site nav { display: flex; gap: 16px; flex-wrap: wrap; }
footer.site a { color: var(--muted); }

@media (max-width: 640px) {
  .top nav a.navlink .txt { display: none; }
  .top nav a.navlink { padding: 8px; font-size: 20px; }
  .hide-mobile { display: none !important; }
}
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
