/* App frame: left rail with tile grid, main area, mobile drawer. */
.app { display: flex; min-height: 100vh; }
.rail {
  flex: 0 0 256px; width: 256px; padding: 22px 18px; display: flex; flex-direction: column; gap: 18px;
  background: var(--rail); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.main { flex: 1 1 auto; min-width: 0; padding: 26px 32px 48px; display: flex; flex-direction: column; gap: 20px; outline: none; }
.topbar, .rail-scrim { display: none; }

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.brand > div:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 15px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: none;
}

.firm-switch { display: flex; gap: 4px; background: #EFECE5; padding: 4px; border-radius: var(--r); }
.firm-switch button {
  flex: 1; height: 34px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted);
  font-weight: 600; font-size: 13px; cursor: pointer;
}
.firm-switch button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  height: 82px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; background: #fff; color: var(--ink-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600;
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--teal); color: var(--ink); }
.tile:active { transform: scale(.98); }
.tile.on { background: var(--teal); color: #fff; border-color: var(--teal); }

.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.me-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.me-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #FDE7D3; color: var(--orange-dark); flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; background: var(--blue-bg); color: var(--blue-dark); font-size: 22px; font-weight: 800; }

.loading, .empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.boot-msg { padding: 60px 20px; text-align: center; }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .topbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--rail);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  }
  .rail {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: 100%; transform: translateX(-105%);
    transition: transform .22s ease; box-shadow: var(--shadow);
  }
  body.rail-open .rail { transform: none; }
  body.rail-open .rail-scrim { display: block; position: fixed; inset: 0; background: rgba(27, 30, 33, .35); z-index: 40; }
  .main { padding: 18px 16px 40px; }
}
