:root {
  color-scheme: light;
  --green-950: #073d2c;
  --green-900: #0b5139;
  --green-800: #0b6848;
  --green-700: #10855a;
  --green-100: #dff1e5;
  --green-50: #f1f8f3;
  --paper: #f6f9f6;
  --ink: #17241d;
  --muted: #6f7e74;
  --line: #e3ebe5;
  --white: #fff;
  --danger: #b6423a;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-card: 0 8px 24px rgba(16, 53, 34, .055);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(16, 133, 90, .35);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.app-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding-bottom: calc(94px + env(safe-area-inset-bottom));
  overflow: clip;
  background: var(--paper);
}

.topbar {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 58px;
  height: 42px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { color: var(--green-950); font-size: 17px; line-height: 1.2; }
.brand-copy small { color: var(--muted); font-size: 10px; }

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--green-800);
  background: var(--white);
  box-shadow: 0 3px 10px rgba(16, 53, 34, .04);
  cursor: pointer;
}

.icon-button span { font-size: 27px; font-weight: 500; line-height: 1; }

main { padding-inline: 18px; }
.screen { padding-bottom: 16px; }

.welcome-card {
  position: relative;
  min-height: 218px;
  padding: 22px 22px 18px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: var(--white);
  background: linear-gradient(138deg, #0c7650 0%, #09513a 100%);
  box-shadow: 0 16px 32px rgba(8, 83, 57, .15);
  isolation: isolate;
}

.welcome-card::before, .welcome-card::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 50%;
  content: "";
}

.welcome-card::before { width: 230px; height: 230px; top: -145px; left: -72px; }
.welcome-card::after { width: 180px; height: 180px; right: -95px; bottom: -105px; background: rgba(255,255,255,.035); }

