diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..2351d92
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "gnexus-ui-kit"]
+ path = gnexus-ui-kit
+ url = https://git.gnexus.space/git/root/gnexus-ui-kit.git
diff --git a/README.md b/README.md
index 2d779d6..3e9063e 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,31 @@
mardis_calc
===============
+Калькуляция переменных для фаершоу.
+
+Калькулятор должен представлять из себя веб страничку.
+
+Для начала нужен список артистов: пусть это будет json с масивом артистов, можно встроить прямо в страничку.
+
+Есть формула: S=Pz+Tz+(Lz\*Nl)+Rom+Rop+Rot+Rok+(Na\*Z)
+Переменные формулы:
+- S - общая сумма за шоу
+- Pz - Стоимость пиротехники
+- Tz - Стоимость титана
+- Lz - Стоимость одного литра керосина
+- Nl - Количество литров керосина
+- Rom - Роялти коллектива как организации
+- Rop - Роялти постановщика
+- Rot - Роялти техника
+- Rok - Роялти коммисионные, за привлечение привлечение клиента
+- Na - Количество артистов
+- Z - Зарплата артиста
+
+Роялти в процентах
+Rom - 10%
+Rop - 5%
+Rot - 5%
+Rok - 10%
+
+Необходима система, которая позволит ввести все известные и получить неизвестные. Сумма почти всегда известна, но было бы хорошо его тоже иметь возможность посчитать из прочих переменных.
+
+Для UI необходимо использовать https://git.gnexus.space/root/gnexus-ui-kit
\ No newline at end of file
diff --git a/css/styles.css b/css/styles.css
new file mode 100644
index 0000000..3025f15
--- /dev/null
+++ b/css/styles.css
@@ -0,0 +1,48 @@
+.page-header {
+ padding: var(--space-6) 0;
+ border-bottom: 2px solid var(--color-accent);
+ margin-bottom: var(--space-6);
+}
+
+.page-header-title {
+ font-size: 1.75rem;
+ font-weight: 600;
+ margin: 0;
+}
+
+.page-header-subtitle {
+ color: var(--color-text-muted);
+ margin: var(--space-1) 0 0;
+}
+
+.text-center {
+ text-align: center;
+}
+
+.dl-row-highlight {
+ font-weight: 600;
+ border-top: 1px solid var(--color-border);
+ padding-top: var(--space-2);
+ margin-top: var(--space-2);
+}
+
+#artists-table td,
+#artists-table th {
+ vertical-align: middle;
+}
+
+.checkbox-inline {
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
+ flex-wrap: wrap;
+}
+
+.checkbox-inline .checkbox {
+ margin: 0;
+}
+
+.payout-cell {
+ font-weight: 600;
+ white-space: nowrap;
+}
diff --git a/data/artists.json b/data/artists.json
new file mode 100644
index 0000000..a93b140
--- /dev/null
+++ b/data/artists.json
@@ -0,0 +1,12 @@
+[
+ { "name": "Алексей" },
+ { "name": "Мария" },
+ { "name": "Дмитрий" },
+ { "name": "Анна" },
+ { "name": "Иван" },
+ { "name": "Елена" },
+ { "name": "Сергей" },
+ { "name": "Ольга" },
+ { "name": "Павел" },
+ { "name": "Наталья" }
+]
diff --git a/docs/plan.md b/docs/plan.md
new file mode 100644
index 0000000..604978a
--- /dev/null
+++ b/docs/plan.md
@@ -0,0 +1,98 @@
+# Plan: Fire Show Calculator (mardis_calc)
+
+## Context
+
+New project: a single-page web calculator for fire show budgeting. The page must calculate one unknown variable from all known ones using the formula `S = Pz + Tz + (Lz * Nl) + Rom + Rop + Rot + Rok + (Na * Z)`. Royalties are fixed percentages calculated from the net amount after material costs (`Base = S - Pz - Tz - Lz*Nl`). The UI must be built with `gnexus-ui-kit` (added as a git submodule). The page is a plain static HTML+JS app (no build system). Artists are stored in a local JSON file (names only). The calculator should show how much each assigned artist receives (salary + any assigned royalties). State must be persisted to `localStorage`, plus export/import as JSON.
+
+## Key clarifications
+
+- UI kit: add as git submodule (`https://git.gnexus.space/root/gnexus-ui-kit`).
+- Royalties base: `Rom/Rop/Rot/Rok` are percentages of `Base = S - Pz - Tz - Lz*Nl`.
+- One unknown at a time: when all fields but one are filled, auto-calculate the missing variable.
+- Artists can have multiple roles: e.g. one person can be both an artist (gets `Z`) and a director (gets `Rop`), etc.
+- Rounding: to 2 decimal places (cents).
+- Persistence: `localStorage` + JSON export/import.
+- Artists JSON: array of objects with at least `{ "name": "..." }`.
+
+## Architecture
+
+Single static page. No bundler. Use vanilla JS.
+
+### Files
+
+1. **`.gitmodules`** (via `git submodule add`) — link `gnexus-ui-kit`.
+2. **`index.html`** — main page, loads UI kit assets from submodule path, app CSS/JS.
+3. **`css/styles.css`** — minimal custom styles on top of UI kit.
+4. **`js/app.js`** — all calculator logic.
+5. **`data/artists.json`** — embedded artist list.
+
+### UI layout
+
+- **Header**: project title.
+- **Inputs section**: numeric inputs for `S`, `Pz`, `Tz`, `Lz`, `Nl`, `Z`. `Na` and royalty fields (`Rom`, `Rop`, `Rot`, `Rok`) are **read-only / computed**.
+ - `Na` auto-updates from the artist roster table (count of rows with "Artist" role checked).
+ - Royalties auto-calculate from `Base`.
+ - When 5 of the 6 editable fields are filled, the 6th is computed on blur/change.
+- **Artist roster section**:
+ - Add-artist dropdown (populated from `data/artists.json`).
+ - Table of added artists with role checkboxes: Artist, Director (`Rop`), Technician (`Rot`), Commissioner (`Rok`), Organizer (`Rom`).
+ - Each row shows the individual payout (sum of applicable shares).
+- **Actions**: Export JSON, Import JSON, Reset.
+- **Summary**: total show cost `S`, total material costs, total artist salaries, total royalties.
+
+### Calculation logic
+
+**Definitions:**
+- `Materials = Pz + Tz + Lz * Nl`
+- `Base = S - Materials`
+- `Rom = 0.10 * Base`
+- `Rop = 0.05 * Base`
+- `Rot = 0.05 * Base`
+- `Rok = 0.10 * Base`
+- `TotalRoyalties = Rom + Rop + Rot + Rok = 0.30 * Base`
+- `ArtistSalaries = Na * Z`
+
+**Identity:**
+`S = Materials + TotalRoyalties + ArtistSalaries`
+=> `S = Materials + 0.30 * (S - Materials) + Na * Z`
+=> `0.70 * S = 0.70 * Materials + Na * Z`
+=> `S = Materials + (Na * Z) / 0.70`
+
+**Solving for each variable (when all others are known):**
+- `S = Materials + (Na * Z) / 0.70`
+- `Z = (0.70 * (S - Materials)) / Na` (if `Na > 0`)
+- `Na = (0.70 * (S - Materials)) / Z` (displayed as decimal guidance)
+- `Pz = S - (Tz + Lz*Nl) - (Na*Z)/0.70`
+- `Tz = S - (Pz + Lz*Nl) - (Na*Z)/0.70`
+- `Lz = (S - Pz - Tz - (Na*Z)/0.70) / Nl` (if `Nl > 0`)
+- `Nl = (S - Pz - Tz - (Na*Z)/0.70) / Lz` (if `Lz > 0`)
+
+**Validation / guardrails:**
+- Negative results are flagged as errors (real-world values must be non-negative).
+- Division-by-zero protected.
+- If more than one field is empty, show a message like "Заполните все поля кроме одного" instead of computing.
+
+**Roster payout per person:**
+- If role "Artist" checked: add `Z`.
+- If role "Organizer" (`Rom`) checked and only one such person: add `Rom`. If multiple organizers, split equally (or assign full to each? To be safe, split equally; UI can note this).
+- Same splitting logic for `Rop`, `Rot`, `Rok` if multiple persons share the same role.
+
+### Persistence
+
+- On every change, serialize the state (all input values + artist roster table) to `localStorage` key `mardis_calc_state`.
+- On page load, restore from `localStorage` if present.
+- **Export**: trigger browser download of a `.json` file containing the serialized state.
+- **Import**: read a `.json` file via ``, validate structure, replace current state.
+
+## Verification
+
+1. Open `index.html` in a browser.
+2. Fill in `Pz=100`, `Tz=50`, `Lz=30`, `Nl=2`, `Na=2`, leave `S` empty. `S` should auto-calculate to `100 + 50 + 60 + (2*Z)/0.70` depending on `Z`.
+3. Add artists from the dropdown, assign roles, verify individual payouts sum up to `ArtistSalaries + TotalRoyalties`.
+4. Refresh the page; values should restore from `localStorage`.
+5. Click Export, save JSON, clear fields, click Import with that file, verify restoration.
+
+## Risks / open questions
+
+- `gnexus-ui-kit` submodule path and exact CSS/JS files to include are unknown until the submodule is fetched; may need minor path adjustments in `index.html` after adding it.
+- Splitting royalties among multiple persons with the same role: plan assumes equal split. User can adjust later if needed.
diff --git a/gnexus-ui-kit b/gnexus-ui-kit
new file mode 160000
index 0000000..dab0f37
--- /dev/null
+++ b/gnexus-ui-kit
@@ -0,0 +1 @@
+Subproject commit dab0f37319daee098a8a9c18b06648c5636d08c2
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..3c73c2b
--- /dev/null
+++ b/index.html
@@ -0,0 +1,188 @@
+
+
+