:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: #202124;
  background: #fff;
  --red: #cd2237;
  --blue: #2659b9;
  --muted: #656971;
  --line: #e9e9ed;
  --pad: 16px;
}
* { box-sizing: border-box }
body { margin: 0; -webkit-tap-highlight-color: transparent }
button, input { font: inherit; color: inherit }
button { border: 0; background: none; cursor: pointer; padding: 0 }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid #2e66bd; outline-offset: 2px;
}
button:active { opacity: .8 }
button[hidden], [hidden] { display: none !important }
h1, h2, h3, p { margin: 0 }
h1 { font-size: 1.13rem; line-height: 1.35; font-weight: 660 }
h2 { font-size: 1.12rem; letter-spacing: -.025em; line-height: 1.4 }
.icon { width: 23px; height: 23px; flex: 0 0 auto; display: inline-block; vertical-align: middle }
.icon-button { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 10px }
.icon-button:hover { background: #f3f3f5 }
#app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: white;
  padding-top: env(safe-area-inset-top); position: relative;
}
.with-nav { padding-bottom: calc(82px + env(safe-area-inset-bottom)) }
.top { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  padding: 5px 8px; min-height: 56px; text-align: center; background: #fff }
.home-mark { display: flex; justify-content: space-between; align-items: center; padding: 4px 12px 0 var(--pad) }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 760; letter-spacing: -.035em }
.badge { font-size: .75rem; font-weight: 700; line-height: 1; padding: 5px 8px; border-radius: 6px;
  color: #a32335; background: #fbe9eb; letter-spacing: .025em }
.home-search { display: flex; gap: 7px; padding: 5px 10px 12px var(--pad); align-items: center }
.search { display: flex; align-items: center; gap: 9px; padding: 0 12px; background: #f0f0f3;
  border-radius: 10px; min-height: 41px; color: #767981; flex: 1; min-width: 0 }
.search .icon { width: 18px; height: 18px }
.search input { width: 100%; min-width: 0; border: none; background: transparent; height: 42px; font-size: 1rem; outline: none }
.search input::placeholder { color: #757880 }
.search:focus-within { box-shadow: inset 0 0 0 2px #8aa9da }
.banners, .strip { display: flex; gap: 10px; overflow-x: auto; padding: 0 var(--pad); scrollbar-width: none; scroll-snap-type: x proximity }
.banners::-webkit-scrollbar, .strip::-webkit-scrollbar { display: none }
.banners { gap: 12px }
.banner { flex: 0 0 47%; border-radius: 12px; overflow: hidden; scroll-snap-align: center; aspect-ratio: 166/107 }
.banner img { height: 100%; width: 100%; display: block; object-fit: cover }
.home-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px 0; padding: 19px 5px 16px }
.shortcut { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px;
  min-height: 65px; padding: 4px 1px; font-size: .88rem; line-height: 1.15 }
.shortcut .icon { color: var(--red); width: 35px; height: 35px; stroke-width: 1.85 }
.magnum { display: grid; place-items: center; width: 35px; height: 35px; color: white;
  background: #d90056; border-radius: 6px; font: bold 29px Georgia,serif }
.shortcut .magnum { font-size:24px; line-height:1 }
.products { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
  padding: 19px var(--pad); gap: 18px 10px }
.product { display: flex; text-align: left; align-items: flex-start; gap: 9px; line-height: 1.2; min-height: 44px }
.product small, .row small { display: block; margin-top: 3px; font-size: .84rem; color: var(--muted); line-height: 1.28 }
.product strong { color: #ba2234 }
.product-icon { width: 43px; height: 35px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 6px; font-size: .75rem; font-weight: 780; color: white; background: #dc2d3d }
.product-icon.lime { background: #84bd43 }.product-icon.gold { background: #e6b700 }
.section-title { padding: 12px var(--pad) 10px }
.recent { padding-bottom: 12px }
.recent button { flex: 0 0 39%; text-align: left; font-size: .88rem }
.recent img { display: block; width: 100%; aspect-ratio: 1.1; object-fit: cover; border-radius: 12px; margin-bottom: 6px; background: #f4f4f4 }
.recent .phone { object-fit: contain }
.nav { position: fixed; z-index: 2; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%,480px);
  display: grid; grid-template-columns: repeat(4,1fr); background: rgba(255,255,255,.98);
  border-top: 1px solid #e1e2e6; padding: 4px 0 calc(6px + env(safe-area-inset-bottom)) }
.nav button { min-height: 49px; display: grid; align-content: center; justify-items: center; gap: 3px; color: #6d7077; font-size: .75rem }
.nav button[aria-current="page"] { color: var(--red); font-weight: 620 }
.nav .icon { width: 23px; height: 23px }
.segments { display: flex; padding: 3px; background: #eeeef2; border-radius: 9px }
.segments button { flex: 1; min-height: 33px; font-size: .9rem; border-radius: 7px }
.segments .on { background: white; box-shadow: 0 1px 4px #2222; font-weight: 600 }
.service-tools { padding: 4px var(--pad) 14px; display: grid; gap: 11px }
.doc-tiles { margin-bottom: 3px }
.doc-tile { scroll-snap-align: center; display: flex; flex: 0 0 36.6%; flex-direction: column; gap: 11px; align-items: flex-start;
  text-align: left; background: #f5f5f7; border-radius: 14px; padding: 15px 13px; min-height: 118px; font-size: .93rem; font-weight: 520; line-height: 1.22 }
.doc-symbol { display: inline-grid; place-items: center; width: 58px; height: 38px; border-radius: 5px; background: #287f83; color: #e8d29e }
.doc-symbol.student { background: #434370; color: #f6dfb2 }.doc-symbol.id { background: linear-gradient(125deg,#d0e6e2,#c4e7f5 68%,#e9eac9); color: #428488 }
.text-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 49px; padding: 0 var(--pad); text-align: left; color: #37628e }
.chev { color: #73767d; width: 17px; height: 17px }
.categories { display: grid; grid-template-columns: repeat(4,1fr); border-top: 7px solid #f1f1f4; border-bottom: 1px solid var(--line); padding: 14px 0 0 }
.categories button { position: relative; min-height: 88px; padding-bottom: 12px; font-size: .83rem }
.categories img { display: block; width: 48px; height: 48px; margin: 0 auto 6px; border-radius: 12px }
.categories .on { color: #b21d31; font-weight: 650 }
.categories .on::after { content: ""; position: absolute; bottom: 0; left: 24%; width: 52%; height: 3px; background: var(--red); border-radius: 2px }
.list { padding: 0 var(--pad) }
.row { display: flex; width: 100%; min-height: 65px; gap: 13px; align-items: center; border-bottom: 1px solid var(--line); text-align: left; padding: 12px 0 }
.row .chev { margin-left: auto; flex-shrink: 0 }
.row-symbol { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: #a82c46; background: #f4edf0 }
.row-label { flex: 1 }
.new { border-radius: 5px; padding: 3px 5px; color: white; background: #c82336; font-size: .7rem; font-weight: 700 }
.empty { padding: 42px 22px; text-align: center; color: var(--muted); line-height: 1.5 }
.doc-screen { display: flex; flex-direction: column; min-height: calc(100vh - env(safe-area-inset-top)); min-height: calc(100dvh - env(safe-area-inset-top)) }
.doc-preview { height: calc(100vh - env(safe-area-inset-top)); height: calc(100dvh - env(safe-area-inset-top)) }
.doc-preview > :where(.top, .doc-tabs, .doc-action-stack) { flex: none }
.doc-tabs { padding: 5px var(--pad) 14px; border-bottom: 1px solid var(--line) }
.doc-tabs button { touch-action: manipulation; user-select: none; -webkit-user-select: none }
.demo-line { margin: 13px 12px 0; border-radius: 7px; background: #252937; color: #fff; font-size: .78rem; padding: 8px 6px; font-weight: 600; text-align: center }
.cards { position: relative; min-width: 0 }
.doc-preview > .cards { flex: 1; min-height: 120px }
.card-window { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain;
  touch-action: pan-x pan-y; overflow-anchor: none }
.card-pages { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; margin: 18px auto 22px;
  width: calc(min(calc(100% - var(--card-gutter, 24px)), var(--card-fit, 312px)) * var(--card-scale, 1)) }
.zoom-reset { position: absolute; top: 8px; right: 12px; border-radius: 8px; padding: 9px 12px;
  background: white; color: var(--blue); box-shadow: 0 1px 6px #0003; font-size: .85rem }
.card-pages canvas { width: 100% }
.card-front { position: relative }
.cards canvas { display: block; height: auto; border-radius: 8px; box-shadow: 0 1px 5px #283c4a1f }
.card-front canvas { width: 100% }
.emblem-target { position: absolute; top: 15%; left: 50%; transform: translate(-50%,-50%);
  width: 16%; height: 26%; min-width: 44px; min-height: 44px; border-radius: 50%;
  -webkit-touch-callout: none; user-select: none; touch-action: manipulation }
.enlarged { --card-fit: 100%; --card-gutter: 0px; height: 60vh; height: 60dvh }
.enlarged .card-pages { margin-block: 13px 20px }
.doc-action-stack { margin-top: auto; padding: 12px var(--pad) calc(21px + env(safe-area-inset-bottom)); display: grid; gap: 10px }
.action { min-height: 47px; border-radius: 9px; display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; font-weight: 610; line-height: 1.3; padding: 9px 12px }
.action .icon { width: 20px; height: 20px }
.primary { background: var(--red); color: white }.secondary { background: #f0f0f4 }
.blue { background: var(--blue); color: white }.outline { border: 1px solid #6580a4; color: #264d7a; background: #fff }
.save { background: #078455; color: white }
.details-banner { margin: 12px var(--pad) 3px; border: 1px solid #f1c5cd; background: #fcf1f3; color: #77293a; border-radius: 9px; padding: 10px 12px; font-size: .84rem; line-height: 1.4 }
.link-button { color: #265a94; text-decoration: underline; text-underline-offset: 2px }
.fields { padding: 0 var(--pad) }
.field { display: flex; align-items: center; min-height: 67px; border-bottom: 1px solid var(--line); gap: 8px }
.field-edit { flex: 1; text-align: left; min-width: 0; padding: 11px 0; min-height: 65px }
.field-edit span { display: block; color: var(--muted); font-size: .82rem; margin-bottom: 5px }
.field-edit b { display: block; font-size: 1rem; font-weight: 520; overflow-wrap: anywhere }
.edit-value { display: block; width: 100%; margin-top: 14px; padding: 12px; background: white; border: 1px solid #a6b1c6; border-radius: 9px }
.edit-hint { color: var(--muted); margin: 8px 0; font-size: .85rem }
.edit-status, .pin-issue { color: #a52237; font-size: .9rem }
.edit-status:not(:empty) { margin-top: 10px }
.field .icon-button { color: #525560; touch-action: manipulation; user-select: none }
.field .icon { width: 19px; height: 19px }
#sheet { position: fixed; inset: auto 0 0; width: min(100%,480px); margin: 0 auto; border: none;
  border-radius: 20px 20px 0 0; color: #22242a; background: white; padding: 9px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 90vh; max-height: 90dvh; box-shadow: 0 -8px 50px #0002; overscroll-behavior: contain }
#sheet::backdrop { background: #20232a69 }
body:has(#sheet[open]) { overflow: hidden }
.handle { width: 42px; height: 4px; border-radius: 3px; background: #dcdce1; margin: 0 auto 17px }
#sheet h2 { margin-bottom: 7px; font-size: 1.18rem }
.sheet-text { color: #595f69; line-height: 1.45; margin: 5px 0 15px }
.sheet-stack { display: grid; gap: 9px; margin-top: 14px }
.option { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 11px; border: 1px solid var(--line); cursor: pointer }
.option:has(:checked) { border-color: #a8c4ef; background: #f7faff }
.option input { accent-color: var(--blue); width: 18px; height: 18px }
.option small { display: block; color: var(--muted); margin-top: 3px; font-size: .84rem }
.qr { display: block; max-width: 220px; width: 66%; margin: 14px auto 8px }
.share-text { display: block; width: 100%; min-height: 160px; font: inherit; border: 1px solid #dedfe4; border-radius: 10px; padding: 10px }
#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%,6px);
  z-index: 8; max-width: min(90%,440px); width: max-content; border-radius: 12px; background: #222737; color: white; padding: 10px 16px;
  font-size: .92rem; line-height: 1.4; pointer-events: none; opacity: 0; transition: all .16s }
#toast.show { opacity: 1; transform: translate(-50%,0) }
@media (min-width: 540px) {
  #app { box-shadow: 0 0 0 1px #dfdfe4, 0 8px 32px #3538480c }
  :root { --pad: 20px }
}
@media (min-width: 540px) and (hover: hover) and (display-mode: browser) {
  :root { background: #eff0f3 }
}
@media (max-width: 350px) { :root { --pad: 12px }.shortcut { font-size: .78rem }.product { font-size: .92rem }.product-icon { width: 35px } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important } }
.pin-screen { min-height: calc(100vh - env(safe-area-inset-top)); min-height: calc(100dvh - env(safe-area-inset-top)); padding: 12px 18px max(17px,env(safe-area-inset-bottom)); display:flex; flex-direction:column; align-items:center }
.pin-brand { display:flex; justify-content:space-between; width:100%; padding-top:clamp(4px,2vh,20px); }
.pin-brand button { width:44px; height:44px; color:#df4637; font-size:1.55rem; }
.pin-content { width:100%; text-align:center; padding-top:clamp(12px,3.3vh,34px) }
.pin-content img { display:block; margin:0 auto 14px; border-radius:50% }
.pin-content h1 { font-size:1.14rem; font-weight:650 }
.pin-hint { margin:7px auto 0; color:#646468; line-height:1.4; max-width:330px }
.pin-dots { display:flex; justify-content:center; gap:15px; margin:33px 0 9px }
.pin-dots i { width:10px; height:10px; border-radius:50%; background:#e4e4e6 }
.pin-dots .filled { background:#45464b }
.pin-issue { min-height:1.4em; margin:10px 0 }
.pin-pad { display:grid; grid-template-columns:repeat(3,1fr); width:min(100%,370px); margin:auto auto 0; gap:0 }
.pin-pad button { color:#151518; font-size:2rem; font-weight:400; font-variant-numeric:tabular-nums; min-height:48px; height:clamp(50px,9.5vh,82px); touch-action:manipulation; border-radius:16px }
.pin-pad button:active { background:#f5f5f6 }.pin-pad button:last-child { color:#77797b; font-size:1.65rem }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
.home-search { padding-top:14px; padding-bottom:10px }
.promos { margin:0 var(--pad) }
.banners { padding:0; gap:0; border-radius:12px; scroll-snap-type:x mandatory }
.banner { flex:0 0 100%; aspect-ratio:3.25; border-radius:12px; scroll-snap-align:start }
.banner img { object-fit:fill }
.promo-dots { display:flex; justify-content:center; align-items:center; gap:0; height:15px }
.promo-dots button { width:14px; height:15px; display:grid; place-items:center }
.promo-dots button::after { content:""; width:5px; height:5px; background:#cfd0d3; border-radius:4px }
.promo-dots [aria-pressed="true"]::after { background:#6f6c69; width:12px }
.home-grid { padding-top:7px; padding-bottom:9px; gap:10px 0 }
.shortcut .icon,.magnum { width:30px; height:30px }
.glovo { padding:13px var(--pad); width:100%; display:flex; gap:13px; align-items:center; text-align:left; border-top:1px solid var(--line); font-size:.92rem; line-height:1.35 }
.glovo-logo { width:39px; height:39px; border-radius:7px; background:#ffc148; display:grid; place-items:center; color:#00866c }
.glovo-logo svg { width:24px; height:24px }
.glovo small { color:#fff; background:#6b9e32; border-radius:4px; padding:1px 4px }
.recent button { flex-basis:29% }
.recent img { aspect-ratio:1.12; object-fit:cover }
.service-head { position:sticky; top:0; background:white; z-index:3; padding-top:env(safe-area-inset-top) }
.services-page { margin-top:calc(-1 * env(safe-area-inset-top)) }
.service-head .service-tools { padding-bottom:6px }
.service-tools { padding-top:3px; padding-bottom:12px }
.doc-tile { flex-basis:34%; min-height:107px; gap:10px; border-radius:14px }
.doc-tile img { width:61px; height:40px; object-fit:contain; object-position:left center; mix-blend-mode:multiply }
.categories { display:flex; align-items:stretch; overflow-x:auto; scrollbar-width:none; position:sticky; top:var(--services-top,102px); z-index:2; background:white; padding-top:9px }
.categories button { flex:1 0 20%; min-width:64px; min-height:78px; padding:0 2px 8px; font-size:.8rem }
.categories button:first-child { flex-grow:1.3 }
.cat-icon { margin:0 auto 5px; display:grid; place-items:center; width:46px; height:46px; border-radius:13px; overflow:hidden; background:#eeedee }
.categories img { display:block; width:100%; height:100%; margin:0; border-radius:0; mix-blend-mode:multiply }
.row-photo { object-fit:cover; width:42px; height:42px; flex:0 0 auto; border-radius:11px }
.service-group { border-bottom:8px solid #f0f0f2; padding-bottom:4px }
.service-group:last-child { min-height:calc(100dvh - var(--services-top,102px) - 145px); border:0 }
.egov-intro { min-height:calc(100vh - env(safe-area-inset-top)); min-height:calc(100dvh - env(safe-area-inset-top)); display:grid; place-items:center; position:relative; background:white }
.egov-intro img { width:64%; height:auto; display:block }
.doc-action-stack a { text-decoration:none }
#toast { top:calc(15px + env(safe-area-inset-top)); bottom:auto; background:#464648f2; border-radius:10px; color:white }
@media (max-height:560px) { .pin-content {padding-top:0}.pin-content img {display:none}.pin-dots {margin:10px 0}.pin-pad button {height:46px} }
