/* EAI City — design system v6 «Premium». The city fills the screen; calm glass UI floats over it; everything else opens as
   clean white panels. Manrope for every UI text, Playfair Display only for names, building titles and big headings.
   Warm paper, white panels, hairlines; one confident primary (deep petrol), a warm gold accent for rewards and «Для вас».
   Legacy token names (--blue, --yellow, --green …) stay and point at the new palette, so every module restyles at once. */
:root {
  /* ink */
  --ink: #17202b; --ink2: #4a5462; --ink3: #646d79; --on-color: #ffffff;
  /* surfaces */
  --paper: #f5f1ea; --panel: #ffffff; --panel2: #f8f5f0; --panel3: #efe9e0;
  --line: #e7e1d7; --line2: #d7cfc2; --hair: rgba(23, 32, 43, 0.08);
  --glass: rgba(255, 255, 255, 0.82); --glass-strong: rgba(255, 255, 255, 0.92); --glass-line: rgba(255, 255, 255, 0.7);
  --glass-dark: rgba(16, 21, 28, 0.58); --blur: blur(18px) saturate(1.4);
  --sky: #e9e3d8; --scrim: rgba(14, 19, 26, 0.5);
  /* primary: deep petrol */
  --primary: #14505c; --primary-d: #0d3c46; --primary-l: #e3eeee; --primary-m: #9cc0c4; --primary-ll: #f1f7f7;
  /* gold accent: rewards, highlights, «Для вас» */
  --gold: #c9a35a; --gold-d: #a8823a; --gold-t: #7d5f1e; --gold-l: #f7efdd; --gold-ll: #fbf7ee;
  /* status (muted) */
  --success: #2f7550; --success-l: #e4f0e8;
  --warn: #a8701a; --warn-t: #8a5a10; --warn-l: #f8eed8;
  --danger: #b0433c; --danger-l: #f8e7e4;
  --plum: #5b4680; --plum-l: #efeaf5;
  /* legacy names → new palette (other modules use them) */
  --blue: var(--primary); --blue-d: var(--primary-d); --blue-l: var(--primary-l);
  --yellow: #d2ae66; --yellow-d: var(--gold-d); --yellow-l: var(--gold-l);
  --green: #3b8160; --green-d: #2a6a48; --green-l: var(--success-l);
  --red: #c0544b; --red-d: #a33c35; --red-l: var(--danger-l);
  --purple: #6c58a0; --purple-d: var(--plum); --purple-l: var(--plum-l);
  --orange: #c47a3c; --orange-l: #f7ece1; --pink: #b35c7e; --teal: #3f7fbf;
  --ad: var(--gold-t); --ad-l: var(--gold-l);
  /* type */
  --font: 'Manrope', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --display: var(--serif);
  /* shape */
  --r-s: 10px; --r-m: 12px; --r-l: 14px; --r-xl: 16px;
  --sh-1: 0 1px 2px rgba(23, 32, 43, 0.06), 0 1px 3px rgba(23, 32, 43, 0.04);
  --sh-2: 0 2px 6px rgba(23, 32, 43, 0.05), 0 12px 32px rgba(23, 32, 43, 0.1);
  --sh-3: 0 4px 14px rgba(23, 32, 43, 0.08), 0 30px 70px rgba(23, 32, 43, 0.2);
  --sh-glass: 0 1px 1px rgba(23, 32, 43, 0.04), 0 8px 28px rgba(23, 32, 43, 0.14);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fs: 16px;
  color-scheme: light;
}
html.big { --fs: 19px; }
html, body { height: 100%; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-weight: 500; line-height: 1.45; overflow: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: 'cv11', 'ss01'; }
* { box-sizing: border-box; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; color: var(--ink); }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -0.005em; }
h1 { font-size: 2rem; } h2 { font-size: 1.55rem; }
h3, h4 { font-family: var(--font); font-weight: 700; letter-spacing: -0.005em; }
h3 { font-size: 1.08rem; } h4 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--primary); text-underline-offset: 3px; }
.muted { color: var(--ink2); } .faint { color: var(--ink3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; } .row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.num { font-family: var(--font); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.serif { font-family: var(--display); }
.overline { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); }

/* ---------------------------------------------------------------- icons */
.ico { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -0.2em; }
.ico svg { width: 100%; height: 100%; display: block; }
/* a tinted rounded square holding a line icon (the building colour via --tc / --ti) */
.isq { --tc: var(--primary-l); --ti: var(--primary); position: relative; flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--tc); color: var(--ti); }
.isq .ico { width: 22px; height: 22px; }
.isq.sm { width: 36px; height: 36px; border-radius: 10px; } .isq.sm .ico { width: 18px; height: 18px; }
.isq.lg { width: 56px; height: 56px; border-radius: 14px; } .isq.lg .ico { width: 26px; height: 26px; }
.isq.gold { --tc: var(--gold-l); --ti: var(--gold-t); }
.isq.ok { --tc: var(--success-l); --ti: var(--success); }
.isq.warn { --tc: var(--warn-l); --ti: var(--warn-t); }
.isq.err { --tc: var(--danger-l); --ti: var(--danger); }
.isq.plum { --tc: var(--plum-l); --ti: var(--plum); }
.isq.ink { --tc: var(--ink); --ti: #fff; }
.isq.soft { --tc: var(--panel3); --ti: var(--ink2); }
/* the EAI concierge mark: a petrol medallion with a gold spark */
.eai-mark { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #e8cf98;
  background: radial-gradient(120% 120% at 30% 20%, #2a6f7c 0%, #14505c 48%, #0b3039 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 2px 8px rgba(13, 60, 70, 0.28); }
.eai-mark .ico { width: 52%; height: 52%; }
.eai-mark.lg { width: 64px; height: 64px; } .eai-mark.xl { width: 88px; height: 88px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --c: var(--primary); --cd: var(--primary-d); --tc: var(--on-color);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--r-m);
  background: var(--c); color: var(--tc); font-family: var(--font); font-weight: 700; font-size: 1rem; letter-spacing: 0; line-height: 1.2;
  box-shadow: 0 1px 2px rgba(23, 32, 43, 0.12);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  user-select: none; -webkit-tap-highlight-color: transparent; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--cd); }
.btn:active, .btn.pressed { box-shadow: none; filter: brightness(0.96); }
.btn[disabled], .btn.off { opacity: 0.45; pointer-events: none; }
.btn.yellow, .btn.gold { --c: var(--yellow); --cd: #c49d50; --tc: var(--ink); }
.btn.green { --c: var(--success); --cd: #255f40; }
.btn.red { --c: var(--danger); --cd: #93362f; }
.btn.purple { --c: var(--plum); --cd: #4a3769; }
.btn.ink { --c: var(--ink); --cd: #0b1118; }
.btn.ghost { --c: var(--panel); --cd: var(--panel2); --tc: var(--ink); border-color: var(--line2); box-shadow: 0 1px 2px rgba(23, 32, 43, 0.05); }
.btn.ghost:hover { border-color: #c5bcad; }
.btn.flat { background: transparent; box-shadow: none; color: var(--ink2); min-height: 44px; padding: 8px 12px; border-color: transparent; }
.btn.flat:hover { background: var(--panel3); color: var(--ink); }
.btn.lg { min-height: 54px; padding: 13px 24px; font-size: 1.05rem; border-radius: var(--r-l); }
.btn.sm { min-height: 44px; padding: 7px 14px; font-size: 0.94rem; border-radius: var(--r-s); }
.btn.block { display: flex; width: 100%; }
.btn.round { width: 48px; min-width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 50%; }
.btn .ico { width: 1.15em; height: 1.15em; }

/* ---------------------------------------------------------------- panels, cards, chips, tags, inputs */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-2); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; }
.card.soft { background: var(--panel2); border-color: transparent; }
.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); box-shadow: var(--sh-glass); }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line2); color: var(--ink); font-weight: 600; font-size: 0.95rem; line-height: 1.25; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.chip:hover { border-color: #bfb5a6; background: var(--panel2); }
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .ico { width: 1.05em; height: 1.05em; }
.chip.ad { background: var(--gold-l); border-color: #e6d6b0; color: var(--gold-t); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.35; background: var(--panel3); color: var(--ink2); white-space: nowrap; }
.tag .ico { width: 1.05em; height: 1.05em; }
.tag.ad { background: var(--gold-l); color: var(--gold-t); }
.tag.ok { background: var(--success-l); color: var(--success); } .tag.warn { background: var(--warn-l); color: var(--warn-t); } .tag.err { background: var(--danger-l); color: var(--danger); } .tag.new { background: var(--plum-l); color: var(--plum); }
.tag.gold { background: var(--gold-l); color: var(--gold-t); }
.badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 0.74rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--panel); line-height: 1; }
.badge:empty { display: none; }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.input, .textarea, .select { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-m); border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font-weight: 500; font-size: 1rem; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.textarea { resize: none; line-height: 1.45; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5462' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.input:hover, .textarea:hover, .select:hover { border-color: #c5bcad; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20, 80, 92, 0.14); }
/* fields show focus with their border + ring; the global outline would double it */
html .input:focus-visible, html .textarea:focus-visible, html .select:focus-visible, html .bld-input:focus-visible { outline: none; }
.input::placeholder, .textarea::placeholder { color: #6f7680; font-weight: 400; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; font-weight: 500; color: var(--ink2); font-size: 0.98rem; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; margin-top: 1px; }

/* tabs: a quiet segmented control */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-m); background: var(--panel3); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 16px; border-radius: 9px; border: 0; background: transparent; color: var(--ink2); font-family: var(--font); font-weight: 600; font-size: 0.95rem; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--panel); color: var(--ink); box-shadow: var(--sh-1); }
.tab .ico { width: 1.1em; height: 1.1em; }
.tab .tag { margin-left: 2px; }

/* avatar circle */
.ava { position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--panel3); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--hair), var(--sh-1); overflow: hidden; flex: none; display: grid; place-items: center; font-size: 1.3rem; }
.ava > img, .ava > svg, .ava > canvas, .ava > picture { width: 100%; height: 100%; display: block; object-fit: cover; }
.ava > .ava, .ava > span:only-child, .ava > div:only-child { width: 100%; height: 100%; border: 0; box-shadow: none; border-radius: 50%; }
.ava.lg { width: 84px; height: 84px; } .ava.sm { width: 34px; height: 34px; font-size: 1rem; } .ava.xl { width: 132px; height: 132px; border-width: 3px; }

