body { font-size: 1rem; line-height: 1.6; }
button { border: 0; background: none; cursor: pointer; color: inherit; }
main, header > div, .nav-inner { width: min(100% - 40px, 1112px); margin-inline: auto; }
header { border-bottom: 1px solid var(--edge); padding-top: env(safe-area-inset-top); }
header > div { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-tools { display: flex; gap: 10px; align-items: center; }
.demo, .pill { color: var(--brand-ink); background: var(--soft); border-radius: 20px; padding: 4px 11px; font-size: .875rem; }
.soft, .lang, select, input { border: 1px solid var(--edge); background: var(--surface); border-radius: 10px; min-height: 44px; padding: 9px 13px; color: var(--text); }
.soft:hover, .lang:hover { border-color: var(--brand); background: var(--soft); }
.action { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 9px 18px; background: var(--brand); border-radius: 10px; color: var(--text); font-weight: 800; }
.action:hover:not(:disabled) { background: var(--brand-hover); }
.action:disabled { opacity: .45; cursor: default; }
main { padding-block: 26px calc(108px + env(safe-area-inset-bottom)); }

.hero { display: grid; grid-template-columns: 1fr 1.15fr; border: 1px solid var(--edge); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.hero-content { align-self: center; padding: clamp(22px, 5vw, 54px); }

.hero h1 { font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.15; }
.hero h1 em { display: block; font-style: normal; color: var(--brand-ink); }
.hero p { max-width: 33ch; margin: 14px 0 20px; color: var(--muted); }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 28px 0 13px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); line-height: 1.25; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.06rem; line-height: 1.35; }
.text-button { color: var(--brand-ink); padding: 8px 0; text-align: start; font-weight: 750; text-underline-offset: 4px; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card { padding: 0; display: block; text-align: start; background: var(--surface); border: 1px solid var(--edge); border-radius: 15px; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.card:hover, .card[aria-pressed=true] { border-color: var(--brand); }
.card img, .art-placeholder { display: block; width: 100%; aspect-ratio: 1.62; object-fit: cover; object-position: center 55%; }
.art-placeholder { display: grid; place-items: center; color: var(--brand-icon); background: var(--soft); }
.art-placeholder svg { width: 34px; height: 34px; }
.card .info { padding: 12px 14px; }
.card p { color: var(--brand-ink); font-size: .875rem; margin-top: 6px; }
.select-mark { position: absolute; top: 9px; inset-inline-end: 9px; border-radius: 50%; background: #fff; color: var(--brand-ink); display: grid; place-items: center; width: 30px; height: 30px; font-size: 1.125rem; box-shadow: var(--shadow); }
.card[aria-pressed=true] .select-mark { background: var(--brand); color: var(--text); }
.branches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.branches button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.branches svg { width: 20px; height: 20px; color: var(--brand-icon); flex: none; }

.nav { position: fixed; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--edge); background: #fffffff5; backdrop-filter: blur(12px); z-index: 3; padding-bottom: env(safe-area-inset-bottom); }
.nav-inner { max-width: 590px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding-block: 6px; }
.nav button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 52px; border-radius: 12px; padding: 4px 0; color: var(--muted); font-size: .875rem; }
.nav button:hover, .nav button[aria-current=page] { color: var(--brand-ink); background: var(--soft); }
.nav button[aria-current=page] { font-weight: 800; }
.nav svg { color: var(--brand-icon); width: 21px; height: 21px; }

.page { max-width: 640px; margin-inline: auto; }
.page h1 { margin: 6px 0 10px; }
.note { margin: 6px 0 16px; color: var(--muted); }
.box { padding: 18px; background: var(--surface); border: 1px solid var(--edge); border-radius: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.box p { margin: 5px 0; }
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 5px; }
.stack input, .stack select { width: 100%; border-color: var(--input-edge); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-top: 18px; flex-wrap: wrap; }
.pill { display: inline-block; font-weight: 700; }
.error { color: #a92d14; }
.error:empty { display: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.money { display: flex; justify-content: space-between; gap: 8px; }
.empty { color: var(--muted); padding: 16px 0; }
.tabs { padding: 0; margin: 0; }
.account-links { margin-top: 14px; }
.invoice-doc .money { padding: 7px 0; border-bottom: 1px solid var(--edge); }
.invoice-doc h2 { margin: .3em 0; }
.task { border-top: 1px solid var(--edge); margin: 12px 0 8px; padding-top: 10px; }
.task button { margin-block: 4px; }
.page .row { margin-block: 10px; }

@media (max-width: 680px) {
  main, header > div, .nav-inner { width: calc(100% - 32px); }
  header > div { min-height: 64px; }
  main { padding-top: 16px; }
  .hero { grid-template-columns: 1fr; border-radius: 20px; }

  .hero h1 em { display: inline; }
  .hero p { margin: 8px 0 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid, .branches { gap: 8px; }
  .card .info { padding: 9px; }
  .branches button { padding-inline: 4px; font-size: .875rem; }
}

@media print {
  header, .nav, .print-action { display: none !important; }
  body, .box { background: #fff !important; color: #111 !important; }
  .box { border-color: #999 !important; box-shadow: none; }
  .pill, p { color: #222 !important; }
  main { padding: 0; width: 100%; }
  .page { max-width: none; }
}
