.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  z-index: 30;
  transition: transform 0.35s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
}

.brand svg {
  height: 20px;
  width: auto;
  fill: currentColor;
}

.brand .pill {
  height: 20px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line2);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--mute);
}

.picker {
  position: relative;
  margin: 0 0 18px;
}

.picker-btn {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  text-align: left;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.picker-btn:hover,
.picker.open .picker-btn {
  border-color: var(--line2);
  background: var(--hover);
}

.picker-btn .meta {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.picker-btn b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-btn small {
  color: var(--mute);
  font-size: 11.5px;
}

.picker-btn .chev {
  width: 16px;
  height: 16px;
  color: var(--mute);
  transition: transform 0.3s var(--ease);
}

.picker.open .chev {
  transform: rotate(180deg);
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 12px;
  transform-origin: top;
  animation: pop 0.22s var(--ease) both;
  z-index: 40;
}

.menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  color: var(--mute);
  transition: background 0.15s, color 0.15s;
}

.menu button:hover,
.menu button.on {
  background: var(--hover);
  color: var(--text);
}

.menu button .tick {
  margin-left: auto;
  width: 15px;
  height: 15px;
  opacity: 0;
}

.menu button.on .tick {
  opacity: 1;
}

.nav {
  position: relative;
  flex: 1;
}

.nav-label {
  padding: 14px 12px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.nav-label:first-child {
  padding-top: 0;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--mute);
  font-weight: 500;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.nav a .ico {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.3s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: var(--hover);
}

.nav a:hover .ico {
  transform: scale(1.1);
}

.nav a.on {
  color: var(--text);
  background: var(--raised);
}

.nav a .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.nav-bar {
  position: absolute;
  left: -14px;
  top: 0;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--text);
  transition: transform 0.45s var(--ease), height 0.45s var(--ease);
}

.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 0 10px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: var(--inv);
  font-weight: 600;
  font-size: 13px;
}

.me .who {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.me .who b {
  display: block;
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me .who small {
  color: var(--mute);
  font-size: 11.5px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bar {
  display: none;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 20;
}

.content {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 40px 64px;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.content.out {
  opacity: 0;
  transform: translateY(6px);
}

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.head .sub {
  margin-top: 6px;
  color: var(--mute);
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scrim {
  display: none;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: fixed;
    left: 0;
    top: 0;
    width: 272px;
    transform: translateX(-100%);
  }

  .shell.open .side {
    transform: none;
  }

  .shell.open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--scrim);
    z-index: 25;
    animation: fade 0.25s both;
  }

  .bar {
    display: flex;
  }

  .content {
    padding: 24px 18px 48px;
  }
}
