@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/manrope-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/manrope-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/manrope-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/manrope-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/manrope-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/manrope-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #202028;
  --text: #282d3c;
  --muted: #8b8da5;
  --line: #e2e4ea;
  --paper: #fff;
  --canvas: #f6f6f9;
  --field: #f4f6fb;
  --blue: #007bfc;
  --blue-press: #006bdb;
  --blue-soft: #daecff;
  --danger: #ff2f13;
  --ok: #2ca94c;
  --ok-soft: #e1f7e6;
  --shadow: 0 0 1px #0000000a, 0 2px 6px #0000000a, 0 16px 24px #00000014;
  --font: Manrope, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -0.16px;
}
button, input { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(880px 420px at 50% -8%, rgba(0, 123, 252, 0.2), transparent 68%),
    #eef3f9;
}
.gate-inner {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 28px;
  padding: 36px 32px 32px;
  box-shadow: 0 0 0 1px rgba(0, 123, 252, 0.08), 0 18px 48px rgba(32, 40, 64, 0.1);
}
.gate-mark {
  width: 44px;
  height: 4px;
  margin-bottom: 18px;
  border-radius: 4px;
  background: var(--blue);
}
.gate h1 {
  font-size: 34px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.6px;
  color: var(--ink);
  margin-bottom: 24px;
}
.stack { display: grid; gap: 12px; }
.field, .select {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 8px;
  background: var(--field);
  padding: 0 24px;
  font-weight: 500;
  color: var(--text);
}
.field:focus, .select:focus { outline: 2px solid var(--blue); }
.field:disabled { color: var(--muted); }
.field.code {
  letter-spacing: 0.4em;
  font-size: 22px;
  text-align: center;
  padding-left: 24px;
}
.btn {
  height: 48px;
  border: 0;
  border-radius: 48px;
  padding: 0 24px;
  background: var(--blue);
  color: #fff;
  font-weight: 500;
  letter-spacing: -0.16px;
}
.btn:hover { background: var(--blue-press); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.block { width: 100%; margin-top: 4px; }
.btn.ghost {
  background: var(--field);
  color: var(--blue);
}
.btn.ghost:hover { background: var(--blue-soft); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #e0220c; }
.btn.small { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.outline {
  height: 56px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  white-space: nowrap;
}
.btn.outline:hover { background: var(--blue-soft); color: var(--blue-press); border-color: var(--blue-press); }
.link {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-weight: 500;
}
.link:disabled { opacity: 0.55; cursor: default; }
.note { color: var(--danger); font-size: 14px; line-height: 1.35; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.4; }
.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.choice button {
  height: 64px;
  border: 0;
  border-radius: 16px;
  background: var(--field);
  color: var(--ink);
  font-weight: 500;
}
.choice button.on { background: var(--blue); color: #fff; }
.choice small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; opacity: 0.8; }

.shell { min-height: 100dvh; background: var(--canvas); }
.side {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 16px 0;
  overflow: auto;
  background: #fff;
  box-shadow: var(--shadow);
}
.side-top { display: grid; gap: 28px; align-content: start; }
.side-nav { display: grid; gap: 8px; align-content: start; }
.side-nav button {
  height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  text-align: left;
}
.side-nav button.on { background: var(--blue); color: #fff; }
.scrim {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 248px;
  z-index: 25;
  border: 0;
  background: rgba(32, 32, 40, 0.4);
}
.main {
  margin-left: 248px;
  min-height: 100dvh;
  padding: 30px 32px 64px 30px;
}
.menu-btn {
  display: none;
  height: 36px;
  margin-bottom: 16px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow: var(--shadow);
}
.brand {
  padding: 0 16px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1.25;
  color: var(--ink);
}
.who {
  margin-top: auto;
  margin-left: -16px;
  margin-right: -16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 32px 20px;
  border-top: 1px solid var(--line);
  background: var(--canvas);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.who span {
  min-width: 0;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who .link { flex: 0 0 auto; }
.complex-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.tab {
  height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 20px;
  padding: 0 16px;
  background: #fff;
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 0 1px #00000014;
}
.tab.on { background: var(--blue); color: #fff; }
.complex-edit { height: 40px; flex: 0 0 auto; padding: 0 8px; }
.page { width: 100%; max-width: 1040px; margin: 0; padding: 0; }
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.page h1 {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.6px;
  line-height: 1.15;
  color: var(--ink);
}
.lead { color: var(--muted); max-width: 52ch; line-height: 1.45; }
.panel { display: grid; gap: 20px; align-content: start; }
.panel h1, .panel .lead { margin: 0; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 12px; align-items: start; }
.toolbar.has-add { grid-template-columns: minmax(0, 1fr) 240px auto; }
.field.search {
  background: #fff;
  border: 1px solid var(--line);
}
.field.search:focus { border-color: transparent; }
.field.search::-webkit-search-decoration,
.field.search::-webkit-search-cancel-button { display: none; }
.drop { position: relative; }
.drop-btn {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 24px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
}
.drop-btn:focus { outline: 2px solid var(--blue); }
.chev {
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transition: transform 0.18s ease;
}
.drop.open .chev { transform: rotate(180deg); }
.drop-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transform-origin: top center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.drop.open .drop-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.drop-menu button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0 16px;
  color: var(--text);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
.drop-menu button:hover { background: var(--field); }
.drop-menu button.on { background: var(--blue-soft); color: var(--blue-press); }
.list { display: grid; gap: 12px; }
.card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.card.wide {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px 24px;
  align-items: center;
}
.card.out { box-shadow: 0 0 0 2px var(--blue-soft), var(--shadow); }
.card-main, .card-side { display: grid; gap: 8px; }
.card-status { justify-self: center; }
.card-side { justify-self: end; justify-items: end; align-content: center; }
.form-card h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.3px; color: var(--ink); }
.flat-no { font-size: 22px; font-weight: 500; letter-spacing: -0.4px; color: var(--ink); }
.meta { color: var(--muted); font-size: 14px; }
.keyset { font-size: 16px; font-weight: 500; color: var(--text); }
.key-edit { justify-self: start; font-size: 14px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 48px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 14px;
  font-weight: 500;
  width: fit-content;
}
.pill.out { background: var(--blue-soft); color: var(--blue-press); }
.timer { font-variant-numeric: tabular-nums; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.add-row, .inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.inline-form .field { width: auto; flex: 1 1 140px; }
.history, .people { display: grid; gap: 12px; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(32, 32, 40, 0);
  transition: background 0.22s ease;
}
.modal.open { background: rgba(32, 32, 40, 0.48); }
.modal-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px 24px;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.modal.open .modal-card { opacity: 1; transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.3px; color: var(--ink); }
.modal-x {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--field);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}
.modal-x:hover { background: var(--blue-soft); }
.row {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.row strong { font-weight: 500; color: var(--ink); }
.person { display: grid; gap: 4px; }
.shot {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--field);
}
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(32, 32, 40, 0.48);
  display: grid;
  align-items: end;
  z-index: 20;
  padding: 0;
}
.sheet-card {
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding: 28px 24px calc(24px + env(safe-area-inset-bottom));
  display: grid;
  gap: 16px;
}
.sheet-card h2 { font-size: 28px; font-weight: 500; letter-spacing: -0.4px; color: var(--ink); }
.preview {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 16px;
  background: var(--field);
}
.file-btn {
  display: grid;
  place-items: center;
  min-height: 88px;
  border-radius: 16px;
  background: var(--field);
  color: var(--blue);
  font-weight: 500;
  cursor: pointer;
}
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.empty {
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  color: var(--muted);
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .side { transform: translateX(-105%); transition: transform 0.2s ease; }
  .shell.menu-open .side { transform: none; }
  .main { margin-left: 0; padding: 30px 16px 48px; }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    position: sticky;
    top: 16px;
    z-index: 20;
    width: fit-content;
  }
  .page { max-width: none; }
  .toolbar, .toolbar.has-add { grid-template-columns: 1fr; }
  .toolbar .btn.outline { width: 100%; }
  .card.wide { grid-template-columns: 1fr; }
  .card-status { justify-self: center; }
  .card-side { justify-self: stretch; justify-items: stretch; }
  .card-side .btn { width: 100%; }
  .title-row { flex-wrap: nowrap; align-items: center; gap: 12px; }
  .title-row h1 { font-size: 28px; }
  .title-row .btn { height: 40px; margin-left: auto; padding: 0 14px; font-size: 13px; white-space: nowrap; }
}
@media (max-width: 720px) {
  .gate h1, .page h1 { font-size: 32px; }
  .row { flex-direction: column; align-items: flex-start; }
  .title-row { align-items: flex-start; }
}
@media (min-width: 720px) {
  .sheet { align-items: center; justify-items: center; padding: 24px; }
  .sheet-card { width: min(440px, 100%); border-radius: 28px; }
}
