/* Sidebar (desktop) and lists home (phone #/lists) (piece: sidebar). */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar);
  border-right: 1px solid #ececed;
  user-select: none;
  -webkit-user-select: none;
}
.sidebar-top {
  flex: none;
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
.brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #9b9ea3;
}
.sidebar-search:empty { display: none; }
.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 16px;
}
.sb-group { padding: 0 11px; }
.sb-group + .sb-group { margin-top: 12px; }
.sb-group.sb-lists { margin-top: 24px; }
.sb-group.sb-lists + .sb-group.sb-lists { margin-top: 16px; }

.sb-item {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 11px 0 8px;
  border-radius: 5px;
  color: #2c2d30;
  font-size: 14px;
  line-height: 17px;
  font-weight: 500;
  cursor: default;
}
.sb-item:hover { background: rgba(0, 0, 0, .025); }
.sb-item.selected { background: #dfe1e6; }
.sb-icon { flex: none; width: 17px; height: 17px; margin-right: 5px; display: grid; place-items: center; }
.sb-icon svg { width: 16.5px; height: 16.5px; }
.sb-item[data-key="anytime"] .sb-icon svg { width: 15.5px; height: 15.5px; }
.sb-item[data-key="today"] .sb-icon svg { width: 18px; height: 18px; }
.sb-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-count { flex: none; margin-left: 6px; font-size: 13px; color: #9a9a9d; font-variant-numeric: tabular-nums; }
.sb-badge {
  flex: none;
  min-width: 20px;
  height: 15px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 7.5px;
  background: var(--badge);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sb-area { font-weight: 600; color: #38383a; }
.sb-area .sb-icon { color: #aaadb1; }
.sb-area .sb-icon svg { width: 17.5px; height: 17.5px; }
.sb-area .sb-icon path { stroke-width: 1.4; }
.sb-project { color: #3a3b3e; font-weight: 400; }
.sb-project .sb-icon { color: #a9acb0; }
.sb-project .sb-icon svg { width: 15px; height: 15px; }

.sidebar-foot {
  flex: none;
  height: 37px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 17px;
  border-top: 1px solid #e8e9eb;
}
.sb-new {
  display: flex; align-items: center; gap: 6.5px;
  height: 26px;
  padding: 0 7px 0 2px;
  border-radius: 6px;
  font-size: 13px;
  color: #53575b;
}
.sb-new svg { width: 15px; height: 15px; }
.sb-new:hover, .sb-settings:hover { background: rgba(0, 0, 0, .04); }
.sb-settings { width: 30px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: #7b7f84; }
.sb-settings svg { width: 17px; height: 15px; }

/* area rows carry a disclosure chevron (always on touch, on hover with a mouse) */
.sb-area-row { position: relative; }
.sb-disclose {
  position: absolute; top: 0; right: 4px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: #b3b6ba;
  opacity: 0;
  transition: opacity .12s;
}
.sb-disclose svg { width: 11px; height: 7px; transition: transform .15s ease; }
.sb-area-row:hover .sb-disclose, .sb-disclose:focus-visible { opacity: 1; }
.sb-group.collapsed .sb-disclose { opacity: 1; }
.sb-group.collapsed .sb-disclose svg { transform: rotate(-90deg); }
.sb-group.collapsed .sb-area-projects { display: none; }
@media (hover: none) { .sb-disclose { opacity: 1; } }

/* ---------- phone: lists home ---------- */
@media (max-width: 699px) {
  .sidebar {
    position: absolute; inset: 0;
    display: block;
    overflow-y: auto;
    border-right: 0;
    background: #f4f5f7;
    padding-top: var(--safe-t);
  }
  .sidebar-top { display: none; }
  .sidebar-search { flex: none; padding: 7px calc(16px + var(--safe-r)) 6px calc(16px + var(--safe-l)); }
  .sb-search {
    width: 100%;
    height: 33px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    border-radius: 10px;
    background: #e0e2e6;
    color: #9fa3a8;
    font-size: 17px;
    letter-spacing: -.01em;
  }
  .sb-search svg { width: 16px; height: 16px; }
  .sidebar-nav { overflow: visible; padding: 19px 0 8px; }
  .sb-group { padding: 0 calc(10px + var(--safe-r)) 0 calc(8px + var(--safe-l)); }
  .sb-group + .sb-group { margin-top: 10px; }
  .sb-group.sb-lists { margin-top: 16px; padding-top: 16px; position: relative; }
  .sb-group.sb-lists::before { content: ""; position: absolute; top: 0; left: calc(20px + var(--safe-l)); right: calc(20px + var(--safe-r)); height: 1px; background: #dfe1e5; }
  .sb-group.sb-lists + .sb-group.sb-lists { margin-top: 16px; }
  .sb-item { height: 42.7px; padding: 0 12px 0 9px; border-radius: 10px; font-size: 17px; line-height: 22px; color: #202326; font-weight: 600; }
  .sb-item:hover { background: none; }
  .sb-item:active { background: #e3e5e9; }
  .sb-icon { width: 24px; height: 24px; margin-right: 6px; }
  .sb-icon svg { width: 23px; height: 23px; }
  .sb-item[data-key="anytime"] .sb-icon svg { width: 22.5px; height: 22.5px; }
  .sb-item[data-key="today"] .sb-icon svg { width: 24px; height: 24px; }
  .sb-project { font-weight: 400; color: #3a3c3f; }
  .sb-project .sb-icon svg { width: 18px; height: 18px; }
  .sb-project .sb-icon, .sb-area .sb-icon { color: #b3b6ba; }
  .sb-area .sb-icon svg { width: 22px; height: 22px; }
  .sb-area .sb-icon path { stroke-width: 1.1; }
  .sb-area-row .sb-item { padding-right: 44px; }
  .sb-disclose { top: 0; right: 3px; width: 30px; height: 42.7px; border-radius: 10px; color: #c3c5c9; opacity: 1; }
  .sb-disclose svg { width: 15px; height: 9.4px; }
  .sb-count { font-size: 17px; color: #a3a6a9; font-weight: 400; }
  .sb-badge { min-width: 26px; height: 22px; line-height: 22px; border-radius: 11px; font-size: 15px; }
  .sidebar-foot {
    height: auto;
    padding: 10px calc(18px + var(--safe-r)) calc(96px + var(--safe-b)) calc(20px + var(--safe-l));
    border-top: 0;
  }
  .sb-new { font-size: 17px; color: #4a4e53; gap: 8px; }
  .sb-new svg { width: 17px; height: 17px; }
  .sb-settings { display: none; }
}
