.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  background: var(--bg-app);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
  color: var(--text-primary);
}

.brand-mark {
  width: 40px;
  height: 40px;
  color: var(--text-primary);
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-tag {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

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

.nav-section + .nav-section {
  margin-top: 22px;
}

.nav-label {
  padding: 0 10px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: var(--radius-m);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
}

.nav-link:hover {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

html[data-theme="dark"] .nav-link.is-active {
  box-shadow: inset 0 0 24px var(--accent-glow);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 16px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.page {
  flex: 1;
  width: min(100%, calc(var(--content-w) + 64px));
  margin: 0 auto;
  padding: 20px 32px 140px;
}

.page-wide {
  width: min(100%, 920px);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.page-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
}

.bottom-nav,
.more-sheet-backdrop {
  display: none;
}

.quick-add {
  position: fixed;
  left: calc(var(--sidebar-w) + 20px);
  bottom: 24px;
  z-index: 20;
  width: auto;
  margin: 0;
  pointer-events: none;
}

.quick-add > .qa-fab {
  pointer-events: auto;
  margin: 0;
}

.quick-add .qa-sheet-backdrop {
  pointer-events: auto;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .page {
    padding: 16px 16px 120px;
  }

  .quick-add {
    position: static;
    left: auto;
    bottom: auto;
  }

  .quick-add > .qa-fab {
    display: none;
  }

  .more-sheet-backdrop:not(.hidden) {
    display: block;
  }

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

  .bottom-nav a,
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 44px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
  }

.bottom-nav .bottom-nav-add {
  position: relative;
  top: -18px;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--bg-surface);
  background: var(--accent);
  color: #f7fffe;
  box-shadow: var(--shadow-float);
  gap: 0;
  min-height: 56px;
  z-index: 1;
}

html[data-theme="dark"] .bottom-nav .bottom-nav-add {
  color: #06201e;
  border-color: var(--bg-app);
}

.bottom-nav .bottom-nav-add .icon {
  width: 24px;
  height: 24px;
}

.bottom-nav .bottom-nav-add span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bottom-nav .bottom-nav-add:hover,
.bottom-nav .bottom-nav-add:focus-visible {
  filter: brightness(1.05);
}

.bottom-nav .is-active {
  color: var(--accent-strong);
}
}
