.app {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-4);
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.sidebar nav {
  flex: 1;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 0;
  padding: 0 var(--space-2);
}

.brand {
  display: block;
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.brand-ip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  margin-bottom: 10px;
  padding: 0 var(--space-2);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  color: #fff;
}

.brand-ip-value {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

html[data-theme="light"] .brand-ip {
  color: var(--color-text);
}

.storage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 var(--space-2) var(--space-5);
}

.storage-clear {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
}

.storage-clear:hover {
  color: var(--color-text);
}

.storage-clear:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.storage-size {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
}

.ip-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  flex-shrink: 0;
}

.ip-copy:hover {
  background: rgba(255, 255, 255, 0.14);
}

html[data-theme="light"] .ip-copy:hover {
  background: var(--color-bg);
}

.ip-copy:disabled {
  opacity: 0.45;
  cursor: default;
}

.ip-copy:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.theme-switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  margin-top: 2px;
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.theme-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 999px;
}

.theme-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}

.theme-switch input:checked + .theme-slider {
  background: var(--color-accent);
}

.theme-switch input:checked + .theme-slider::before {
  transform: translateX(18px);
}

.theme-switch input:focus-visible + .theme-slider {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.nav-section {
  margin: var(--space-4) 0 0;
}

.nav-section:first-of-type {
  margin-top: 0;
}

.nav-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  list-style: none;
  cursor: pointer;
  margin: 0 0 var(--space-2);
  padding: 0 var(--space-2) 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  user-select: none;
}

.nav-group::-webkit-details-marker {
  display: none;
}

.nav-group::marker {
  content: "";
}

.nav-group:hover {
  color: var(--color-text);
}

.nav-group:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.nav-chevron {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
}

.nav-section:not([open]) .nav-chevron {
  transform: rotate(-45deg);
  margin-top: 2px;
}

.nav-section-items {
  padding: 0;
}

.nav-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--color-text);
  margin-bottom: 2px;
}

.nav-link:hover {
  background: var(--color-bg);
}

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

.nav-empty {
  display: block;
  padding: 8px 10px;
  color: var(--color-muted);
  font-size: 13px;
}

.nav-legal {
  display: block;
  margin-top: var(--space-4);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-muted);
}

.nav-legal:hover,
.nav-legal.is-active {
  color: var(--color-text);
}

.workspace {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  padding: var(--space-6);
}

.page-header {
  margin-bottom: var(--space-5);
  max-width: 960px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fav-star {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-muted);
  box-shadow: none;
}

.fav-star:hover {
  background: var(--color-bg);
}

.fav-star path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.fav-star.is-on {
  color: #e6b325;
}

.fav-star.is-on path {
  fill: #e6b325;
}

.lede {
  margin-top: var(--space-2);
  color: var(--color-muted);
  max-width: 960px;
}

.page-body {
  max-width: 960px;
}

@media (max-width: 720px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .workspace {
    padding: var(--space-4);
  }
}
