:root {
  color-scheme: dark;
  --green: #2dbe64;
  --green-bright: #46d47a;
  --green-soft: rgba(45, 190, 100, 0.14);
  --page: #0c0f0d;
  --surface: #141815;
  --surface-2: #1a201c;
  --line: #283129;
  --text: #f6f8f6;
  --muted: #929b94;
  --danger: #ff7373;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body { min-width: 320px; min-height: 100vh; min-height: 100dvh; margin: 0; background: var(--page); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
.auth-card { width: min(100%, 420px); padding: 24px 20px 22px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(155deg, #171c18, #101411); box-shadow: 0 24px 80px #0008; }
.eyebrow { margin: 0 0 6px; color: var(--green-bright); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.auth-card h1 { margin: 0; font-size: 42px; letter-spacing: -.055em; line-height: 1; }
.auth-lead { margin: 9px 0 25px; color: var(--muted); font-size: 15px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: #090c0a; }
.auth-tabs button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 750; }
.auth-tabs button.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.auth-form { display: grid; gap: 15px; margin-top: 20px; }
.auth-form label { display: grid; gap: 7px; }
.auth-form label > span { color: #b7beb8; font-size: 12px; font-weight: 700; }
.auth-form input, .search-box input { width: 100%; min-width: 0; border: 1px solid var(--line); outline: 0; background: #0d110e; color: var(--text); }
.auth-form input { height: 49px; padding: 0 14px; border-radius: 13px; font-size: 16px; }
.auth-form input:focus, .search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,190,100,.1); }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.primary-button { min-height: 50px; margin-top: 4px; border: 0; border-radius: 14px; background: var(--green); color: #07120a; font-weight: 850; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.form-hint { margin: -2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-message { min-height: 18px; margin: 13px 2px 0; color: var(--danger); font-size: 13px; line-height: 1.4; }
.form-message.is-success { color: var(--green-bright); }

.app-shell { min-height: 100dvh; }
.topbar { position: sticky; z-index: 20; top: 0; height: calc(58px + env(safe-area-inset-top)); display: grid; grid-template-columns: 42px 1fr auto; align-items: end; gap: 8px; padding: env(safe-area-inset-top) 14px 8px; border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(12,15,13,.88); backdrop-filter: blur(18px); }
.menu-button, .brand-button, .round-button { border: 0; background: transparent; }
.menu-button { width: 42px; height: 42px; display: grid; place-content: center; gap: 5px; padding: 0; border-radius: 12px; }
.menu-button span { width: 19px; height: 2px; display: block; border-radius: 2px; background: var(--text); }
.brand-button { height: 42px; justify-self: start; padding: 0 4px; font-size: 20px; font-weight: 900; letter-spacing: -.03em; }
.user-badge { align-self: center; max-width: 90px; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.page { width: min(100%, 760px); min-height: calc(100dvh - 58px); margin: 0 auto; padding: 32px 18px max(36px, calc(env(safe-area-inset-bottom) + 20px)); }
.page-home { background: var(--page); }
.page-heading h1 { margin: 0; font-size: clamp(34px, 10vw, 54px); line-height: 1; letter-spacing: -.055em; }
.page-heading > p:last-child { margin: 10px 0 0; color: var(--muted); }
.search-box { height: 50px; display: flex; align-items: center; gap: 10px; margin-top: 27px; padding: 0 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.search-box > span { color: var(--green-bright); font-size: 22px; }
.search-box input { height: 46px; padding: 0; border: 0; background: transparent; font-size: 16px; box-shadow: none !important; }
.domophone-list { display: grid; gap: 10px; margin-top: 18px; }
.domophone-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.domophone-card h2 { margin: 0; font-size: 17px; line-height: 1.25; }
.domophone-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 14px; color: var(--muted); font-size: 13px; }
.domophone-meta span { padding: 5px 8px; border-radius: 8px; background: #0c100d; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.code-row code { color: var(--green-bright); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 21px; font-weight: 850; letter-spacing: .04em; overflow-wrap: anywhere; }
.copy-code { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #35523d; border-radius: 10px; background: var(--green-soft); color: var(--green-bright); font-size: 12px; font-weight: 800; }
.report-code { width: fit-content; margin-top: 13px; padding: 8px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; text-align: left; }
.report-code:not(:disabled) { color: #dbbc65; }
.report-code:disabled { cursor: default; }
.domophone-card.needs-check { border-color: rgba(241,199,91,.35); }
.domophone-note { margin: 13px 0 0; color: #bcc3bd; font-size: 13px; line-height: 1.45; }
.content-message { min-height: 20px; margin-top: 14px; color: var(--muted); font-size: 13px; }

.menu-backdrop { position: fixed; z-index: 39; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); }
.drawer { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(86vw, 340px); display: flex; flex-direction: column; padding: max(22px, calc(env(safe-area-inset-top) + 12px)) 16px max(22px, calc(env(safe-area-inset-bottom) + 12px)); border-right: 1px solid var(--line); background: #101411; box-shadow: 24px 0 60px #0009; transform: translateX(-105%); transition: transform .24s ease; }
.drawer.is-open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 5px 4px 23px; }
.drawer-head strong { font-size: 20px; }
.round-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 24px; }
.drawer-nav { display: grid; gap: 7px; }
.drawer-nav button { display: grid; gap: 3px; padding: 14px 15px; border: 1px solid transparent; border-radius: 14px; background: transparent; text-align: left; }
.drawer-nav button span { font-size: 16px; font-weight: 800; }
.drawer-nav button i { color: var(--muted); font-size: 12px; font-style: normal; }
.drawer-nav button.is-active { border-color: rgba(45,190,100,.32); background: var(--green-soft); }
.drawer-spacer { flex: 1; }
.install-button, .logout-button { min-height: 46px; border-radius: 13px; font-weight: 750; }
.install-button { margin-bottom: 8px; border: 0; background: var(--green); color: #07120a; }
.logout-button { border: 1px solid var(--line); background: transparent; color: var(--muted); }

@media (max-width: 370px) { .auth-card { padding-inline: 16px; border-radius: 22px; } .name-grid { grid-template-columns: 1fr; } .page { padding-inline: 14px; } }
@media (min-width: 700px) { .auth-card { padding: 30px; } .page { padding-top: 48px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