/* progress bar: thin */
.bar { position: relative; height: 6px; border-radius: 999px; background: rgba(23, 32, 43, 0.08); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--primary); transition: width 0.5s var(--ease); }
.bar.gold > i { background: linear-gradient(90deg, #d9bb7a, var(--gold-d)); }
.bar.blue > i { background: var(--primary); } .bar.green > i { background: var(--success); }

/* ---------------------------------------------------------------- overlays: modal, sheet, toasts */
.scrim { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: grid; place-items: center; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); animation: fadeIn 0.18s ease; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal { position: relative; width: min(560px, 100%); max-height: min(88vh, 100%); overflow: auto; background: var(--panel); border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: 26px 28px; animation: rise 0.22s var(--ease); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.modal:focus, .modal:focus-visible { outline: none; }
.modal.wide { width: min(920px, 100%); }
.modal__head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding-right: 44px; }
.modal__head h2 { font-size: 1.6rem; }
.modal__close { position: absolute; top: 14px; right: 14px; z-index: 4; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--panel2); color: var(--ink2); display: grid; place-items: center; transition: background-color 0.15s ease, color 0.15s ease; }
.modal__close:hover { background: var(--panel3); color: var(--ink); }
.modal__close .ico { width: 20px; height: 20px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
@media (max-width: 600px) {
  .scrim.as-sheet { place-items: end stretch; padding: 0; padding-top: calc(24px + env(safe-area-inset-top, 0px)); }
  .scrim.as-sheet .modal { width: 100%; max-height: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 26px 18px calc(20px + env(safe-area-inset-bottom, 0px)); animation: up 0.26s var(--ease); }
  .scrim.as-sheet .modal::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line2); }
  .modal__head h2 { font-size: 1.4rem; }
}
.toasts { position: fixed; z-index: 120; left: 50%; top: calc(80px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(480px, calc(100% - 32px)); }
.toast { pointer-events: auto; cursor: default; display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border-radius: var(--r-l); background: rgba(23, 32, 43, 0.95); color: #fff; font-weight: 600; font-size: 1rem; line-height: 1.35; box-shadow: var(--sh-2); animation: drop 0.22s var(--ease); max-width: 100%; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.toast.no-ico { padding-left: 18px; }
.toast .t-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.12); color: #e8cf98; }
.toast .t-ico .ico { width: 16px; height: 16px; }
.toast.ok .t-ico { background: rgba(110, 196, 150, 0.18); color: #8fdcb2; }
.toast.warn .t-ico { background: rgba(232, 180, 90, 0.2); color: #f0c879; }
.toast.err .t-ico { background: rgba(232, 112, 100, 0.2); color: #f4a097; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
@keyframes pulse { 50% { opacity: 0.55; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -40% 0; } }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(23, 32, 43, 0.12); border-top-color: var(--primary); animation: spin 0.8s linear infinite; display: inline-block; flex: none; }
/* empty states */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; text-align: center; color: var(--ink2); }
.empty .isq { margin-bottom: 4px; }
.empty b { font-weight: 700; color: var(--ink); font-size: 1.04rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; } }

/* weak devices (the city runs on its 'low' tier): no live blur behind panels — solid glass instead (blur costs every frame) */
html.lowfx { --glass: rgba(255, 255, 255, 0.95); --glass-strong: rgba(255, 255, 255, 0.98); --blur: none; }
html.lowfx *, html.lowfx *::before, html.lowfx *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.lowfx .scrim { background: rgba(14, 19, 26, 0.55); }
