/* The frame: a quiet sidebar on a desk, a top line and a bar of tabs along the bottom on a phone. */

.console {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.mark {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 12px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-top {
  padding: 4px 10px 20px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.side-link .icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-3);
}

.side-link:hover {
  background: var(--surface-hover);
  color: var(--ink);
  text-decoration: none;
}

.side-link.is-on {
  background: var(--surface-hover);
  color: var(--ink);
  font-weight: 600;
}

.side-link.is-on .icon {
  color: var(--accent);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sidebar-email {
  overflow: hidden;
  padding: 0 10px 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-column {
  min-width: 0;
}

.content {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px var(--gutter) 72px;
  outline: none;
}

.topbar,
.tabbar {
  display: none;
}

.sheet {
  width: 100%;
  max-width: 520px;
  margin: auto auto 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
}

.sheet::backdrop {
  background: rgba(10, 10, 12, 0.36);
}

.sheet-grip {
  width: 36px;
  height: 4px;
  margin: 4px auto 12px;
  border-radius: 2px;
  background: var(--line-strong);
}

.sheet-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sheet-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--surface-sunk);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-weight: 550;
}

.sheet-link:hover {
  text-decoration: none;
}

.sheet-link .icon {
  width: 20px;
  height: 20px;
  color: var(--ink-3);
}

.sheet-link.is-on {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.sheet-link.is-on .icon {
  color: var(--accent);
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sheet-email {
  overflow: hidden;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .console {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 var(--gutter);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }

  .topbar-title {
    color: var(--ink-3);
    font-size: 15px;
  }

  .topbar-title::before {
    content: '/';
    margin-right: 10px;
    color: var(--line-strong);
  }

  .content {
    padding: 18px var(--gutter) calc(96px + env(safe-area-inset-bottom));
  }

  .tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }

  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0 4px;
    border: 0;
    background: none;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 550;
    cursor: pointer;
  }

  .tab:hover {
    text-decoration: none;
  }

  .tab .icon {
    width: 22px;
    height: 22px;
  }

  .tab.is-on {
    color: var(--accent);
  }
}
