@font-face {
  font-family: Manrope;
  src: url('./manrope-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ground: #f3f5f7;
  --surface: #fff;
  --raised: #f2f8fd;
  --border: #e6e9ec;
  --control: #bcc5cf;
  --text: #1b1d1f;
  --muted: #555b64;
  --accent: #1856bd;
  --accent-soft: #dcf1ff;
  --accent-ink: #0a3a80;
  --positive: #28683e;
  --positive-bg: #e1f6e8;
  --warning: #824513;
  --warning-bg: #fff2db;
  --negative: #a82230;
  --negative-bg: #ffebec;
  --neutral: #edf1f5;
  --card-radius: 20px;
  --control-radius: 10px;
  --gap: 24px;
  --bottom-inset: max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
  --top-inset: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  font: 500 16px/1.5 Manrope, system-ui, sans-serif;
  color: var(--text);
  background: var(--ground);
}
[data-theme="dark"] {
  color-scheme: dark;
  --ground: #15191f;
  --surface: #1e242e;
  --raised: #222d3a;
  --border: #333c48;
  --control: #738092;
  --text: #f1f4f9;
  --muted: #bbc4d1;
  --accent: #9dc2ff;
  --accent-soft: #293e5d;
  --accent-ink: #d3e5ff;
  --positive: #9fdfb4;
  --positive-bg: #233b2d;
  --warning: #ffd29b;
  --warning-bg: #473521;
  --negative: #ffa1a9;
  --negative-bg: #492731;
  --neutral: #303744;
}
:root:has(.parcel-app, .operator-body) {
  color-scheme: dark;
  --ground: #101210;
  --surface: #191c18;
  --raised: #252925;
  --border: #2d322d;
  --control: #627168;
  --text: #f5f7f2;
  --muted: #a9b1a6;
  --accent: #d8f684;
  --accent-soft: #2f3b25;
  --accent-ink: #e5ffa6;
  --positive: #d8f684;
  --positive-bg: #293520;
  --warning: #f2cd95;
  --warning-bg: #3a3020;
  --negative: #ffabb1;
  --negative-bg: #41282b;
  --neutral: #252d27;
  --card-radius: 20px;
  --control-radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: .2em; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.04em; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
p { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.skip-link { position: absolute; z-index: 5; left: 12px; top: 12px; background: var(--surface); padding: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.top { background: var(--surface); border-bottom: 1px solid var(--border); padding-top: var(--top-inset); }
.top-inner { width: min(1140px, 100% - 48px); min-height: 72px; margin-inline: auto; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; color: var(--text); font-size: 1.24rem; font-weight: 700; letter-spacing: -.05em; white-space: nowrap; }
.brand-mark { display: block; width: 29px; height: 29px; border: 1.5px solid var(--accent); border-radius: 8px; position: relative; }
.brand-mark::before { content: ''; position: absolute; inset: 7px 6px; border-block: 2px solid var(--accent); }
.brand-mark::after { content: ''; position: absolute; width: 8px; height: 2px; left: 6px; top: 12px; background: var(--accent); }
.brand-role { font-size: .82rem; letter-spacing: 0; color: var(--muted); font-weight: 600; }
.desktop-nav { display: flex; gap: 4px; margin-left: 12px; }
.nav-link { padding: 11px 15px; display: inline-flex; justify-content: center; align-items: center; min-height: 44px; color: var(--muted); font-size: .88rem; text-decoration: none; border-radius: var(--control-radius); }
.nav-link[aria-current] { color: var(--accent-ink); background: var(--accent-soft); font-weight: 700; }
.nav-link:hover:not([aria-current]), .ghost:hover, .filter:hover { background: var(--neutral); }
.top-tools { display: flex; align-items: center; gap: 13px; margin-left: auto; }
.language-select { color: var(--muted); font-size: .78rem; padding: 6px; }
.task-cover { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); min-height: 220px; background: #0c3694; color: #fff; border-radius: var(--card-radius); overflow: hidden; }
.cover-copy { align-self: center; display: grid; justify-items: start; gap: 12px; padding: 28px 32px; }
.cover-caption { color: #e4edff; max-width: 31ch; font-size: .95rem; }
.cover-image { width: 100%; height: 100%; min-height: 0; max-height: 255px; object-fit: cover; object-position: 78% 50%; }
.cover-action { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 10px; background: #ffeb9d; color: #26354f; font-size: .875rem; font-weight: 700; text-decoration: none; }
.cover-action:hover { background: #fff3c6; }
.cover-action:focus-visible { outline-color: #fff; }
.market-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-block: 18px; }
.bottom-nav { display: none; }
.canvas { width: min(1140px, 100% - 48px); margin: 42px auto 48px; min-height: 52vh; }
.heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.heading p { margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .775rem; }
.text-link { color: var(--accent); font-weight: 700; font-size: .875rem; display: inline-flex; align-items: center; gap: 5px; min-height: 44px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.positive { color: var(--positive); }
.tag { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; min-height: 24px; padding: 2px 8px; border-radius: 6px; background: var(--neutral); color: var(--muted); font-size: .75rem; font-weight: 700; white-space: normal; }
.tag.blue { background: var(--accent-soft); color: var(--accent-ink); }
.tag.good { background: var(--positive-bg); color: var(--positive); }
.tag.wait { background: var(--warning-bg); color: var(--warning); }
.tag.bad { background: var(--negative-bg); color: var(--negative); }
.layout { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(16rem, 1fr); gap: var(--gap); align-items: start; }
.stack { display: grid; gap: var(--gap); min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-radius); min-width: 0; }
.panel { padding: 22px; }
.panel > p { margin-top: 8px; }
.card-head { padding: 20px 22px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.card-head p { margin-top: 6px; }
.card-foot { padding: 12px 22px; border-top: 1px solid var(--border); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 22px 14px; border-bottom: 1px solid var(--border); }
.filter, .ghost { border: 1px solid transparent; color: var(--muted); background: transparent; border-radius: var(--control-radius); min-height: 44px; padding: 8px 11px; font-size: .875rem; }
.filter[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-picker { display: grid; grid-template-columns: auto auto; gap: 8px; max-width: 100%; }
select, input:not([type="checkbox"]), textarea { min-height: 44px; border: 1px solid var(--control); border-radius: var(--control-radius); background: var(--surface); color: var(--text); padding: 8px 11px; min-width: 0; }
textarea { width: 100%; min-height: 100px; resize: vertical; }
input:not([type="checkbox"]) { width: 100%; }
.demo-picker select { font-size: .84rem; }
.offer-list { list-style: none; padding: 0; margin: 0; }
.offer-list > li + li { border-top: 1px solid var(--border); }
.offer-row { display: grid; grid-template-columns: 67px minmax(0, 1fr) auto; align-items: center; width: 100%; gap: 14px; padding: 16px 22px; min-height: 94px; background: transparent; border: 0; color: var(--text); text-align: left; }
.offer-row:hover { background: var(--raised); }
.offer-row:focus-visible { outline-offset: -5px; border-radius: 12px; }
.offer-visual { display: block; width: 67px; height: 53px; border-radius: 8px; object-fit: cover; background: var(--raised); }
.offer-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.offer-desc { display: block; color: var(--muted); font-size: .85rem; margin-top: 3px; overflow-wrap: anywhere; }
.offer-amount { display: grid; gap: 3px; text-align: right; white-space: nowrap; }
.offer-amount strong { font-size: clamp(.95rem, 1.6vw, 1.16rem); }
.balance-value { display: block; font-size: clamp(2rem, 5vw, 2.72rem); line-height: 1.15; margin-block: 10px 16px; font-weight: 700; }
.money-lines { margin: 0; }
.money-lines > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.money-lines dd { margin: 0; white-space: nowrap; font-weight: 700; }
.steps { list-style: none; margin: 13px 0 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; position: relative; padding: 0 0 16px; }
.steps li:last-child { padding-bottom: 0; }
.steps li:not(:last-child)::after { content: ''; position: absolute; top: 20px; bottom: 0; left: 10px; border-left: 1px solid var(--control); }
.step-mark { width: 21px; height: 21px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--control); border-radius: 50%; color: var(--muted); font-size: .71rem; font-weight: 700; z-index: 1; }
.step-mark.done { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.step-copy { display: grid; gap: 2px; }
.empty { padding: 30px 22px; min-height: 134px; }
.empty p { margin-top: 6px; }
.empty button { margin-top: 12px; }
.list-group { padding: 0; margin: 0; list-style: none; }
.list-group > li { padding: 14px 20px; }
.list-group > li + li { border-top: 1px solid var(--border); }
.activity-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 16px; }
.activity-row .tag { justify-self: end; }
.activity-row .text-link { padding: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.primary, .secondary, .danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: var(--control-radius); padding: 9px 14px; border: 1px solid transparent; text-decoration: none; font-size: .875rem; font-weight: 700; text-align: center; }
.primary { background: #1856bd; color: white; }
.primary:hover:not(:disabled) { background: #13468f; }
.secondary { background: var(--surface); color: var(--text); border-color: var(--control); }
.secondary:hover:not(:disabled) { background: var(--neutral); }
.danger { background: var(--negative-bg); color: var(--negative); border-color: var(--negative); }
button.text-link { border: 0; background: none; padding: 0; }
.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.form-field { display: grid; gap: 5px; min-width: 0; font-size: .88rem; font-weight: 700; }
.form-field > :is(input,select,textarea) { font-weight: 500; }
.form-field:has(input[type="checkbox"]) { display: flex; align-items: center; min-height: 44px; font-weight: 600; }
.form-field input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--accent); margin: 0 4px 0 0; }
.form-field .muted { font-weight: 500; }
.form-error { color: var(--negative); font-size: .88rem; }
.form-error:empty { display: none; }
dialog { width: min(100% - 32px, 520px); max-height: calc(100dvh - 32px); padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--card-radius); overscroll-behavior: contain; }
dialog::backdrop { background: rgb(22 29 42 / .56); }
.dialog-body { padding: 23px; display: grid; gap: 15px; }
.dialog-top { display: flex; align-items: start; gap: 12px; justify-content: space-between; }
.dialog-top h2 { margin-top: 9px; }
.dialog-close { min-width: 44px; padding-inline: 8px; }
.dialog-amount { color: var(--positive); font-size: 1.75rem; font-weight: 700; }
.detail-list { display: grid; gap: 9px; margin: 0; }
.detail-list > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; border-bottom: 1px solid var(--border); padding: 6px 0 9px; }
.detail-list dd { margin: 0; font-weight: 700; }
.toast { position: fixed; z-index: 3; bottom: 20px; right: 20px; max-width: min(440px, calc(100% - 36px)); background: var(--text); color: var(--surface); border-radius: var(--control-radius); padding: 11px 15px; font-size: .875rem; }
.toast:empty { display: none; }
.footer { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; }
.op-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.op-nav .nav-link { background: var(--surface); border: 1px solid var(--border); }
.op-nav .nav-link[aria-current] { background: var(--accent-soft); }
.ops-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(17rem,1fr); gap: var(--gap); align-items: start; }
.opsearch { display: flex; gap: 8px; align-items: end; max-width: 460px; }
.opsearch label { flex: 1; }
.reference { overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: .78rem; }
.standalone { width: min(100% - 32px, 520px); margin: 8vh auto; }
.standalone h1, .standalone .primary { margin-top: 14px; }
.standalone .text-link { margin-top: 8px; }
.legal { width: min(100% - 32px, 680px); }
.legal h2 { margin-top: 24px; }
@media (max-width: 780px) {
  .layout, .ops-grid { grid-template-columns: minmax(0,1fr); }
  .top-inner, .canvas { width: calc(100% - 32px); }
  .canvas { margin-top: 26px; }
  .desk-balance { display: none; }
}
@media (max-width: 600px) {
  html { scroll-padding-bottom: calc(70px + var(--bottom-inset)); }
  .top-inner { min-height: 58px; gap: 10px; }
  .top-tools { gap: 8px; }
  .top-tools .tag { display: none; }
  .task-cover { min-height: 143px; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); }
  .cover-copy { padding: 15px; gap: 7px; }
  .cover-caption { font-size: .79rem; }
  .cover-image { object-position: 79% center; }
  .market-strip { flex-wrap: wrap; margin-block: 12px; }
  .desktop-nav { display: none; }
  .bottom-nav { position: fixed; z-index: 2; bottom: 0; inset-inline: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding: 7px max(10px,env(safe-area-inset-right,0px)) calc(7px + var(--bottom-inset)) max(10px,env(safe-area-inset-left,0px)); border-top: 1px solid var(--border); background: var(--surface); }
  .canvas { margin-bottom: calc(82px + var(--bottom-inset)); }
  .operator-body .canvas { margin-bottom: 28px; }
  .heading { align-items: start; flex-direction: column; margin-bottom: 16px; gap: 12px; }
  .card-head, .panel, .empty { padding-inline: 15px; }
  .filter-bar { padding-inline: 12px; }
  .offer-row { padding: 14px; grid-template-columns: 46px minmax(0,1fr) auto; gap: 9px; }
  .offer-visual { width: 46px; height: 42px; }
  .offer-desc { font-size: .82rem; }
  .toast { bottom: calc(68px + var(--bottom-inset)); right: 12px; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  dialog { max-height: calc(100dvh - var(--top-inset) - var(--bottom-inset) - 24px); }
}
@media (max-width: 365px) {
  .canvas, .top-inner { width: calc(100% - 24px); }
  .offer-row { grid-template-columns: minmax(0,1fr) auto; }
  .offer-visual { display: none; }
  .brand { font-size: 1.05rem; }
}