.welcome-topline {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #d5eee0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a8e4ba; box-shadow: 0 0 0 4px rgba(168,228,186,.12); }
.welcome-card h1 { margin: 22px 0 8px; font-size: clamp(27px, 7vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.welcome-card p { max-width: 340px; margin: 0; color: #e1f1e7; font-size: 13px; line-height: 1.85; }
.welcome-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 17px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #e3f3e8; background: rgba(255,255,255,.075); font-size: 10px; }
.privacy-pill span { font-size: 14px; }
.welcome-mark { position: absolute; left: 26px; bottom: 8px; color: rgba(226,246,233,.12); font-size: 72px; font-weight: 700; line-height: 1; }

.assistant-feature {
  display: flex;
  width: 100%;
  min-height: 78px;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dcece1;
  border-radius: var(--radius-md);
  color: var(--ink);
  text-align: start;
  background: linear-gradient(120deg, #fff 0%, #f3faf5 100%);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.assistant-feature:active, .tool-card:active { transform: scale(.985); }
.assistant-orb { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, #12865b, #07543b); font-size: 23px; box-shadow: 0 6px 14px rgba(8, 83, 57, .15); }
.assistant-orb.small { width: 39px; height: 39px; border-radius: 13px; font-size: 20px; }
.assistant-feature-copy { display: grid; flex: 1; gap: 4px; }
.assistant-feature-copy strong { color: var(--green-950); font-size: 13px; }
.assistant-feature-copy small { color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.feature-arrow { color: var(--green-700); font-size: 21px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 27px 2px 13px; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--green-700); font-size: 10px; font-weight: 700; letter-spacing: .025em; }
.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.tools-count { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--white); font-size: 10px; }

.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.tool-card {
  position: relative;
  display: flex;
  min-height: 143px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  color: var(--ink);
  text-align: start;
  background: var(--white);
  box-shadow: 0 3px 10px rgba(16,53,34,.025);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.tool-card:hover { border-color: #b5d7c2; box-shadow: var(--shadow-card); }
.tool-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 15px; color: var(--green-800); background: var(--green-50); font-size: 23px; }
.tool-icon.large { width: 58px; height: 58px; border-radius: 19px; font-size: 29px; }
.tool-card[data-tool="income"] .tool-icon { color: #87652a; background: #faf4e7; }
.tool-card[data-tool="goods"] .tool-icon { color: #39715a; background: #eaf4ed; }
.tool-card[data-tool="vat"] .tool-icon { color: #08764f; background: #e1f4e8; }
.tool-card[data-tool="vehicle"] .tool-icon { color: #497b72; background: #e9f3f1; }
.tool-card[data-tool="property"] .tool-icon { color: #8a6744; background: #f7f0e9; }
.tool-card-copy { display: grid; width: 100%; gap: 5px; }
.tool-card-copy strong { font-size: 12px; line-height: 1.45; }
.tool-card-copy span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.tool-card-mark { position: absolute; left: 12px; top: 10px; color: #c8d9ce; font-size: 15px; }

.install-card { display: flex; align-items: center; gap: 11px; margin-top: 17px; padding: 14px; border: 1px solid #e2eee5; border-radius: 18px; background: #edf6ef; }
.install-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: var(--green-800); background: #d9eddf; font-size: 20px; }
.install-copy { display: grid; flex: 1; gap: 4px; }
.install-copy strong { color: var(--green-950); font-size: 11px; }
.install-copy span { color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.text-button { padding: 8px 2px 8px 0; border: 0; color: var(--green-800); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.home-note { margin: 14px 4px 0; color: var(--muted); font-size: 9.5px; line-height: 1.75; }

.calculator-screen { padding-top: 2px; }
.back-button { display: inline-flex; align-items: center; gap: 7px; margin: 2px 0 16px; padding: 8px 4px; border: 0; color: var(--green-800); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.back-button span { font-size: 17px; }
.calculator-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.calculator-heading h1 { margin: 0; font-size: 21px; line-height: 1.35; letter-spacing: -.03em; }
.calculator-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }

.calc-card, .smart-card, .result-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-card); }
.calc-card { padding: 18px; }
.card-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.step-number { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--green-800); background: var(--green-50); font-size: 14px; font-weight: 700; }
.card-heading h2 { margin: 0; font-size: 14px; }
.card-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 15px; padding: 4px; border-radius: 13px; background: #f0f5f1; }
.mode-button { min-height: 36px; padding: 6px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 600; cursor: pointer; }
.mode-button.active { color: var(--green-950); background: var(--white); box-shadow: 0 2px 6px rgba(16,53,34,.08); }
.field-label { display: block; margin: 13px 2px 7px; color: #435249; font-size: 10px; font-weight: 700; }
.input-wrap { display: flex; min-height: 49px; align-items: center; border: 1px solid #dfe8e1; border-radius: 14px; background: #fbfdfb; transition: border-color .15s ease, box-shadow .15s ease; }
.input-wrap:focus-within { border-color: #56a77d; box-shadow: 0 0 0 3px rgba(16,133,90,.1); }
.input-wrap input { width: 100%; min-width: 0; height: 47px; padding: 0 13px; border: 0; outline: 0; color: var(--ink); background: transparent; direction: ltr; text-align: right; font-size: 15px; }
.input-wrap input::placeholder { color: #a0aca4; font-size: 12px; }
.input-unit { min-width: max-content; padding: 0 13px; border-right: 1px solid var(--line); color: #839087; font-size: 10px; }
.fixed-rate { display: flex; align-items: center; gap: 7px; min-height: 43px; margin-top: 7px; padding: 0 12px; border-radius: 13px; color: var(--green-800); background: var(--green-50); font-size: 11px; font-weight: 700; }
.fixed-rate span { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: var(--white); background: var(--green-700); font-size: 11px; }
.primary-button, .secondary-button { display: flex; width: 100%; min-height: 49px; align-items: center; justify-content: space-between; padding: 0 16px; border: 0; border-radius: 15px; color: var(--white); background: linear-gradient(115deg, #11865a, #086644); box-shadow: 0 7px 15px rgba(8, 104, 72, .16); font-size: 12px; font-weight: 700; cursor: pointer; transition: filter .15s ease, transform .15s ease; }
.primary-button { margin-top: 16px; }
.primary-button:hover, .secondary-button:hover { filter: brightness(1.04); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.form-error { margin: 9px 2px 0; color: var(--danger); font-size: 11px; line-height: 1.6; }

.result-card { margin-top: 14px; padding: 17px; border-color: #d8ebde; background: linear-gradient(150deg, #f7fcf8, #fff); }
.result-topline { display: flex; align-items: center; gap: 8px; color: var(--green-900); font-size: 12px; font-weight: 700; }
.result-check { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 8px; color: var(--white); background: var(--green-700); font-size: 12px; }
.estimate-tag { margin-inline-start: auto; padding: 4px 8px; border-radius: 99px; color: #8b6c2e; background: #f8f1df; font-size: 9px; font-weight: 600; }
.result-main { display: flex; align-items: center; justify-content: space-between; margin: 17px 0 13px; padding: 0 0 13px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.result-main strong { color: var(--green-900); direction: ltr; font-size: 23px; font-variant-numeric: tabular-nums; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; color: var(--muted); font-size: 10px; }
.result-row strong { color: var(--ink); direction: ltr; font-size: 11px; font-variant-numeric: tabular-nums; }
.copy-button { display: flex; width: 100%; min-height: 39px; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; border: 1px solid #dce9df; border-radius: 12px; color: var(--green-800); background: var(--white); font-size: 10px; font-weight: 700; cursor: pointer; }

.smart-card { margin-top: 14px; padding: 17px; }
.smart-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.smart-heading h2 { margin: 0; color: var(--green-950); font-size: 13px; }
.smart-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.smart-card textarea { display: block; width: 100%; min-height: 84px; resize: vertical; padding: 12px; border: 1px solid #dfe8e1; border-radius: 14px; outline: 0; color: var(--ink); background: #fbfdfb; font-size: 12px; line-height: 1.7; }
.smart-card textarea::placeholder { color: #98a49c; }
.smart-card textarea:focus { border-color: #56a77d; box-shadow: 0 0 0 3px rgba(16,133,90,.1); }
.secondary-button { min-height: 43px; margin-top: 10px; justify-content: center; gap: 8px; border-radius: 13px; font-size: 11px; }
.analysis-steps { display: grid; gap: 8px; margin: 13px 0 0; padding: 13px 14px 13px 13px; border: 1px solid #e2eee5; border-radius: 13px; color: #3f5347; background: #f4f9f5; list-style: none; counter-reset: step; }
.analysis-steps li { position: relative; padding-inline-start: 27px; font-size: 10px; line-height: 1.6; counter-increment: step; }
.analysis-steps li::before { position: absolute; inset-inline-start: 0; top: 0; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 6px; color: var(--green-800); background: #e1f1e6; content: counter(step); font-size: 9px; font-weight: 700; }
.analysis-notice { margin-top: 10px; padding: 10px; border-radius: 11px; color: #79612b; background: #faf4e5; font-size: 10px; line-height: 1.6; }
.legal-note { margin: 13px 4px 0; color: var(--muted); font-size: 9.5px; line-height: 1.75; }

.bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; width: min(100%, 520px); grid-template-columns: 1fr 1fr; margin-inline: auto; padding: 9px 36px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(222,233,224,.9); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.nav-button { display: grid; justify-items: center; gap: 3px; padding: 3px 5px; border: 0; color: #8a978e; background: transparent; cursor: pointer; }
.nav-button span { font-size: 20px; line-height: 1.15; }
.nav-button small { font-size: 9px; }
.nav-button.selected { color: var(--green-800); }
.nav-button.selected span { font-weight: 700; }

.install-dialog { width: min(calc(100% - 32px), 420px); padding: 24px; border: 1px solid var(--line); border-radius: 25px; color: var(--ink); background: var(--white); box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.install-dialog::backdrop { background: rgba(9, 31, 21, .52); backdrop-filter: blur(3px); }
.install-dialog > form:first-child { position: absolute; top: 12px; left: 12px; }
.dialog-close { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 11px; color: var(--muted); background: #f1f5f2; font-size: 22px; cursor: pointer; }
.install-dialog-icon { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 14px; border-radius: 16px; color: var(--green-800); background: var(--green-50); font-size: 28px; }
.install-dialog h2 { margin: 0 0 15px; color: var(--green-950); font-size: 19px; }
.install-dialog ol { display: grid; gap: 11px; margin: 0; padding-inline-start: 22px; color: #4e5c53; font-size: 12px; line-height: 1.7; }
.install-dialog li::marker { color: var(--green-700); font-weight: 700; }
.install-dialog p { margin: 15px 0 0; padding: 11px; border-radius: 12px; color: #67766c; background: var(--green-50); font-size: 10px; line-height: 1.7; }
.dialog-done { justify-content: center; margin-top: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

@media (min-width: 600px) {
  body { padding-block: 20px; background: #eaf0eb; }
  .app-shell { min-height: calc(100dvh - 40px); border: 1px solid #e1e9e3; border-radius: 28px; box-shadow: 0 20px 70px rgba(18, 53, 33, .1); }
  .bottom-nav { bottom: 20px; border-radius: 0 0 28px 28px; }
}

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