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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px 22px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-contrast);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.25;
}

.nav-section {
  margin-top: 38px;
}

.nav-label {
  margin: 0 10px 9px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.tool-navigation {
  display: grid;
  gap: 5px;
}

.tool-nav-item {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.tool-nav-item:hover {
  background: #f2f2ef;
}

.tool-nav-item:active {
  transform: scale(0.985);
}

.tool-nav-item.is-active {
  background: #ecece8;
}

.tool-nav-icon {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
}

.tool-nav-copy {
  min-width: 0;
}

.tool-nav-copy strong,
.tool-nav-copy span {
  display: block;
}

.tool-nav-copy strong {
  font-size: 14px;
  line-height: 1.2;
}

.tool-nav-copy span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.sidebar-note {
  margin-top: auto;
  padding: 13px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  line-height: 1.35;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #3f9b69;
}

.main-area {
  min-width: 0;
  padding: 56px clamp(24px, 4vw, 64px) 72px;
}

.tool-root {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  outline: none;
}

.mobile-header {
  display: none;
}

.mobile-tools-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 16px;
  right: 16px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.mobile-tools-menu .tool-nav-item {
  min-height: 48px;
}

.mobile-tools-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 68px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .brand-mobile .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }

  .brand-mobile strong {
    font-size: 14px;
  }

  .brand-mobile span {
    font-size: 10px;
  }

  .main-area {
    padding: 34px 18px 54px;
  }
}

@media (max-width: 360px) {
  .mobile-header {
    padding-inline: 12px;
  }

  .brand-mobile span {
    display: none;
  }

  .main-area {
    padding: 26px 12px 44px;
  }
}

@media (max-width: 240px) {
  .brand-mobile strong {
    font-size: 12px;
  }

  .brand-mobile .brand-mark {
    display: none;
  }

  .mobile-tools-button {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .main-area {
    padding-inline: 8px;
  }
}
