:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #778197;
  --line: #e1e5ed;
  --navy: #17213b;
  --accent: #ff5c43;
  --accent-2: #ff775d;
  --green: #28ad7c;
  --green-bg: #eaf8f3;
  --danger: #e94242;
  --shadow: 0 12px 34px rgba(18, 30, 55, .09);
  --radius: 22px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { min-height: 100dvh; overflow-x: hidden; }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.screen {
  min-height: 100dvh;
  padding: calc(18px + max(env(safe-area-inset-top), var(--tg-safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px))) 20px calc(26px + max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px)));
  animation: enter .25s ease both;
}
.center-screen { display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.topbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.topbar-title { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.icon-button { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; color: var(--navy); background: var(--surface); box-shadow: 0 5px 16px rgba(18,30,55,.07); font-size: 25px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: white; display: grid; place-items: center; font-weight: 800; }
.avatar-button { border: 0; }
.brand-mark { width: 68px; height: 68px; border-radius: 23px; background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: white; display: grid; place-items: center; font-weight: 900; letter-spacing: .05em; box-shadow: 0 16px 34px rgba(255,92,67,.25); }

h1 { margin: 0; font-size: clamp(29px, 8vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 25px; line-height: 1.15; letter-spacing: -.025em; }
p { margin: 0; line-height: 1.45; }
.muted { color: var(--muted); }
.lead { color: var(--muted); font-size: 16px; margin-top: 8px; }
.section-label { color: #97a0b3; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin: 28px 2px 12px; }

.hero-action { width: 100%; min-height: 166px; margin-top: 30px; padding: 24px; border-radius: 28px; color: white; text-align: left; background: linear-gradient(145deg, var(--accent-2), var(--accent)); box-shadow: 0 20px 36px rgba(255,92,67,.22); position: relative; overflow: hidden; }
.hero-action::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -35px; top: -55px; background: rgba(255,255,255,.1); }
.plus { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); font-size: 30px; line-height: 1; }
.hero-action strong { display: block; margin-top: 19px; font-size: 22px; line-height: 1.12; max-width: 210px; }
.hero-arrow { position: absolute; right: 26px; bottom: 33px; font-size: 37px; font-weight: 300; }

.secondary-card, .status-card, .issue-card, .apartment-card { width: 100%; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.secondary-card { min-height: 92px; padding: 18px; margin-top: 18px; display: flex; align-items: center; gap: 14px; text-align: left; color: var(--ink); }
.secondary-card .circle, .apartment-icon { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: #eef1f7; color: #526079; }
.secondary-card strong { display: block; font-size: 17px; }
.secondary-card small { display: block; margin-top: 4px; color: #98a2b3; font-size: 13px; }
.current-issues-card { margin-top: 16px; }
.chevron { margin-left: auto; color: #9aa4b7; font-size: 28px; }
.status-card { margin-top: 30px; padding: 19px; background: var(--green-bg); box-shadow: none; display: flex; align-items: center; gap: 13px; color: #147457; }
.status-dot { width: 37px; height: 37px; border-radius: 50%; background: var(--green); color: white; display: grid; place-items: center; font-size: 21px; font-weight: 700; }
.status-card strong { display: block; font-size: 15px; }
.status-card small { display: block; margin-top: 3px; color: #4a907b; }

.search { margin-top: 20px; position: relative; }
.search input { width: 100%; height: 58px; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 0 46px 0 48px; color: var(--ink); outline: none; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,92,67,.1); }
.search::before { content: "⌕"; position: absolute; left: 17px; top: 10px; font-size: 29px; color: #8c97aa; }
.clear-search { position: absolute; right: 10px; top: 9px; width: 40px; height: 40px; background: transparent; color: #98a2b3; font-size: 21px; }
.apartment-list, .issue-list { display: grid; gap: 12px; }
.apartment-group + .apartment-group { margin-top: 24px; }
.apartment-group-title { margin: 0 2px 10px; display: flex; align-items: center; justify-content: space-between; color: var(--ink); }
.apartment-group-title strong { font-size: 15px; }
.apartment-group-title span { min-width: 27px; height: 27px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 999px; color: #8a5f08; background: #f7edcf; font-size: 12px; font-weight: 800; }
.apartment-group--clear .apartment-group-title { color: #64748b; }
.apartment-group--clear .apartment-group-title span { color: #64748b; background: #e9eef4; }
.apartment-card { min-height: 68px; padding: 12px 15px; display: flex; align-items: center; gap: 13px; text-align: left; color: var(--ink); }
.apartment-card strong { font-size: 16px; }
.apartment-card small { display: block; color: #98a2b3; margin-top: 3px; }
.apartment-icon { width: 44px; height: 44px; border-radius: 15px; font-size: 20px; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }

.selected-apartment { display: flex; align-items: center; gap: 12px; background: var(--navy); color: white; padding: 14px 16px; border-radius: 20px; margin-bottom: 28px; }
.selected-apartment .apartment-icon { color: white; background: var(--accent); }
.selected-apartment small { display: block; color: #b9c2d5; margin-top: 3px; }
.composer { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.composer textarea { width: 100%; min-height: 106px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; line-height: 1.5; }
.attachment-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.attachment-button { height: 64px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: #445169; display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; }
.attachment-button input { display: none; }
.attachment-preview { margin-top: 14px; border-radius: 18px; padding: 13px; display: flex; align-items: center; gap: 11px; color: #4d5a72; background: #eef1f7; }
.attachment-preview img { width: 58px; height: 58px; object-fit: cover; border-radius: 12px; }
.remove-attachment { margin-left: auto; background: transparent; color: var(--danger); font-size: 20px; }
.primary-button { width: 100%; height: 64px; margin-top: 24px; border-radius: 20px; color: white; background: linear-gradient(145deg, var(--accent-2), var(--accent)); font-size: 17px; font-weight: 800; box-shadow: 0 13px 27px rgba(255,92,67,.2); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.hint { margin-top: 17px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 13px; }
.hint .check { color: var(--green); font-weight: 900; }

.issue-card { padding: 17px; box-shadow: 0 8px 24px rgba(18,30,55,.07); }
.issue-head { display: flex; align-items: flex-start; gap: 10px; }
.issue-head strong { font-size: 16px; }
.issue-head time { display: block; color: #98a2b3; font-size: 12px; margin-top: 4px; }
.badge { margin-left: auto; border-radius: 999px; padding: 5px 9px; background: #fff0ec; color: #d84b35; font-size: 11px; font-weight: 800; }
.badge.resolved { background: var(--green-bg); color: #167657; }
.issue-description { margin-top: 13px; color: #4e5a70; white-space: pre-wrap; }
.issue-attachment { margin-top: 13px; border-radius: 15px; overflow: hidden; background: #eef1f7; }
.issue-attachment img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.issue-attachment audio { display: block; width: 100%; }
.issue-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.issue-actions > :only-child { grid-column: 1 / -1; }
.resolve-button, .delete-button { width: 100%; min-height: 48px; padding: 10px; border-radius: 15px; font-weight: 800; }
.resolve-button { background: var(--green-bg); color: #157153; }
.delete-button { color: #a23131; border: 1px solid #f1cece; background: #fff1f1; }
.issue-card.is-resolved { opacity: .82; }
.empty-card { border: 1px solid rgba(200, 162, 74, .18); border-radius: var(--radius); background: rgba(255, 255, 255, .055); }
.count-badge { margin-left: auto; min-width: 31px; height: 31px; padding: 0 9px; border-radius: 999px; display: grid; place-items: center; color: #1a1206; background: var(--accent); font-weight: 900; }
.add-issue-button { margin: 0 0 6px; }
.role-pill { display: inline-flex; margin-bottom: 15px; padding: 6px 11px; border: 1px solid rgba(200, 162, 74, .34); border-radius: 999px; color: #e2c77f; background: rgba(200, 162, 74, .08); font-size: 12px; font-weight: 800; }

.access-state-icon { width: 74px; height: 74px; border: 1px solid rgba(200, 162, 74, .35); border-radius: 24px; display: grid; place-items: center; color: var(--accent); background: rgba(255, 255, 255, .06); font-size: 40px; font-weight: 800; }
.compact-button { width: min(100%, 300px); }
.page-loader { margin: 42px auto; }
.access-list { display: grid; gap: 12px; }
.access-card { padding: 17px; border: 1px solid #e2e8f0; border-radius: var(--radius); color: var(--ink); background: #f8fafc; box-shadow: var(--shadow); }
.access-card strong { display: block; font-size: 16px; }
.access-card small { display: block; margin-top: 4px; color: #64748b; }
.role-actions { display: grid; grid-template-columns: 1.1fr .8fr 1.45fr; gap: 8px; margin-top: 14px; }
.role-actions button { min-width: 0; min-height: 44px; padding: 8px 6px; border: 1px solid #d9e0e9; border-radius: 13px; color: #334155; background: #eef2f7; font-size: 12px; font-weight: 800; white-space: nowrap; }
.role-actions button.active { color: #1a1206; border-color: #c8a24a; background: #efe6c8; }
.role-actions button.danger-action { grid-column: 1 / -1; color: #9f2f2f; border-color: #f2cccc; background: #fff0f0; }

@media (max-width: 360px) {
  .role-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-actions button[data-role="admin"] { grid-column: 1 / -1; }
}

.success-icon { width: 90px; height: 90px; border-radius: 30px; background: var(--green); color: white; display: grid; place-items: center; font-size: 48px; box-shadow: 0 18px 35px rgba(40,173,124,.24); }
.success-card { width: min(100%, 360px); margin-top: 12px; padding: 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }

.loader { width: 32px; height: 32px; border: 3px solid #e0e4ec; border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 20px; right: 20px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 50; padding: 14px 16px; color: white; background: #202a3f; border-radius: 15px; box-shadow: var(--shadow); transform: translateY(140%); opacity: 0; transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #9f2f2f; }

@media (min-width: 560px) {
  .screen { width: 480px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Exact visual identity from the published dayandnight-nsk.ru site. */
@font-face { font-family: "Inter DN"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-400-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter DN"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter DN"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-500-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter DN"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter DN"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-600-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter DN"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter DN"; font-style: normal; font-weight: 700 900; font-display: swap; src: url("/fonts/inter-700-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter DN"; font-style: normal; font-weight: 700 900; font-display: swap; src: url("/fonts/inter-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Quicksand DN"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/quicksand-600-latin.woff2") format("woff2"); }

:root {
  --bg: #0a2349;
  --surface: #f8fafc;
  --ink: #020617;
  --muted: #9fb3cc;
  --line: #e2e8f0;
  --navy: #0a2349;
  --accent: #c8a24a;
  --accent-2: #d8b65e;
  --green: #36a873;
  --green-bg: rgba(54, 168, 115, .14);
  --shadow: 0 18px 42px rgba(2, 12, 30, .24);
  font-family: "Inter DN", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
  background:
    radial-gradient(circle at 106% 0%, rgba(200, 162, 74, .13), transparent 29%),
    radial-gradient(circle at -15% 92%, rgba(159, 179, 204, .11), transparent 31%),
    linear-gradient(155deg, #103063 0%, #0a2349 54%, #06182f 100%);
  background-attachment: fixed;
}

.screen { position: relative; isolation: isolate; color: #f8fafc; }
.screen::before {
  content: "";
  position: fixed;
  z-index: -1;
  right: -82px;
  bottom: 6vh;
  width: 238px;
  height: 238px;
  background: url("/brand/mark-footer.svg") center / contain no-repeat;
  opacity: .025;
  transform: rotate(-12deg);
  pointer-events: none;
}

.brand-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.live-brand-logo { display: inline-flex; align-items: center; gap: 9px; color: #fff; }
.live-brand-logo > img { flex: 0 0 34px; width: 34px; height: 34px; display: block; }
.live-wordmark { white-space: nowrap; font-family: "Quicksand DN", sans-serif; font-size: 23px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.live-wordmark .and { color: #c8a24a; }
.live-brand-logo--panel {
  padding: 24px 28px;
  border: 1px solid rgba(200, 162, 74, .28);
  border-radius: 22px;
  background: rgba(16, 48, 99, .68);
  box-shadow: 0 25px 70px rgba(0, 8, 24, .32), inset 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px);
}
.live-brand-logo--panel > img { width: 44px; height: 44px; flex-basis: 44px; }
.live-brand-logo--panel .live-wordmark { font-size: 28px; }
.brand-kicker { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; margin-bottom: 13px; }

.avatar { color: #1a1206; background: var(--accent); box-shadow: 0 8px 24px rgba(200, 162, 74, .2); }
h1, h2 { color: #f8fafc; text-shadow: 0 2px 18px rgba(0, 8, 24, .18); }
.lead, .muted, .hint { color: #b9c9dc; }
.topbar-title, .section-label { color: #c8a24a; }
.icon-button { color: #c8a24a; background: rgba(255, 255, 255, .075); border: 1px solid rgba(200, 162, 74, .2); box-shadow: none; backdrop-filter: blur(12px); }

.hero-action {
  color: #1a1206;
  background: linear-gradient(145deg, rgba(255, 255, 255, .18), transparent 42%), linear-gradient(135deg, #d8b65e, #c8a24a 58%, #a78132);
  box-shadow: 0 22px 45px rgba(87, 61, 6, .26), inset 0 1px rgba(255, 255, 255, .42);
  border: 1px solid rgba(239, 230, 200, .35);
}
.hero-action::after { background: rgba(255, 255, 255, .13); }
.hero-action .plus { color: #fff; background: #0a2349; box-shadow: 0 8px 22px rgba(2, 12, 30, .24); }

.secondary-card, .apartment-card, .issue-card, .success-card { background: #f8fafc; border: 1px solid #e2e8f0; box-shadow: var(--shadow); }
.secondary-card .circle, .apartment-icon { color: #8b6a23; background: #efe6c8; }
.secondary-card small, .apartment-card small, .issue-head time { color: #64748b; }
.status-card { color: #d9f4ea; background: rgba(54, 168, 115, .13); border: 1px solid rgba(54, 168, 115, .26); backdrop-filter: blur(12px); }
.status-card small { color: #a3d7c2; }

.search input, .composer, .attachment-button { color: #020617; background: #f8fafc; border-color: #e2e8f0; box-shadow: 0 12px 34px rgba(2, 12, 30, .14); }
.search input:focus { border-color: #c8a24a; box-shadow: 0 0 0 4px rgba(200, 162, 74, .16), 0 12px 34px rgba(2, 12, 30, .14); }
.search::before, .clear-search { color: #64748b; }
.composer textarea { color: #020617; }
.selected-apartment { background: rgba(10, 35, 73, .76); border: 1px solid rgba(200, 162, 74, .32); box-shadow: 0 16px 38px rgba(2, 12, 30, .2); backdrop-filter: blur(14px); }
.selected-apartment .apartment-icon { color: #1a1206; background: #c8a24a; }
.selected-apartment small { color: #b9c9dc; }
.attachment-preview { color: #020617; background: #eef4fb; border: 1px solid #e2e8f0; }

.primary-button { color: #1a1206; background: #c8a24a; border: 1px solid rgba(239, 230, 200, .35); box-shadow: 0 16px 32px rgba(87, 61, 6, .24), inset 0 1px rgba(255, 255, 255, .35); }
.primary-button:focus-visible, .hero-action:focus-visible, .secondary-card:focus-visible, .apartment-card:focus-visible, .attachment-button:focus-within, .icon-button:focus-visible { outline: 3px solid #c8a24a; outline-offset: 3px; }
.success-icon { color: #1a1206; background: #c8a24a; box-shadow: 0 20px 45px rgba(87, 61, 6, .28); }
.loader { border-color: rgba(231, 238, 246, .2); border-top-color: #c8a24a; }
.toast { background: #0a2349; border: 1px solid rgba(200, 162, 74, .28); }
.issue-description { color: #475569; }
.badge { color: #755716; background: #efe6c8; }
.resolve-button { color: #11674e; background: #eaf7f1; }

@media (min-width: 560px) { .screen { padding-left: 30px; padding-right: 30px; } }
