:root {
  --bg: #eef5fb;
  --panel: #ffffff;
  --panel-2: #f8fbff;
  --text: #122033;
  --muted: #637083;
  --primary: #1687d9;
  --primary-dark: #0e68ac;
  --border: #d7e3ef;
  --danger: #c93636;
  --success: #198754;
  --warning: #ad7a00;
  --shadow: 0 14px 35px rgba(20, 57, 95, 0.12);
  --radius: 16px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }
.small-text { font-size: 12px; }
.muted { color: var(--muted); }
.num { text-align: right; }
.full { width: 100%; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #0f6eb8 0%, #0d4f8b 100%);
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand.centered { justify-content: center; }
.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 24px;
}
.brand h1, .brand p { margin: 0; }
.brand h1 { font-size: 21px; }
.brand p { font-size: 12px; opacity: .8; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-btn {
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  color: #fff;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}
.nav-btn.active, .nav-btn:hover {
  background: #fff;
  color: #0e5d9c;
}
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-badge {
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
}

.main {
  padding: 22px;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.topbar h2, .topbar p { margin: 0; }
.topbar h2 { font-size: 26px; }
.topbar p { color: var(--muted); margin-top: 4px; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.version {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.page { display: none; }
.page.active { display: block; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 27px; margin-top: 8px; }
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.card-header, .toolbar, .table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.toolbar h3, .toolbar p, .card-header h3 { margin: 0; }
.toolbar p { color: var(--muted); margin-top: 4px; }

button, input, select, textarea {
  font-family: inherit;
}
button {
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 700;
}
button.primary {
  background: var(--primary);
  color: #fff;
}
button.primary:hover { background: var(--primary-dark); }
button.secondary {
  background: #fff;
  color: var(--primary-dark);
  border-color: var(--border);
}
button.small { padding: 7px 10px; font-size: 12px; }
button.danger { background: var(--danger); color: #fff; }
.link-btn {
  background: transparent;
  color: var(--primary-dark);
  padding: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.form-grid input, .form-grid select, .form-grid textarea,
.auth-form input, .chat-form input, .table-tools input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
.form-grid .wide { grid-column: 1 / -1; }
.check-row {
  justify-content: center;
  flex-direction: row !important;
  align-items: center;
  color: var(--text) !important;
}
.check-row input { width: auto; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.table-card { padding: 0; overflow: hidden; }
.table-tools { padding: 14px 14px 0; }
.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 260px);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-2);
  color: #32465c;
}
tr:hover td { background: #f7fbff; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  background: #edf5ff;
  color: #0e5d9c;
  white-space: nowrap;
}
.badge.success { background: #e8f7ef; color: var(--success); }
.badge.warning { background: #fff7e2; color: var(--warning); }
.badge.danger { background: #ffeded; color: var(--danger); }
.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.path-cell {
  max-width: 250px;
  word-break: break-word;
  color: var(--muted);
}

.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fbfdff;
}
.empty-state {
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.chat-card {
  display: grid;
  grid-template-rows: minmax(350px, 55vh) auto;
  gap: 12px;
}
.chat-messages {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 75%;
  border-radius: 14px;
  padding: 10px 12px;
  background: #edf5ff;
}
.chat-msg.mine {
  align-self: flex-end;
  background: #dff1ff;
}
.chat-msg small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}
.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.alert {
  margin-bottom: 14px;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff7e2;
  border: 1px solid #ffd980;
  color: #7a5400;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: radial-gradient(circle at top, #cfeaff 0%, #eef5fb 42%, #e8f2fb 100%);
}
.auth-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.auth-form {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}
.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.auth-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.setup-warning {
  margin-top: 18px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #ffd980;
  background: #fff7e2;
}
.setup-warning p { margin: 6px 0 0; }
code {
  background: #eef5fb;
  padding: 2px 5px;
  border-radius: 6px;
}

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; min-height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .main { padding: 14px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .cards-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .chat-form { grid-template-columns: 1fr; }
}

/* V0.3 - Bilanci, riparti e rate */
.content-grid.stackable {
  margin-top: 14px;
  align-items: start;
}
.table-wrap.compact {
  max-height: 360px;
}
.table-tools h3 {
  margin: 0;
  white-space: nowrap;
}
.form-grid label span.muted {
  font-size: 11px;
  font-weight: 400;
}


.info-card {
  background: #f8fbff;
  border-left: 4px solid #1d9bf0;
}
.info-card p {
  margin: 6px 0 0;
  color: var(--muted);
}
.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.actions-cell {
  white-space: nowrap;
}

/* V0.7 - Versione sotto icona */
.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.brand-version {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 2px 7px;
  color: rgba(255,255,255,0.9);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

/* V0.6 - Bilanci: sezioni a pagina intera */
.bilanci-toolbar {
  align-items: flex-start;
}
.toolbar-search {
  min-width: min(420px, 100%);
}
.section-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.section-tab {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 12px;
  text-align: center;
}
.section-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.bilanci-section {
  display: none;
}
.bilanci-section.active {
  display: block;
}
.full-section-card {
  min-height: calc(100vh - 190px);
  display: flex;
  flex-direction: column;
}
.section-head {
  align-items: flex-start;
  padding: 16px 16px 0;
}
.section-head h3,
.section-head p {
  margin: 0;
}
.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.full-page-table {
  flex: 1;
  max-height: calc(100vh - 285px);
}
@media (max-width: 980px) {
  .section-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bilanci-toolbar { flex-direction: column; }
  .toolbar-search { min-width: 100%; }
}
@media (max-width: 620px) {
  .section-tabs { grid-template-columns: 1fr; }
}


/* 1.0.01 - Menu laterale richiudibile, riparti a pagina intera e rate per condomino */
.sidebar-toggle {
  background: #fff;
  color: var(--primary-dark);
  border-color: var(--border);
  white-space: nowrap;
  align-self: flex-start;
}
.app-shell.sidebar-closed {
  grid-template-columns: 0 1fr;
}
.app-shell.sidebar-closed .sidebar {
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  border: 0;
}
.app-shell.sidebar-closed .main {
  padding-left: 22px;
}
.riparti-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.riparti-section {
  display: none;
}
.riparti-section.active {
  display: block;
}
.rate-cell {
  min-width: 135px;
  display: grid;
  gap: 5px;
}
.rate-cell strong {
  font-size: 13px;
}
.rate-cell .muted {
  font-size: 11px;
}
.rate-cell button {
  justify-self: start;
  padding: 5px 8px;
  font-size: 11px;
}
.rates-table td,
.rates-table th {
  vertical-align: top;
}
@media (max-width: 1050px) {
  .app-shell.sidebar-closed { grid-template-columns: 1fr; }
  .app-shell.sidebar-closed .sidebar { display: none; }
}
@media (max-width: 620px) {
  .riparti-tabs { grid-template-columns: 1fr; }
  .sidebar-toggle { width: 100%; }
}

/* 1.0.01 - Bilanci: moduli in popup, elenco sempre visibile sotto la sezione */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 26, 45, 0.48);
  backdrop-filter: blur(2px);
  z-index: 90;
}
.modal-form {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(980px, calc(100vw - 36px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  z-index: 100;
  margin: 0;
  box-shadow: 0 28px 75px rgba(5, 22, 40, 0.34);
  border: 1px solid #c5d8ea;
}
.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.modal-title-row h3,
.modal-title-row p {
  margin: 0;
}
.modal-title-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.modal-close {
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .modal-form {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    grid-template-columns: 1fr;
  }
  .modal-title-row {
    flex-direction: column;
  }
  .modal-close {
    width: 100%;
  }
}


/* 1.0.01 - Menu a tendina da pulsante, pagine larghe e dati PDF in sola lettura */
.app-shell {
  display: block;
  min-height: 100vh;
}
.main {
  padding: 14px 22px 22px;
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(238, 245, 251, 0.96);
  backdrop-filter: blur(8px);
  padding: 8px 0 12px;
  border-bottom: 1px solid rgba(215, 227, 239, 0.8);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.topbar-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(20,57,95,0.08);
  font-size: 23px;
}
.topbar-brand strong,
.topbar-brand span {
  display: block;
  line-height: 1.2;
}
.topbar-brand strong { font-size: 15px; }
.topbar-brand span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.topbar-title { min-width: 0; }
.topbar-title h2 { font-size: 22px; }
.sidebar {
  position: fixed;
  z-index: 80;
  top: 72px;
  left: 22px;
  width: 290px;
  min-height: auto;
  max-height: calc(100vh - 90px);
  overflow: auto;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(4, 28, 52, .26);
}
.sidebar .brand { display: none; }
.app-shell.sidebar-closed .sidebar {
  display: none;
}
.app-shell.sidebar-closed,
.app-shell.sidebar-closed .main {
  padding-left: 22px;
}
.nav-btn { font-size: 15px; }
.sidebar-toggle {
  flex: 0 0 auto;
  padding: 11px 16px;
}
.wide-original-table {
  min-width: 1280px;
}
.wide-original-table th,
.wide-original-table td {
  white-space: nowrap;
}
.full-section-card {
  min-height: calc(100vh - 215px);
}
.full-page-table {
  max-height: calc(100vh - 315px);
}
.controls-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.detail-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.detail-box strong,
.detail-box span {
  display: block;
}
.detail-box strong {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.condomino-detail-content h4 {
  margin: 18px 0 8px;
}
.badge.warning {
  background: #fff4d6;
  color: var(--warning);
}
@media (max-width: 900px) {
  .topbar { align-items: flex-start; }
  .topbar-left { flex-wrap: wrap; }
  .topbar-brand { min-width: 0; }
  .controls-summary-grid,
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .controls-summary-grid,
  .detail-grid { grid-template-columns: 1fr; }
}

/* 1.0.01 - Tabelle più adattive, menu e popup corretti */
.full-page-table table,
.table-wrap table {
  width: 100%;
  table-layout: auto;
}
.wide-original-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
  font-size: 12px;
}
.wide-original-table th,
.wide-original-table td {
  white-space: normal;
  padding: 8px 7px;
  line-height: 1.25;
}
.wide-original-table .num,
.wide-original-table td.num,
.wide-original-table th.num {
  white-space: nowrap;
}
.full-section-card .table-wrap {
  overflow: auto;
}
#page-bilanci .full-page-table table th,
#page-bilanci .full-page-table table td {
  white-space: normal;
}
#page-bilanci .num,
#page-rate .num,
#page-controlli .num {
  white-space: nowrap;
}
#controlsTable .actions,
#compareTable .actions {
  justify-content: flex-start;
  flex-wrap: nowrap;
}
#controlsTable td,
#compareTable td {
  vertical-align: middle;
}
.modal-form.hidden,
.modal-backdrop.hidden {
  display: none !important;
}
@media (max-width: 1180px) {
  .wide-original-table { font-size: 11px; }
  .wide-original-table th,
  .wide-original-table td { padding: 7px 5px; }
}

/* 1.0.04 - Menu più grande e importazione guidata PDF */
.sidebar-toggle {
  font-size: 15px;
  padding: 14px 22px;
  min-height: 48px;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(20,57,95,0.08);
}
.import-card {
  margin-bottom: 14px;
}
.import-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.import-step {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.import-step strong {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}
.import-form-grid {
  margin-bottom: 12px;
}
.import-preview-card {
  padding-bottom: 16px;
}
.import-preview {
  padding: 0 16px 16px;
  display: grid;
  gap: 16px;
}
.import-preview-section h4 {
  margin: 0 0 8px;
}
.import-preview-section .table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 320px;
}
@media (max-width: 900px) {
  .import-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .import-steps { grid-template-columns: 1fr; }
}

/* 1.0.04 - Filtri anno/gestione e tabelle più adattive */
.filter-tools, .toolbar-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-filters {
  justify-content: flex-end;
}
.year-filter {
  min-width: 150px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  padding: 0 12px;
  color: var(--text);
  font-weight: 700;
}
.full-page-table table, .wide-original-table, .rates-table {
  table-layout: auto;
  width: 100%;
}
.full-page-table th, .full-page-table td {
  white-space: nowrap;
}
.full-page-table td:nth-child(2), .full-page-table th:nth-child(2) {
  white-space: normal;
}
@media (max-width: 900px) {
  .toolbar-filters, .filter-tools { justify-content: stretch; }
  .year-filter, .toolbar-search, .filter-tools input { width: 100%; }
}


/* 1.0.04 - Pagine a dimensione fissa e moduli sempre in popup */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.app-shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}
.main {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.topbar {
  flex: 0 0 auto;
}
#alertBox {
  flex: 0 0 auto;
}
.page {
  height: calc(100vh - 118px);
  min-height: 0;
  overflow: hidden;
}
.page.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.page > .toolbar,
.page > .section-tabs,
.page > .cards-grid,
.page > .info-card,
.page > .import-card {
  flex: 0 0 auto;
}
.page > .card.table-card,
.page > .full-section-card,
.page > .content-grid,
.bilanci-section.active,
.riparti-section.active {
  flex: 1 1 auto;
  min-height: 0;
}
.bilanci-section.active,
.riparti-section.active {
  display: flex;
  flex-direction: column;
}
.table-card,
.full-section-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.table-tools,
.section-head {
  flex: 0 0 auto;
}
.table-wrap,
.full-page-table,
.full-section-card .table-wrap,
.table-wrap.compact {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  overflow-y: auto;
  overflow-x: hidden;
}
.table-wrap table,
.full-page-table table,
.wide-original-table,
.rates-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}
th, td,
.full-page-table th, .full-page-table td,
.wide-original-table th, .wide-original-table td {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}
th.num, td.num,
.full-page-table th.num, .full-page-table td.num,
.wide-original-table th.num, .wide-original-table td.num {
  white-space: nowrap !important;
  overflow-wrap: normal;
}
.modal-form {
  position: fixed;
  z-index: 120;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1040px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  margin: 0;
}
.modal-form.hidden { display: none !important; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(9, 25, 43, .42);
}
body.modal-open { overflow: hidden; }
.th-subdate {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}
.rate-cell {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 24px;
}
@media (max-width: 900px) {
  .page { height: calc(100vh - 148px); }
  .modal-form { width: min(760px, calc(100vw - 24px)); }
}
